Skip to content

feat: downsize contracts#101

Open
matheus1lva wants to merge 14 commits into
mainfrom
feat/downsize-contract
Open

feat: downsize contracts#101
matheus1lva wants to merge 14 commits into
mainfrom
feat/downsize-contract

Conversation

@matheus1lva
Copy link
Copy Markdown

  1. simplify contract to downsize
 ·---------------------------------------|--------------------------------|--------------------------------·
 |  Solc version: 0.8.16                 ·  Optimizer enabled: true       ·  Runs: 200                     │
 ········································|································|·································
 |  Contract Name                        ·  Deployed size (KiB) (change)  ·  Initcode size (KiB) (change)  │
 ········································|································|·································
 |  Address                              ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  BucketAuction                        ·                19.020 (0.000)  ·                20.373 (0.000)  │
 ········································|································|·································
 |  BucketAuctionOperatorFilterer        ·                20.019 (0.000)  ·                21.734 (0.000)  │
 ········································|································|·································
 |  BytesLib                             ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  DutchAuction                         ·                16.440 (0.000)  ·                17.700 (0.000)  │
 ········································|································|·································
 |  ECDSA                                ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  EnumerableSet                        ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  ERC20                                ·                 2.121 (0.000)  ·                 2.859 (0.000)  │
 ········································|································|·································
 |  ERC721                               ·                 4.261 (0.000)  ·                 4.999 (0.000)  │
 ········································|································|·································
 |  ERC721A                              ·                 3.334 (0.000)  ·                 4.076 (0.000)  │
 ········································|································|·································
 |  ERC721M                              ·                14.456 (0.000)  ·                15.698 (0.000)  │
 ········································|································|·································
 |  ERC721MAutoApprover                  ·                14.694 (0.000)  ·                15.994 (0.000)  │
 ········································|································|·································
 |  ERC721MIncreasableOperatorFilterer   ·                15.747 (0.000)  ·                17.387 (0.000)  │
 ········································|································|·································
 |  ERC721MIncreasableSupply             ·                14.748 (0.000)  ·                16.027 (0.000)  │
 ········································|································|·································
 |  ERC721MLite                          ·                13.948 (0.000)  ·                15.419 (0.000)  │
 ········································|································|·································
 |  ERC721MOnft                          ·                23.708 (0.000)  ·                25.406 (0.000)  │
 ········································|································|·································
 |  ERC721MOperatorFilterer              ·                15.455 (0.000)  ·                17.039 (0.000)  │
 ········································|································|·································
 |  ERC721MOperatorFiltererAutoApprover  ·                15.712 (0.000)  ·                17.363 (0.000)  │
 ········································|································|·································
 |  ERC721MPausable                      ·                14.949 (0.000)  ·                16.218 (0.000)  │
 ········································|································|·································
 |  ERC721MPausableOperatorFilterer      ·                15.948 (0.000)  ·                17.577 (0.000)  │
 ········································|································|·································
 |  ExcessivelySafeCall                  ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  MerkleProof                          ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  MockERC20                            ·                 2.384 (0.000)  ·                 2.934 (0.000)  │
 ········································|································|·································
 |  MockLayerZeroEndpoint                ·                 2.150 (0.000)  ·                 2.182 (0.000)  │
 ········································|································|·································
 |  ONFT721Lite                          ·                15.771 (0.000)  ·                16.822 (0.000)  │
 ········································|································|·································
 |  SafeERC20                            ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  SignatureChecker                     ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  Strings                              ·                 0.084 (0.000)  ·                 0.138 (0.000)  │
 ········································|································|·································
 |  TestReentrantExploit                 ·                 1.077 (0.000)  ·                 1.221 (0.000)  │
 ········································|································|·································
 |  TestStaking                          ·                 1.377 (0.000)  ·                 1.521 (0.000)  │
 ·---------------------------------------|--------------------------------|--------------------------------·
  1. Simplify removing updateStages where setStages has basically the same functionality.
  2. Move some setters directly to constructor since some are rarely updated after deployment, saving some bytes
  3. remove intermediary variable definitions
  4. simplify withdraw and withdrawERC20 into single one
  5. remove some more unused methods

There are some tests failing in regards to cosign, which needs a bit of work because i was not able to find the root cause.

Comment thread contracts/BucketAuction.sol
Comment thread contracts/ERC721M.sol Outdated
Comment thread contracts/ERC721M.sol
Comment thread contracts/ERC721M.sol Outdated
Comment thread contracts/ERC721MOperatorFilterer.sol Outdated
@channing-magiceden
Copy link
Copy Markdown
Contributor

Since you changed most contracts' constructor, you should also update scritps/deployXXX.ts and update hardhat.config.ts to require extra params

# Conflicts:
#	contracts/BucketAuctionOperatorFilterer.sol
#	contracts/ERC721MIncreasableOperatorFilterer.sol
#	contracts/ERC721MOnft.sol
#	contracts/ERC721MPausable.sol
#	contracts/ERC721MPausableOperatorFilterer.sol
Comment thread contracts/BucketAuction.sol Outdated
Comment thread contracts/BucketAuction.sol Outdated
Comment thread contracts/DutchAuction.sol Outdated
@matheus1lva
Copy link
Copy Markdown
Author

Since you changed most contracts' constructor, you should also update scritps/deployXXX.ts and update hardhat.config.ts to require extra params

updating now.

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.

2 participants