GovernorTimelock
Constructor
constructor(
address tokenWithdrawer_,
address proposer_,
address executor_,
address canceller_,
address roleAdmin_
);Parameters:
0
tokenWithdrawer_
address
address
1
proposer_
address
address
2
executor_
address
address
3
canceller_
address
address
4
roleAdmin_
address
address
Functions
CANCELLER_ROLE
Returns the bytes32 representation of the canceler role. Address that has the canceler role can unschedule proposals but can not unschedule role updates.
Return Values:
0
cancelerRole
bytes32
bytes32
The canceler role
EXECUTOR_ROLE
Returns the bytes32 representation of the executor role. Address that has the executor role can execute all proposals including role updates.
Return Values:
0
executorRole
bytes32
bytes32
The executor role
MIN_DELAY
Returns the minimum delay for a proposal
Return Values:
0
minDelay
uint32
uint32
The minimum delay for a proposal
MIN_EXECUTION_WINDOW
Returns the minimum execution window for a proposal
Return Values:
0
minExecutionWindow
uint32
uint32
The minimum execution window for a proposal
PROPOSER_ROLE
Returns the bytes32 representation of the proposer role. Address that has the proposer role can schedule proposals but can not schedule role updates.
Return Values:
0
proposerRole
bytes32
bytes32
The proposer role
ROLE_ADMIN
Returns the bytes32 representation of the role admin role. Address that has the role admin role can update roles including the role admin role itself.
Return Values:
0
roleAdmin
bytes32
bytes32
The role admin role
acceptTokenWithdrawer
Accepts the token withdrawer role and sets pending token withdrawer to zero address. Only the pending token withdrawer can accept the token withdrawer role.
defaultTimelockParameters
Returns the default timelock parameters
Return Values:
0
delay
uint32
uint32
The delay
1
executionWindow
uint32
uint32
The execution window
executeProposals
Executes proposals. The proposalIds, targets and data arrays must have the same length.
Parameters:
0
proposalIds
uint256[]
uint256[]
The ids of the proposals to execute
1
targets
address[]
address[]
The targets of the proposals
2
data
bytes[]
bytes[]
The calldata of the proposals that the contract is going to execute
functionTimelockParameters
Returns the timelock parameters for a given target and function selector
Parameters:
0
target
address
address
The target of the function
1
functionSelector
bytes4
bytes4
The function selector
Return Values:
0
delay
uint32
uint32
The delay
1
executionWindow
uint32
uint32
The execution window
hasRole
Checks if an account has a role
Parameters:
0
account
address
address
The account to check
1
role
bytes32
bytes32
The role to check
Return Values:
0
doesHaveRole
bool
bool
Whether the account has the role
isExecutable
Checks if a proposal is executable
Parameters:
0
proposalId
uint256
uint256
The id of the proposal
Return Values:
0
isExecutable
bool
bool
Whether the proposal is executable
latestProposalId
Returns the latest proposal id
Return Values:
0
latestProposalId
uint256
uint256
The latest proposal id
pendingTokenWithdrawer
Returns the pending token withdrawer
Return Values:
0
pendingTokenWithdrawer
address
address
The address of the pending token withdrawer
proposals
Returns the proposal for a given proposal id
Parameters:
0
proposalId
uint256
uint256
The id of the proposal
Return Values:
0
proposalHash
bytes32
bytes32
The hash of the proposal
1
isUnschedulable
bool
bool
Whether the proposal is unschedulable
2
scheduledAt
uint32
uint32
The timestamp when the proposal was scheduled
3
delayedUntil
uint32
uint32
The timestamp when the proposal was delayed
4
validUntil
uint32
uint32
The timestamp when the proposal was valid
proposeRoleUpdates
Proposes to update roles. The role updating needs to be done through the timelock contract.
Parameters:
0
roles
bytes32[]
bytes32[]
The roles to update
1
accounts
address[]
address[]
The accounts to update the roles for
2
shouldGrant
bool[]
bool[]
Whether to grant or revoke the roles
scheduleProposals
Schedules proposals. The targets and data arrays must have the same length.
Parameters:
0
targets
address[]
address[]
The targets of the proposals
1
data
bytes[]
bytes[]
The calldata of the proposals that the contract is going to execute
setDefaultTimelockParameters
Sets the default timelock parameters
Parameters:
0
delay
uint32
uint32
The new default delay
1
executionWindow
uint32
uint32
The new default execution window
setFunctionTimelockParameters
Sets the function timelock parameters
Parameters:
0
target
address
address
The target of the function
1
functionSelector
bytes4
bytes4
The function selector
2
delay
uint32
uint32
The new delay
3
executionWindow
uint32
uint32
The new execution window
setPendingTokenWithdrawer
Sets the pending token withdrawer. Only an address with the ROLE_ADMIN role can set the pending token withdrawer.
Parameters:
0
newPendingTokenWithdrawer
address
address
The address of the new pending token withdrawer
tokenWithdrawer
Returns the token withdrawer
Return Values:
0
tokenWithdrawer
address
address
The address of the token withdrawer
unscheduleProposals
Unschedule proposals. The proposalIds array must not contain duplicates.
Parameters:
0
proposalIds
uint256[]
uint256[]
The ids of the proposals to unschedule
updateRole
Updates a role. The role updating needs to be done through the timelock contract.
Parameters:
0
role
bytes32
bytes32
The role to update
1
account
address
address
The account to update the role for
2
grantRole
bool
bool
Whether the role is granted or revoked
withdrawERC20Token
Withdraws tokens from the governor timelock contract. Only the token withdrawer can withdraw tokens and tokens are sent to the token withdrawer.
Parameters:
0
token
address
address
The address of the token to withdraw
1
amount
uint256
uint256
The amount of tokens to withdraw
Events
DefaultTimelockSet
Emitted when the default timelock parameters are set
Parameters:
0
delay
uint32
uint32
The new default delay
1
executionWindow
uint32
uint32
The new default execution window
ERC20TokenWithdrawn
Emitted when tokens are withdrawn from the governor timelock contract
Parameters:
0
token
address
address
The address of the token withdrawn
1
receiver
address
address
The address of the receiver of the tokens
2
amount
uint256
uint256
The amount of tokens withdrawn
FunctionTimelockSet
Emitted when the function timelock parameters are set
Parameters:
0
target
address
address
The target of the function
1
functionSelector
bytes4
bytes4
The function selector
2
delay
uint32
uint32
The new delay
3
executionWindow
uint32
uint32
The new execution window
PendingTokenWithdrawerSet
Emitted when the pending token withdrawer is set
Parameters:
0
newPendingTokenWithdrawer
address
address
The address of the new pending token withdrawer
ProposalExecuted
Emitted when a proposal is executed
Parameters:
0
proposalId
uint256
uint256
The id of the proposal
ProposalScheduled
Emitted when a proposal is scheduled
Parameters:
0
proposalId
uint256
uint256
The id of the proposal
1
proposal
tuple
struct IGovernorTimelock.Proposal
The proposal
ProposalUnscheduled
Emitted when a proposal is unscheduled
Parameters:
0
proposalId
uint256
uint256
The id of the proposal
RoleUpdated
Emitted when a role is updated
Parameters:
0
role
bytes32
bytes32
The role updated
1
account
address
address
The account updated the role for
2
grantRole
bool
bool
Whether the role is granted or revoked
TokenWithdrawerAccepted
Emitted when the token withdrawer is accepted
Parameters:
0
tokenWithdrawer
address
address
The address of the new token withdrawer
Structs
Proposal
Members:
0
proposalHash
bytes32
bytes32
1
isUnschedulable
bool
bool
2
scheduledAt
uint32
uint32
3
delayedUntil
uint32
uint32
4
validUntil
uint32
uint32
Last updated
Was this helpful?