TimelockController

https://github.com/Into-the-Fathom/fathom-dao-smart-contracts/blob/master/contracts/dao/governance/TimelockController.sol

The TimelockController is a contract designed to add a delay between the initiation and execution of governance proposals as a security measure. It ensures that actions intended by governance are delayed by a minimum time period (configurable), allowing the community to prepare or respond to upcoming changes. This contract operates with role-based permissions for proposing, executing, and canceling scheduled operations. It supports batch operations and manages operational prerequisites to ensure that proposals are executed in the correct sequence and timing

Set Functions

schedule

  • Arguments:

    • target (address): The target address for the operation.

    • value (uint256): The amount of ether to send with the operation.

    • data (bytes): The data payload for the operation.

    • predecessor (bytes32): The identifier of the preceding operation.

    • salt (bytes32): A salt to ensure uniqueness of the operation's hash.

    • delay (uint256): The delay before the operation can be executed.

  • Description: Schedules an operation to be executed after a specified delay.

scheduleBatch

  • Arguments:

    • targets (address[]): Array of target addresses for the batch operation.

    • values (uint256[]): Array of ether amounts to send with each operation.

    • payloads (bytes[]): Array of data payloads for each operation.

    • predecessor (bytes32): The identifier of the preceding operation.

    • salt (bytes32): A salt to ensure uniqueness of the batch operation's hash.

    • delay (uint256): The delay before the batch operation can be executed.

  • Description: Schedules a batch of operations to be executed after a specified delay.

cancel

  • Arguments:

    • id (bytes32): The unique identifier of the operation to cancel.

  • Description: Cancels a scheduled operation.

execute

  • Arguments:

    • target (address): The target address for the operation.

    • value (uint256): The amount of ether to send with the operation.

    • payload (bytes): The data payload for the operation.

    • predecessor (bytes32): The identifier of the preceding operation.

    • salt (bytes32): A salt to ensure uniqueness of the operation's hash.

  • Description: Executes a scheduled operation if it is ready and all prerequisites are met.

executeBatch

  • Arguments:

    • targets (address[]): Array of target addresses for the batch operation.

    • values (uint256[]): Array of ether amounts to send with each operation.

    • payloads (bytes[]): Array of data payloads for each operation.

    • predecessor (bytes32): The identifier of the preceding operation.

    • salt (bytes32): A salt to ensure uniqueness of the batch operation's hash.

  • Description: Executes a batch of scheduled operations if they are ready and all prerequisites are met.

updateDelay

  • Arguments:

    • newDelay (uint256): The new minimum delay for operations to be executed.

  • Description: Updates the minimum delay for all future operations.

grantRoleByAdmin

  • Arguments:

    • role (bytes32): The role identifier.

    • account (address): The address to be granted the role.

  • Description: Grants a specified role to an account, callable only by admin.

revokeRoleByAdmin

  • Arguments:

    • role (bytes32): The role identifier.

    • account (address): The address from which to revoke the role.

  • Description: Revokes a specified role from an account, callable only by admin.

Events

CallScheduled

  • Parameters:

    • id (bytes32): Unique identifier of the operation.

    • index (uint256): Index of the specific call in the batch operation.

    • target (address): Address of the contract targeted by the call.

    • value (uint256): Ether value, in wei, to be sent with the call.

    • data (bytes): Data payload to be sent to the target.

    • predecessor (bytes32): Identifier of the operation that must be completed before this one.

    • delay (uint256): Delay before the operation becomes valid.

  • Description: Emitted when an operation is scheduled.

CallExecuted

  • Parameters:

    • id (bytes32): Unique identifier of the executed operation.

    • index (uint256): Index of the specific call in the batch operation.

    • target (address): Address of the contract targeted by the call.

    • value (uint256): Ether value, in wei, used in the call.

    • data (bytes): Data payload sent to the target.

  • Description: Emitted when an operation is successfully executed.

Cancelled

  • Parameters:

    • id (bytes32): Unique identifier of the operation that was cancelled.

  • Description: Emitted when a scheduled operation is cancelled.

MinDelayChange

  • Parameters:

    • oldDuration (uint256): Previous minimum delay before operations can be executed.

    • newDuration (uint256): New minimum delay before operations can be executed.

  • Description: Emitted when the minimum delay for operations is changed.

ExecuteTransaction

  • Parameters:

    • owner (address): Address initiating the transaction.

    • success (bool): Status of the transaction execution.

    • data (bytes): Data payload used in the transaction.

  • Description: Emitted after an execution attempt, detailing the result.

Last updated

Copyright© Fathom App 2024.