Skip to content

Commit

Permalink
Issue warning if codesize exceeds EIP-170 limits
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Dec 13, 2019
1 parent c084f64 commit 6e5ed11
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions libsolidity/interface/CompilerStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,16 @@ void CompilerStack::compileContract(
solAssert(false, "Assembly exception for deployed bytecode");
}

// Throw an error if EIP-170 limits are exceeded.
if (
m_evmVersion >= langutil::EVMVersion::spuriousDragon() &&
compiledContract.object.bytecode.size() > 0x6000
)
m_errorReporter.warning(
"Contract code size exceeds 24576 bytes (introduced in Spurious Dragon). "
"This contract may not be deployable on mainnet."
);

_otherCompilers[compiledContract.contract] = compiler;
}

Expand Down
Loading

0 comments on commit 6e5ed11

Please sign in to comment.