Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lidangzzz committed May 17, 2023
1 parent 18220be commit d9f6f98
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion darc-protocol/contracts/MachineState.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct MachineState {
/**
* The list of addresses that have approved operations
*/
address[] operationLogMapLogAddressList;
address[] operationLogMapAddressList;

/**
* The machine state parameters of the DARC protocol
Expand Down
20 changes: 10 additions & 10 deletions darc-protocol/contracts/MachineStateManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ contract MachineStateManager {
sandboxMachineState.beforeOpPlugins[i] = currentMachineState.beforeOpPlugins[i];
}

// 2. clone the token list
// todo 2. clone the token list
for (uint256 i = 0; i < currentMachineState.tokenList.length; i++) {
//
}
Expand All @@ -154,18 +154,18 @@ contract MachineStateManager {

// 4. Clone the operationLogMap
// 4.1 clean all the operation log from the operation log map
for (uint256 i = 0; i < sandboxMachineState.operationLogMapLogAddressList.length; i++) {
delete sandboxMachineState.operationLogMap[sandboxMachineState.operationLogMapLogAddressList[i]];
for (uint256 i = 0; i < sandboxMachineState.operationLogMapAddressList.length; i++) {
delete sandboxMachineState.operationLogMap[sandboxMachineState.operationLogMapAddressList[i]];
}
// 4.2 copy the operation log address list from current machine state to sandbox
sandboxMachineState.operationLogMapLogAddressList = new address[](currentMachineState.operationLogMapLogAddressList.length);
for (uint256 i = 0; i < currentMachineState.operationLogMapLogAddressList.length; i++) {
sandboxMachineState.operationLogMapLogAddressList[i] = currentMachineState.operationLogMapLogAddressList[i];
sandboxMachineState.operationLogMapAddressList = new address[](currentMachineState.operationLogMapAddressList.length);
for (uint256 i = 0; i < currentMachineState.operationLogMapAddressList.length; i++) {
sandboxMachineState.operationLogMapAddressList[i] = currentMachineState.operationLogMapAddressList[i];
}
// 4.3 copy the operation log map from current machine state to sandbox
for (uint256 i = 0; i < currentMachineState.operationLogMapLogAddressList.length; i++) {
sandboxMachineState.operationLogMap[currentMachineState.operationLogMapLogAddressList[i]]
= currentMachineState.operationLogMap[currentMachineState.operationLogMapLogAddressList[i]];
for (uint256 i = 0; i < currentMachineState.operationLogMapAddressList.length; i++) {
sandboxMachineState.operationLogMap[currentMachineState.operationLogMapAddressList[i]]
= currentMachineState.operationLogMap[currentMachineState.operationLogMapAddressList[i]];
}

// 5. Clone the machine state parameters
Expand Down Expand Up @@ -206,7 +206,7 @@ contract MachineStateManager {
sandboxMachineState.withdrawableDividendsMap[currentMachineState.withdrawableDividendsOwnerList[i]]
= currentMachineState.withdrawableDividendsMap[currentMachineState.withdrawableDividendsOwnerList[i]];
}

}

}

0 comments on commit d9f6f98

Please sign in to comment.