pub trait TimelockController: ContractEnv {
Show 28 associated items
type isOperationOutput: ImpliesReturn<bool>;
type isOperationPendingOutput: ImpliesReturn<bool>;
type isOperationReadyOutput: ImpliesReturn<bool>;
type isOperationDoneOutput: ImpliesReturn<bool>;
type getTimestampOutput: ImpliesReturn<Timestamp>;
type getMinDelayOutput: ImpliesReturn<Timestamp>;
type hashOperationOutput: ImpliesReturn<Hash>;
type hashOperationBatchOutput: ImpliesReturn<Hash>;
type scheduleOutput: ImpliesReturn<Result<(), TimelockControllerError>>;
type scheduleBatchOutput: ImpliesReturn<Result<(), TimelockControllerError>>;
type cancelOutput: ImpliesReturn<Result<(), TimelockControllerError>>;
type executeOutput: ImpliesReturn<Result<(), TimelockControllerError>>;
type executeBatchOutput: ImpliesReturn<Result<(), TimelockControllerError>>;
type updateDelayOutput: ImpliesReturn<Result<(), TimelockControllerError>>;
// Required methods
fn is_operation(&self, id: OperationId) -> Self::isOperationOutput;
fn is_operation_pending(
&self,
id: OperationId,
) -> Self::isOperationPendingOutput;
fn is_operation_ready(
&self,
id: OperationId,
) -> Self::isOperationReadyOutput;
fn is_operation_done(&self, id: OperationId) -> Self::isOperationDoneOutput;
fn get_timestamp(&self, id: OperationId) -> Self::getTimestampOutput;
fn get_min_delay(&self) -> Self::getMinDelayOutput;
fn hash_operation(
&self,
transaction: Transaction,
predecessor: Option<OperationId>,
salt: [u8; 32],
) -> Self::hashOperationOutput;
fn hash_operation_batch(
&self,
transactions: Vec<Transaction>,
predecessor: Option<OperationId>,
salt: [u8; 32],
) -> Self::hashOperationBatchOutput;
fn schedule(
&mut self,
transaction: Transaction,
predecessor: Option<OperationId>,
salt: [u8; 32],
delay: Timestamp,
) -> Self::scheduleOutput;
fn schedule_batch(
&mut self,
transactions: Vec<Transaction>,
predecessor: Option<OperationId>,
salt: [u8; 32],
delay: Timestamp,
) -> Self::scheduleBatchOutput;
fn cancel(&mut self, id: OperationId) -> Self::cancelOutput;
fn execute(
&mut self,
transaction: Transaction,
predecessor: Option<OperationId>,
salt: [u8; 32],
) -> Self::executeOutput;
fn execute_batch(
&mut self,
transactions: Vec<Transaction>,
predecessor: Option<OperationId>,
salt: [u8; 32],
) -> Self::executeBatchOutput;
fn update_delay(&mut self, new_delay: Timestamp) -> Self::updateDelayOutput;
}
Expand description
Contract module which acts as a time-locked controller. When set as the
owner of an Ownable
smart contract, it enforces a timelock on all
onlyOwner
maintenance operations. This gives time for users of the
controlled contract to exit before a potentially dangerous maintenance
operation is applied.
By default, this contract is self-administered, meaning administration tasks
have to go through the timelock process. The proposer (resp executor) role
is in charge of proposing (resp executing) operations. A common use case is
to position this TimelockController
as the owner of a smart contract, with
a multisig or a DAO as the sole proposer.
Required Associated Types§
Sourcetype isOperationOutput: ImpliesReturn<bool>
type isOperationOutput: ImpliesReturn<bool>
Output type of the respective trait message.
Sourcetype isOperationPendingOutput: ImpliesReturn<bool>
type isOperationPendingOutput: ImpliesReturn<bool>
Output type of the respective trait message.
Sourcetype isOperationReadyOutput: ImpliesReturn<bool>
type isOperationReadyOutput: ImpliesReturn<bool>
Output type of the respective trait message.
Sourcetype isOperationDoneOutput: ImpliesReturn<bool>
type isOperationDoneOutput: ImpliesReturn<bool>
Output type of the respective trait message.
Sourcetype getTimestampOutput: ImpliesReturn<Timestamp>
type getTimestampOutput: ImpliesReturn<Timestamp>
Output type of the respective trait message.
Sourcetype getMinDelayOutput: ImpliesReturn<Timestamp>
type getMinDelayOutput: ImpliesReturn<Timestamp>
Output type of the respective trait message.
Sourcetype hashOperationOutput: ImpliesReturn<Hash>
type hashOperationOutput: ImpliesReturn<Hash>
Output type of the respective trait message.
Sourcetype hashOperationBatchOutput: ImpliesReturn<Hash>
type hashOperationBatchOutput: ImpliesReturn<Hash>
Output type of the respective trait message.
Sourcetype scheduleOutput: ImpliesReturn<Result<(), TimelockControllerError>>
type scheduleOutput: ImpliesReturn<Result<(), TimelockControllerError>>
Output type of the respective trait message.
Sourcetype scheduleBatchOutput: ImpliesReturn<Result<(), TimelockControllerError>>
type scheduleBatchOutput: ImpliesReturn<Result<(), TimelockControllerError>>
Output type of the respective trait message.
Sourcetype cancelOutput: ImpliesReturn<Result<(), TimelockControllerError>>
type cancelOutput: ImpliesReturn<Result<(), TimelockControllerError>>
Output type of the respective trait message.
Sourcetype executeOutput: ImpliesReturn<Result<(), TimelockControllerError>>
type executeOutput: ImpliesReturn<Result<(), TimelockControllerError>>
Output type of the respective trait message.
Sourcetype executeBatchOutput: ImpliesReturn<Result<(), TimelockControllerError>>
type executeBatchOutput: ImpliesReturn<Result<(), TimelockControllerError>>
Output type of the respective trait message.
Sourcetype updateDelayOutput: ImpliesReturn<Result<(), TimelockControllerError>>
type updateDelayOutput: ImpliesReturn<Result<(), TimelockControllerError>>
Output type of the respective trait message.