The bytecode size of LendingPool.sol is over 24k

324 Views Asked by At

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.

1

There are 1 best solutions below

1
On

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.