diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-09-02 10:11:00 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-09-04 22:57:47 +0800 |
commit | 7a8ab6fbe806970176364b914790f2ce348194ff (patch) | |
tree | 450f038efdd9559c7d8b13663de8f19bf12c7e3b /packages/contracts | |
parent | 9deec8ec353f21fcdbb8f7edb6a844fdf2ea9901 (diff) | |
download | dexon-sol-tools-7a8ab6fbe806970176364b914790f2ce348194ff.tar dexon-sol-tools-7a8ab6fbe806970176364b914790f2ce348194ff.tar.gz dexon-sol-tools-7a8ab6fbe806970176364b914790f2ce348194ff.tar.bz2 dexon-sol-tools-7a8ab6fbe806970176364b914790f2ce348194ff.tar.lz dexon-sol-tools-7a8ab6fbe806970176364b914790f2ce348194ff.tar.xz dexon-sol-tools-7a8ab6fbe806970176364b914790f2ce348194ff.tar.zst dexon-sol-tools-7a8ab6fbe806970176364b914790f2ce348194ff.zip |
Update MultiSigWalletWithTimeLock to 0.4.24
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol | 44 | ||||
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol | 4 |
2 files changed, 24 insertions, 24 deletions
diff --git a/packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol b/packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol index cb86f2cad..9513d3b30 100644 --- a/packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol +++ b/packages/contracts/src/2.0.0/multisig/MultiSigWalletWithTimeLock.sol @@ -16,18 +16,17 @@ */ -// solhint-disable -pragma solidity ^0.4.15; +pragma solidity 0.4.24; import "./MultiSigWallet.sol"; /// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed. /// @author Amir Bandeali - <amir@0xProject.com> +// solhint-disable not-rely-on-time contract MultiSigWalletWithTimeLock is MultiSigWallet { - event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime); event TimeLockChange(uint256 secondsTimeLocked); @@ -36,29 +35,34 @@ contract MultiSigWalletWithTimeLock is mapping (uint256 => uint256) public confirmationTimes; modifier notFullyConfirmed(uint256 transactionId) { - require(!isConfirmed(transactionId)); + require( + !isConfirmed(transactionId), + "TX_FULLY_CONFIRMED" + ); _; } modifier fullyConfirmed(uint256 transactionId) { - require(isConfirmed(transactionId)); + require( + isConfirmed(transactionId), + "TX_NOT_FULLY_CONFIRMED" + ); _; } modifier pastTimeLock(uint256 transactionId) { - require(block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked); + require( + block.timestamp >= confirmationTimes[transactionId] + secondsTimeLocked, + "TIME_LOCK_INCOMPLETE" + ); _; } - /* - * Public functions - */ - /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds. - function MultiSigWalletWithTimeLock( + constructor ( address[] _owners, uint256 _required, uint256 _secondsTimeLocked @@ -76,7 +80,7 @@ contract MultiSigWalletWithTimeLock is onlyWallet { secondsTimeLocked = _secondsTimeLocked; - TimeLockChange(_secondsTimeLocked); + emit TimeLockChange(_secondsTimeLocked); } /// @dev Allows an owner to confirm a transaction. @@ -89,7 +93,7 @@ contract MultiSigWalletWithTimeLock is notFullyConfirmed(transactionId) { confirmations[transactionId][msg.sender] = true; - Confirmation(msg.sender, transactionId); + emit Confirmation(msg.sender, transactionId); if (isConfirmed(transactionId)) { setConfirmationTime(transactionId, block.timestamp); } @@ -105,23 +109,19 @@ contract MultiSigWalletWithTimeLock is { Transaction storage txn = transactions[transactionId]; txn.executed = true; - if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) - Execution(transactionId); - else { - ExecutionFailure(transactionId); + if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) { + emit Execution(transactionId); + } else { + emit ExecutionFailure(transactionId); txn.executed = false; } } - /* - * Internal functions - */ - /// @dev Sets the time of when a submission first passed. function setConfirmationTime(uint256 transactionId, uint256 confirmationTime) internal { confirmationTimes[transactionId] = confirmationTime; - ConfirmationTimeSet(transactionId, confirmationTime); + emit ConfirmationTimeSet(transactionId, confirmationTime); } } diff --git a/packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol b/packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol index 6ec710f25..edb788fab 100644 --- a/packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol +++ b/packages/contracts/src/2.0.0/protocol/AssetProxyOwner/AssetProxyOwner.sol @@ -98,9 +98,9 @@ contract AssetProxyOwner is { Transaction storage txn = transactions[transactionId]; txn.executed = true; - if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) + if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) { emit Execution(transactionId); - else { + } else { emit ExecutionFailure(transactionId); txn.executed = false; } |