|
| 1 | +// SPDX-License-Identifier: UNLICENSED |
| 2 | +pragma solidity ^0.8.4; |
| 3 | + |
| 4 | +library Enum { |
| 5 | + type Operation is uint8; |
| 6 | +} |
| 7 | + |
| 8 | +interface ITimelockGuard { |
| 9 | + enum TransactionState { |
| 10 | + NotScheduled, |
| 11 | + Pending, |
| 12 | + Cancelled, |
| 13 | + Executed |
| 14 | + } |
| 15 | + struct ScheduledTransaction { |
| 16 | + uint256 executionTime; |
| 17 | + TransactionState state; |
| 18 | + ExecTransactionParams params; |
| 19 | + } |
| 20 | + |
| 21 | + struct ExecTransactionParams { |
| 22 | + address to; |
| 23 | + uint256 value; |
| 24 | + bytes data; |
| 25 | + Enum.Operation operation; |
| 26 | + uint256 safeTxGas; |
| 27 | + uint256 baseGas; |
| 28 | + uint256 gasPrice; |
| 29 | + address gasToken; |
| 30 | + address payable refundReceiver; |
| 31 | + } |
| 32 | + |
| 33 | + error TimelockGuard_GuardNotConfigured(); |
| 34 | + error TimelockGuard_GuardNotEnabled(); |
| 35 | + error TimelockGuard_GuardStillEnabled(); |
| 36 | + error TimelockGuard_InvalidTimelockDelay(); |
| 37 | + error TimelockGuard_TransactionAlreadyCancelled(); |
| 38 | + error TimelockGuard_TransactionAlreadyScheduled(); |
| 39 | + error TimelockGuard_TransactionNotScheduled(); |
| 40 | + error TimelockGuard_TransactionNotReady(); |
| 41 | + error TimelockGuard_TransactionAlreadyExecuted(); |
| 42 | + error TimelockGuard_InvalidVersion(); |
| 43 | + |
| 44 | + event CancellationThresholdUpdated(address indexed safe, uint256 oldThreshold, uint256 newThreshold); |
| 45 | + event GuardConfigured(address indexed safe, uint256 timelockDelay); |
| 46 | + event TransactionCancelled(address indexed safe, bytes32 indexed txHash); |
| 47 | + event TransactionScheduled(address indexed safe, bytes32 indexed txHash, uint256 executionTime); |
| 48 | + event TransactionExecuted(address indexed safe, bytes32 txHash); |
| 49 | + event Message(string message); |
| 50 | + |
| 51 | + function cancelTransaction(address _safe, bytes32 _txHash, uint256 _nonce, bytes memory _signatures) external; |
| 52 | + function signCancellation(bytes32 _txHash) external; |
| 53 | + function cancellationThreshold(address _safe) external view returns (uint256); |
| 54 | + function checkTransaction( |
| 55 | + address _to, |
| 56 | + uint256 _value, |
| 57 | + bytes memory _data, |
| 58 | + Enum.Operation _operation, |
| 59 | + uint256 _safeTxGas, |
| 60 | + uint256 _baseGas, |
| 61 | + uint256 _gasPrice, |
| 62 | + address _gasToken, |
| 63 | + address payable _refundReceiver, |
| 64 | + bytes memory _signatures, |
| 65 | + address _msgSender |
| 66 | + ) |
| 67 | + external; |
| 68 | + function checkAfterExecution(bytes32, bool) external; |
| 69 | + function configureTimelockGuard(uint256 _timelockDelay) external; |
| 70 | + function scheduledTransaction( |
| 71 | + address _safe, |
| 72 | + bytes32 _txHash |
| 73 | + ) |
| 74 | + external |
| 75 | + view |
| 76 | + returns (ScheduledTransaction memory); |
| 77 | + function safeConfigs(address) external view returns (uint256 timelockDelay); |
| 78 | + function scheduleTransaction( |
| 79 | + address _safe, |
| 80 | + uint256 _nonce, |
| 81 | + ExecTransactionParams memory _params, |
| 82 | + bytes memory _signatures |
| 83 | + ) |
| 84 | + external; |
| 85 | + function version() external view returns (string memory); |
| 86 | + function timelockConfiguration(address _safe) external view returns (uint256 timelockDelay); |
| 87 | + function maxCancellationThreshold(address _safe) external view returns (uint256); |
| 88 | + function pendingTransactions(address _safe) |
| 89 | + external |
| 90 | + view |
| 91 | + returns (ScheduledTransaction[] memory); |
| 92 | +} |
0 commit comments