Skip to content

Commit

Permalink
Add removeLastOwner for replayability (#52)
Browse files Browse the repository at this point in the history
* Added removeLastOwner selector to list of approved selectors for replayability

* add missing arg to certora .spec

* Fix typo in sig hash in spec
  • Loading branch information
stevieraykatz authored Apr 12, 2024
1 parent 487151a commit 9edcf7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion certora/specs/ERC4337Account.spec
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ rule OnlyOwnerOrSelf(env e, method f) filtered {
// There is no difference between filtering functions and using them as a lhs of implication
f -> f.selector == sig:addOwnerAddress(address).selector
|| f.selector == sig:addOwnerPublicKey(bytes32, bytes32).selector
|| f.selector == sig:removeOwnerAtIndex(uint256, bytes).selector
|| f.selector == sig:removeOwnerAtIndex(uint256, bytes).selector
|| f.selector == sig:removeLastOwner(uint256, bytes).selector
|| f.selector == sig:upgradeToAndCall(address, bytes).selector
} {
bool ownerBefore = e.msg.sender == currentContract || isOwnerAddress(e.msg.sender); // owner can remove themselves
Expand Down
1 change: 1 addition & 0 deletions src/CoinbaseSmartWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ contract CoinbaseSmartWallet is MultiOwnable, UUPSUpgradeable, Receiver, ERC1271
functionSelector == MultiOwnable.addOwnerPublicKey.selector
|| functionSelector == MultiOwnable.addOwnerAddress.selector
|| functionSelector == MultiOwnable.removeOwnerAtIndex.selector
|| functionSelector == MultiOwnable.removeLastOwner.selector
|| functionSelector == UUPSUpgradeable.upgradeToAndCall.selector
) {
return true;
Expand Down
1 change: 1 addition & 0 deletions test/CoinbaseSmartWallet/CanSkipChainIdValidation.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ contract TestCanSkipChainIdValidation is SmartWalletTestBase {
MultiOwnable.addOwnerAddress.selector,
MultiOwnable.addOwnerPublicKey.selector,
MultiOwnable.removeOwnerAtIndex.selector,
MultiOwnable.removeLastOwner.selector,
UUPSUpgradeable.upgradeToAndCall.selector
];
bytes4[] otherSelectors = [CoinbaseSmartWallet.execute.selector, CoinbaseSmartWallet.executeBatch.selector];
Expand Down

0 comments on commit 9edcf7f

Please sign in to comment.