crytic/echidna

[Bug-Candidate]: Contract Size Exceeded when optimized contract is under 24KB

jptusern opened this issue · 3 comments

Describe the issue:

I have a contract, whose size exceeds 24KB unoptimized, but when it's optimized, it's down to 15KB.
But, I cannot deploy this contract on my echidna test contract, and it reverts with error MaxCodeSizeExceeded 0x6000 0x63f2 error. Is there a workaround for this?

Code example to reproduce the issue:

contract EchidnaTest {
    constructor(){
        ContractA a = new ContractA();
        ContractA b = new ContractB(); // size limit when unoptimized
    }
}

Version:

Echidna 2.2.2

Relevant log output:

echidna: Deploying the contract 0x00a329c0648769A73afAc7F9381E08FB43dBEA72 failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.):
OwnershipTransferred() from: 0xb4c79dab8f259c7aee6e5b2aa729821864227e84
OwnershipTransferred() from: 0x62d69f6867a0a084c6d313943dc22023bc263691
error MaxCodeSizeExceeded 0x6000 0x63f2

Found a PR which I can bypass the size issue with. I don't see this being documented anywhere though.
https://github.com/crytic/echidna/pull/544/files

You are right, this should be documented, thanks for the report. I will fix this soon.