Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c08130c
WIP: add a Safe Guard that implements a timelock for the upgrade Safe
duncancmt Oct 18, 2024
307bb0a
Cleanup
duncancmt Oct 18, 2024
ed151b6
Fix CI
duncancmt Oct 15, 2024
4b376f0
Cleanup
duncancmt Oct 18, 2024
747bbfa
Bug! Wrong direction on timelock checking; add check that transaction…
duncancmt Oct 18, 2024
89a5495
Add `cancel` function to Timelock/Guard
duncancmt Oct 18, 2024
3d7730e
Revert "Cleanup"
duncancmt Oct 18, 2024
d7ec5fd
Add lockdown mode to Safe Guard (requires unanimous signatures to unl…
duncancmt Oct 18, 2024
c7fa949
Comment
duncancmt Oct 18, 2024
0751f8c
Comments
duncancmt Oct 18, 2024
963b396
Simplify guard design by storing only a single `txHash` and expiry in…
duncancmt Oct 19, 2024
58ef97b
Typo
duncancmt Oct 19, 2024
bb5288d
Comment
duncancmt Oct 19, 2024
844a064
Make initial `delay` a constructor argument
duncancmt Oct 19, 2024
b7f9224
Bug! Prevent smuggling calls to `unlock` through `enqueue` => multica…
duncancmt Oct 19, 2024
df0160c
Remove assumption about the relationship between `encodeTransactionDa…
duncancmt Oct 19, 2024
9d9e021
Resolve TODO
duncancmt Oct 19, 2024
228571b
Comment
duncancmt Oct 19, 2024
0769fa8
Rework Safe guard so that it only requires 1 multisig transaction; th…
duncancmt Oct 19, 2024
d2e5027
Remove unused
duncancmt Oct 21, 2024
68deecf
Add some extra safety checks; realistically they should never trigger…
duncancmt Oct 21, 2024
1fa4378
Attempt to guard against as many footguns and bizarre scenarios as po…
duncancmt Oct 21, 2024
76ae824
Golf
duncancmt Oct 21, 2024
acf46bc
Add some indexed fields to `SafeTransactionEnqueued` event
duncancmt Oct 21, 2024
f726ab0
Explain provenance of copied code
duncancmt Oct 21, 2024
99514b3
Golf
duncancmt Oct 21, 2024
103584f
Explain comment a little better (less ambiguous)
duncancmt Oct 21, 2024
2955ee4
Pedantry
duncancmt Oct 21, 2024
84910a9
Remove redundant check
duncancmt Oct 21, 2024
cbee10c
Resolve TODO
duncancmt Oct 21, 2024
fd73329
Add happy-path unit test for Safe Guard
duncancmt Oct 21, 2024
021b3c2
Add timelock sad path test case for Guard
duncancmt Oct 22, 2024
2902d4b
Bug! Require that a call to `cancel` be accompanied by approving the …
duncancmt Oct 22, 2024
56dab72
Fix CI
duncancmt Oct 22, 2024
e633657
Prevent calling the specified Guard functions outside of the Guard co…
duncancmt Oct 22, 2024
f8a0043
Fix Safe owner reverse order
duncancmt Oct 22, 2024
8bb0aa5
Check that the Safe call is actually going through
duncancmt Oct 22, 2024
c2013cb
I give up; completely remove the ability to `DELEGATECALL` from the Safe
duncancmt Oct 22, 2024
7a3c713
Remove unnecessary duplicate locked down checks
duncancmt Oct 22, 2024
70366ca
Cleanup
duncancmt Oct 22, 2024
d013975
Update copied interface in test
duncancmt Oct 22, 2024
4f6392e
Bug! Prevent re-queueing transaction (possibly clearing cancelation)
duncancmt Oct 22, 2024
6b5e3a8
Fail early if attempting an `Operation.DelegateCall`
duncancmt Oct 22, 2024
262f537
Check event
duncancmt Oct 22, 2024
f2d2709
Add canceller address to event
duncancmt Oct 23, 2024
556b15e
Test for `DELEGATECALL` prevention
duncancmt Oct 23, 2024
f12cb22
Test for `cancel`
duncancmt Oct 23, 2024
7d8f671
Add some sad-path tests for `cancel`
duncancmt Oct 23, 2024
8338e86
Add test for `lockDown`
duncancmt Oct 23, 2024
d9519f0
Add test for `unlock`
duncancmt Oct 23, 2024
ab25287
Cleanup
duncancmt Oct 23, 2024
e93ec09
Add test for non-unanimous `unlock`
duncancmt Oct 23, 2024
baf42ce
Replace `notRemoved` and `notLockedDown` modifiers witih `normalOpera…
duncancmt Oct 23, 2024
e0a9f21
Comment
duncancmt Oct 23, 2024
dbc5a70
Check for emitted success event by Safe
duncancmt Oct 23, 2024
1180afe
Remove noisy debug logging
duncancmt Oct 23, 2024
d4b761d
Cleanup
duncancmt Oct 24, 2024
570534d
Merge branch 'master' into dcmt/upgrade-timelock
duncancmt Feb 14, 2025
7e8fe01
Merge branch 'master' into dcmt/upgrade-timelock
duncancmt Feb 21, 2025
0d5a970
Try to speed up CI
duncancmt Feb 21, 2025
6eb73a6
Add Dedaub audit report for `SafeGuard.sol`
duncancmt Mar 14, 2025
83d0959
Add *DRAFT* Bailsec audit report for `SafeGuard.sol`
duncancmt Mar 17, 2025
a397c62
Address Bailsec audit findings
duncancmt Mar 17, 2025
1d921f9
`forge fmt`
duncancmt Mar 17, 2025
2ab40b7
Add graffiti event to show the resignation `txHash`
duncancmt Mar 18, 2025
f0b528b
Fix unit tests
duncancmt Mar 18, 2025
3f81cf0
Add some new test cases
duncancmt Mar 18, 2025
6a7c180
Add another new test case
duncancmt Mar 18, 2025
9f23096
`forge fmt`
duncancmt Mar 18, 2025
3872df5
Add unit test for the `resignTxHash` flow
duncancmt Mar 18, 2025
a6232a3
DRY
duncancmt Mar 19, 2025
bc3c51d
Add final Bailsec audit report for `SafeGuard.sol`
duncancmt Mar 20, 2025
61625d9
Reorder checks for clarity
duncancmt Mar 20, 2025
a3a8acb
Make `safe` a constructor argument in `SafeGuard`
duncancmt Mar 23, 2025
b4ec987
`forge fmt`
duncancmt Mar 23, 2025
2b9dccd
Support both Arachnid deployer and Safe singleton factory rooted Safe…
duncancmt Mar 23, 2025
f394f9b
Comment
duncancmt Mar 23, 2025
405cb27
Add more unit test
duncancmt Mar 23, 2025
2b53b0a
Merge branch 'master' into dcmt/upgrade-timelock
duncancmt Jul 9, 2025
e481714
Merge branch 'master' into dcmt/upgrade-timelock
duncancmt Aug 19, 2025
95f9499
Golf
duncancmt Aug 19, 2025
768269b
Revert "Golf"
duncancmt Aug 19, 2025
9fa9f7f
Fix CI
duncancmt Aug 19, 2025
e58f3cb
Fix CI
duncancmt Aug 19, 2025
662b788
Style
duncancmt Aug 19, 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
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: npm install

- name: Check contract sizes
run: forge build --sizes --skip MultiCall.sol --skip CrossChainReceiverFactory.sol --skip 'test/*'
run: forge build --sizes --skip UniswapV4UnitTest.t.sol --skip MultiCall.sol --skip CrossChainReceiverFactory --skip SafeGuard.sol --skip 'test/*'

- name: Run tests
run: forge test --skip 'src/*' --skip 'test/0.8.28/*'
Expand Down
34 changes: 23 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@ jobs:
- name: Install dependencies
run: git submodule update --recursive --init

- name: Run EulerSwap math tests
run: forge test --skip 'src/*' --skip 'script/*' --skip 'test/unit/*' --skip 'test/integration/*' --skip 'test/0.8.25/*' --mp test/0.8.28/EulerSwapBUSL.t.sol
- name: Build Safe Guard
run: forge build src/deployer/SafeGuard.sol
env:
FOUNDRY_SOLC_VERSION: 0.8.28

- name: Build contracts
run: forge build --skip MultiCall.sol --skip CrossChainReceiverFactory.sol --skip 'test/*'
FOUNDRY_EVM_VERSION: london
FOUNDRY_OPTIMIZER_RUNS: 200

- name: Build UniswapV4 tests
run: forge build -- test/unit/core/UniswapV4UnitTest.t.sol
- name: Run SafeGuard tests
run: forge test --skip 'src/*' --skip 'test/unit/*' --skip 'test/integration/*' --skip 'test/0.8.28/*' --mp test/0.8.25/SafeGuard.t.sol
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
BNB_MAINNET_RPC_URL: ${{ secrets.BNB_MAINNET_RPC_URL }}

- name: Build UniswapV4
run: forge build -- lib/v4-core/src/PoolManager.sol
- name: Run EulerSwap math tests
run: forge test --skip 'src/*' --skip 'script/*' --skip 'test/unit/*' --skip 'test/integration/*' --skip 'test/0.8.25/*' --mp test/0.8.28/EulerSwapBUSL.t.sol
env:
FOUNDRY_SOLC_VERSION: 0.8.26
FOUNDRY_SOLC_VERSION: 0.8.28

- name: Build MultiCall
run: forge build -- src/multicall/MultiCall.sol
Expand All @@ -61,6 +62,17 @@ jobs:
- name: Run CrossChainReceiverFactory tests
run: forge test --skip 'src/*' --skip 'test/integration/*' --skip 'test/0.8.28/*' --skip 'test/unit/deployer/*' --mp test/unit/CrossChainReceiverFactory.t.sol

- name: Build contracts
run: forge build --skip UniswapV4UnitTest.t.sol --skip MultiCall.sol --skip CrossChainReceiverFactory.sol --skip SafeGuard.sol --skip 'test/*'

- name: Build UniswapV4 tests
run: forge build --skip MultiCall.sol --skip SafeGuard.sol --skip 'test/*' -- test/unit/core/UniswapV4UnitTest.t.sol

- name: Build UniswapV4
run: forge build -- lib/v4-core/src/PoolManager.sol
env:
FOUNDRY_SOLC_VERSION: 0.8.26

- name: Run all the other tests
run: FOUNDRY_FUZZ_SEED="0x$(python3 -c 'import secrets, binascii; print(binascii.hexlify((secrets.randbits(256)).to_bytes(32, byteorder="big")).decode("ascii"))')" forge test --skip 'src/*' --skip 'test/0.8.28/*' --skip CrossChainReceiverFactory.t.sol --skip MultiCall.t.sol
env:
Expand Down
Binary file added audits/Bailsec - 0x - SafeGuard - 2nd Report.pdf
Binary file not shown.
Binary file not shown.
Loading