Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Contract code size exceeds 24576 bytes" during coverage #290

Open
vibern0 opened this issue Apr 2, 2020 · 6 comments
Open

"Contract code size exceeds 24576 bytes" during coverage #290

vibern0 opened this issue Apr 2, 2020 · 6 comments
Labels
question Further information is requested

Comments

@vibern0
Copy link
Member

vibern0 commented Apr 2, 2020

In #288 we've seen a warning during the coverage phase in CI. This is not urgent but deserves a look at.

/home/travis/build/HQ20/contracts/.coverage_contracts/examples/dao/VentureEth.sol:26:1: Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
contract VentureEth is
^ (Relevant source part starts here and spans across multiple lines).
,/home/travis/build/HQ20/contracts/.coverage_contracts/examples/dao/DAO.sol:22:1: Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
contract DAO is VentureEth, Democratic {
^ (Relevant source part starts here and spans across multiple lines).
,/home/travis/build/HQ20/contracts/.coverage_contracts/exchange/UniswapFactory.sol:49:1: Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
contract UniswapFactory is IUniswapFactory {
^ (Relevant source part starts here and spans across multiple lines).
,/home/travis/build/HQ20/contracts/.coverage_contracts/test/exchange/TestUniswapExchange.sol:5:1: Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
contract TestUniswapExchange is UniswapExchange {
^ (Relevant source part starts here and spans across multiple lines).
,/home/travis/build/HQ20/contracts/.coverage_contracts/test/exchange/TestUniswapFactory.sol:6:1: Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
contract TestUniswapFactory is UniswapFactory {
^ (Relevant source part starts here and spans across multiple lines).
@vibern0 vibern0 added the question Further information is requested label Apr 2, 2020
@alcueca
Copy link
Contributor

alcueca commented Apr 2, 2020

Background for this. I can't believe they thought that choosing a hard coded limit was a good idea.

ethereum/EIPs#170

On the bright side, this is a good opportunity to explore some techniques to make contracts lighter.

@alcueca
Copy link
Contributor

alcueca commented Apr 2, 2020

Reading this thread makes me sad. Mostly because the amount of people impacted by this and how little concern is there for them.

Not to mention that the workarounds being proposed sound complex as hell.

@PeterYang03110
Copy link

please help me.

@dokxo96
Copy link

dokxo96 commented Nov 3, 2021

please help me.

hi LuckyStar0831 ,i modified the hardhat.config or the truffle instead. and i added this.hopw its works for u!

module.exports = {
  solidity: {
    version: "0.8.3",
    settings: {
      optimizer: {
        enabled: true,
        runs: 1000,
      },
    },
  },
};

@PeterYang03110
Copy link

PeterYang03110 commented Nov 25, 2021

image

image

please help me.

@PeterYang03110
Copy link

please help me.

hi LuckyStar0831 ,i modified the hardhat.config or the truffle instead. and i added this.hopw its works for u!

module.exports = {
  solidity: {
    version: "0.8.3",
    settings: {
      optimizer: {
        enabled: true,
        runs: 1000,
      },
    },
  },
};

Thank you for your interest.
But it's not working on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants