A contract that enables function execution after a certain time has passed. Implements the {ITimeLock} interface.
bytes32 PREFIX_TIME_LOCK
uint256 minimumTimeLockDelay
Returns a minimum time delay at which the TimeLock may be scheduled.
| Name | Type | Description | | —- | —- | ———– |
constructor(uint256 minimumTimeDelay) public
The constructor for the TimeLock.
Name | Type | Description |
---|---|---|
minimumTimeDelay | uint256 | The minimum time delay (in secs) that must pass for the TimeLock to be executed |
function getTimeLock(bytes32 hash) external view returns (uint256)
Returns the timestamp after which the TimeLock may be executed.
Name | Type | Description |
---|---|---|
hash | bytes32 | The hash of the timelock |
Name | Type | Description |
---|---|---|
[0] | uint256 | uint256 The timestamp after which the timelock with the given hash can be executed |
function _scheduleTimeLock(bytes32 hash, uint256 eta) internal returns (uint256)
Schedules a new timelock.
The timestamp will be set to the current block timestamp + minimum time delay, if the provided timestamp is less than that.
Name | Type | Description |
---|---|---|
hash | bytes32 | The hash of the new timelock |
eta | uint256 | The proposed Unix timestamp (in secs) after which the new timelock can be executed |
Name | Type | Description |
---|---|---|
[0] | uint256 | uint The Unix timestamp (in secs) after which the new timelock can be executed |
function _cancelTimeLock(bytes32 hash) internal
Cancels an existing timelock by setting its eta to zero.
Name | Type | Description |
---|---|---|
hash | bytes32 | The hash of the timelock to cancel |
function _finalizeTimeLock(bytes32 hash) internal
Finalizes an existing timelock and sets its eta back to zero.
To finalize, the timelock must currently exist and the required time delay must have passed.
Name | Type | Description |
---|---|---|
hash | bytes32 | The hash of the timelock to finalize |
function _getTimeLockEta(bytes32 hash) internal view returns (uint256 eta)
Returns the timestamp after which the timelock with the given hash can be executed.