axelar-gmp-sdk-solidity

Solidity API

TimeLock

A contract that enables function execution after a certain time has passed. Implements the {ITimeLock} interface.

PREFIX_TIME_LOCK

bytes32 PREFIX_TIME_LOCK

minimumTimeLockDelay

uint256 minimumTimeLockDelay

Returns a minimum time delay at which the TimeLock may be scheduled.

Return Values

| Name | Type | Description | | —- | —- | ———– |

constructor

constructor(uint256 minimumTimeDelay) public

The constructor for the TimeLock.

Parameters

Name Type Description
minimumTimeDelay uint256 The minimum time delay (in secs) that must pass for the TimeLock to be executed

getTimeLock

function getTimeLock(bytes32 hash) external view returns (uint256)

Returns the timestamp after which the TimeLock may be executed.

Parameters

Name Type Description
hash bytes32 The hash of the timelock

Return Values

Name Type Description
[0] uint256 uint256 The timestamp after which the timelock with the given hash can be executed

_scheduleTimeLock

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.

Parameters

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

Return Values

Name Type Description
[0] uint256 uint The Unix timestamp (in secs) after which the new timelock can be executed

_cancelTimeLock

function _cancelTimeLock(bytes32 hash) internal

Cancels an existing timelock by setting its eta to zero.

Parameters

Name Type Description
hash bytes32 The hash of the timelock to cancel

_finalizeTimeLock

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.

Parameters

Name Type Description
hash bytes32 The hash of the timelock to finalize

_getTimeLockEta

function _getTimeLockEta(bytes32 hash) internal view returns (uint256 eta)

Returns the timestamp after which the timelock with the given hash can be executed.