-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: allow both variants #58
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⛽ Gas reportCreate3Factory
ProxyAdmin
TransparentProxyFactory
TransparentUpgradeableProxy
ERC20
MockERC721
MockImpl
ImplOwnableWithGuardian
PermissionlessRescuable
Rescuable
Rescuable721
RescuableACL
ImplOwnableWithGuardian
MockContract
|
🌈 Test ResultsNo files changed, compilation skipped
Ran 1 test for test/ChainHelperTest.t.sol:TestChainHelpers
[PASS] test_selectChain_shouldRevert() (gas: 3293)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 380.37µs (108.91µs CPU time)
Ran 5 tests for test/RescuableACL.t.sol:RescueACLTest
[PASS] testEmergencyEtherTransfer() (gas: 57746)
[PASS] testEmergencyEtherTransferWhenNotOwner() (gas: 17659)
[PASS] testEmergencyTokenTransfer() (gas: 231235)
[PASS] testEmergencyTokenTransferWhenNotOwner() (gas: 203516)
[PASS] testToken() (gas: 2392)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 2.42ms (2.02ms CPU time)
Ran 6 tests for test/OwnableWithGuardian.t.sol:TestOfOwnableWithGuardian
[PASS] testConstructorLogic() (gas: 18202)
[PASS] testGuardianUpdateNoAccess() (gas: 14902)
[PASS] testGuardianUpdateViaGuardian(address) (runs: 256, μ: 19419, ~: 19419)
[PASS] testGuardianUpdateViaOwner(address) (runs: 256, μ: 19236, ~: 19236)
[PASS] test_onlyGuardianGuard() (gas: 12577)
[PASS] test_onlyGuardianGuard_shouldRevert() (gas: 10566)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 40.89ms (40.33ms CPU time)
Ran 6 tests for test/PermissionlessRescuable.t.sol:PermissionlessRescuableTest
[PASS] test_emergencyEtherTransfer() (gas: 59257)
[PASS] test_emergencyEtherTransferInsufficientBalance_shouldRevert() (gas: 45456)
[PASS] test_emergencyTokenTransfer() (gas: 81017)
[PASS] test_emergencyTokenTransferInsufficientBalance_shouldRevert() (gas: 21438)
[PASS] test_emergencyTokenTransfer_withTransferRestriction() (gas: 115750)
[PASS] test_whoShouldReceiveFunds() (gas: 12734)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 3.32ms (2.94ms CPU time)
Ran 5 tests for test/Rescuable.t.sol:RescueTest
[PASS] testEmergencyEtherTransfer() (gas: 57744)
[PASS] testEmergencyEtherTransferWhenNotOwner() (gas: 17666)
[PASS] testEmergencyTokenTransfer() (gas: 231216)
[PASS] testEmergencyTokenTransferWhenNotOwner() (gas: 203504)
[PASS] testToken() (gas: 2392)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 2.51ms (2.14ms CPU time)
Ran 6 tests for test/UpgradeableOwnableWithGuardian.t.sol:TestOfUpgradableOwnableWithGuardian
[PASS] test_initializer() (gas: 18304)
[PASS] test_onlyGuardian() (gas: 11066)
[PASS] test_onlyOwnerOrGuardian() (gas: 13262)
[PASS] test_updateGuardian_eoa(address,address) (runs: 256, μ: 18703, ~: 18703)
[PASS] test_updateGuardian_guardian(address) (runs: 256, μ: 19684, ~: 19684)
[PASS] test_updateGuardian_owner(address) (runs: 256, μ: 19400, ~: 19400)
Suite result: ok. 6 passed; 0 failed; 0 skipped; finished in 55.09ms (54.87ms CPU time)
Ran 3 tests for test/Rescuable721.t.sol:Rescue721Test
[PASS] testFuzzEmergencyTokenTransfer(address) (runs: 256, μ: 79081, ~: 79081)
[PASS] testFuzzEmergencyTokenTransferWhenNotOwner(address,address) (runs: 256, μ: 71859, ~: 71859)
[PASS] testToken() (gas: 2458)
Suite result: ok. 3 passed; 0 failed; 0 skipped; finished in 84.62ms (84.26ms CPU time)
Ran 2 tests for test/create3Test.t.sol:Create3FactoryTest
[PASS] testCreate3WithValue(address,address,address) (runs: 256, μ: 280857, ~: 280857)
[PASS] testCreate3WithoutValue(address,address,bytes32) (runs: 256, μ: 283786, ~: 283786)
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 108.76ms (125.14ms CPU time)
Ran 4 tests for test/TransparentProxyFactory.t.sol:TestTransparentProxyFactory
[PASS] testCreateDeterministic(address,bytes32) (runs: 256, μ: 389679, ~: 389679)
[PASS] testCreateDeterministicProxyAdmin(address,bytes32) (runs: 256, μ: 282377, ~: 282377)
[PASS] testCreateDeterministicWithDeterministicProxy(bytes32,bytes32) (runs: 256, μ: 396253, ~: 396253)
[PASS] testCreateProxyAdmin(address,bytes32) (runs: 256, μ: 276416, ~: 276416)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 160.98ms (248.89ms CPU time)
Ran 9 test suites in 162.58ms (458.97ms CPU time): 38 tests passed, 0 failed, 0 skipped (38 total tests) 🌈 Test Results zksyncCompiling 44 files with Solc 0.8.24
Solc 0.8.24 finished in 1.41s
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: 342958)
[PASS] testCreateDeterministic(bytes32) (runs: 256, μ: 575713, ~: 575713)
[PASS] testCreateDeterministicProxyAdmin(address,bytes32) (runs: 256, μ: 465698, ~: 469976)
[PASS] testCreateDeterministicWithDeterministicProxy(bytes32,bytes32) (runs: 256, μ: 686760, ~: 686760)
[PASS] testCreateProxyAdmin(address,bytes32) (runs: 256, μ: 354000, ~: 358418)
Suite result: ok. 5 passed; 0 failed; 0 skipped; finished in 9.17s (29.23s CPU time)
Ran 1 test suite in 9.18s (9.17s CPU time): 5 tests passed, 0 failed, 0 skipped (5 total tests) |
🔧 Build logsCompiling 87 files with Solc 0.8.28
installing solc version "0.8.28"
Successfully installed solc 0.8.28
Solc 0.8.28 finished in 3.72s
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 | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| ChainHelpers | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| ChainIds | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| Create2Utils | 162 | 212 | 24,414 | 48,940 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| Create3 | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| Create3Factory | 1,094 | 1,122 | 23,482 | 48,030 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| ERC1967Proxy | 163 | 1,014 | 24,413 | 48,138 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| ERC1967Utils | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| ERC20 | 2,331 | 3,020 | 22,245 | 46,132 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| EnumerableSet | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| ImplOwnableWithGuardian | 1,464 | 1,492 | 23,112 | 47,660 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| MockContract | 759 | 1,021 | 23,817 | 48,131 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| MockERC721 | 2,421 | 2,449 | 22,155 | 46,703 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| MockImpl | 465 | 690 | 24,111 | 48,462 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| PermissionlessRescuable | 1,908 | 2,081 | 22,668 | 47,071 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| ProxyAdmin | 1,039 | 1,275 | 23,537 | 47,877 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| Rescuable | 1,807 | 1,958 | 22,769 | 47,194 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| Rescuable721 | 2,043 | 2,201 | 22,533 | 46,951 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| RescuableACL | 1,695 | 1,827 | 22,881 | 47,325 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| SafeCast | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| SafeERC20 | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| StorageSlot | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| TestNetChainIds | 85 | 135 | 24,491 | 49,017 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| TransparentProxyFactory | 6,961 | 6,989 | 17,615 | 42,163 |
|-----------------------------+------------------+-------------------+--------------------+---------------------|
| TransparentUpgradeableProxy | 1,137 | 3,667 | 23,439 | 45,485 |
╰-----------------------------+------------------+-------------------+--------------------+---------------------╯ 🔧 Build logs zksyncCompiling 46 files with zksolc and solc 0.8.24
zksolc and solc 0.8.24 finished in 10.13s
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;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╭-------------------------------+------------------+-------------------+--------------------+---------------------╮
| 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,000 | 4,000 | 446,999 | 446,999 |
|-------------------------------+------------------+-------------------+--------------------+---------------------|
| ERC1967Utils | 224 | 224 | 450,775 | 450,775 |
|-------------------------------+------------------+-------------------+--------------------+---------------------|
| MockImpl | 2,208 | 2,208 | 448,791 | 448,791 |
|-------------------------------+------------------+-------------------+--------------------+---------------------|
| ProxyAdmin | 4,384 | 4,384 | 446,615 | 446,615 |
|-------------------------------+------------------+-------------------+--------------------+---------------------|
| StorageSlot | 224 | 224 | 450,775 | 450,775 |
|-------------------------------+------------------+-------------------+--------------------+---------------------|
| TransparentProxyFactoryZkSync | 10,720 | 10,720 | 440,279 | 440,279 |
|-------------------------------+------------------+-------------------+--------------------+---------------------|
| TransparentUpgradeableProxy | 7,584 | 7,584 | 443,415 | 443,415 |
╰-------------------------------+------------------+-------------------+--------------------+---------------------╯ |
🔮 Coverage report
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.