Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: linea custom patch #52

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

fix: linea custom patch #52

wants to merge 1 commit into from

Conversation

sakulstra
Copy link
Contributor

@sakulstra sakulstra commented Dec 11, 2024

npx catapulta-verify@1.2.2-8d32ccd9a1da7eff0fe5678627996d3572d3e517.0 -b verify.json

put ETHERSCAN_API_KEY in your global env (not sure if must be a mainnet etherscan key or not, i'm using one at least)

Copy link
Contributor

🌈 Test Results
No files changed, compilation skipped

Ran 1 test for test/ChainHelperTest.t.sol:TestChainHelpers
[PASS] test_selectChain_shouldRevert() (gas: 3305)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 394.81µs (117.09µs CPU time)

Ran 6 tests for test/PermissionlessRescuable.t.sol:PermissionlessRescuableTest
[PASS] test_emergencyEtherTransfer() (gas: 59275)
[PASS] test_emergencyEtherTransferInsufficientBalance_shouldRevert() (gas: 45474)
[PASS] test_emergencyTokenTransfer() (gas: 81066)
[PASS] test_emergencyTokenTransferInsufficientBalance_shouldRevert() (gas: 21467)
[PASS] test_emergencyTokenTransfer_withTransferRestriction() (gas: 115843)
[PASS] test_whoShouldReceiveFunds() (gas: 12739)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 883.60µs (488.57µs CPU time)

Ran 5 tests for test/Rescuable.t.sol:RescueTest
[PASS] testEmergencyEtherTransfer() (gas: 57806)
[PASS] testEmergencyEtherTransferWhenNotOwner() (gas: 17702)
[PASS] testEmergencyTokenTransfer() (gas: 238746)
[PASS] testEmergencyTokenTransferWhenNotOwner() (gas: 210996)
[PASS] testToken() (gas: 2393)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 2.38ms (2.01ms CPU time)

Ran 6 tests for test/UpgradeableOwnableWithGuardian.t.sol:TestOfUpgradableOwnableWithGuardian
[PASS] test_initializer() (gas: 18313)
[PASS] test_onlyGuardian() (gas: 11077)
[PASS] test_onlyOwnerOrGuardian() (gas: 13274)
[PASS] test_updateGuardian_eoa(address,address) (runs: 256, μ: 18721, ~: 18721)
[PASS] test_updateGuardian_guardian(address) (runs: 256, μ: 19695, ~: 19695)
[PASS] test_updateGuardian_owner(address) (runs: 256, μ: 19410, ~: 19410)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 30.16ms (29.93ms CPU time)

Ran 3 tests for test/Rescuable721.t.sol:Rescue721Test
[PASS] testFuzzEmergencyTokenTransfer(address) (runs: 256, μ: 79128, ~: 79128)
[PASS] testFuzzEmergencyTokenTransferWhenNotOwner(address,address) (runs: 256, μ: 71895, ~: 71895)
[PASS] testToken() (gas: 2459)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 54.88ms (54.45ms CPU time)

Ran 5 tests for test/RescuableACL.t.sol:RescueACLTest
[PASS] testEmergencyEtherTransfer() (gas: 57808)
[PASS] testEmergencyEtherTransferWhenNotOwner() (gas: 17695)
[PASS] testEmergencyTokenTransfer() (gas: 238765)
[PASS] testEmergencyTokenTransferWhenNotOwner() (gas: 211008)
[PASS] testToken() (gas: 2393)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 2.53ms (2.15ms CPU time)

Ran 4 tests for test/TransparentProxyFactory.t.sol:TestTransparentProxyFactory
[PASS] testCreateDeterministic(address,bytes32) (runs: 256, μ: 381162, ~: 381162)
[PASS] testCreateDeterministicProxyAdmin(address,bytes32) (runs: 256, μ: 278926, ~: 278926)
[PASS] testCreateDeterministicWithDeterministicProxy(bytes32,bytes32) (runs: 256, μ: 387741, ~: 387741)
[PASS] testCreateProxyAdmin(address,bytes32) (runs: 256, μ: 272971, ~: 272971)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 120.65ms (224.29ms CPU time)

Ran 2 tests for test/create3Test.t.sol:Create3FactoryTest
[PASS] testCreate3WithValue(address,address,address) (runs: 256, μ: 275048, ~: 275048)
[PASS] testCreate3WithoutValue(address,address,bytes32) (runs: 256, μ: 278020, ~: 278020)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 87.34ms (110.02ms CPU time)

Ran 6 tests for test/OwnableWithGuardian.t.sol:TestOfOwnableWithGuardian
[PASS] testConstructorLogic() (gas: 18210)
[PASS] testGuardianUpdateNoAccess() (gas: 14910)
[PASS] testGuardianUpdateViaGuardian(address) (runs: 256, μ: 19428, ~: 19428)
[PASS] testGuardianUpdateViaOwner(address) (runs: 256, μ: 19245, ~: 19245)
[PASS] test_onlyGuardianGuard() (gas: 12583)
[PASS] test_onlyGuardianGuard_shouldRevert() (gas: 10572)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 141.43ms (41.72ms CPU time)

Ran 9 test suites in 143.59ms (440.66ms CPU time): 38 tests passed, 0 failed, 0 skipped (38 total tests)
🌈 Test Results zksync
Compiling 44 files with Solc 0.8.24
Solc 0.8.24 finished in 1.50s
Compiler run successful with warnings:
Warning (2519): This declaration shadows an existing declaration.
  --> zksync/test/TransparentProxyFactoryZkSync.t.sol:88:5:
   |
88 |     address proxyAdmin = factory.createDeterministicProxyAdmin(proxyAdminOwner, proxyAdminSalt);
   |     ^^^^^^^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> zksync/test/TransparentProxyFactoryZkSync.t.sol:14:3:
   |
14 |   ProxyAdmin internal proxyAdmin;
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning (2519): This declaration shadows an existing declaration.
   --> zksync/test/TransparentProxyFactoryZkSync.t.sol:106:5:
    |
106 |     address proxyAdmin = factory.createDeterministicProxyAdmin(proxyAdminOwner, proxyAdminSalt);
    |     ^^^^^^^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> zksync/test/TransparentProxyFactoryZkSync.t.sol:14:3:
   |
14 |   ProxyAdmin internal proxyAdmin;
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


No files changed, compilation skipped

Ran 5 tests for zksync/test/TransparentProxyFactoryZkSync.t.sol:TestTransparentProxyFactoryZkSync
[PASS] testCreate() (gas: 2776054)
[PASS] testCreateDeterministic(bytes32) (runs: 256, μ: 3201204, ~: 3201204)
[PASS] testCreateDeterministicProxyAdmin(address,bytes32) (runs: 256, μ: 2013126, ~: 2103572)
[PASS] testCreateDeterministicWithDeterministicProxy(bytes32,bytes32) (runs: 256, μ: 3408076, ~: 3408342)
[PASS] testCreateProxyAdmin(address,bytes32) (runs: 256, μ: 1809130, ~: 1895923)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 9.26s (29.38s CPU time)

Ran 1 test suite in 9.26s (9.26s CPU time): 5 tests passed, 0 failed, 0 skipped (5 total tests)

Copy link
Contributor

Gas report

Create3Factory

  • size: ↓-1.7%1103 / 49152
Method min mean median max calls
create(bytes32,bytes) ↑0.67%41810 ↓-1.8%205916 ↓-2%287772 ↓-2%288168 3
predictAddress(address,bytes32) ↑0.39%1024 ↑0.39%1024 ↑0.39%1024 ↑0.39%1024 2

ProxyAdmin

  • size: 1307 / 49152
Method min mean median max calls
owner() ↑0.69%290 ↑0.69%290 ↑0.69%290 ↑0.69%290 2

TransparentProxyFactory

  • size: ↑3.2%5515 / 49152
Method min mean median max calls
createDeterministic(address,address,bytes,bytes32) ↓-1.2%380441 ↓-1.1%380543 ↓-1.1%380543 ↓-1.1%380645 2
createDeterministicProxyAdmin(address,bytes32) ↓-1.4%284890 ↓-1.3%285172 ↓-1.3%285172 ↓-1.2%285454 2
predictCreateDeterministic(address,address,bytes,bytes32) ↑2.3%8897 ↑2.3%8897 ↑2.3%8897 ↑2.3%8897 2
predictCreateDeterministicProxyAdmin(bytes32,address) ↑0.27%4889 ↑0.27%4889 ↑0.27%4889 ↑0.27%4889 2

TransparentUpgradeableProxy

  • size: 2520 / 49152
Method min mean median max calls
fallback() 692 692 692 692 2

ERC20

  • size: ↑1.9%3274 / 49152
Method min mean median max calls
balanceOf(address) ↑0.54%562 ↑0.33%904 ↑0.54%562 ↑0.12%2562 35
mint(address,uint256) 68177 68177 68177 68177 2
transfer(address,uint256) 51470 51470 51470 51470 4

MockERC721

  • size: ↑1.7%2491 / 49152
Method min mean median max calls
balanceOf(address) ↑0.66%609 ↑0.66%609 ↑0.66%609 ↑0.66%609 4
mint(address,uint256) 68325 68325 68325 68325 2
transferFrom(address,address,uint256) 54102 54102 54102 54102 1

MockImpl

  • size: ↓-2.6%672 / 49152
Method min mean median max calls
getFoo() ↑0.41%247 ↑0.41%247 ↑0.41%247 ↑0.41%247 2
initialize(uint256) 46319 46319 46319 46319 2

ImplOwnableWithGuardian

  • size: ↓-1.6%1179 / 49152
Method min mean median max calls
guardian() ↑0.28%353 ↑0.16%638 ↑0.28%353 2353 7
mock_onlyGuardian() 23395 23447 23447 23499 2
owner() ↑0.59%341 ↑0.32%626 ↑0.59%341 2341 7
transferOwnership(address) 28574 28574 28574 28574 6
updateGuardian(address) 26172 30024 30522 30522 9

PermissionlessRescuable

  • size: ↑1.2%2171 / 49152
Method min mean median max calls
emergencyEtherTransfer(uint256) 58371 59277 59277 60183 2
emergencyTokenTransfer(address,uint256) 32838 48627 49124 63423 4
whoShouldReceiveFunds() 2364 2364 2364 2364 1

Rescuable

  • size: ↑0.1%1992 / 49152
Method min mean median max calls
emergencyEtherTransfer(address,uint256) 21910 40140 40140 58370 2
emergencyTokenTransfer(address,address,uint256) 22291 37928 37928 53565 2

Rescuable721

  • size: 2235 / 49152
Method min mean median max calls
emergency721TokenTransfer(address,address,uint256) 22423 ↓-0.23%40967 ↓-0.23%40967 ↓-0.31%59512 2

RescuableACL

  • size: ↑0.38%1866 / 49152
Method min mean median max calls
emergencyEtherTransfer(address,uint256) 21903 40137 40137 58372 2
emergencyTokenTransfer(address,address,uint256) 22306 37947 37947 53589 2

ImplOwnableWithGuardian

  • size: ↓-1.3%1472 / 49152
Method min mean median max calls
guardian() 2393 2393 2393 2393 1
initialize(address,address) 93663 93663 93663 93663 6
mock_onlyGuardian() 23515 23515 23515 23515 1
mock_onlyOwnerOrGuardian() 25756 25756 25756 25756 1
owner() 2381 2381 2381 2381 1
updateGuardian(address) 26347 ↑0.25%29137 ↑0.65%30524 30540 3

MockContract

  • size: 1064 / 49152
Method min mean median max calls
SOME_ADDRESS() ↑0.37%270 ↑0.37%270 ↑0.37%270 ↑0.37%270 1
owner() ↑0.55%363 ↑0.55%363 ↑0.55%363 ↑0.55%363 1

Copy link
Contributor

🔮 Coverage report
File Line Coverage Function Coverage Branch Coverage
src/contracts/access-control/OwnableWithGuardian.sol ${\color{orange}90\%}$
$9 / 10$
20
${\color{orange}87.5\%}$
$7 / 8$
OwnableWithGuardian.onlyOwnerOrGuardian
${\color{green}100\%}$
$4 / 4$
src/contracts/access-control/UpgradeableOwnableWithGuardian.sol ${\color{green}100\%}$
$14 / 14$
${\color{green}100\%}$
$9 / 9$
${\color{green}100\%}$
$2 / 2$
src/contracts/create3/Create3.sol ${\color{orange}92.86\%}$
$13 / 14$
66
${\color{red}80\%}$
$4 / 5$
Create3.create3
${\color{red}33.33\%}$
$1 / 3$
src/contracts/create3/Create3Factory.sol ${\color{green}100\%}$
$4 / 4$
${\color{green}100\%}$
$2 / 2$
${\color{green}100\%}$
$0 / 0$
src/contracts/oz-common/Ownable.sol ${\color{red}80\%}$
$8 / 10$
37, 63
${\color{red}71.43\%}$
$5 / 7$
Ownable.onlyOwner, Ownable.renounceOwnership
${\color{red}50\%}$
$2 / 4$
src/contracts/oz-common/SafeERC20.sol ${\color{red}13.64\%}$
$3 / 22$
46, 54, 55, 64, 65 and 14 more
${\color{red}25\%}$
$2 / 8$
SafeERC20.safeTransferFrom, SafeERC20.safeIncreaseAllowance, SafeERC20.safeDecreaseAllowance, SafeERC20.forceApprove, SafeERC20.safePermit and 1 more
${\color{red}0\%}$
$0 / 4$
src/contracts/transparent-proxy/Initializable.sol ${\color{red}68.42\%}$
$13 / 19$
124, 128, 129, 131, 132 and 1 more
${\color{red}60\%}$
$3 / 5$
Initializable.reinitializer, Initializable.onlyInitializing
${\color{red}45.45\%}$
$5 / 11$
src/contracts/transparent-proxy/Proxy.sol ${\color{red}0\%}$
$0 / 11$
33, 37, 40, 44, 45 and 6 more
${\color{red}0\%}$
$0 / 5$
Proxy._delegate, Proxy._fallback, Proxy., Proxy., Proxy._beforeFallback
${\color{green}100\%}$
$0 / 0$
src/contracts/transparent-proxy/ProxyAdmin.sol ${\color{red}0\%}$
$0 / 1$
43
$^{↓-100\%}{\color{red}0\%}$
$0 / 1$
ProxyAdmin.upgradeAndCall
${\color{green}100\%}$
$0 / 0$
src/contracts/transparent-proxy/TransparentProxyFactory.sol ${\color{green}100\%}$
$2 / 2$
${\color{green}100\%}$
$1 / 1$
${\color{green}100\%}$
$0 / 0$
src/contracts/transparent-proxy/TransparentProxyFactoryBase.sol ${\color{red}62.5\%}$
$10 / 16$
19, 21, 22, 27, 29 and 1 more
${\color{red}66.67\%}$
$4 / 6$
TransparentProxyFactoryBase.create, TransparentProxyFactoryBase.createProxyAdmin
${\color{green}100\%}$
$0 / 0$
src/contracts/transparent-proxy/TransparentUpgradeableProxy.sol ${\color{red}50\%}$
$5 / 10$
104, 105, 107, 122, 123
${\color{red}75\%}$
$3 / 4$
TransparentUpgradeableProxy._dispatchUpgradeToAndCall
${\color{red}0\%}$
$0 / 4$
src/contracts/utils/PermissionlessRescuable.sol ${\color{green}100\%}$
$2 / 2$
${\color{green}100\%}$
$2 / 2$
${\color{green}100\%}$
$0 / 0$
src/contracts/utils/Rescuable.sol ${\color{green}100\%}$
$4 / 4$
${\color{green}100\%}$
$3 / 3$
${\color{green}100\%}$
$1 / 1$
src/contracts/utils/Rescuable721.sol ${\color{green}100\%}$
$2 / 2$
${\color{green}100\%}$
$1 / 1$
${\color{green}100\%}$
$0 / 0$
src/contracts/utils/RescuableACL.sol ${\color{green}100\%}$
$3 / 3$
${\color{green}100\%}$
$3 / 3$
${\color{green}100\%}$
$0 / 0$
src/contracts/utils/RescuableBase.sol ${\color{green}100\%}$
$8 / 8$
${\color{green}100\%}$
$2 / 2$
${\color{green}100\%}$
$1 / 1$

Copy link
Contributor

🔧 Build logs
Compiling 87 files with Solc 0.8.20
Solc 0.8.20 finished in 4.52s
Compiler run successful with warnings:
Warning (5667): Unused function parameter. Remove or comment out the variable name to silence this warning.
   --> src/mocks/ERC721.sol:933:23:
    |
933 |     function tokenURI(uint256 id) public view override returns (string memory) {
    |                       ^^^^^^^^^^

Warning (2018): Function state mutability can be restricted to pure
   --> src/mocks/ERC721.sol:923:5:
    |
923 |     function name() public view override returns (string memory) {
    |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
   --> src/mocks/ERC721.sol:928:5:
    |
928 |     function symbol() public view override returns (string memory) {
    |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to pure
   --> src/mocks/ERC721.sol:933:5:
    |
933 |     function tokenURI(uint256 id) public view override returns (string memory) {
    |     ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/PermissionlessRescuable.t.sol:63:3:
   |
63 |   function test_whoShouldReceiveFunds() public {
   |   ^ (Relevant source part starts here and spans across multiple lines).

Warning (2018): Function state mutability can be restricted to view
  --> test/UpgradeableOwnableWithGuardian.t.sol:29:3:
   |
29 |   function test_initializer() external {
   |   ^ (Relevant source part starts here and spans across multiple lines).

| Contract                    | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) |
|-----------------------------|------------------|-------------------|--------------------|---------------------|
| Address                     |               45 |               100 |             24,531 |              49,052 |
| ChainHelpers                |               45 |               100 |             24,531 |              49,052 |
| ChainIds                    |               45 |               100 |             24,531 |              49,052 |
| Create2Utils                |              123 |               179 |             24,453 |              48,973 |
| Create3                     |               45 |               100 |             24,531 |              49,052 |
| Create3Factory              |            1,071 |             1,103 |             23,505 |              48,049 |
| ERC1967Proxy                |              129 |               993 |             24,447 |              48,159 |
| ERC1967Utils                |               45 |               100 |             24,531 |              49,052 |
| ERC20                       |            2,326 |             3,082 |             22,250 |              46,070 |
| EnumerableSet               |               45 |               100 |             24,531 |              49,052 |
| ImplOwnableWithGuardian     |            1,440 |             1,472 |             23,136 |              47,680 |
| MockContract                |              730 |             1,000 |             23,846 |              48,152 |
| MockERC721                  |            2,459 |             2,491 |             22,117 |              46,661 |
| MockImpl                    |              435 |               672 |             24,141 |              48,480 |
| PermissionlessRescuable     |            1,917 |             2,107 |             22,659 |              47,045 |
| ProxyAdmin                  |            1,022 |             1,275 |             23,554 |              47,877 |
| Rescuable                   |            1,802 |             1,960 |             22,774 |              47,192 |
| Rescuable721                |            2,038 |             2,203 |             22,538 |              46,949 |
| RescuableACL                |            1,689 |             1,834 |             22,887 |              47,318 |
| SafeCast                    |               45 |               100 |             24,531 |              49,052 |
| SafeERC20                   |               45 |               100 |             24,531 |              49,052 |
| StorageSlot                 |               45 |               100 |             24,531 |              49,052 |
| TestNetChainIds             |               45 |               100 |             24,531 |              49,052 |
| TransparentProxyFactory     |            5,483 |             5,515 |             19,093 |              43,637 |
| TransparentUpgradeableProxy |            1,118 |             2,328 |             23,458 |              46,824 |
🔧 Build logs zksync
Compiling 46 files with zksolc and ZKsync solc 0.8.24
zksolc and ZKsync solc 0.8.24 finished in 11.36s
Compiler run successful with warnings:
Warning (2519)
Warning: This declaration shadows an existing declaration.
  --> zksync/test/TransparentProxyFactoryZkSync.t.sol:88:5:
   |
88 |     address proxyAdmin = factory.createDeterministicProxyAdmin(proxyAdminOwner, proxyAdminSalt);
   |     ^^^^^^^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> zksync/test/TransparentProxyFactoryZkSync.t.sol:14:3:
   |
14 |   ProxyAdmin internal proxyAdmin;
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning (2519)
Warning: This declaration shadows an existing declaration.
   --> zksync/test/TransparentProxyFactoryZkSync.t.sol:106:5:
    |
106 |     address proxyAdmin = factory.createDeterministicProxyAdmin(proxyAdminOwner, proxyAdminSalt);
    |     ^^^^^^^^^^^^^^^^^^
Note: The shadowed declaration is here:
  --> zksync/test/TransparentProxyFactoryZkSync.t.sol:14:3:
   |
14 |   ProxyAdmin internal proxyAdmin;
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Warning

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Warning: Your code or one of its dependencies uses the 'extcodesize' instruction, which is       │
│ usually needed in the following cases:                                                           │
│   1. To detect whether an address belongs to a smart contract.                                   │
│   2. To detect whether the deploy code execution has finished.                                   │
│ zkSync Era comes with native account abstraction support (so accounts are smart contracts,       │
│ including private-key controlled EOAs), and you should avoid differentiating between contracts   │
│ and non-contract addresses.                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
--> lib/forge-std/src/StdCheats.sol
Warning

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Warning: Your code or one of its dependencies uses the 'extcodesize' instruction, which is       │
│ usually needed in the following cases:                                                           │
│   1. To detect whether an address belongs to a smart contract.                                   │
│   2. To detect whether the deploy code execution has finished.                                   │
│ zkSync Era comes with native account abstraction support (so accounts are smart contracts,       │
│ including private-key controlled EOAs), and you should avoid differentiating between contracts   │
│ and non-contract addresses.                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
--> lib/forge-std/src/StdUtils.sol
Warning

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Warning: It looks like you are using 'ecrecover' to validate a signature of a user account.      │
│ zkSync Era comes with native account abstraction support, therefore it is highly recommended NOT │
│ to rely on the fact that the account has an ECDSA private key attached to it since accounts might│
│ implement other signature schemes.                                                               │
│ Read more about Account Abstraction at https://v2-docs.zksync.io/dev/developer-guides/aa.html    │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
--> lib/forge-std/src/mocks/MockERC20.sol
Warning

┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Warning: Your code or one of its dependencies uses the 'extcodesize' instruction, which is       │
│ usually needed in the following cases:                                                           │
│   1. To detect whether an address belongs to a smart contract.                                   │
│   2. To detect whether the deploy code execution has finished.                                   │
│ zkSync Era comes with native account abstraction support (so accounts are smart contracts,       │
│ including private-key controlled EOAs), and you should avoid differentiating between contracts   │
│ and non-contract addresses.                                                                      │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
--> lib/forge-std/src/mocks/MockERC721.sol
| Contract                      | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) |
|-------------------------------|------------------|-------------------|--------------------|---------------------|
| Address                       |              224 |               224 |            450,775 |             450,775 |
| Create2UtilsZkSync            |              480 |               480 |            450,519 |             450,519 |
| ERC1967Proxy                  |            4,192 |             4,192 |            446,807 |             446,807 |
| ERC1967Utils                  |              224 |               224 |            450,775 |             450,775 |
| MockImpl                      |            2,272 |             2,272 |            448,727 |             448,727 |
| ProxyAdmin                    |            4,512 |             4,512 |            446,487 |             446,487 |
| StorageSlot                   |              224 |               224 |            450,775 |             450,775 |
| TransparentProxyFactoryZkSync |            8,032 |             8,032 |            442,967 |             442,967 |
| TransparentUpgradeableProxy   |            7,136 |             7,136 |            443,863 |             443,863 |

@sakulstra sakulstra marked this pull request as draft January 9, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant