Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
cf4270b
feat: implement configureTimelockGuard function
maurelian Sep 8, 2025
290ec17
feat: implement clearTimelockGuard function
maurelian Sep 8, 2025
ef1ccbd
refactor: extract guard checking logic to internal helper function
maurelian Sep 8, 2025
a95ed01
feat: implement cancellationThreshold function
maurelian Sep 9, 2025
a5054e6
feat: add placeholder functions for remaining TimelockGuard functiona…
maurelian Sep 9, 2025
6084abe
Self review fixes
maurelian Sep 9, 2025
e3121ca
Fix warnings on unimplemented functions
maurelian Sep 9, 2025
d117aa7
Fix names of test functions
maurelian Sep 9, 2025
56e366d
Satisfy semgrep by removing revert with string
maurelian Sep 9, 2025
4c79044
Remove arg names from unimplemented functions
maurelian Sep 9, 2025
3de308e
Snapshots
maurelian Sep 9, 2025
052e4e6
Add interface
maurelian Sep 9, 2025
54d5e92
Simplify cancellationThreshold() getter
maurelian Sep 10, 2025
afdbaf1
Replace _getGuard with isGuardEnabled
maurelian Sep 10, 2025
3f82d24
Allow a timelock delay of zero
maurelian Sep 10, 2025
cea893e
TimelockGuard: Add scheduleTransaction()
maurelian Sep 11, 2025
c90de48
Add todo note
maurelian Sep 11, 2025
c17a782
Pseudocode draft of a non-nested timelock
Sep 15, 2025
0d31d51
Remove signatures field from ExecTransactionParams
maurelian Sep 15, 2025
0562482
Refactor tests with improve utils (_getDummyTx, _getSignaturesForTx)
maurelian Sep 15, 2025
227f9eb
Test for TransactionCancelled event
maurelian Sep 15, 2025
e7f90ce
Further improve util functions
maurelian Sep 15, 2025
5b1cfcc
Add approve hash test case
maurelian Sep 15, 2025
756cdff
fix warnings
maurelian Sep 15, 2025
bac2f8a
Use correct typing for Safe addresses
maurelian Sep 15, 2025
e92ed3f
Add additional scheduleTransaction tests
maurelian Sep 15, 2025
18f54e6
Enable specifying which safeInstance in utility functions
maurelian Sep 15, 2025
6782b1b
Change cancelTransaction to accept a tx hash
maurelian Sep 15, 2025
4fccd48
Add increaseCancellationThreshold to cancelTransaction
maurelian Sep 15, 2025
b792e04
Add configured boolean to guard config
maurelian Sep 15, 2025
3f407e1
Fix signature reuse vulnerability in cancelTransaction
maurelian Sep 16, 2025
37da3d5
Move signature verification before existence check in scheduleTransac…
maurelian Sep 16, 2025
43d7871
Remove unused console.logs
maurelian Sep 16, 2025
8c9fbf1
Fix increaseCancellationThreshold inputs
maurelian Sep 16, 2025
b28d653
Separate cancellation threshold events from transaction cancellation
maurelian Sep 17, 2025
4fff3d1
Remove unused _txHash argument from resetCancellation function
maurelian Sep 17, 2025
56238e8
Update ITimelockGuard to match implementation
maurelian Sep 17, 2025
1856abc
Use configured flag instead of timelockDelay check in clearTimelockGuard
maurelian Sep 17, 2025
4a9f2e2
Add configuration check to scheduleTransaction and fix test names
maurelian Sep 17, 2025
486ab05
Implement checkTransaction
maurelian Sep 18, 2025
bf20466
Add itest placeholder contract
maurelian Sep 18, 2025
ca166ef
Add comment to checkAfterExecution body
maurelian Sep 18, 2025
8b621c4
pre-pr checks
maurelian Sep 18, 2025
04ad47d
Remove GuardConfig.configured boolean field
maurelian Sep 18, 2025
b977666
Remove clearTimelockGuard
maurelian Sep 18, 2025
581cab0
Refactor: Add TransactionBuilder library
maurelian Sep 19, 2025
c84267d
Add unreachable AlreadyExecuted error
maurelian Sep 19, 2025
733a6e1
Add integration tests
maurelian Sep 19, 2025
5770509
Add getPendingTransactions function and tests
maurelian Sep 19, 2025
572d6cf
Add tests for getScheduledTransaction
maurelian Sep 19, 2025
c8b655c
Add _ prefix in front of internal mappings
maurelian Sep 22, 2025
df3daa6
Rename viewTimelockGuard to timelockSafeConfigurationper specs
maurelian Sep 22, 2025
072c1b4
Add maxCancellationThreshold
maurelian Sep 22, 2025
487b098
Improve names on getter functions
maurelian Sep 23, 2025
93256f2
Remove @dev tags with invariants
maurelian Sep 23, 2025
3f21655
Add slowTimelock function
maurelian Sep 22, 2025
5086806
Add toggleSafetyDelay function
maurelian Sep 24, 2025
5efe9a6
Add logic to enforce additional safety delay.
maurelian Sep 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions packages/contracts-bedrock/interfaces/safe/ITimelockGuard.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;

library Enum {
type Operation is uint8;
}

library TimelockGuard {
struct GuardConfig {
uint256 timelockDelay;
uint256 safetyDelay;
}

struct ScheduledTransaction {
uint256 executionTime;
bool cancelled;
bool executed;
}
}

interface Interface {
struct ExecTransactionParams {
address to;
uint256 value;
bytes data;
Enum.Operation operation;
uint256 safeTxGas;
uint256 baseGas;
uint256 gasPrice;
address gasToken;
address payable refundReceiver;
}

error TimelockGuard_GuardNotConfigured();
error TimelockGuard_GuardNotEnabled();
error TimelockGuard_GuardStillEnabled();
error TimelockGuard_InvalidTimelockDelay();
error TimelockGuard_InvalidSafetyDelay();
error TimelockGuard_TransactionAlreadyCancelled();
error TimelockGuard_TransactionAlreadyScheduled();
error TimelockGuard_TransactionNotScheduled();

event CancellationThresholdUpdated(address indexed safe, uint256 oldThreshold, uint256 newThreshold);
event GuardConfigured(address indexed safe, uint256 timelockDelay, uint256 safetyDelay);
event TransactionCancelled(address indexed safe, bytes32 indexed txId);
event TransactionScheduled(address indexed safe, bytes32 indexed txId, uint256 when);

function blockingThresholdForSafe(address) external pure returns (uint256);
function cancelTransaction(address _safe, bytes32 _txHash, uint256 _nonce, bytes memory _signatures) external;
function cancellationThresholdForSafe(address _safe) external view returns (uint256);
function checkAfterExecution(bytes32, bool) external;
function pendingTransactionsForSafe(address) external pure returns (bytes32[] memory);
function checkTransaction(
address,
uint256 _value,
bytes memory,
Enum.Operation,
uint256,
uint256,
uint256,
address,
address payable,
bytes memory,
address
) external;
function configureTimelockGuard(uint256 _timelockDelay, uint256 _safetyDelay) external;
function scheduledTransactionForSafe(address _safe, bytes32 _txHash)
external
view
returns (TimelockGuard.ScheduledTransaction memory);
function safeConfigs(address) external view returns (uint256 timelockDelay, uint256 safetyDelay);
function scheduleTransaction(
address _safe,
uint256 _nonce,
ExecTransactionParams memory _params,
bytes memory _signatures
) external;
function version() external view returns (string memory);
function timelockConfigurationForSafe(address _safe) external view returns (TimelockGuard.GuardConfig memory);
}
Loading