Timelock
Inherits: ITimelock
Constants
GRACE_PERIOD
uint256 public constant GRACE_PERIOD = 1 days;
MINIMUM_DELAY
uint256 public constant MINIMUM_DELAY = 1 days;
MAXIMUM_DELAY
uint256 public constant MAXIMUM_DELAY = 3 days;
State Variables
admin
address public admin;
pendingAdmin
address public pendingAdmin;
delay
uint256 public delay;
initialized
bool public initialized;
queuedTransactions
mapping(bytes32 => bool) public queuedTransactions;
Functions
constructor
constructor(address admin_, uint256 delay_);
Parameters
| Name | Type | Description |
|---|---|---|
| admin_ | address | |
| delay_ | uint256 |
setFirstAdmin
function setFirstAdmin(address admin_) public;
Parameters
| Name | Type | Description |
|---|---|---|
| admin_ | address |
fallback
fallback() external payable;
setDelay
function setDelay(uint256 delay_) public;
Parameters
| Name | Type | Description |
|---|---|---|
| delay_ | uint256 |
acceptAdmin
function acceptAdmin() public;
setPendingAdmin
function setPendingAdmin(address pendingAdmin_) public;
Parameters
| Name | Type | Description |
|---|---|---|
| pendingAdmin_ | address |
queueTransaction
function queueTransaction(
uint256 proposalId,
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) public returns (bytes32);
Parameters
| Name | Type | Description |
|---|---|---|
| proposalId | uint256 | |
| target | address | |
| value | uint256 | |
| signature | string | |
| data | bytes | |
| eta | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes32 |
cancelTransaction
function cancelTransaction(
uint256 proposalId,
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) public;
Parameters
| Name | Type | Description |
|---|---|---|
| proposalId | uint256 | |
| target | address | |
| value | uint256 | |
| signature | string | |
| data | bytes | |
| eta | uint256 |
executeTransaction
function executeTransaction(
uint256 proposalId,
address target,
uint256 value,
string memory signature,
bytes memory data,
bytes32 codehash,
uint256 eta
) public payable returns (bytes memory);
Parameters
| Name | Type | Description |
|---|---|---|
| proposalId | uint256 | |
| target | address | |
| value | uint256 | |
| signature | string | |
| data | bytes | |
| codehash | bytes32 | |
| eta | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bytes |
Events
NewAdmin
event NewAdmin(address indexed newAdmin);
Parameters
| Name | Type | Description |
|---|---|---|
| newAdmin | address |
NewPendingAdmin
event NewPendingAdmin(address indexed newPendingAdmin);
Parameters
| Name | Type | Description |
|---|---|---|
| newPendingAdmin | address |
NewDelay
event NewDelay(uint256 indexed newDelay);
Parameters
| Name | Type | Description |
|---|---|---|
| newDelay | uint256 |
CancelTransaction
event CancelTransaction(
uint256 indexed proposalId,
bytes32 indexed txHash,
address indexed target,
uint256 value,
string signature,
bytes data,
uint256 eta
);
Parameters
| Name | Type | Description |
|---|---|---|
| proposalId | uint256 | |
| txHash | bytes32 | |
| target | address | |
| value | uint256 | |
| signature | string | |
| data | bytes | |
| eta | uint256 |
ExecuteTransaction
event ExecuteTransaction(
uint256 indexed proposalId,
bytes32 indexed txHash,
address indexed target,
uint256 value,
string signature,
bytes data,
uint256 eta
);
Parameters
| Name | Type | Description |
|---|---|---|
| proposalId | uint256 | |
| txHash | bytes32 | |
| target | address | |
| value | uint256 | |
| signature | string | |
| data | bytes | |
| eta | uint256 |
QueueTransaction
event QueueTransaction(
uint256 indexed proposalId,
bytes32 indexed txHash,
address indexed target,
uint256 value,
string signature,
bytes data,
uint256 eta
);
Parameters
| Name | Type | Description |
|---|---|---|
| proposalId | uint256 | |
| txHash | bytes32 | |
| target | address | |
| value | uint256 | |
| signature | string | |
| data | bytes | |
| eta | uint256 |
Errors
Timelock_OnlyOnce
error Timelock_OnlyOnce();
Timelock_OnlyAdmin
error Timelock_OnlyAdmin();
Timelock_OnlyPendingAdmin
error Timelock_OnlyPendingAdmin();
Timelock_OnlyInternalCall
error Timelock_OnlyInternalCall();
Timelock_InvalidDelay
error Timelock_InvalidDelay();
Timelock_InvalidExecutionTime
error Timelock_InvalidExecutionTime();
Timelock_InvalidTx_Stale
error Timelock_InvalidTx_Stale();
Timelock_InvalidTx_Locked
error Timelock_InvalidTx_Locked();
Timelock_InvalidTx_NotQueued
error Timelock_InvalidTx_NotQueued();
Timelock_InvalidTx_CodeHashChanged
error Timelock_InvalidTx_CodeHashChanged();
Timelock_InvalidTx_ExecReverted
error Timelock_InvalidTx_ExecReverted();