mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adds support for the EVM version "Paris".
Deprecates `block.difficulty` and disallow `difficulty()` in inline assembly for EVM versions >= paris. The change is due to the renaming introduced by EIP-4399 (see: https://eips.ethereum.org/EIPS/eip-4399). Introduces `block.prevrandao` in Solidity and `prevrandao()` in inline assembly for EVM versions >= paris. Co-authored-by: Alex Beregszaszi <alex@rtfs.hu> Co-authored-by: Daniel <daniel@ekpyron.org> Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com> Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
This commit is contained in:
co-authored by
Alex Beregszaszi
Daniel
matheusaaguiar
Nikola Matić
parent
d70d79af4a
commit
ef6ff2f055
@@ -381,6 +381,7 @@ Json::Value formatImmutableReferences(map<u256, pair<string, vector<size_t>>> co
|
||||
}
|
||||
|
||||
Json::Value collectEVMObject(
|
||||
langutil::EVMVersion _evmVersion,
|
||||
evmasm::LinkerObject const& _object,
|
||||
string const* _sourceMap,
|
||||
Json::Value _generatedSources,
|
||||
@@ -392,7 +393,7 @@ Json::Value collectEVMObject(
|
||||
if (_artifactRequested("object"))
|
||||
output["object"] = _object.toHex();
|
||||
if (_artifactRequested("opcodes"))
|
||||
output["opcodes"] = evmasm::disassemble(_object.bytecode);
|
||||
output["opcodes"] = evmasm::disassemble(_object.bytecode, _evmVersion);
|
||||
if (_artifactRequested("sourceMap"))
|
||||
output["sourceMap"] = _sourceMap ? *_sourceMap : "";
|
||||
if (_artifactRequested("functionDebugData"))
|
||||
@@ -1328,6 +1329,7 @@ Json::Value StandardCompiler::compileSolidity(StandardCompiler::InputsAndSetting
|
||||
wildcardMatchesExperimental
|
||||
))
|
||||
evmData["bytecode"] = collectEVMObject(
|
||||
_inputsAndSettings.evmVersion,
|
||||
compilerStack.object(contractName),
|
||||
compilerStack.sourceMapping(contractName),
|
||||
compilerStack.generatedSources(contractName),
|
||||
@@ -1349,6 +1351,7 @@ Json::Value StandardCompiler::compileSolidity(StandardCompiler::InputsAndSetting
|
||||
wildcardMatchesExperimental
|
||||
))
|
||||
evmData["deployedBytecode"] = collectEVMObject(
|
||||
_inputsAndSettings.evmVersion,
|
||||
compilerStack.runtimeObject(contractName),
|
||||
compilerStack.runtimeSourceMapping(contractName),
|
||||
compilerStack.generatedSources(contractName, true),
|
||||
@@ -1491,6 +1494,7 @@ Json::Value StandardCompiler::compileYul(InputsAndSettings _inputsAndSettings)
|
||||
if (o.bytecode)
|
||||
output["contracts"][sourceName][contractName]["evm"][kind] =
|
||||
collectEVMObject(
|
||||
_inputsAndSettings.evmVersion,
|
||||
*o.bytecode,
|
||||
o.sourceMappings.get(),
|
||||
Json::arrayValue,
|
||||
|
||||
Reference in New Issue
Block a user