Skip to content

Commit

Permalink
update LogicManager
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterchen2010 committed Jan 14, 2020
1 parent a1875a5 commit 6fee39d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
@@ -1,8 +1,8 @@


Contract | Address | Description
Contract | Mainnet Address | Description
------------- | ------------- | -------------
LogicManager | 0xE667CF33CC993BeD290BD97332CC16B06b023172 | Management of all logic modules
LogicManager | 0xDF8aC96BC9198c610285b3d1B29de09621B04528 | Management of all logic modules
AccountLogic | 0x52dAb11c6029862eBF1E65A4d5c30641f5FbD957 | Logic of account management
TransferLogic | 0x1C2349ACBb7f83d07577692c75B6D7654899BF10 | Logic of transfering assets
DualsigsLogic | 0x039aA54fEbe98AaaDb91aE2b1Db7aA00a82F8571 | Logic of dual-signature operations by user and emergency contact
Expand Down
25 changes: 21 additions & 4 deletions contracts/LogicManager.sol
Expand Up @@ -30,7 +30,13 @@ contract LogicManager is Owned {
mapping (address => pending) public pendingLogics;

// pending time before updated logics take effect
uint public pendingTime;
struct pendingTime {
uint curPendingTime;
uint nextPendingTime;
uint dueTime;
}

pendingTime public pt;

// how many authorized logics
uint public logicCount;
Expand All @@ -44,8 +50,19 @@ contract LogicManager is Owned {
}
authorizedLogics = _initialLogics;

// pendingTime: 4 days for mainnet, 4 minutes for ropsten testnet
pendingTime = _pendingTime;
pt.curPendingTime = _pendingTime;
pt.nextPendingTime = _pendingTime;
pt.dueTime = now;
}

function submitUpdatePendingTime(uint _pendingTime) external onlyOwner {
pt.nextPendingTime = _pendingTime;
pt.dueTime = pt.curPendingTime + now;
}

function triggerUpdatePendingTime() external {
require(pt.dueTime <= now, "too early to trigger updatePendingTime");
pt.curPendingTime = pt.nextPendingTime;
}

function isAuthorized(address _logic) external view returns (bool) {
Expand All @@ -59,7 +76,7 @@ contract LogicManager is Owned {
function submitUpdate(address _logic, bool _value) external onlyOwner {
pending storage p = pendingLogics[_logic];
p.value = _value;
p.dueTime = now + pendingTime;
p.dueTime = now + pt.curPendingTime;
emit UpdateLogicSubmitted(_logic, _value);
}

Expand Down
Binary file modified reports/CertiK Verification Report for MYKEY.pdf
Binary file not shown.

0 comments on commit 6fee39d

Please sign in to comment.