You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Note we don't return false after incorrect transfer because when stake is increased the transfer is done immediately, thus it can't disrupt delayed stakes' queue.
Copy file name to clipboardExpand all lines: contracts/src/arbitration/SortitionModule.sol
+53-9
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ contract SortitionModule is ISortitionModule {
36
36
address account; // The address of the juror.
37
37
uint96 courtID; // The ID of the court.
38
38
uint256 stake; // The new stake.
39
+
bool alreadyTransferred; // True if tokens were already transferred before delayed stake's execution.
39
40
}
40
41
41
42
// ************************************* //
@@ -60,6 +61,7 @@ contract SortitionModule is ISortitionModule {
60
61
uint256public delayedStakeReadIndex =1; // The index of the next `delayedStake` item that should be processed. Starts at 1 because 0 index is skipped.
61
62
mapping(bytes32=> SortitionSumTree) sortitionSumTrees; // The mapping trees by keys.
62
63
mapping(uint256=> DelayedStake) public delayedStakes; // Stores the stakes that were changed during Drawing phase, to update them when the phase is switched to Staking.
64
+
mapping(address=>mapping(uint96=>uint256)) public latestDelayedStakeIndex; // Maps the juror to its latest delayed stake. If there is already a delayed stake for this juror then it'll be replaced. latestDelayedStakeIndex[juror][courtID].
63
65
64
66
// ************************************* //
65
67
// * Function Modifiers * //
@@ -184,12 +186,40 @@ contract SortitionModule is ISortitionModule {
184
186
185
187
for (uint256 i = delayedStakeReadIndex; i < newDelayedStakeReadIndex; i++) {
0 commit comments