Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
154 changes: 78 additions & 76 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,76 +1,78 @@
AddOwnerAddressTest:testEmitsAddOwner() (gas: 91954)
AddOwnerAddressTest:testIncreasesOwnerIndex() (gas: 90492)
AddOwnerAddressTest:testRevertsIfAlreadyOwner() (gas: 92327)
AddOwnerAddressTest:testRevertsIfCalledByNonOwner() (gas: 11831)
AddOwnerAddressTest:testSetsIsOwner() (gas: 90125)
AddOwnerAddressTest:testSetsOwnerAtIndex() (gas: 99961)
AddOwnerPublicKeyTest:testEmitsAddOwner() (gas: 115024)
AddOwnerPublicKeyTest:testFuzzIsOwnerPublicKey(bytes32,bytes32) (runs: 256, μ: 114454, ~: 114454)
AddOwnerPublicKeyTest:testRevertsIfAlreadyOwner() (gas: 115392)
AddOwnerPublicKeyTest:testRevertsIfCalledByNonOwner() (gas: 11895)
AddOwnerPublicKeyTest:testSetsIsOwner() (gas: 113193)
AddOwnerPublicKeyTest:testSetsOwnerAtIndex() (gas: 130925)
CoinbaseSmartWallet1271InputGeneratorTest:testGetReplaySafeHashForDeployedAccount() (gas: 311701)
CoinbaseSmartWallet1271InputGeneratorTest:testGetReplaySafeHashForUndeployedAccount() (gas: 293976)
CoinbaseSmartWalletFactoryTest:testDeployDeterministicPassValues() (gas: 270581)
CoinbaseSmartWalletFactoryTest:test_CreateAccount_ReturnsPredeterminedAddress_WhenAccountAlreadyExists() (gas: 289811)
CoinbaseSmartWalletFactoryTest:test_RevertsIfLength32ButLargerThanAddress() (gas: 303514)
CoinbaseSmartWalletFactoryTest:test_constructor_revertsIfImplementationIsNotDeployed(address) (runs: 256, μ: 39338, ~: 39348)
CoinbaseSmartWalletFactoryTest:test_constructor_setsImplementation(address) (runs: 256, μ: 455736, ~: 455736)
CoinbaseSmartWalletFactoryTest:test_createAccountDeploysToPredeterminedAddress() (gas: 271825)
CoinbaseSmartWalletFactoryTest:test_createAccountSetsOwnersCorrectly() (gas: 281476)
CoinbaseSmartWalletFactoryTest:test_createAccount_emitsAccountCreatedEvent(uint256) (runs: 256, μ: 273358, ~: 273358)
CoinbaseSmartWalletFactoryTest:test_exitIfAccountIsAlreadyInitialized() (gas: 271307)
CoinbaseSmartWalletFactoryTest:test_implementation_returnsExpectedAddress() (gas: 7698)
CoinbaseSmartWalletFactoryTest:test_initCodeHash() (gas: 7913)
CoinbaseSmartWalletFactoryTest:test_revertsIfNoOwners() (gas: 29256)
ERC1271Test:test_returnsExpectedDomainHashWhenProxy() (gas: 31630)
ERC1271Test:test_static() (gas: 4046108)
MultiOwnableInitializeTest:testRevertsIfLength32ButLargerThanAddress() (gas: 80861)
MultiOwnableInitializeTest:testRevertsIfLength32NotAddress() (gas: 81027)
MultiOwnableInitializeTest:testRevertsIfLengthNot32Or64() (gas: 103534)
RemoveLastOwnerTest:test_emitsRemoveOwner() (gas: 50105)
RemoveLastOwnerTest:test_removesOwner() (gas: 48993)
RemoveLastOwnerTest:test_removesOwnerAtIndex() (gas: 49127)
RemoveLastOwnerTest:test_revert_whenCalledByNonOwner(address) (runs: 256, μ: 19210, ~: 19210)
RemoveLastOwnerTest:test_revert_whenNoOwnerAtIndex() (gas: 48103)
RemoveLastOwnerTest:test_revert_whenWrongOwnerAtIndex() (gas: 34023)
RemoveLastOwnerTest:test_reverts_whenNotLastOwner() (gas: 123054)
RemoveOwnerAtIndexTest:test_emitsRemoveOwner() (gas: 55370)
RemoveOwnerAtIndexTest:test_removesOwner() (gas: 54324)
RemoveOwnerAtIndexTest:test_removesOwnerAtIndex() (gas: 54222)
RemoveOwnerAtIndexTest:test_revert_whenCalledByNonOwner(address) (runs: 256, μ: 19232, ~: 19232)
RemoveOwnerAtIndexTest:test_revert_whenNoOwnerAtIndex() (gas: 33098)
RemoveOwnerAtIndexTest:test_revert_whenWrongOwnerAtIndex() (gas: 36598)
RemoveOwnerAtIndexTest:test_reverts_ifIsLastOwner() (gas: 7632833)
TestCanSkipChainIdValidation:test_approvedSelectorsReturnTrue() (gas: 17685)
TestCanSkipChainIdValidation:test_otherSelectorsReturnFalse() (gas: 12561)
TestExecuteWithoutChainIdValidation:testExecute() (gas: 485146)
TestExecuteWithoutChainIdValidation:testExecuteBatch() (gas: 889868)
TestExecuteWithoutChainIdValidation:testExecuteBatch(uint256) (runs: 256, μ: 4544535, ~: 4457018)
TestExecuteWithoutChainIdValidation:test__codesize() (gas: 61710)
TestExecuteWithoutChainIdValidation:test_revertsWithReservedNonce() (gas: 81700)
TestExecuteWithoutChainIdValidation:test_reverts_whenCallerNotEntryPoint() (gas: 11148)
TestExecuteWithoutChainIdValidation:test_reverts_whenOneCallReverts() (gas: 467006)
TestExecuteWithoutChainIdValidation:test_reverts_whenOneSelectorNotApproved() (gas: 179933)
TestExecuteWithoutChainIdValidation:test_reverts_whenSelectorNotApproved() (gas: 106565)
TestExecuteWithoutChainIdValidation:test_succeeds_whenSelectorAllowed() (gas: 424623)
TestImplementation:testImplementation() (gas: 12677)
TestInitialize:testInitialize() (gas: 21146)
TestInitialize:test_cannotInitImplementation() (gas: 3676943)
TestIsValidSignature:testReturnsInvalidIfPasskeySigButWrongOwnerLength() (gas: 40556)
TestIsValidSignature:testRevertsIfEthereumSignatureButWrongOwnerLength() (gas: 24272)
TestIsValidSignature:testRevertsIfOwnerIsInvalidEthereumAddress() (gas: 22001)
TestIsValidSignature:testSmartWalletSigner() (gas: 3967929)
TestIsValidSignature:testValidateSignatureWithEOASigner() (gas: 25053)
TestIsValidSignature:testValidateSignatureWithEOASignerFailsWithWrongSigner() (gas: 23780)
TestIsValidSignature:testValidateSignatureWithPasskeySigner() (gas: 354806)
TestIsValidSignature:testValidateSignatureWithPasskeySignerFailsBadOwnerIndex() (gas: 35960)
TestIsValidSignature:testValidateSignatureWithPasskeySignerFailsWithWrongBadSignature() (gas: 345393)
TestUpgradeToAndCall:testUpgradeToAndCall() (gas: 25322)
TestValidateUserOp:test_reverts_whenReplayableNonceKeyInvalidForSelector() (gas: 14609)
TestValidateUserOp:test_reverts_whenSelectorInvalidForReplayableNonceKey() (gas: 14469)
TestValidateUserOp:test_reverts_whenUpgradeToImplementationWithNoCode(address) (runs: 256, μ: 23208, ~: 23228)
TestValidateUserOp:test_succeedsWithEOASigner() (gas: 456302)
TestValidateUserOp:test_succeedsWithPasskeySigner() (gas: 711409)
TestValidateUserOp:test_succeeds_whenUpgradeToImplementationWithCode() (gas: 3714211)
AddOwnerAddressTest:testEmitsAddOwner() (gas: 95829)
AddOwnerAddressTest:testIncreasesOwnerIndex() (gas: 93811)
AddOwnerAddressTest:testRevertsIfAlreadyOwner() (gas: 97900)
AddOwnerAddressTest:testRevertsIfCalledByNonOwner() (gas: 13315)
AddOwnerAddressTest:testSetsIsOwner() (gas: 94340)
AddOwnerAddressTest:testSetsOwnerAtIndex() (gas: 97345)
AddOwnerPublicKeyTest:testEmitsAddOwner() (gas: 119224)
AddOwnerPublicKeyTest:testFuzzIsOwnerPublicKey(bytes32,bytes32) (runs: 260, μ: 120409, ~: 120409)
AddOwnerPublicKeyTest:testRevertsIfAlreadyOwner() (gas: 121567)
AddOwnerPublicKeyTest:testRevertsIfCalledByNonOwner() (gas: 13468)
AddOwnerPublicKeyTest:testSetsIsOwner() (gas: 117612)
AddOwnerPublicKeyTest:testSetsOwnerAtIndex() (gas: 120856)
CoinbaseSmartWallet1271InputGeneratorTest:testGetReplaySafeHashForDeployedAccount() (gas: 321780)
CoinbaseSmartWallet1271InputGeneratorTest:testGetReplaySafeHashForUndeployedAccount() (gas: 306564)
CoinbaseSmartWalletFactoryTest:testDeployDeterministicPassValues() (gas: 278647)
CoinbaseSmartWalletFactoryTest:test_CreateAccount_ReturnsPredeterminedAddress_WhenAccountAlreadyExists() (gas: 302620)
CoinbaseSmartWalletFactoryTest:test_RevertsIfLength32ButLargerThanAddress() (gas: 312891)
CoinbaseSmartWalletFactoryTest:test_constructor_revertsIfImplementationIsNotDeployed(address) (runs: 260, μ: 40036, ~: 40046)
CoinbaseSmartWalletFactoryTest:test_constructor_setsImplementation(address) (runs: 260, μ: 548238, ~: 548238)
CoinbaseSmartWalletFactoryTest:test_createAccountDeploysToPredeterminedAddress() (gas: 281841)
CoinbaseSmartWalletFactoryTest:test_createAccountSetsOwnersCorrectly() (gas: 293368)
CoinbaseSmartWalletFactoryTest:test_createAccount_emitsAccountCreatedEvent(uint256) (runs: 260, μ: 284216, ~: 284216)
CoinbaseSmartWalletFactoryTest:test_exitIfAccountIsAlreadyInitialized() (gas: 282240)
CoinbaseSmartWalletFactoryTest:test_implementation_returnsExpectedAddress() (gas: 7992)
CoinbaseSmartWalletFactoryTest:test_initCodeHash() (gas: 8307)
CoinbaseSmartWalletFactoryTest:test_revertsIfNoOwners() (gas: 30019)
ERC1271Test:test_returnsExpectedDomainHashWhenProxy() (gas: 23618)
ERC1271Test:test_static() (gas: 5038825)
EndToEndTest:test_transfer_erc20() (gas: 462176)
EndToEndTest:test_transfer_native() (gas: 355253)
MultiOwnableInitializeTest:testRevertsIfLength32ButLargerThanAddress() (gas: 83336)
MultiOwnableInitializeTest:testRevertsIfLength32NotAddress() (gas: 83255)
MultiOwnableInitializeTest:testRevertsIfLengthNot32Or64() (gas: 105695)
RemoveLastOwnerTest:test_emitsRemoveOwner() (gas: 52621)
RemoveLastOwnerTest:test_removesOwner() (gas: 52383)
RemoveLastOwnerTest:test_removesOwnerAtIndex() (gas: 53221)
RemoveLastOwnerTest:test_revert_whenCalledByNonOwner(address) (runs: 260, μ: 20652, ~: 20652)
RemoveLastOwnerTest:test_revert_whenNoOwnerAtIndex() (gas: 50014)
RemoveLastOwnerTest:test_revert_whenWrongOwnerAtIndex() (gas: 37450)
RemoveLastOwnerTest:test_reverts_whenNotLastOwner() (gas: 127056)
RemoveOwnerAtIndexTest:test_emitsRemoveOwner() (gas: 57775)
RemoveOwnerAtIndexTest:test_removesOwner() (gas: 57349)
RemoveOwnerAtIndexTest:test_removesOwnerAtIndex() (gas: 57914)
RemoveOwnerAtIndexTest:test_revert_whenCalledByNonOwner(address) (runs: 260, μ: 20674, ~: 20674)
RemoveOwnerAtIndexTest:test_revert_whenNoOwnerAtIndex() (gas: 35018)
RemoveOwnerAtIndexTest:test_revert_whenWrongOwnerAtIndex() (gas: 40657)
RemoveOwnerAtIndexTest:test_reverts_ifIsLastOwner() (gas: 8529792)
TestCanSkipChainIdValidation:test_approvedSelectorsReturnTrue() (gas: 20637)
TestCanSkipChainIdValidation:test_otherSelectorsReturnFalse() (gas: 13631)
TestExecuteWithoutChainIdValidation:testExecute() (gas: 587208)
TestExecuteWithoutChainIdValidation:testExecuteBatch() (gas: 1087434)
TestExecuteWithoutChainIdValidation:testExecuteBatch(uint256) (runs: 260, μ: 5622658, ~: 5415134)
TestExecuteWithoutChainIdValidation:test__codesize() (gas: 65702)
TestExecuteWithoutChainIdValidation:test_revertsWithReservedNonce() (gas: 87228)
TestExecuteWithoutChainIdValidation:test_reverts_whenCallerNotEntryPoint() (gas: 11407)
TestExecuteWithoutChainIdValidation:test_reverts_whenOneCallReverts() (gas: 475054)
TestExecuteWithoutChainIdValidation:test_reverts_whenOneSelectorNotApproved() (gas: 183931)
TestExecuteWithoutChainIdValidation:test_reverts_whenSelectorNotApproved() (gas: 108819)
TestExecuteWithoutChainIdValidation:test_succeeds_whenSelectorAllowed() (gas: 440590)
TestImplementation:testImplementation() (gas: 12896)
TestInitialize:testInitialize() (gas: 22939)
TestInitialize:test_cannotInitImplementation() (gas: 4597308)
TestIsValidSignature:testReturnsInvalidIfPasskeySigButWrongOwnerLength() (gas: 50912)
TestIsValidSignature:testRevertsIfEthereumSignatureButWrongOwnerLength() (gas: 29788)
TestIsValidSignature:testRevertsIfOwnerIsInvalidEthereumAddress() (gas: 29384)
TestIsValidSignature:testSmartWalletSigner() (gas: 4950306)
TestIsValidSignature:testValidateSignatureWithEOASigner() (gas: 30653)
TestIsValidSignature:testValidateSignatureWithEOASignerFailsWithWrongSigner() (gas: 27974)
TestIsValidSignature:testValidateSignatureWithPasskeySigner() (gas: 275434)
TestIsValidSignature:testValidateSignatureWithPasskeySignerFailsBadOwnerIndex() (gas: 46521)
TestIsValidSignature:testValidateSignatureWithPasskeySignerFailsWithWrongBadSignature() (gas: 270588)
TestUpgradeToAndCall:testUpgradeToAndCall() (gas: 26537)
TestValidateUserOp:test_reverts_whenReplayableNonceKeyInvalidForSelector() (gas: 17983)
TestValidateUserOp:test_reverts_whenSelectorInvalidForReplayableNonceKey() (gas: 19057)
TestValidateUserOp:test_reverts_whenUpgradeToImplementationWithNoCode(address) (runs: 260, μ: 30315, ~: 30315)
TestValidateUserOp:test_succeedsWithEOASigner() (gas: 687856)
TestValidateUserOp:test_succeedsWithPasskeySigner() (gas: 854583)
TestValidateUserOp:test_succeeds_whenUpgradeToImplementationWithCode() (gas: 4688457)
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[submodule "lib/safe-singleton-deployer-sol"]
path = lib/safe-singleton-deployer-sol
url = https://github.com/wilsoncusack/safe-singleton-deployer-sol
[submodule "lib/v4-core"]
path = lib/v4-core
url = https://github.com/Uniswap/v4-core
32 changes: 32 additions & 0 deletions foundry.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"lib/account-abstraction": {
"rev": "abff2aca61a8f0934e533d0d352978055fddbd96"
},
"lib/forge-std": {
"tag": {
"name": "v1.10.0",
"rev": "8bbcf6e3f8f62f419e5429a0bd89331c85c37824"
}
},
"lib/openzeppelin-contracts": {
"rev": "5705e8208bc92cd82c7bcdfeac8dbc7377767d96"
},
"lib/p256-verifier": {
"rev": "29475ae300ec95d98d5c7cc34c094846f0aa2dcd"
},
"lib/safe-singleton-deployer-sol": {
"rev": "cf2b89c33fed536c4dd6fef2fb84f39053068868"
},
"lib/solady": {
"rev": "c4c96607cb3aa3807b14c81ae2015bcba061f8fc"
},
"lib/v4-core": {
"tag": {
"name": "v4.0.0",
"rev": "e50237c43811bd9b526eff40f26772152a42daba"
}
},
"lib/webauthn-sol": {
"rev": "619f20ab0f074fef41066ee4ab24849a913263b2"
}
}
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ optimizer = true
optimizer_runs = 999999
via_ir = true
evm_version = "prague"
solc_version = "0.8.23"
solc_version = "0.8.26"

