question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Contract code size exceeds 24576 bytes" during coverage

See original GitHub issue

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).

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
alcuecacommented, 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.

1reaction
dokxo96commented, 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,
      },
    },
  },
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: Contract code size exceeds 24576 bytes
12:1 ; 24576 bytes (a limit introduced in ; not be deployable on ; Consider enabling the optimizer (with a low "runs" value!),...
Read more >
Downsizing contracts to fight the contract size limit
Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on mainnet.
Read more >
"Contract code size exceeds 24576 bytes" ERC721Upgradeable
I ran into the following limit with an ERC721Upgradeable: Warning: Contract code size exceeds 24576 bytes (a limit introduced in Spurious ...
Read more >
Contract code size exceeds 24576 bytes) Pops on Hardhat ...
you need to mention the optimization settings inside the version since hardhat execute. multiple solidity version code.
Read more >
[Solidity] Contract code size over limit | by Sigit H. Yudanto
On November 22, 2016 the Spurious Dragon hard-fork introduced EIP-170 which added a smart contract size limit of 24.576 kb. For you as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found