0

I used the "npm run compile" command to compile the protocol-v2 in the aave. I found that bytecode size of LendingPool.sol is 43,892 bytes. It exceeds the 24k of the contract's max limit of evm. But the protocol-v2 can deploy this contract to ethereum by using hardhat-deploy. I want to know the reason.

Ramisha Mukhtar
  • 321
  • 1
  • 12

1 Answers1

0

The Aave LendingPool.sol was compiled with the optimizer configured for 200 runs, see the Settings JSON under the link.

Solidity optimizer removes unused bytecode, optimizes paths, replaces multiple chunks of the same bytecode with links to just one copy of it, ... and one of its effects is reducing the bytecode size.

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100
  • can you computer the size of bytecode of artifcats/contracts/protocol/lendingpool/LendingPool.json? i used the "npm run compile " in the aave/protocolc-v2 project. – 郝丽锋 Apr 19 '22 at 06:19