[fmt]
sort_imports = true
Expand Down
2 changes: 1 addition & 1 deletion lib/forge-std
Submodule forge-std updated 55 files
+1 −0 .github/CODEOWNERS
+57 −109 .github/workflows/ci.yml
+3 −1 .github/workflows/sync.yml
+0 −3 .gitmodules
+193 −0 CONTRIBUTING.md
+21 −5 README.md
+5 −3 foundry.toml
+0 −1 lib/ds-test
+1 −1 package.json
+13 −2 scripts/vm.py
+16 −9 src/Base.sol
+1 −0 src/Script.sol
+590 −202 src/StdAssertions.sol
+49 −11 src/StdChains.sol
+17 −5 src/StdCheats.sol
+30 −0 src/StdConstants.sol
+18 −3 src/StdInvariant.sol
+111 −11 src/StdJson.sol
+202 −107 src/StdStorage.sol
+283 −0 src/StdToml.sol
+1 −19 src/StdUtils.sol
+5 −4 src/Test.sol
+1,416 −62 src/Vm.sol
+635 −608 src/console.sol
+1 −1,555 src/console2.sol
+1 −1 src/interfaces/IERC1155.sol
+3 −3 src/interfaces/IERC4626.sol
+72 −0 src/interfaces/IERC6909.sol
+1 −1 src/interfaces/IERC721.sol
+150 −0 src/interfaces/IERC7540.sol
+241 −0 src/interfaces/IERC7575.sol
+0 −216 src/mocks/MockERC20.sol
+0 −221 src/mocks/MockERC721.sol
+693 −4 src/safeconsole.sol
+44 −0 test/CommonBase.t.sol
+35 −909 test/StdAssertions.t.sol
+55 −44 test/StdChains.t.sol
+66 −37 test/StdCheats.t.sol
+38 −0 test/StdConstants.t.sol
+12 −12 test/StdError.t.sol
+49 −0 test/StdJson.t.sol
+12 −22 test/StdMath.t.sol
+190 −17 test/StdStorage.t.sol
+1 −1 test/StdStyle.t.sol
+49 −0 test/StdToml.t.sol
+26 −26 test/StdUtils.t.sol
+9 −6 test/Vm.t.sol
+1 −1 test/compilation/CompilationScript.sol
+1 −1 test/compilation/CompilationScriptBase.sol
+1 −1 test/compilation/CompilationTest.sol
+1 −1 test/compilation/CompilationTestBase.sol
+8 −0 test/fixtures/test.json
+6 −0 test/fixtures/test.toml
+0 −441 test/mocks/MockERC20.t.sol
+0 −721 test/mocks/MockERC721.t.sol
1 change: 1 addition & 0 deletions lib/v4-core
Submodule v4-core added at e50237
15 changes: 15 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@ensdomains/=lib/v4-core/node_modules/@ensdomains/
@openzeppelin/=lib/v4-core/lib/openzeppelin-contracts/
FreshCryptoLib/=lib/webauthn-sol/lib/FreshCryptoLib/solidity/src/
account-abstraction/=lib/account-abstraction/contracts/
ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/
forge-std/=lib/forge-std/src/
hardhat/=lib/v4-core/node_modules/hardhat/
openzeppelin-contracts/=lib/openzeppelin-contracts/
p256-verifier/=lib/p256-verifier/
safe-singleton-deployer-sol/=lib/safe-singleton-deployer-sol/
solady/=lib/solady/src/
solmate/=lib/v4-core/lib/solmate/
v4-core/=lib/v4-core/src/
webauthn-sol/=lib/webauthn-sol/src/
8 changes: 8 additions & 0 deletions snapshots/EndToEndTest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"e2e_swap_baseAccount": "388633",
"e2e_swap_eoa": "176712",
"e2e_transfer_erc20_baseAccount": "158011",
"e2e_transfer_erc20_eoa": "50584",
"e2e_transfer_native_baseAccount": "133676",
"e2e_transfer_native_eoa": "17326"
}
2 changes: 1 addition & 1 deletion src/CoinbaseSmartWallet.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
pragma solidity 0.8.26;

import {IAccount} from "account-abstraction/interfaces/IAccount.sol";

Expand Down
Loading
Loading