0xsequence / create3

CREATE3 (see EIP-3171) implemented in Solidity
280 stars 34 forks source link

Optimize gas, fix payable constructors and deny redeploying to the same addresses #3

Closed k06a closed 2 years ago

k06a commented 2 years ago

Implemented in collaboration with @zumzoom

·-------------------------|----------------------------|-------------|-----------------------------·
|   Solc version: 0.8.9   ·  Optimizer enabled: false  ·  Runs: 200  ·  Block limit: 30000000 gas  │
··························|····························|·············|······························
|  Methods                                                                                         │
···············|··········|··············|·············|·············|···············|··············
|  Contract    ·  Method  ·  Min         ·  Max        ·  Avg        ·  # calls      ·  usd (avg)  │
···············|··········|··············|·············|·············|···············|··············
|  Create3Imp  ·  create  ·      100824  ·     554369  ·     327350  ·         2052  ·          -  │
···············|··········|··············|·············|·············|···············|··············
|  Deployments            ·                                          ·  % of limit   ·             │
··························|··············|·············|·············|···············|··············
|  Create3Imp             ·           -  ·          -  ·     571662  ·        1.9 %  ·          -  │
·-------------------------|--------------|-------------|-------------|---------------|-------------·

=>

·-------------------------|----------------------------|-------------|-----------------------------·
|   Solc version: 0.8.9   ·  Optimizer enabled: false  ·  Runs: 200  ·  Block limit: 30000000 gas  │
··························|····························|·············|······························
|  Methods                                                                                         │
···············|··········|·············|··············|·············|···············|··············
|  Contract    ·  Method  ·  Min        ·  Max         ·  Avg        ·  # calls      ·  usd (avg)  │
···············|··········|·············|··············|·············|···············|··············
|  Create3Imp  ·  create  ·      95621  ·      549130  ·     322150  ·         2052  ·          -  │
···············|··········|·············|··············|·············|···············|··············
|  Deployments            ·                                          ·  % of limit   ·             │
··························|·············|··············|·············|···············|··············
|  Create3Imp             ·          -  ·           -  ·     572046  ·        1.9 %  ·          -  │
·-------------------------|-------------|--------------|-------------|---------------|-------------·
Agusx1211 commented 2 years ago

Awesome contribution and good catch! Thanks a lot

k06a commented 2 years ago

I afraid we could have been break redeployabilibity of the CREATE3.