mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12177 from DavidRomanovizc/patch-4
Include actual contract size in the code size warning
This commit is contained in:
commit
558d9d4556
@ -83,6 +83,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace solidity;
|
using namespace solidity;
|
||||||
@ -1248,7 +1249,9 @@ void CompilerStack::assemble(
|
|||||||
m_errorReporter.warning(
|
m_errorReporter.warning(
|
||||||
5574_error,
|
5574_error,
|
||||||
_contract.location(),
|
_contract.location(),
|
||||||
"Contract code size exceeds 24576 bytes (a limit introduced in Spurious Dragon). "
|
"Contract code size is "s +
|
||||||
|
to_string(compiledContract.runtimeObject.bytecode.size()) +
|
||||||
|
" bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). "
|
||||||
"This contract may not be deployable on mainnet. "
|
"This contract may not be deployable on mainnet. "
|
||||||
"Consider enabling the optimizer (with a low \"runs\" value!), "
|
"Consider enabling the optimizer (with a low \"runs\" value!), "
|
||||||
"turning off revert strings, or using libraries."
|
"turning off revert strings, or using libraries."
|
||||||
|
@ -77,6 +77,8 @@ void SyntaxTest::setupCompiler()
|
|||||||
OptimiserSettings::full() :
|
OptimiserSettings::full() :
|
||||||
OptimiserSettings::minimal()
|
OptimiserSettings::minimal()
|
||||||
);
|
);
|
||||||
|
compiler().setMetadataFormat(CompilerStack::MetadataFormat::NoMetadata);
|
||||||
|
compiler().setMetadataHash(CompilerStack::MetadataHash::None);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SyntaxTest::parseAndAnalyze()
|
void SyntaxTest::parseAndAnalyze()
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
pragma abicoder v2;
|
||||||
|
|
||||||
contract test {
|
contract test {
|
||||||
function f() public pure returns (string memory ret) {
|
function f() public pure returns (string memory ret) {
|
||||||
// 27000 bytes long data
|
// 27000 bytes long data
|
||||||
@ -5,6 +7,6 @@ contract test {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ====
|
// ====
|
||||||
// EVMVersion: >=spuriousDragon
|
// EVMVersion: >byzantium
|
||||||
// ----
|
// ----
|
||||||
// Warning 5574: (0-27133): 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.
|
// Warning 5574: (21-27154): Contract code size is 27199 bytes and 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.
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user