DSPause
allows authorized users to schedule function calls that can only be executed once some predetermined waiting period has elapsed. The configurable delay
attribute sets the minimum wait time between scheduling and executing a transaction.scheduledTransactions[hashedTx: bytes32]
- mapping with all scheduled transactions. A hashedTx
consists of an address usr
to delegatecall
into, the expected codehash of usr
, calldata
to use and the first possible time of executionproxy
- the proxy contract that will execute scheduledTransactions
in an isolated environment. It can only be called by DSPause
delay
- the delay applied to every scheduledTransaction
currentlyScheduledTransactions
- the current number of concurrently scheduled transactionsmaxScheduledTransactions
- the max number of transactions that can be scheduled at the same timeMAX_DELAY
- the maximum delay for a transaction from the moment it is scheduledDS_PAUSE_TYPE
- the type of the DSPause
contract (can be BASIC
or PROTEST
)isDelayed
- checks if msg.sender
is DSPause
itselfsetOwner(owner: address)
- set a new contract owner. Overriden from DSAuth
setAuthority(authority: DSAuthority)
- set an authority contract. Overriden from DSAuth
setDelay(delay: uint256)
- set a delay applied to all scheduledTransactions
scheduleTransaction(usr:address
, codeHash: bytes32
, parameters: bytes
, earliestExecutionTime: uint)
- schedule a new transaction by providing usr
, usr
's codehash, the calldata and the first possible time of executionscheduleTransaction(usr: address
, codeHash: bytes32
, parameters: bytes
, earliestExecutionTime: uint
, description: string)
- schedule a new transaction and attach a description to itattachTransactionDescription(usr: address
, codeHash: bytes32
, parameters: bytes
, earliestExecutionTime: uint
, description: string)
- attach a description for an already scheduled transactionabandonTransaction(usr:address
, codeHash: bytes32
, parameters: bytes
, earliestExecutionTime: uint)
- delete a scheduled transactionexecuteTransaction(usr:address
, codeHash: bytes32
, parameters: bytes
, earliestExecutionTime: uint)
- execute a scheduled transaction. Throws if the scheduledTransaction
's delay
has not yet passedSetDelay
- emitted when the delay
is changed. Contains:delay
- the new delayScheduleTransaction
- emitted when a new transaction is scheduled. Contains:sender
- the msg.sender
that scheduled the transactionusr
- the target contractcodeHash
- the code hash of usr
parameters
- parameters for the transactionearliestExecutionTime
- earliest time when the transaction can be executedAbandonTransaction
- emitted when governance abandons a previously scheduled transaction. Contains:sender
- the msg.sender
that scheduled the transactionusr
- the target contractcodeHash
- the code hash of usr
parameters
- parameters for the transactionearliestExecutionTime
- earliest time when the transaction can be executedExecuteTransaction
- emitted when a transaction is executed. Contains:sender
- the msg.sender
that scheduled the transactionusr
- the target contractcodeHash
- the code hash of usr
parameters
- parameters for the transactionearliestExecutionTime
- earliest time when the transaction can be executedAttachTransactionDescription
- emitted when governance attaches a description to a scheduled transaction. Contains:sender
- the msg.sender
that scheduled the transactionusr
- the target contractcodeHash
- the code hash of usr
parameters
- parameters for the transactionearliestExecutionTime
- earliest time when the transaction can be executeddescription
- the transaction descriptionDSPause
is designed to be used as a component in a governance system, to give affected parties time to respond to decisions. If those affected by governance decisions have e.g. exit or veto rights, then the pause can serve as an effective check on governance power.scheduledTransaction
describes a single delegatecall
operation and a unix timestamp earliestExecutionTime
before which it cannot be executed.scheduledTransaction
consists of:usr
: address to delegatecall
intocodeHash
: the expected codehash of usr
parameters
: calldata
to useearliestExecutionTime
: first possible time of execution (as seconds since unix epoch)keccack256(abi.encode(usr, codeHash, parameters, earliestExecutionTime))
scheduledTransaction
execution, we perform the actual delegatecall
operation in a seperate contract with an isolated storage context (DSPauseProxy
). Each pause has it's own individual proxy
.scheduledTransactions
are executed with the identity of the proxy
, and when integrating the pause into some auth scheme, you probably want to trust the pause's proxy
and not the pause itself.