diff --git a/.editorconfig b/.editorconfig index 829878823..0f19ed338 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,6 +18,6 @@ indent_size = 4 indent_style = space indent_size = 4 -[*.{txt,cmake}] +[*.{txt,cmake,json}] indent_style = tab indent_size = 4 diff --git a/Changelog.md b/Changelog.md index 9742dcd65..c9bcced6b 100644 --- a/Changelog.md +++ b/Changelog.md @@ -34,6 +34,7 @@ Compiler Features: * SMTChecker: Support ``selector`` for expressions with value known at compile-time. * Command Line Interface: New option ``--model-checker-timeout`` sets a timeout in milliseconds for each individual query performed by the SMTChecker. * Standard JSON: New option ``modelCheckerSettings.timeout`` sets a timeout in milliseconds for each individual query performed by the SMTChecker. + * Assembler: Perform linking in assembly mode when library addresses are provided. Bugfixes: @@ -45,6 +46,7 @@ Bugfixes: * SMTChecker: Fix false negative in modifier applied multiple times. * SMTChecker: Fix internal error in the BMC engine when inherited contract from a different source unit has private state variables. * SMTChecker: Fix internal error when ``array.push()`` is used as the LHS of an assignment. + * SMTChecker: Fix CHC false positives when branches are used inside modifiers. * Code generator: Fix missing creation dependency tracking for abstract contracts. diff --git a/libsolidity/formal/CHC.cpp b/libsolidity/formal/CHC.cpp index 545ec9ee6..6fc432d06 100644 --- a/libsolidity/formal/CHC.cpp +++ b/libsolidity/formal/CHC.cpp @@ -746,7 +746,7 @@ void CHC::clearIndices(ContractDefinition const* _contract, FunctionDefinition c { for (auto const& var: _function->parameters() + _function->returnParameters()) m_context.variable(*var)->increaseIndex(); - for (auto const& var: _function->localVariables()) + for (auto const& var: localVariablesIncludingModifiers(*_function)) m_context.variable(*var)->increaseIndex(); } @@ -821,7 +821,7 @@ void CHC::defineInterfacesAndSummaries(SourceUnit const& _source) createVariable(*var); for (auto var: function->returnParameters()) createVariable(*var); - for (auto const* var: function->localVariables()) + for (auto const* var: localVariablesIncludingModifiers(*function)) createVariable(*var); m_summaries[contract].emplace(function, createSummaryBlock(*function, *contract)); diff --git a/libsolidity/formal/PredicateInstance.cpp b/libsolidity/formal/PredicateInstance.cpp index 29a6e75d8..3c38d4d60 100644 --- a/libsolidity/formal/PredicateInstance.cpp +++ b/libsolidity/formal/PredicateInstance.cpp @@ -132,7 +132,7 @@ vector currentBlockVariables(FunctionDefinition const& _fun { return currentFunctionVariables(_function, _contract, _context) + applyMap( - _function.localVariables(), + SMTEncoder::localVariablesIncludingModifiers(_function), [&](auto _var) { return _context.variable(*_var)->currentValue(); } ); } diff --git a/libsolidity/formal/PredicateSort.cpp b/libsolidity/formal/PredicateSort.cpp index ac730d7a5..18fcbdfc3 100644 --- a/libsolidity/formal/PredicateSort.cpp +++ b/libsolidity/formal/PredicateSort.cpp @@ -90,7 +90,7 @@ SortPointer functionBodySort(FunctionDefinition const& _function, ContractDefini auto smtSort = [](auto _var) { return smt::smtSortAbstractFunction(*_var->type()); }; return make_shared( - fSort->domain + applyMap(_function.localVariables(), smtSort), + fSort->domain + applyMap(SMTEncoder::localVariablesIncludingModifiers(_function), smtSort), SortProvider::boolSort ); } diff --git a/libsolidity/formal/SMTEncoder.cpp b/libsolidity/formal/SMTEncoder.cpp index 924acb87e..76de76907 100644 --- a/libsolidity/formal/SMTEncoder.cpp +++ b/libsolidity/formal/SMTEncoder.cpp @@ -1986,7 +1986,12 @@ void SMTEncoder::initializeFunctionCallParameters(CallableDeclaration const& _fu m_arrayAssignmentHappened = true; } - for (auto const& variable: _function.localVariables()) + vector localVars; + if (auto const* fun = dynamic_cast(&_function)) + localVars = localVariablesIncludingModifiers(*fun); + else + localVars = _function.localVariables(); + for (auto const& variable: localVars) if (createVariable(*variable)) { m_context.newValue(*variable); @@ -2026,7 +2031,7 @@ void SMTEncoder::initializeStateVariables(ContractDefinition const& _contract) void SMTEncoder::createLocalVariables(FunctionDefinition const& _function) { - for (auto const& variable: _function.localVariables()) + for (auto const& variable: localVariablesIncludingModifiers(_function)) createVariable(*variable); for (auto const& param: _function.parameters()) @@ -2039,7 +2044,7 @@ void SMTEncoder::createLocalVariables(FunctionDefinition const& _function) void SMTEncoder::initializeLocalVariables(FunctionDefinition const& _function) { - for (auto const& variable: _function.localVariables()) + for (auto const& variable: localVariablesIncludingModifiers(_function)) { solAssert(m_context.knownVariable(*variable), ""); m_context.setZeroValue(*variable); @@ -2294,7 +2299,7 @@ void SMTEncoder::clearIndices(ContractDefinition const* _contract, FunctionDefin { for (auto const& var: _function->parameters() + _function->returnParameters()) m_context.variable(*var)->resetIndex(); - for (auto const& var: _function->localVariables()) + for (auto const& var: localVariablesIncludingModifiers(*_function)) m_context.variable(*var)->resetIndex(); } m_context.state().reset(); @@ -2429,6 +2434,38 @@ vector SMTEncoder::stateVariablesIncludingInheritedA return stateVariablesIncludingInheritedAndPrivate(dynamic_cast(*_function.scope())); } +vector SMTEncoder::localVariablesIncludingModifiers(FunctionDefinition const& _function) +{ + return _function.localVariables() + modifiersVariables(_function); +} + +vector SMTEncoder::modifiersVariables(FunctionDefinition const& _function) +{ + struct BlockVars: ASTConstVisitor + { + BlockVars(Block const& _block) { _block.accept(*this); } + void endVisit(VariableDeclaration const& _var) { vars.push_back(&_var); } + vector vars; + }; + + vector vars; + set visited; + for (auto invok: _function.modifiers()) + { + if (!invok) + continue; + auto decl = invok->name().annotation().referencedDeclaration; + auto const* modifier = dynamic_cast(decl); + if (!modifier || visited.count(modifier)) + continue; + + visited.insert(modifier); + vars += applyMap(modifier->parameters(), [](auto _var) { return _var.get(); }); + vars += BlockVars(modifier->body()).vars; + } + return vars; +} + SourceUnit const* SMTEncoder::sourceUnitContaining(Scopable const& _scopable) { for (auto const* s = &_scopable; s; s = dynamic_cast(s->scope())) diff --git a/libsolidity/formal/SMTEncoder.h b/libsolidity/formal/SMTEncoder.h index 366cfc0b2..49cac0082 100644 --- a/libsolidity/formal/SMTEncoder.h +++ b/libsolidity/formal/SMTEncoder.h @@ -71,6 +71,9 @@ public: static std::vector stateVariablesIncludingInheritedAndPrivate(ContractDefinition const& _contract); static std::vector stateVariablesIncludingInheritedAndPrivate(FunctionDefinition const& _function); + static std::vector localVariablesIncludingModifiers(FunctionDefinition const& _function); + static std::vector modifiersVariables(FunctionDefinition const& _function); + /// @returns the SourceUnit that contains _scopable. static SourceUnit const* sourceUnitContaining(Scopable const& _scopable); diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 3b4ef56c5..fa51a5761 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -1180,8 +1180,6 @@ Json::Value StandardCompiler::compileYul(InputsAndSettings _inputsAndSettings) return formatFatalError("JSONError", "Yul mode does not support smtlib2responses."); if (!_inputsAndSettings.remappings.empty()) return formatFatalError("JSONError", "Field \"settings.remappings\" cannot be used for Yul."); - if (!_inputsAndSettings.libraries.empty()) - return formatFatalError("JSONError", "Field \"settings.libraries\" cannot be used for Yul."); if (_inputsAndSettings.revertStrings != RevertStrings::Default) return formatFatalError("JSONError", "Field \"settings.debug.revertStrings\" cannot be used for Yul."); @@ -1234,6 +1232,11 @@ Json::Value StandardCompiler::compileYul(InputsAndSettings _inputsAndSettings) MachineAssemblyObject runtimeObject; tie(object, runtimeObject) = stack.assembleAndGuessRuntime(); + if (object.bytecode) + object.bytecode->link(_inputsAndSettings.libraries); + if (runtimeObject.bytecode) + runtimeObject.bytecode->link(_inputsAndSettings.libraries); + for (string const& objectKind: vector{"bytecode", "deployedBytecode"}) if (isArtifactRequested( _inputsAndSettings.outputSelection, diff --git a/libyul/backends/wasm/BinaryTransform.cpp b/libyul/backends/wasm/BinaryTransform.cpp index 6c19b19f5..17a9d0334 100644 --- a/libyul/backends/wasm/BinaryTransform.cpp +++ b/libyul/backends/wasm/BinaryTransform.cpp @@ -305,13 +305,23 @@ bytes BinaryTransform::run(Module const& _module) ret += exportSection(functionIDs); map> subModulePosAndSize; - for (auto const& sub: _module.subModules) + for (auto const& [name, module]: _module.subModules) { // TODO should we prefix and / or shorten the name? - bytes data = BinaryTransform::run(sub.second); - size_t length = data.size(); - ret += customSection(sub.first, move(data)); - subModulePosAndSize[sub.first] = {ret.size() - length, length}; + bytes data = BinaryTransform::run(module); + size_t const length = data.size(); + ret += customSection(name, move(data)); + // Skip all the previous sections and the size field of this current custom section. + size_t const offset = ret.size() - length; + subModulePosAndSize[name] = {offset, length}; + } + for (auto const& [name, data]: _module.customSections) + { + size_t const length = data.size(); + ret += customSection(name, data); + // Skip all the previous sections and the size field of this current custom section. + size_t const offset = ret.size() - length; + subModulePosAndSize[name] = {offset, length}; } BinaryTransform bt( @@ -663,9 +673,11 @@ bytes BinaryTransform::globalSection(vector con bytes BinaryTransform::exportSection(map const& _functionIDs) { - bytes result = lebEncode(2); + bool hasMain = _functionIDs.count("main"); + bytes result = lebEncode(hasMain ? 2 : 1); result += encodeName("memory") + toBytes(Export::Memory) + lebEncode(0); - result += encodeName("main") + toBytes(Export::Function) + lebEncode(_functionIDs.at("main")); + if (hasMain) + result += encodeName("main") + toBytes(Export::Function) + lebEncode(_functionIDs.at("main")); return makeSection(Section::EXPORT, move(result)); } diff --git a/libyul/backends/wasm/BinaryTransform.h b/libyul/backends/wasm/BinaryTransform.h index 348250546..d164c11bf 100644 --- a/libyul/backends/wasm/BinaryTransform.h +++ b/libyul/backends/wasm/BinaryTransform.h @@ -112,6 +112,8 @@ private: std::map const m_globalIDs; std::map const m_functionIDs; std::map const m_functionTypes; + /// The map of submodules, where the pair refers to the [offset, length]. The offset is + /// an absolute offset within the resulting assembled bytecode. std::map> const m_subModulePosAndSize; std::map m_locals; diff --git a/libyul/backends/wasm/TextTransform.cpp b/libyul/backends/wasm/TextTransform.cpp index 059f89600..05514cd7c 100644 --- a/libyul/backends/wasm/TextTransform.cpp +++ b/libyul/backends/wasm/TextTransform.cpp @@ -44,6 +44,11 @@ string TextTransform::run(wasm::Module const& _module) " ;; sub-module \"" + sub.first + "\" will be encoded as custom section in binary here, but is skipped in text mode.\n"; + for (auto const& data: _module.customSections) + ret += + " ;; custom-section \"" + + data.first + + "\" will be encoded as custom section in binary here, but is skipped in text mode.\n"; for (wasm::FunctionImport const& imp: _module.imports) { ret += " (import \"" + imp.module + "\" \"" + imp.externalName + "\" (func $" + imp.internalName; @@ -56,8 +61,13 @@ string TextTransform::run(wasm::Module const& _module) // allocate one 64k page of memory and make it available to the Ethereum client ret += " (memory $memory (export \"memory\") 1)\n"; - // export the main function - ret += " (export \"main\" (func $main))\n"; + for (auto const& f: _module.functions) + if (f.name == "main") + { + // export the main function + ret += " (export \"main\" (func $main))\n"; + break; + } for (auto const& g: _module.globals) ret += " (global $" + g.variableName + " (mut " + encodeType(g.type) + ") (" + encodeType(g.type) + ".const 0))\n"; diff --git a/libyul/backends/wasm/WasmAST.h b/libyul/backends/wasm/WasmAST.h index ced3b7bc6..9abdd14d8 100644 --- a/libyul/backends/wasm/WasmAST.h +++ b/libyul/backends/wasm/WasmAST.h @@ -21,6 +21,8 @@ #pragma once +#include + #include #include #include @@ -108,6 +110,7 @@ struct Module std::vector imports; std::vector functions; std::map subModules; + std::map customSections; }; } diff --git a/libyul/backends/wasm/WasmObjectCompiler.cpp b/libyul/backends/wasm/WasmObjectCompiler.cpp index 2b4f0c355..bdd109d31 100644 --- a/libyul/backends/wasm/WasmObjectCompiler.cpp +++ b/libyul/backends/wasm/WasmObjectCompiler.cpp @@ -51,8 +51,10 @@ wasm::Module WasmObjectCompiler::run(Object& _object) for (auto& subNode: _object.subObjects) if (Object* subObject = dynamic_cast(subNode.get())) module.subModules[subObject->name.str()] = run(*subObject); + else if (Data* subObject = dynamic_cast(subNode.get())) + module.customSections[subObject->name.str()] = subObject->data; else - yulAssert(false, "Data is not yet supported for Wasm."); + yulAssert(false, ""); return module; } diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 1d8e24b7e..ff5b660c9 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -1883,8 +1883,29 @@ bool CommandLineInterface::assemble( if (_language != yul::AssemblyStack::Language::Ewasm && _targetMachine == yul::AssemblyStack::Machine::Ewasm) { - stack.translate(yul::AssemblyStack::Language::Ewasm); - stack.optimize(); + try + { + stack.translate(yul::AssemblyStack::Language::Ewasm); + stack.optimize(); + } + catch (Exception const& _exception) + { + serr() << "Exception in assembler: " << boost::diagnostic_information(_exception) << endl; + return false; + } + catch (std::exception const& _e) + { + serr() << + "Unknown exception during compilation" << + (_e.what() ? ": " + string(_e.what()) : ".") << + endl; + return false; + } + catch (...) + { + serr() << "Unknown exception in assembler." << endl; + return false; + } sout() << endl << "==========================" << endl; sout() << endl << "Translated source:" << endl; @@ -1895,6 +1916,7 @@ bool CommandLineInterface::assemble( try { object = stack.assemble(_targetMachine); + object.bytecode->link(m_libraries); } catch (Exception const& _exception) { diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index 491a51261..57a080764 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -112,20 +112,34 @@ function test_solc_behaviour() sed -i.bak -e 's/{[^{]*Warning: This is a pre-release compiler version[^}]*},\{0,1\}//' "$stdout_path" sed -i.bak -E -e 's/ Consider adding \\"pragma solidity \^[0-9.]*;\\"//g' "$stdout_path" sed -i.bak -e 's/"errors":\[\],\{0,1\}//' "$stdout_path" - # Remove explicit bytecode and references to bytecode offsets - sed -i.bak -E -e 's/\"object\":\"[a-f0-9]+\"/\"object\":\"bytecode removed\"/g' "$stdout_path" - sed -i.bak -E -e 's/\"opcodes\":\"[^"]+\"/\"opcodes\":\"opcodes removed\"/g' "$stdout_path" - sed -i.bak -E -e 's/\"sourceMap\":\"[0-9:;-]+\"/\"sourceMap\":\"sourceMap removed\"/g' "$stdout_path" + sed -i.bak -E -e 's/\"opcodes\":\"[^"]+\"/\"opcodes\":\"\"/g' "$stdout_path" + sed -i.bak -E -e 's/\"sourceMap\":\"[0-9:;-]+\"/\"sourceMap\":\"\"/g' "$stdout_path" + + # Remove bytecode (but not linker references). + sed -i.bak -E -e 's/(\"object\":\")[0-9a-f]+([^"]*\")/\1\2/g' "$stdout_path" + sed -i.bak -E -e 's/(\"object\":\"[^"]+\$__)[0-9a-f]+(\")/\1\2/g' "$stdout_path" + sed -i.bak -E -e 's/(__\$[0-9a-f]{34}\$__)[0-9a-f]+(__\$[0-9a-f]{34}\$__)/\1\2/g' "$stdout_path" + # Replace escaped newlines by actual newlines for readability sed -i.bak -E -e 's/\\n/\'$'\n/g' "$stdout_path" rm "$stdout_path.bak" else sed -i.bak -e '/^Warning: This is a pre-release compiler version, please do not use it in production./d' "$stderr_path" sed -i.bak -e '/^Warning (3805): This is a pre-release compiler version, please do not use it in production./d' "$stderr_path" - sed -i.bak -e 's/\(^[ ]*auxdata: \)0x[0-9a-f]*$/\1AUXDATA REMOVED/' "$stdout_path" + sed -i.bak -e 's/\(^[ ]*auxdata: \)0x[0-9a-f]*$/\1/' "$stdout_path" sed -i.bak -e 's/ Consider adding "pragma .*$//' "$stderr_path" - sed -i.bak -e 's/\(Unimplemented feature error: .* in \).*$/\1FILENAME REMOVED/' "$stderr_path" - sed -i.bak -e 's/"version": "[^"]*"/"version": "VERSION REMOVED"/' "$stdout_path" + sed -i.bak -e 's/\(Unimplemented feature error: .* in \).*$/\1/' "$stderr_path" + sed -i.bak -e 's/"version": "[^"]*"/"version": ""/' "$stdout_path" + + # Remove bytecode (but not linker references). Since non-JSON output is unstructured, + # use metadata markers for detection to have some confidence that it's actually bytecode + # and not some random word. + # 64697066735822 = hex encoding of 0x64 'i' 'p' 'f' 's' 0x58 0x22 + # 64736f6c63 = hex encoding of 0x64 's' 'o' 'l' 'c' + sed -i.bak -E -e 's/[0-9a-f]*64697066735822[0-9a-f]+64736f6c63[0-9a-f]+//g' "$stdout_path" + sed -i.bak -E -e 's/(__\$[0-9a-f]{34}\$__)[0-9a-f]+(__\$[0-9a-f]{34}\$__)/\1\2/g' "$stdout_path" + sed -i.bak -E -e 's/[0-9a-f]+((__\$[0-9a-f]{34}\$__)*)/\1/g' "$stdout_path" + # Remove trailing empty lines. Needs a line break to make OSX sed happy. sed -i.bak -e '1{/^$/d }' "$stderr_path" diff --git a/test/cmdlineTests/combined_json_generated_sources/output b/test/cmdlineTests/combined_json_generated_sources/output index d93c81871..dfe910c12 100644 --- a/test/cmdlineTests/combined_json_generated_sources/output +++ b/test/cmdlineTests/combined_json_generated_sources/output @@ -731,5 +731,5 @@ ] } }, - "version": "VERSION REMOVED" + "version": "" } diff --git a/test/cmdlineTests/dup_opt_peephole/output b/test/cmdlineTests/dup_opt_peephole/output index 020260c2b..fec862428 100644 --- a/test/cmdlineTests/dup_opt_peephole/output +++ b/test/cmdlineTests/dup_opt_peephole/output @@ -50,5 +50,5 @@ sub_0: assembly { /* "dup_opt_peephole/input.sol":0:111 contract C {... */ stop - auxdata: AUXDATA REMOVED + auxdata: } diff --git a/test/cmdlineTests/linking_solidity/args b/test/cmdlineTests/linking_solidity/args new file mode 100644 index 000000000..0b04ebd47 --- /dev/null +++ b/test/cmdlineTests/linking_solidity/args @@ -0,0 +1 @@ +--bin --bin-runtime --libraries linking_solidity/input.sol:L:0x1234567890123456789012345678901234567890 diff --git a/test/cmdlineTests/linking_solidity/input.sol b/test/cmdlineTests/linking_solidity/input.sol new file mode 100644 index 000000000..eb06631bb --- /dev/null +++ b/test/cmdlineTests/linking_solidity/input.sol @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +library L { + function f() external {} +} + +contract C { + function foo() public { + L.f(); + } +} diff --git a/test/cmdlineTests/linking_solidity/output b/test/cmdlineTests/linking_solidity/output new file mode 100644 index 000000000..307b131b5 --- /dev/null +++ b/test/cmdlineTests/linking_solidity/output @@ -0,0 +1,12 @@ + +======= linking_solidity/input.sol:C ======= +Binary: + +Binary of the runtime part: + + +======= linking_solidity/input.sol:L ======= +Binary: + +Binary of the runtime part: + diff --git a/test/cmdlineTests/linking_solidity_unresolved_references/args b/test/cmdlineTests/linking_solidity_unresolved_references/args new file mode 100644 index 000000000..a08ce1cb4 --- /dev/null +++ b/test/cmdlineTests/linking_solidity_unresolved_references/args @@ -0,0 +1 @@ +--bin --bin-runtime --libraries linking_solidity_unresolved_references/input.sol:L1:0x1234567890123456789012345678901234567890 diff --git a/test/cmdlineTests/linking_solidity_unresolved_references/input.sol b/test/cmdlineTests/linking_solidity_unresolved_references/input.sol new file mode 100644 index 000000000..2a5f67305 --- /dev/null +++ b/test/cmdlineTests/linking_solidity_unresolved_references/input.sol @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +library L1 { + function f() external {} +} + +library L2 { + function f() external {} +} + +contract C { + function foo() public { + L1.f(); + L2.f(); + L1.f(); + L2.f(); + L1.f(); + } +} diff --git a/test/cmdlineTests/linking_solidity_unresolved_references/output b/test/cmdlineTests/linking_solidity_unresolved_references/output new file mode 100644 index 000000000..f42191f51 --- /dev/null +++ b/test/cmdlineTests/linking_solidity_unresolved_references/output @@ -0,0 +1,24 @@ + +======= linking_solidity_unresolved_references/input.sol:C ======= +Binary: +__$8ef13d1c56d5343bf69cf9444272079aa5$____$8ef13d1c56d5343bf69cf9444272079aa5$__ + +// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2 +// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2 +Binary of the runtime part: +__$8ef13d1c56d5343bf69cf9444272079aa5$____$8ef13d1c56d5343bf69cf9444272079aa5$__ + +// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2 +// $8ef13d1c56d5343bf69cf9444272079aa5$ -> linking_solidity_unresolved_references/input.sol:L2 + +======= linking_solidity_unresolved_references/input.sol:L1 ======= +Binary: + +Binary of the runtime part: + + +======= linking_solidity_unresolved_references/input.sol:L2 ======= +Binary: + +Binary of the runtime part: + diff --git a/test/cmdlineTests/linking_standard_solidity/input.json b/test/cmdlineTests/linking_standard_solidity/input.json new file mode 100644 index 000000000..b70481304 --- /dev/null +++ b/test/cmdlineTests/linking_standard_solidity/input.json @@ -0,0 +1,33 @@ +{ + "language": "Solidity", + "sources": { + "A": { + "content": " + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.0; + + library L { + function f() external {} + } + + contract C { + function foo() public { + L.f(); + } + } + " + } + }, + "settings": { + "libraries": { + "contract/test.sol": { + "L": "0x1234567890123456789012345678901234567890" + } + }, + "outputSelection": { + "*": { + "C": ["evm.bytecode.object", "evm.bytecode.linkReferences"] + } + } + } +} diff --git a/test/cmdlineTests/linking_standard_solidity/output.json b/test/cmdlineTests/linking_standard_solidity/output.json new file mode 100644 index 000000000..1cfa37405 --- /dev/null +++ b/test/cmdlineTests/linking_standard_solidity/output.json @@ -0,0 +1 @@ +{"contracts":{"A":{"C":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"sources":{"A":{"id":0}}} diff --git a/test/cmdlineTests/linking_standard_solidity_quote_in_file_name/input.json b/test/cmdlineTests/linking_standard_solidity_quote_in_file_name/input.json new file mode 100644 index 000000000..fc54cdabc --- /dev/null +++ b/test/cmdlineTests/linking_standard_solidity_quote_in_file_name/input.json @@ -0,0 +1,33 @@ +{ + "language": "Solidity", + "sources": { + "A": { + "content": " + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.0; + + library L { + function f() external {} + } + + contract C { + function foo() public { + L.f(); + } + } + " + } + }, + "settings": { + "libraries": { + "contract/test\"test.sol": { + "L": "0x1234567890123456789012345678901234567890" + } + }, + "outputSelection": { + "*": { + "C": ["evm.bytecode.object", "evm.bytecode.linkReferences"] + } + } + } +} diff --git a/test/cmdlineTests/linking_standard_solidity_quote_in_file_name/output.json b/test/cmdlineTests/linking_standard_solidity_quote_in_file_name/output.json new file mode 100644 index 000000000..1cfa37405 --- /dev/null +++ b/test/cmdlineTests/linking_standard_solidity_quote_in_file_name/output.json @@ -0,0 +1 @@ +{"contracts":{"A":{"C":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"sources":{"A":{"id":0}}} diff --git a/test/cmdlineTests/linking_standard_solidity_unresolved_references/input.json b/test/cmdlineTests/linking_standard_solidity_unresolved_references/input.json new file mode 100644 index 000000000..597e7f96e --- /dev/null +++ b/test/cmdlineTests/linking_standard_solidity_unresolved_references/input.json @@ -0,0 +1,41 @@ +{ + "language": "Solidity", + "sources": { + "A": { + "content": " + // SPDX-License-Identifier: GPL-3.0 + pragma solidity >=0.0; + + library L1 { + function f() external {} + } + + library L2 { + function f() external {} + } + + contract C { + function foo() public { + L1.f(); + L2.f(); + L1.f(); + L2.f(); + L1.f(); + } + } + " + } + }, + "settings": { + "libraries": { + "contract/test.sol": { + "L1": "0x1234567890123456789012345678901234567890" + } + }, + "outputSelection": { + "*": { + "C": ["evm.bytecode.object", "evm.bytecode.linkReferences"] + } + } + } +} diff --git a/test/cmdlineTests/linking_standard_solidity_unresolved_references/output.json b/test/cmdlineTests/linking_standard_solidity_unresolved_references/output.json new file mode 100644 index 000000000..620ca820e --- /dev/null +++ b/test/cmdlineTests/linking_standard_solidity_unresolved_references/output.json @@ -0,0 +1 @@ +{"contracts":{"A":{"C":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{"A":{"L2":[{"length":20,"start":184},{"length":20,"start":368}]}},"object":"__$622b2f540b6a16ff5db7bea656ad8fcf4f$____$622b2f540b6a16ff5db7bea656ad8fcf4f$__","opcodes":"","sourceMap":""}}}}},"sources":{"A":{"id":0}}} diff --git a/test/cmdlineTests/linking_standard_yul/input.json b/test/cmdlineTests/linking_standard_yul/input.json new file mode 100644 index 000000000..3825a1b12 --- /dev/null +++ b/test/cmdlineTests/linking_standard_yul/input.json @@ -0,0 +1,20 @@ +{ + "language": "Yul", + "sources": { + "A": { + "content": "object \"a\" { code { let addr := linkersymbol(\"contract/test.sol:L\") } }" + } + }, + "settings": { + "libraries": { + "contract/test.sol": { + "L": "0x1234567890123456789012345678901234567890" + } + }, + "outputSelection": { + "*": { + "*": ["evm.bytecode.object", "evm.bytecode.linkReferences"] + } + } + } +} diff --git a/test/cmdlineTests/linking_standard_yul/output.json b/test/cmdlineTests/linking_standard_yul/output.json new file mode 100644 index 000000000..ec391c66c --- /dev/null +++ b/test/cmdlineTests/linking_standard_yul/output.json @@ -0,0 +1 @@ +{"contracts":{"A":{"a":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} diff --git a/test/cmdlineTests/linking_standard_yul_quote_in_file_name/input.json b/test/cmdlineTests/linking_standard_yul_quote_in_file_name/input.json new file mode 100644 index 000000000..24fe9d61a --- /dev/null +++ b/test/cmdlineTests/linking_standard_yul_quote_in_file_name/input.json @@ -0,0 +1,20 @@ +{ + "language": "Yul", + "sources": { + "A": { + "content": "object \"a\" { code { let addr := linkersymbol(\"contract/test\\\".sol:L\") } }" + } + }, + "settings": { + "libraries": { + "contract/test\".sol": { + "L": "0x1234567890123456789012345678901234567890" + } + }, + "outputSelection": { + "*": { + "*": ["evm.bytecode.object", "evm.bytecode.linkReferences"] + } + } + } +} diff --git a/test/cmdlineTests/linking_standard_yul_quote_in_file_name/output.json b/test/cmdlineTests/linking_standard_yul_quote_in_file_name/output.json new file mode 100644 index 000000000..ec391c66c --- /dev/null +++ b/test/cmdlineTests/linking_standard_yul_quote_in_file_name/output.json @@ -0,0 +1 @@ +{"contracts":{"A":{"a":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} diff --git a/test/cmdlineTests/linking_standard_yul_unresolved_references/input.json b/test/cmdlineTests/linking_standard_yul_unresolved_references/input.json new file mode 100644 index 000000000..39f0f7c3a --- /dev/null +++ b/test/cmdlineTests/linking_standard_yul_unresolved_references/input.json @@ -0,0 +1,20 @@ +{ + "language": "Yul", + "sources": { + "A": { + "content": "object \"a\" { code { let addr1 := linkersymbol(\"contract/test.sol:L1\") let addr2 := linkersymbol(\"contract/test.sol:L2\") } }" + } + }, + "settings": { + "libraries": { + "contract/test.sol": { + "L1": "0x1234567890123456789012345678901234567890" + } + }, + "outputSelection": { + "*": { + "*": ["evm.bytecode.object", "evm.bytecode.linkReferences"] + } + } + } +} diff --git a/test/cmdlineTests/linking_standard_yul_unresolved_references/output.json b/test/cmdlineTests/linking_standard_yul_unresolved_references/output.json new file mode 100644 index 000000000..a79a5a1cc --- /dev/null +++ b/test/cmdlineTests/linking_standard_yul_unresolved_references/output.json @@ -0,0 +1 @@ +{"contracts":{"A":{"a":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{"contract/test.sol":{"L2":[{"length":20,"start":22}]}},"object":"__$fb58009a6b1ecea3b9d99bedd645df4ec3$__","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","formattedMessage":"Yul is still experimental. Please use the output with care.","message":"Yul is still experimental. Please use the output with care.","severity":"warning","type":"Warning"}]} diff --git a/test/cmdlineTests/linking_strict_assembly/args b/test/cmdlineTests/linking_strict_assembly/args new file mode 100644 index 000000000..7a735d327 --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly/args @@ -0,0 +1 @@ +--strict-assembly --libraries contract/test.sol:L:0x1234567890123456789012345678901234567890 diff --git a/test/cmdlineTests/linking_strict_assembly/err b/test/cmdlineTests/linking_strict_assembly/err new file mode 100644 index 000000000..014a1178f --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly/err @@ -0,0 +1 @@ +Warning: Yul is still experimental. Please use the output with care. diff --git a/test/cmdlineTests/linking_strict_assembly/input.yul b/test/cmdlineTests/linking_strict_assembly/input.yul new file mode 100644 index 000000000..be2052771 --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly/input.yul @@ -0,0 +1,5 @@ +object "a" { + code { + let addr := linkersymbol("contract/test.sol:L") + } +} diff --git a/test/cmdlineTests/linking_strict_assembly/output b/test/cmdlineTests/linking_strict_assembly/output new file mode 100644 index 000000000..23b2826f1 --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly/output @@ -0,0 +1,18 @@ + +======= linking_strict_assembly/input.yul (EVM) ======= + +Pretty printed source: +object "a" { + code { + let addr := linkersymbol("contract/test.sol:L") + } +} + + +Binary representation: +73123456789012345678901234567890123456789050 + +Text representation: + linkerSymbol("f919ba91ac99f96129544b80b9516b27a80e376b9dc693819d0b18b7e0395612") + /* "linking_strict_assembly/input.yul":22:85 */ + pop diff --git a/test/cmdlineTests/linking_strict_assembly_unresolved_references/args b/test/cmdlineTests/linking_strict_assembly_unresolved_references/args new file mode 100644 index 000000000..30b97f0a7 --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly_unresolved_references/args @@ -0,0 +1 @@ +--strict-assembly --libraries contract/test.sol:L1:0x1234567890123456789012345678901234567890 diff --git a/test/cmdlineTests/linking_strict_assembly_unresolved_references/err b/test/cmdlineTests/linking_strict_assembly_unresolved_references/err new file mode 100644 index 000000000..014a1178f --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly_unresolved_references/err @@ -0,0 +1 @@ +Warning: Yul is still experimental. Please use the output with care. diff --git a/test/cmdlineTests/linking_strict_assembly_unresolved_references/input.yul b/test/cmdlineTests/linking_strict_assembly_unresolved_references/input.yul new file mode 100644 index 000000000..b64cc4bae --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly_unresolved_references/input.yul @@ -0,0 +1,6 @@ +object "a" { + code { + let addr1 := linkersymbol("contract/test.sol:L1") + let addr2 := linkersymbol("contract/test.sol:L2") + } +} diff --git a/test/cmdlineTests/linking_strict_assembly_unresolved_references/output b/test/cmdlineTests/linking_strict_assembly_unresolved_references/output new file mode 100644 index 000000000..accbaa09e --- /dev/null +++ b/test/cmdlineTests/linking_strict_assembly_unresolved_references/output @@ -0,0 +1,22 @@ + +======= linking_strict_assembly_unresolved_references/input.yul (EVM) ======= + +Pretty printed source: +object "a" { + code { + let addr1 := linkersymbol("contract/test.sol:L1") + let addr2 := linkersymbol("contract/test.sol:L2") + } +} + + +Binary representation: +73123456789012345678901234567890123456789073__$fb58009a6b1ecea3b9d99bedd645df4ec3$__5050 + +Text representation: + linkerSymbol("05b0326038374a21e0895480a58bda0768cdcc04c8d18f154362d1ca5223d245") + /* "linking_strict_assembly_unresolved_references/input.yul":32:81 */ + linkerSymbol("fb58009a6b1ecea3b9d99bedd645df4ec308f17bc0087e5f39d078f77f809177") + /* "linking_strict_assembly_unresolved_references/input.yul":22:145 */ + pop + pop diff --git a/test/cmdlineTests/optimizer_BlockDeDuplicator/output b/test/cmdlineTests/optimizer_BlockDeDuplicator/output index e5c45e53e..3af48a2f0 100644 --- a/test/cmdlineTests/optimizer_BlockDeDuplicator/output +++ b/test/cmdlineTests/optimizer_BlockDeDuplicator/output @@ -87,5 +87,5 @@ sub_0: assembly { tag_7: jump // out - auxdata: AUXDATA REMOVED + auxdata: } diff --git a/test/cmdlineTests/optimizer_user_yul/output b/test/cmdlineTests/optimizer_user_yul/output index 9a4301aa4..f6e7705c7 100644 --- a/test/cmdlineTests/optimizer_user_yul/output +++ b/test/cmdlineTests/optimizer_user_yul/output @@ -83,5 +83,5 @@ sub_0: assembly { dup1 revert - auxdata: AUXDATA REMOVED + auxdata: } diff --git a/test/cmdlineTests/output_selection_all_A1/output.json b/test/cmdlineTests/output_selection_all_A1/output.json index 9f0cfa596..64c0d4e30 100644 --- a/test/cmdlineTests/output_selection_all_A1/output.json +++ b/test/cmdlineTests/output_selection_all_A1/output.json @@ -1,4 +1,4 @@ -{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } } diff --git a/test/cmdlineTests/output_selection_all_A2/output.json b/test/cmdlineTests/output_selection_all_A2/output.json index ae00e3485..29c7ba76d 100644 --- a/test/cmdlineTests/output_selection_all_A2/output.json +++ b/test/cmdlineTests/output_selection_all_A2/output.json @@ -1,4 +1,4 @@ -{"contracts":{"a.sol":{"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +{"contracts":{"a.sol":{"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } } diff --git a/test/cmdlineTests/output_selection_all_star/output.json b/test/cmdlineTests/output_selection_all_star/output.json index 64653e63f..07a6641a5 100644 --- a/test/cmdlineTests/output_selection_all_star/output.json +++ b/test/cmdlineTests/output_selection_all_star/output.json @@ -1,4 +1,4 @@ -{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}},"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}},"b.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}},"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } } diff --git a/test/cmdlineTests/output_selection_single_A1/output.json b/test/cmdlineTests/output_selection_single_A1/output.json index e29036fde..837fd36cd 100644 --- a/test/cmdlineTests/output_selection_single_A1/output.json +++ b/test/cmdlineTests/output_selection_single_A1/output.json @@ -1,2 +1,2 @@ -{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}} diff --git a/test/cmdlineTests/output_selection_single_B1/output.json b/test/cmdlineTests/output_selection_single_B1/output.json index 9915b12ab..9ba08193e 100644 --- a/test/cmdlineTests/output_selection_single_B1/output.json +++ b/test/cmdlineTests/output_selection_single_B1/output.json @@ -1,4 +1,4 @@ -{"contracts":{"b.sol":{"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version! +{"contracts":{"b.sol":{"B2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"b.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"b.sol","start":-1},"type":"Warning"},{"component":"general","errorCode":"2018","formattedMessage":"b.sol:2:15: Warning: Function state mutability can be restricted to pure contract A1 { function b(uint x) public { assert(x > 0); } } contract B2 { function b(uint x) public pure { assert(x > 0); } } ^------------------------------------------^ diff --git a/test/cmdlineTests/output_selection_single_all/output.json b/test/cmdlineTests/output_selection_single_all/output.json index f98685b2e..c0a48b617 100644 --- a/test/cmdlineTests/output_selection_single_all/output.json +++ b/test/cmdlineTests/output_selection_single_all/output.json @@ -1,2 +1,2 @@ -{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +{"contracts":{"a.sol":{"A1":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}},"A2":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0},"b.sol":{"id":1}}} diff --git a/test/cmdlineTests/standard_generatedSources/output.json b/test/cmdlineTests/standard_generatedSources/output.json index a62173127..4298000ec 100644 --- a/test/cmdlineTests/standard_generatedSources/output.json +++ b/test/cmdlineTests/standard_generatedSources/output.json @@ -1,4 +1,4 @@ -{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:2697:1","statements":[{"body":{"nodeType":"YulBlock","src":"101:684:1","statements":[{"body":{"nodeType":"YulBlock","src":"150:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"159:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"162:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"152:6:1"},"nodeType":"YulFunctionCall","src":"152:12:1"},"nodeType":"YulExpressionStatement","src":"152:12:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"129:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"137:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"125:3:1"},"nodeType":"YulFunctionCall","src":"125:17:1"},{"name":"end","nodeType":"YulIdentifier","src":"144:3:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"121:3:1"},"nodeType":"YulFunctionCall","src":"121:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"114:6:1"},"nodeType":"YulFunctionCall","src":"114:35:1"},"nodeType":"YulIf","src":"111:2:1"},{"nodeType":"YulVariableDeclaration","src":"175:34:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"202:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"189:12:1"},"nodeType":"YulFunctionCall","src":"189:20:1"},"variables":[{"name":"length","nodeType":"YulTypedName","src":"179:6:1","type":""}]},{"nodeType":"YulAssignment","src":"218:89:1","value":{"arguments":[{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"299:6:1"}],"functionName":{"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"242:56:1"},"nodeType":"YulFunctionCall","src":"242:64:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"227:14:1"},"nodeType":"YulFunctionCall","src":"227:80:1"},"variableNames":[{"name":"array","nodeType":"YulIdentifier","src":"218:5:1"}]},{"nodeType":"YulVariableDeclaration","src":"316:16:1","value":{"name":"array","nodeType":"YulIdentifier","src":"327:5:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"320:3:1","type":""}]},{"expression":{"arguments":[{"name":"array","nodeType":"YulIdentifier","src":"348:5:1"},{"name":"length","nodeType":"YulIdentifier","src":"355:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"341:6:1"},"nodeType":"YulFunctionCall","src":"341:21:1"},"nodeType":"YulExpressionStatement","src":"341:21:1"},{"nodeType":"YulAssignment","src":"363:27:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"377:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"385:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"373:3:1"},"nodeType":"YulFunctionCall","src":"373:17:1"},"variableNames":[{"name":"offset","nodeType":"YulIdentifier","src":"363:6:1"}]},{"nodeType":"YulAssignment","src":"391:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"402:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"407:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"398:3:1"},"nodeType":"YulFunctionCall","src":"398:14:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"391:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"452:17:1","value":{"name":"offset","nodeType":"YulIdentifier","src":"463:6:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"456:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"518:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"527:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"530:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"520:6:1"},"nodeType":"YulFunctionCall","src":"520:12:1"},"nodeType":"YulExpressionStatement","src":"520:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"488:3:1"},{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"497:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"505:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"493:3:1"},"nodeType":"YulFunctionCall","src":"493:17:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"484:3:1"},"nodeType":"YulFunctionCall","src":"484:27:1"},{"name":"end","nodeType":"YulIdentifier","src":"513:3:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"481:2:1"},"nodeType":"YulFunctionCall","src":"481:36:1"},"nodeType":"YulIf","src":"478:2:1"},{"body":{"nodeType":"YulBlock","src":"603:176:1","statements":[{"nodeType":"YulVariableDeclaration","src":"617:21:1","value":{"name":"src","nodeType":"YulIdentifier","src":"635:3:1"},"variables":[{"name":"elementPos","nodeType":"YulTypedName","src":"621:10:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"658:3:1"},{"arguments":[{"name":"elementPos","nodeType":"YulIdentifier","src":"684:10:1"},{"name":"end","nodeType":"YulIdentifier","src":"696:3:1"}],"functionName":{"name":"abi_decode_t_uint256","nodeType":"YulIdentifier","src":"663:20:1"},"nodeType":"YulFunctionCall","src":"663:37:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"651:6:1"},"nodeType":"YulFunctionCall","src":"651:50:1"},"nodeType":"YulExpressionStatement","src":"651:50:1"},{"nodeType":"YulAssignment","src":"714:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"725:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"730:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"721:3:1"},"nodeType":"YulFunctionCall","src":"721:14:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"714:3:1"}]},{"nodeType":"YulAssignment","src":"748:21:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"759:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"764:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"755:3:1"},"nodeType":"YulFunctionCall","src":"755:14:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"748:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"565:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"568:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"562:2:1"},"nodeType":"YulFunctionCall","src":"562:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"576:18:1","statements":[{"nodeType":"YulAssignment","src":"578:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"587:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"590:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"583:3:1"},"nodeType":"YulFunctionCall","src":"583:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"578:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"547:14:1","statements":[{"nodeType":"YulVariableDeclaration","src":"549:10:1","value":{"kind":"number","nodeType":"YulLiteral","src":"558:1:1","type":"","value":"0"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"553:1:1","type":""}]}]},"src":"543:236:1"}]},"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"79:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"87:3:1","type":""}],"returnVariables":[{"name":"array","nodeType":"YulTypedName","src":"95:5:1","type":""}],"src":"24:761:1"},{"body":{"nodeType":"YulBlock","src":"843:87:1","statements":[{"nodeType":"YulAssignment","src":"853:29:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"875:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"862:12:1"},"nodeType":"YulFunctionCall","src":"862:20:1"},"variableNames":[{"name":"value","nodeType":"YulIdentifier","src":"853:5:1"}]},{"expression":{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"918:5:1"}],"functionName":{"name":"validator_revert_t_uint256","nodeType":"YulIdentifier","src":"891:26:1"},"nodeType":"YulFunctionCall","src":"891:33:1"},"nodeType":"YulExpressionStatement","src":"891:33:1"}]},"name":"abi_decode_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"821:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"829:3:1","type":""}],"returnVariables":[{"name":"value","nodeType":"YulTypedName","src":"837:5:1","type":""}],"src":"791:139:1"},{"body":{"nodeType":"YulBlock","src":"1027:312:1","statements":[{"body":{"nodeType":"YulBlock","src":"1073:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1082:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1085:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1075:6:1"},"nodeType":"YulFunctionCall","src":"1075:12:1"},"nodeType":"YulExpressionStatement","src":"1075:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"1048:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"1057:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"1044:3:1"},"nodeType":"YulFunctionCall","src":"1044:23:1"},{"kind":"number","nodeType":"YulLiteral","src":"1069:2:1","type":"","value":"32"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"1040:3:1"},"nodeType":"YulFunctionCall","src":"1040:32:1"},"nodeType":"YulIf","src":"1037:2:1"},{"nodeType":"YulBlock","src":"1099:233:1","statements":[{"nodeType":"YulVariableDeclaration","src":"1113:45:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1144:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1155:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1140:3:1"},"nodeType":"YulFunctionCall","src":"1140:17:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"1127:12:1"},"nodeType":"YulFunctionCall","src":"1127:31:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"1117:6:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1205:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1214:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1217:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1207:6:1"},"nodeType":"YulFunctionCall","src":"1207:12:1"},"nodeType":"YulExpressionStatement","src":"1207:12:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"1177:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"1185:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1174:2:1"},"nodeType":"YulFunctionCall","src":"1174:30:1"},"nodeType":"YulIf","src":"1171:2:1"},{"nodeType":"YulAssignment","src":"1234:88:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1294:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"1305:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1290:3:1"},"nodeType":"YulFunctionCall","src":"1290:22:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"1314:7:1"}],"functionName":{"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"1244:45:1"},"nodeType":"YulFunctionCall","src":"1244:78:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1234:6:1"}]}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"997:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"1008:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"1020:6:1","type":""}],"src":"936:403:1"},{"body":{"nodeType":"YulBlock","src":"1410:53:1","statements":[{"expression":{"arguments":[{"name":"pos","nodeType":"YulIdentifier","src":"1427:3:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"1450:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"1432:17:1"},"nodeType":"YulFunctionCall","src":"1432:24:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1420:6:1"},"nodeType":"YulFunctionCall","src":"1420:37:1"},"nodeType":"YulExpressionStatement","src":"1420:37:1"}]},"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"1398:5:1","type":""},{"name":"pos","nodeType":"YulTypedName","src":"1405:3:1","type":""}],"src":"1345:118:1"},{"body":{"nodeType":"YulBlock","src":"1567:124:1","statements":[{"nodeType":"YulAssignment","src":"1577:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1589:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1600:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1585:3:1"},"nodeType":"YulFunctionCall","src":"1585:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1577:4:1"}]},{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"1657:6:1"},{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1670:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1681:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1666:3:1"},"nodeType":"YulFunctionCall","src":"1666:17:1"}],"functionName":{"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulIdentifier","src":"1613:43:1"},"nodeType":"YulFunctionCall","src":"1613:71:1"},"nodeType":"YulExpressionStatement","src":"1613:71:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1539:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1551:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1562:4:1","type":""}],"src":"1469:222:1"},{"body":{"nodeType":"YulBlock","src":"1737:243:1","statements":[{"nodeType":"YulAssignment","src":"1747:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1763:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1757:5:1"},"nodeType":"YulFunctionCall","src":"1757:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1747:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1775:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1797:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1805:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1793:3:1"},"nodeType":"YulFunctionCall","src":"1793:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1779:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1921:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"1923:16:1"},"nodeType":"YulFunctionCall","src":"1923:18:1"},"nodeType":"YulExpressionStatement","src":"1923:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1864:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"1876:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1861:2:1"},"nodeType":"YulFunctionCall","src":"1861:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1900:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"1912:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"1897:2:1"},"nodeType":"YulFunctionCall","src":"1897:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"1858:2:1"},"nodeType":"YulFunctionCall","src":"1858:62:1"},"nodeType":"YulIf","src":"1855:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1959:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1963:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1952:6:1"},"nodeType":"YulFunctionCall","src":"1952:22:1"},"nodeType":"YulExpressionStatement","src":"1952:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1721:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1730:6:1","type":""}],"src":"1697:283:1"},{"body":{"nodeType":"YulBlock","src":"2068:229:1","statements":[{"body":{"nodeType":"YulBlock","src":"2173:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"2175:16:1"},"nodeType":"YulFunctionCall","src":"2175:18:1"},"nodeType":"YulExpressionStatement","src":"2175:18:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2145:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2153:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"2142:2:1"},"nodeType":"YulFunctionCall","src":"2142:30:1"},"nodeType":"YulIf","src":"2139:2:1"},{"nodeType":"YulAssignment","src":"2205:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2217:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2225:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"2213:3:1"},"nodeType":"YulFunctionCall","src":"2213:17:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2205:4:1"}]},{"nodeType":"YulAssignment","src":"2267:23:1","value":{"arguments":[{"name":"size","nodeType":"YulIdentifier","src":"2279:4:1"},{"kind":"number","nodeType":"YulLiteral","src":"2285:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"2275:3:1"},"nodeType":"YulFunctionCall","src":"2275:15:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2267:4:1"}]}]},"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"length","nodeType":"YulTypedName","src":"2052:6:1","type":""}],"returnVariables":[{"name":"size","nodeType":"YulTypedName","src":"2063:4:1","type":""}],"src":"1986:311:1"},{"body":{"nodeType":"YulBlock","src":"2348:32:1","statements":[{"nodeType":"YulAssignment","src":"2358:16:1","value":{"name":"value","nodeType":"YulIdentifier","src":"2369:5:1"},"variableNames":[{"name":"cleaned","nodeType":"YulIdentifier","src":"2358:7:1"}]}]},"name":"cleanup_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2330:5:1","type":""}],"returnVariables":[{"name":"cleaned","nodeType":"YulTypedName","src":"2340:7:1","type":""}],"src":"2303:77:1"},{"body":{"nodeType":"YulBlock","src":"2414:152:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2431:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2434:77:1","type":"","value":"35408467139433450592217433187231851964531694900788300625387963629091585785856"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2424:6:1"},"nodeType":"YulFunctionCall","src":"2424:88:1"},"nodeType":"YulExpressionStatement","src":"2424:88:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2528:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"2531:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2521:6:1"},"nodeType":"YulFunctionCall","src":"2521:15:1"},"nodeType":"YulExpressionStatement","src":"2521:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2552:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2555:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2545:6:1"},"nodeType":"YulFunctionCall","src":"2545:15:1"},"nodeType":"YulExpressionStatement","src":"2545:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"2386:180:1"},{"body":{"nodeType":"YulBlock","src":"2615:79:1","statements":[{"body":{"nodeType":"YulBlock","src":"2672:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2681:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2684:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2674:6:1"},"nodeType":"YulFunctionCall","src":"2674:12:1"},"nodeType":"YulExpressionStatement","src":"2674:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2638:5:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2663:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"2645:17:1"},"nodeType":"YulFunctionCall","src":"2645:24:1"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"2635:2:1"},"nodeType":"YulFunctionCall","src":"2635:35:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"2628:6:1"},"nodeType":"YulFunctionCall","src":"2628:43:1"},"nodeType":"YulIf","src":"2625:2:1"}]},"name":"validator_revert_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2608:5:1","type":""}],"src":"2572:122:1"}]},"contents":"{ +{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:2697:1","statements":[{"body":{"nodeType":"YulBlock","src":"101:684:1","statements":[{"body":{"nodeType":"YulBlock","src":"150:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"159:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"162:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"152:6:1"},"nodeType":"YulFunctionCall","src":"152:12:1"},"nodeType":"YulExpressionStatement","src":"152:12:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"129:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"137:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"125:3:1"},"nodeType":"YulFunctionCall","src":"125:17:1"},{"name":"end","nodeType":"YulIdentifier","src":"144:3:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"121:3:1"},"nodeType":"YulFunctionCall","src":"121:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"114:6:1"},"nodeType":"YulFunctionCall","src":"114:35:1"},"nodeType":"YulIf","src":"111:2:1"},{"nodeType":"YulVariableDeclaration","src":"175:34:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"202:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"189:12:1"},"nodeType":"YulFunctionCall","src":"189:20:1"},"variables":[{"name":"length","nodeType":"YulTypedName","src":"179:6:1","type":""}]},{"nodeType":"YulAssignment","src":"218:89:1","value":{"arguments":[{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"299:6:1"}],"functionName":{"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"242:56:1"},"nodeType":"YulFunctionCall","src":"242:64:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"227:14:1"},"nodeType":"YulFunctionCall","src":"227:80:1"},"variableNames":[{"name":"array","nodeType":"YulIdentifier","src":"218:5:1"}]},{"nodeType":"YulVariableDeclaration","src":"316:16:1","value":{"name":"array","nodeType":"YulIdentifier","src":"327:5:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"320:3:1","type":""}]},{"expression":{"arguments":[{"name":"array","nodeType":"YulIdentifier","src":"348:5:1"},{"name":"length","nodeType":"YulIdentifier","src":"355:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"341:6:1"},"nodeType":"YulFunctionCall","src":"341:21:1"},"nodeType":"YulExpressionStatement","src":"341:21:1"},{"nodeType":"YulAssignment","src":"363:27:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"377:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"385:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"373:3:1"},"nodeType":"YulFunctionCall","src":"373:17:1"},"variableNames":[{"name":"offset","nodeType":"YulIdentifier","src":"363:6:1"}]},{"nodeType":"YulAssignment","src":"391:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"402:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"407:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"398:3:1"},"nodeType":"YulFunctionCall","src":"398:14:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"391:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"452:17:1","value":{"name":"offset","nodeType":"YulIdentifier","src":"463:6:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"456:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"518:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"527:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"530:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"520:6:1"},"nodeType":"YulFunctionCall","src":"520:12:1"},"nodeType":"YulExpressionStatement","src":"520:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"488:3:1"},{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"497:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"505:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"493:3:1"},"nodeType":"YulFunctionCall","src":"493:17:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"484:3:1"},"nodeType":"YulFunctionCall","src":"484:27:1"},{"name":"end","nodeType":"YulIdentifier","src":"513:3:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"481:2:1"},"nodeType":"YulFunctionCall","src":"481:36:1"},"nodeType":"YulIf","src":"478:2:1"},{"body":{"nodeType":"YulBlock","src":"603:176:1","statements":[{"nodeType":"YulVariableDeclaration","src":"617:21:1","value":{"name":"src","nodeType":"YulIdentifier","src":"635:3:1"},"variables":[{"name":"elementPos","nodeType":"YulTypedName","src":"621:10:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"658:3:1"},{"arguments":[{"name":"elementPos","nodeType":"YulIdentifier","src":"684:10:1"},{"name":"end","nodeType":"YulIdentifier","src":"696:3:1"}],"functionName":{"name":"abi_decode_t_uint256","nodeType":"YulIdentifier","src":"663:20:1"},"nodeType":"YulFunctionCall","src":"663:37:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"651:6:1"},"nodeType":"YulFunctionCall","src":"651:50:1"},"nodeType":"YulExpressionStatement","src":"651:50:1"},{"nodeType":"YulAssignment","src":"714:21:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"725:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"730:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"721:3:1"},"nodeType":"YulFunctionCall","src":"721:14:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"714:3:1"}]},{"nodeType":"YulAssignment","src":"748:21:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"759:3:1"},{"kind":"number","nodeType":"YulLiteral","src":"764:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"755:3:1"},"nodeType":"YulFunctionCall","src":"755:14:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"748:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"565:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"568:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"562:2:1"},"nodeType":"YulFunctionCall","src":"562:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"576:18:1","statements":[{"nodeType":"YulAssignment","src":"578:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"587:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"590:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"583:3:1"},"nodeType":"YulFunctionCall","src":"583:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"578:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"547:14:1","statements":[{"nodeType":"YulVariableDeclaration","src":"549:10:1","value":{"kind":"number","nodeType":"YulLiteral","src":"558:1:1","type":"","value":"0"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"553:1:1","type":""}]}]},"src":"543:236:1"}]},"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"79:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"87:3:1","type":""}],"returnVariables":[{"name":"array","nodeType":"YulTypedName","src":"95:5:1","type":""}],"src":"24:761:1"},{"body":{"nodeType":"YulBlock","src":"843:87:1","statements":[{"nodeType":"YulAssignment","src":"853:29:1","value":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"875:6:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"862:12:1"},"nodeType":"YulFunctionCall","src":"862:20:1"},"variableNames":[{"name":"value","nodeType":"YulIdentifier","src":"853:5:1"}]},{"expression":{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"918:5:1"}],"functionName":{"name":"validator_revert_t_uint256","nodeType":"YulIdentifier","src":"891:26:1"},"nodeType":"YulFunctionCall","src":"891:33:1"},"nodeType":"YulExpressionStatement","src":"891:33:1"}]},"name":"abi_decode_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"offset","nodeType":"YulTypedName","src":"821:6:1","type":""},{"name":"end","nodeType":"YulTypedName","src":"829:3:1","type":""}],"returnVariables":[{"name":"value","nodeType":"YulTypedName","src":"837:5:1","type":""}],"src":"791:139:1"},{"body":{"nodeType":"YulBlock","src":"1027:312:1","statements":[{"body":{"nodeType":"YulBlock","src":"1073:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1082:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1085:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1075:6:1"},"nodeType":"YulFunctionCall","src":"1075:12:1"},"nodeType":"YulExpressionStatement","src":"1075:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"1048:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"1057:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"1044:3:1"},"nodeType":"YulFunctionCall","src":"1044:23:1"},{"kind":"number","nodeType":"YulLiteral","src":"1069:2:1","type":"","value":"32"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"1040:3:1"},"nodeType":"YulFunctionCall","src":"1040:32:1"},"nodeType":"YulIf","src":"1037:2:1"},{"nodeType":"YulBlock","src":"1099:233:1","statements":[{"nodeType":"YulVariableDeclaration","src":"1113:45:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1144:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1155:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1140:3:1"},"nodeType":"YulFunctionCall","src":"1140:17:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"1127:12:1"},"nodeType":"YulFunctionCall","src":"1127:31:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"1117:6:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1205:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1214:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1217:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1207:6:1"},"nodeType":"YulFunctionCall","src":"1207:12:1"},"nodeType":"YulExpressionStatement","src":"1207:12:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"1177:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"1185:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1174:2:1"},"nodeType":"YulFunctionCall","src":"1174:30:1"},"nodeType":"YulIf","src":"1171:2:1"},{"nodeType":"YulAssignment","src":"1234:88:1","value":{"arguments":[{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1294:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"1305:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1290:3:1"},"nodeType":"YulFunctionCall","src":"1290:22:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"1314:7:1"}],"functionName":{"name":"abi_decode_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulIdentifier","src":"1244:45:1"},"nodeType":"YulFunctionCall","src":"1244:78:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1234:6:1"}]}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"997:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"1008:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"1020:6:1","type":""}],"src":"936:403:1"},{"body":{"nodeType":"YulBlock","src":"1410:53:1","statements":[{"expression":{"arguments":[{"name":"pos","nodeType":"YulIdentifier","src":"1427:3:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"1450:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"1432:17:1"},"nodeType":"YulFunctionCall","src":"1432:24:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1420:6:1"},"nodeType":"YulFunctionCall","src":"1420:37:1"},"nodeType":"YulExpressionStatement","src":"1420:37:1"}]},"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"1398:5:1","type":""},{"name":"pos","nodeType":"YulTypedName","src":"1405:3:1","type":""}],"src":"1345:118:1"},{"body":{"nodeType":"YulBlock","src":"1567:124:1","statements":[{"nodeType":"YulAssignment","src":"1577:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1589:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1600:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1585:3:1"},"nodeType":"YulFunctionCall","src":"1585:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1577:4:1"}]},{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"1657:6:1"},{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1670:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1681:1:1","type":"","value":"0"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1666:3:1"},"nodeType":"YulFunctionCall","src":"1666:17:1"}],"functionName":{"name":"abi_encode_t_uint256_to_t_uint256_fromStack","nodeType":"YulIdentifier","src":"1613:43:1"},"nodeType":"YulFunctionCall","src":"1613:71:1"},"nodeType":"YulExpressionStatement","src":"1613:71:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1539:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1551:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1562:4:1","type":""}],"src":"1469:222:1"},{"body":{"nodeType":"YulBlock","src":"1737:243:1","statements":[{"nodeType":"YulAssignment","src":"1747:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1763:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1757:5:1"},"nodeType":"YulFunctionCall","src":"1757:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1747:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1775:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1797:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1805:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1793:3:1"},"nodeType":"YulFunctionCall","src":"1793:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1779:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1921:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"1923:16:1"},"nodeType":"YulFunctionCall","src":"1923:18:1"},"nodeType":"YulExpressionStatement","src":"1923:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1864:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"1876:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1861:2:1"},"nodeType":"YulFunctionCall","src":"1861:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1900:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"1912:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"1897:2:1"},"nodeType":"YulFunctionCall","src":"1897:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"1858:2:1"},"nodeType":"YulFunctionCall","src":"1858:62:1"},"nodeType":"YulIf","src":"1855:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1959:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1963:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1952:6:1"},"nodeType":"YulFunctionCall","src":"1952:22:1"},"nodeType":"YulExpressionStatement","src":"1952:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1721:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1730:6:1","type":""}],"src":"1697:283:1"},{"body":{"nodeType":"YulBlock","src":"2068:229:1","statements":[{"body":{"nodeType":"YulBlock","src":"2173:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"2175:16:1"},"nodeType":"YulFunctionCall","src":"2175:18:1"},"nodeType":"YulExpressionStatement","src":"2175:18:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2145:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2153:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"2142:2:1"},"nodeType":"YulFunctionCall","src":"2142:30:1"},"nodeType":"YulIf","src":"2139:2:1"},{"nodeType":"YulAssignment","src":"2205:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"2217:6:1"},{"kind":"number","nodeType":"YulLiteral","src":"2225:4:1","type":"","value":"0x20"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"2213:3:1"},"nodeType":"YulFunctionCall","src":"2213:17:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2205:4:1"}]},{"nodeType":"YulAssignment","src":"2267:23:1","value":{"arguments":[{"name":"size","nodeType":"YulIdentifier","src":"2279:4:1"},{"kind":"number","nodeType":"YulLiteral","src":"2285:4:1","type":"","value":"0x20"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"2275:3:1"},"nodeType":"YulFunctionCall","src":"2275:15:1"},"variableNames":[{"name":"size","nodeType":"YulIdentifier","src":"2267:4:1"}]}]},"name":"array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"length","nodeType":"YulTypedName","src":"2052:6:1","type":""}],"returnVariables":[{"name":"size","nodeType":"YulTypedName","src":"2063:4:1","type":""}],"src":"1986:311:1"},{"body":{"nodeType":"YulBlock","src":"2348:32:1","statements":[{"nodeType":"YulAssignment","src":"2358:16:1","value":{"name":"value","nodeType":"YulIdentifier","src":"2369:5:1"},"variableNames":[{"name":"cleaned","nodeType":"YulIdentifier","src":"2358:7:1"}]}]},"name":"cleanup_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2330:5:1","type":""}],"returnVariables":[{"name":"cleaned","nodeType":"YulTypedName","src":"2340:7:1","type":""}],"src":"2303:77:1"},{"body":{"nodeType":"YulBlock","src":"2414:152:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2431:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2434:77:1","type":"","value":"35408467139433450592217433187231851964531694900788300625387963629091585785856"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2424:6:1"},"nodeType":"YulFunctionCall","src":"2424:88:1"},"nodeType":"YulExpressionStatement","src":"2424:88:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2528:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"2531:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"2521:6:1"},"nodeType":"YulFunctionCall","src":"2521:15:1"},"nodeType":"YulExpressionStatement","src":"2521:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2552:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2555:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2545:6:1"},"nodeType":"YulFunctionCall","src":"2545:15:1"},"nodeType":"YulExpressionStatement","src":"2545:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"2386:180:1"},{"body":{"nodeType":"YulBlock","src":"2615:79:1","statements":[{"body":{"nodeType":"YulBlock","src":"2672:16:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"2681:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"2684:1:1","type":"","value":"0"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"2674:6:1"},"nodeType":"YulFunctionCall","src":"2674:12:1"},"nodeType":"YulExpressionStatement","src":"2674:12:1"}]},"condition":{"arguments":[{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2638:5:1"},{"arguments":[{"name":"value","nodeType":"YulIdentifier","src":"2663:5:1"}],"functionName":{"name":"cleanup_t_uint256","nodeType":"YulIdentifier","src":"2645:17:1"},"nodeType":"YulFunctionCall","src":"2645:24:1"}],"functionName":{"name":"eq","nodeType":"YulIdentifier","src":"2635:2:1"},"nodeType":"YulFunctionCall","src":"2635:35:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"2628:6:1"},"nodeType":"YulFunctionCall","src":"2628:43:1"},"nodeType":"YulIf","src":"2625:2:1"}]},"name":"validator_revert_t_uint256","nodeType":"YulFunctionDefinition","parameters":[{"name":"value","nodeType":"YulTypedName","src":"2608:5:1","type":""}],"src":"2572:122:1"}]},"contents":"{ // uint256[] function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset, end) -> array { @@ -79,5 +79,5 @@ } } -","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;130:7;83:59;;;:::o;24:761:1:-;;144:3;137:4;129:6;125:17;121:27;111:2;;162:1;159;152:12;111:2;202:6;189:20;227:80;242:64;299:6;242:64;:::i;:::-;227:80;:::i;:::-;218:89;;327:5;355:6;348:5;341:21;385:4;377:6;373:17;363:27;;407:4;402:3;398:14;391:21;;463:6;513:3;505:4;497:6;493:17;488:3;484:27;481:36;478:2;;;530:1;527;520:12;478:2;558:1;543:236;568:6;565:1;562:13;543:236;;;635:3;663:37;696:3;684:10;663:37;:::i;:::-;658:3;651:50;730:4;725:3;721:14;714:21;;764:4;759:3;755:14;748:21;;603:176;590:1;587;583:9;578:14;;543:236;;;547:14;101:684;;;;;;;:::o;791:139::-;;875:6;862:20;853:29;;891:33;918:5;891:33;:::i;:::-;843:87;;;;:::o;936:403::-;;1069:2;1057:9;1048:7;1044:23;1040:32;1037:2;;;1085:1;1082;1075:12;1037:2;1155:1;1144:9;1140:17;1127:31;1185:18;1177:6;1174:30;1171:2;;;1217:1;1214;1207:12;1171:2;1244:78;1314:7;1305:6;1294:9;1290:22;1244:78;:::i;:::-;1234:88;;1099:233;1027:312;;;;:::o;1345:118::-;1432:24;1450:5;1432:24;:::i;:::-;1427:3;1420:37;1410:53;;:::o;1469:222::-;;1600:2;1589:9;1585:18;1577:26;;1613:71;1681:1;1670:9;1666:17;1657:6;1613:71;:::i;:::-;1567:124;;;;:::o;1697:283::-;;1763:2;1757:9;1747:19;;1805:4;1797:6;1793:17;1912:6;1900:10;1897:22;1876:18;1864:10;1861:34;1858:62;1855:2;;;1923:18;;:::i;:::-;1855:2;1963:10;1959:2;1952:22;1737:243;;;;:::o;1986:311::-;;2153:18;2145:6;2142:30;2139:2;;;2175:18;;:::i;:::-;2139:2;2225:4;2217:6;2213:17;2205:25;;2285:4;2279;2275:15;2267:23;;2068:229;;;:::o;2303:77::-;;2369:5;2358:16;;2348:32;;;:::o;2386:180::-;2434:77;2431:1;2424:88;2531:4;2528:1;2521:15;2555:4;2552:1;2545:15;2572:122;2645:24;2663:5;2645:24;:::i;:::-;2638:5;2635:35;2625:2;;2684:1;2681;2674:12;2625:2;2615:79;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;130:7;83:59;;;:::o;24:761:1:-;;144:3;137:4;129:6;125:17;121:27;111:2;;162:1;159;152:12;111:2;202:6;189:20;227:80;242:64;299:6;242:64;:::i;:::-;227:80;:::i;:::-;218:89;;327:5;355:6;348:5;341:21;385:4;377:6;373:17;363:27;;407:4;402:3;398:14;391:21;;463:6;513:3;505:4;497:6;493:17;488:3;484:27;481:36;478:2;;;530:1;527;520:12;478:2;558:1;543:236;568:6;565:1;562:13;543:236;;;635:3;663:37;696:3;684:10;663:37;:::i;:::-;658:3;651:50;730:4;725:3;721:14;714:21;;764:4;759:3;755:14;748:21;;603:176;590:1;587;583:9;578:14;;543:236;;;547:14;101:684;;;;;;;:::o;791:139::-;;875:6;862:20;853:29;;891:33;918:5;891:33;:::i;:::-;843:87;;;;:::o;936:403::-;;1069:2;1057:9;1048:7;1044:23;1040:32;1037:2;;;1085:1;1082;1075:12;1037:2;1155:1;1144:9;1140:17;1127:31;1185:18;1177:6;1174:30;1171:2;;;1217:1;1214;1207:12;1171:2;1244:78;1314:7;1305:6;1294:9;1290:22;1244:78;:::i;:::-;1234:88;;1099:233;1027:312;;;;:::o;1345:118::-;1432:24;1450:5;1432:24;:::i;:::-;1427:3;1420:37;1410:53;;:::o;1469:222::-;;1600:2;1589:9;1585:18;1577:26;;1613:71;1681:1;1670:9;1666:17;1657:6;1613:71;:::i;:::-;1567:124;;;;:::o;1697:283::-;;1763:2;1757:9;1747:19;;1805:4;1797:6;1793:17;1912:6;1900:10;1897:22;1876:18;1864:10;1861:34;1858:62;1855:2;;;1923:18;;:::i;:::-;1855:2;1963:10;1959:2;1952:22;1737:243;;;;:::o;1986:311::-;;2153:18;2145:6;2142:30;2139:2;;;2175:18;;:::i;:::-;2139:2;2225:4;2217:6;2213:17;2205:25;;2285:4;2279;2275:15;2267:23;;2068:229;;;:::o;2303:77::-;;2369:5;2358:16;;2348:32;;;:::o;2386:180::-;2434:77;2431:1;2424:88;2531:4;2528:1;2521:15;2555:4;2552:1;2545:15;2572:122;2645:24;2663:5;2645:24;:::i;:::-;2638:5;2635:35;2625:2;;2684:1;2681;2674:12;2625:2;2615:79;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}} diff --git a/test/cmdlineTests/standard_immutable_references/output.json b/test/cmdlineTests/standard_immutable_references/output.json index 2f935a12d..25537229f 100644 --- a/test/cmdlineTests/standard_immutable_references/output.json +++ b/test/cmdlineTests/standard_immutable_references/output.json @@ -1,2 +1,2 @@ -{"contracts":{"a.sol":{"A":{"evm":{"deployedBytecode":{"generatedSources":[],"immutableReferences":{"3":[{"length":32,"start":77}]},"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"36:96:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;74:56;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;108:7;126:1;119:8;;74:56;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +{"contracts":{"a.sol":{"A":{"evm":{"deployedBytecode":{"generatedSources":[],"immutableReferences":{"3":[{"length":32,"start":77}]},"linkReferences":{},"object":"","opcodes":"","sourceMap":"36:96:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;74:56;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;108:7;126:1;119:8;;74:56;:::o"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}} diff --git a/test/cmdlineTests/standard_optimizer_generatedSources/output.json b/test/cmdlineTests/standard_optimizer_generatedSources/output.json index 79b0f11a2..f855f874a 100644 --- a/test/cmdlineTests/standard_optimizer_generatedSources/output.json +++ b/test/cmdlineTests/standard_optimizer_generatedSources/output.json @@ -1,4 +1,4 @@ -{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:1608:1","statements":[{"nodeType":"YulBlock","src":"6:3:1","statements":[]},{"body":{"nodeType":"YulBlock","src":"109:927:1","statements":[{"nodeType":"YulVariableDeclaration","src":"119:12:1","value":{"kind":"number","nodeType":"YulLiteral","src":"129:2:1","type":"","value":"32"},"variables":[{"name":"_1","nodeType":"YulTypedName","src":"123:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"176:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"185:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"193:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"178:6:1"},"nodeType":"YulFunctionCall","src":"178:22:1"},"nodeType":"YulExpressionStatement","src":"178:22:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"151:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"160:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"147:3:1"},"nodeType":"YulFunctionCall","src":"147:23:1"},{"name":"_1","nodeType":"YulIdentifier","src":"172:2:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"143:3:1"},"nodeType":"YulFunctionCall","src":"143:32:1"},"nodeType":"YulIf","src":"140:2:1"},{"nodeType":"YulVariableDeclaration","src":"211:37:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"238:9:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"225:12:1"},"nodeType":"YulFunctionCall","src":"225:23:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"215:6:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"257:28:1","value":{"kind":"number","nodeType":"YulLiteral","src":"267:18:1","type":"","value":"0xffffffffffffffff"},"variables":[{"name":"_2","nodeType":"YulTypedName","src":"261:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"312:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"321:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"329:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"314:6:1"},"nodeType":"YulFunctionCall","src":"314:22:1"},"nodeType":"YulExpressionStatement","src":"314:22:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"300:6:1"},{"name":"_2","nodeType":"YulIdentifier","src":"308:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"297:2:1"},"nodeType":"YulFunctionCall","src":"297:14:1"},"nodeType":"YulIf","src":"294:2:1"},{"nodeType":"YulVariableDeclaration","src":"347:32:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"361:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"372:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"357:3:1"},"nodeType":"YulFunctionCall","src":"357:22:1"},"variables":[{"name":"_3","nodeType":"YulTypedName","src":"351:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"427:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"436:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"444:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"429:6:1"},"nodeType":"YulFunctionCall","src":"429:22:1"},"nodeType":"YulExpressionStatement","src":"429:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"406:2:1"},{"kind":"number","nodeType":"YulLiteral","src":"410:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"402:3:1"},"nodeType":"YulFunctionCall","src":"402:13:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"417:7:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"398:3:1"},"nodeType":"YulFunctionCall","src":"398:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"391:6:1"},"nodeType":"YulFunctionCall","src":"391:35:1"},"nodeType":"YulIf","src":"388:2:1"},{"nodeType":"YulVariableDeclaration","src":"462:30:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"489:2:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"476:12:1"},"nodeType":"YulFunctionCall","src":"476:16:1"},"variables":[{"name":"length","nodeType":"YulTypedName","src":"466:6:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"519:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"521:16:1"},"nodeType":"YulFunctionCall","src":"521:18:1"},"nodeType":"YulExpressionStatement","src":"521:18:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"507:6:1"},{"name":"_2","nodeType":"YulIdentifier","src":"515:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"504:2:1"},"nodeType":"YulFunctionCall","src":"504:14:1"},"nodeType":"YulIf","src":"501:2:1"},{"nodeType":"YulVariableDeclaration","src":"550:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"564:6:1"},{"name":"_1","nodeType":"YulIdentifier","src":"572:2:1"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"560:3:1"},"nodeType":"YulFunctionCall","src":"560:15:1"},"variables":[{"name":"_4","nodeType":"YulTypedName","src":"554:2:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"584:38:1","value":{"arguments":[{"arguments":[{"name":"_4","nodeType":"YulIdentifier","src":"614:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"618:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"610:3:1"},"nodeType":"YulFunctionCall","src":"610:11:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"595:14:1"},"nodeType":"YulFunctionCall","src":"595:27:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"588:3:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"631:16:1","value":{"name":"dst","nodeType":"YulIdentifier","src":"644:3:1"},"variables":[{"name":"dst_1","nodeType":"YulTypedName","src":"635:5:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"663:3:1"},{"name":"length","nodeType":"YulIdentifier","src":"668:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"656:6:1"},"nodeType":"YulFunctionCall","src":"656:19:1"},"nodeType":"YulExpressionStatement","src":"656:19:1"},{"nodeType":"YulAssignment","src":"684:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"695:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"700:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"691:3:1"},"nodeType":"YulFunctionCall","src":"691:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"684:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"712:22:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"727:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"731:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"723:3:1"},"nodeType":"YulFunctionCall","src":"723:11:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"716:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"780:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"789:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"797:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"782:6:1"},"nodeType":"YulFunctionCall","src":"782:22:1"},"nodeType":"YulExpressionStatement","src":"782:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"757:2:1"},{"name":"_4","nodeType":"YulIdentifier","src":"761:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"753:3:1"},"nodeType":"YulFunctionCall","src":"753:11:1"},{"name":"_1","nodeType":"YulIdentifier","src":"766:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"749:3:1"},"nodeType":"YulFunctionCall","src":"749:20:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"771:7:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"746:2:1"},"nodeType":"YulFunctionCall","src":"746:33:1"},"nodeType":"YulIf","src":"743:2:1"},{"nodeType":"YulVariableDeclaration","src":"815:15:1","value":{"name":"value0","nodeType":"YulIdentifier","src":"824:6:1"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"819:1:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"888:118:1","statements":[{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"909:3:1"},{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"927:3:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"914:12:1"},"nodeType":"YulFunctionCall","src":"914:17:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"902:6:1"},"nodeType":"YulFunctionCall","src":"902:30:1"},"nodeType":"YulExpressionStatement","src":"902:30:1"},{"nodeType":"YulAssignment","src":"945:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"956:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"961:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"952:3:1"},"nodeType":"YulFunctionCall","src":"952:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"945:3:1"}]},{"nodeType":"YulAssignment","src":"977:19:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"988:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"993:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"984:3:1"},"nodeType":"YulFunctionCall","src":"984:12:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"977:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"850:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"853:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"847:2:1"},"nodeType":"YulFunctionCall","src":"847:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"861:18:1","statements":[{"nodeType":"YulAssignment","src":"863:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"872:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"875:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"868:3:1"},"nodeType":"YulFunctionCall","src":"868:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"863:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"843:3:1","statements":[]},"src":"839:167:1"},{"nodeType":"YulAssignment","src":"1015:15:1","value":{"name":"dst_1","nodeType":"YulIdentifier","src":"1025:5:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1015:6:1"}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"75:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"86:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"98:6:1","type":""}],"src":"14:1022:1"},{"body":{"nodeType":"YulBlock","src":"1142:76:1","statements":[{"nodeType":"YulAssignment","src":"1152:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1164:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1175:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1160:3:1"},"nodeType":"YulFunctionCall","src":"1160:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1152:4:1"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1194:9:1"},{"name":"value0","nodeType":"YulIdentifier","src":"1205:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1187:6:1"},"nodeType":"YulFunctionCall","src":"1187:25:1"},"nodeType":"YulExpressionStatement","src":"1187:25:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1111:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1122:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1133:4:1","type":""}],"src":"1041:177:1"},{"body":{"nodeType":"YulBlock","src":"1267:207:1","statements":[{"nodeType":"YulAssignment","src":"1277:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1293:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1287:5:1"},"nodeType":"YulFunctionCall","src":"1287:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1277:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1305:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1327:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1335:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1323:3:1"},"nodeType":"YulFunctionCall","src":"1323:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1309:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1415:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"1417:16:1"},"nodeType":"YulFunctionCall","src":"1417:18:1"},"nodeType":"YulExpressionStatement","src":"1417:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1358:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"1370:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1355:2:1"},"nodeType":"YulFunctionCall","src":"1355:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1394:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"1406:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"1391:2:1"},"nodeType":"YulFunctionCall","src":"1391:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"1352:2:1"},"nodeType":"YulFunctionCall","src":"1352:62:1"},"nodeType":"YulIf","src":"1349:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1453:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1457:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1446:6:1"},"nodeType":"YulFunctionCall","src":"1446:22:1"},"nodeType":"YulExpressionStatement","src":"1446:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1247:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1256:6:1","type":""}],"src":"1223:251:1"},{"body":{"nodeType":"YulBlock","src":"1511:95:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1528:1:1","type":"","value":"0"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1535:3:1","type":"","value":"224"},{"kind":"number","nodeType":"YulLiteral","src":"1540:10:1","type":"","value":"0x4e487b71"}],"functionName":{"name":"shl","nodeType":"YulIdentifier","src":"1531:3:1"},"nodeType":"YulFunctionCall","src":"1531:20:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1521:6:1"},"nodeType":"YulFunctionCall","src":"1521:31:1"},"nodeType":"YulExpressionStatement","src":"1521:31:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1568:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"1571:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1561:6:1"},"nodeType":"YulFunctionCall","src":"1561:15:1"},"nodeType":"YulExpressionStatement","src":"1561:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1592:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1595:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1585:6:1"},"nodeType":"YulFunctionCall","src":"1585:15:1"},"nodeType":"YulExpressionStatement","src":"1585:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"1479:127:1"}]},"contents":"{ +{"contracts":{"a.sol":{"A":{"evm":{"bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[{"ast":{"nodeType":"YulBlock","src":"0:1608:1","statements":[{"nodeType":"YulBlock","src":"6:3:1","statements":[]},{"body":{"nodeType":"YulBlock","src":"109:927:1","statements":[{"nodeType":"YulVariableDeclaration","src":"119:12:1","value":{"kind":"number","nodeType":"YulLiteral","src":"129:2:1","type":"","value":"32"},"variables":[{"name":"_1","nodeType":"YulTypedName","src":"123:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"176:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"185:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"193:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"178:6:1"},"nodeType":"YulFunctionCall","src":"178:22:1"},"nodeType":"YulExpressionStatement","src":"178:22:1"}]},"condition":{"arguments":[{"arguments":[{"name":"dataEnd","nodeType":"YulIdentifier","src":"151:7:1"},{"name":"headStart","nodeType":"YulIdentifier","src":"160:9:1"}],"functionName":{"name":"sub","nodeType":"YulIdentifier","src":"147:3:1"},"nodeType":"YulFunctionCall","src":"147:23:1"},{"name":"_1","nodeType":"YulIdentifier","src":"172:2:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"143:3:1"},"nodeType":"YulFunctionCall","src":"143:32:1"},"nodeType":"YulIf","src":"140:2:1"},{"nodeType":"YulVariableDeclaration","src":"211:37:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"238:9:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"225:12:1"},"nodeType":"YulFunctionCall","src":"225:23:1"},"variables":[{"name":"offset","nodeType":"YulTypedName","src":"215:6:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"257:28:1","value":{"kind":"number","nodeType":"YulLiteral","src":"267:18:1","type":"","value":"0xffffffffffffffff"},"variables":[{"name":"_2","nodeType":"YulTypedName","src":"261:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"312:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"321:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"329:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"314:6:1"},"nodeType":"YulFunctionCall","src":"314:22:1"},"nodeType":"YulExpressionStatement","src":"314:22:1"}]},"condition":{"arguments":[{"name":"offset","nodeType":"YulIdentifier","src":"300:6:1"},{"name":"_2","nodeType":"YulIdentifier","src":"308:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"297:2:1"},"nodeType":"YulFunctionCall","src":"297:14:1"},"nodeType":"YulIf","src":"294:2:1"},{"nodeType":"YulVariableDeclaration","src":"347:32:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"361:9:1"},{"name":"offset","nodeType":"YulIdentifier","src":"372:6:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"357:3:1"},"nodeType":"YulFunctionCall","src":"357:22:1"},"variables":[{"name":"_3","nodeType":"YulTypedName","src":"351:2:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"427:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"436:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"444:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"429:6:1"},"nodeType":"YulFunctionCall","src":"429:22:1"},"nodeType":"YulExpressionStatement","src":"429:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"406:2:1"},{"kind":"number","nodeType":"YulLiteral","src":"410:4:1","type":"","value":"0x1f"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"402:3:1"},"nodeType":"YulFunctionCall","src":"402:13:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"417:7:1"}],"functionName":{"name":"slt","nodeType":"YulIdentifier","src":"398:3:1"},"nodeType":"YulFunctionCall","src":"398:27:1"}],"functionName":{"name":"iszero","nodeType":"YulIdentifier","src":"391:6:1"},"nodeType":"YulFunctionCall","src":"391:35:1"},"nodeType":"YulIf","src":"388:2:1"},{"nodeType":"YulVariableDeclaration","src":"462:30:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"489:2:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"476:12:1"},"nodeType":"YulFunctionCall","src":"476:16:1"},"variables":[{"name":"length","nodeType":"YulTypedName","src":"466:6:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"519:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"521:16:1"},"nodeType":"YulFunctionCall","src":"521:18:1"},"nodeType":"YulExpressionStatement","src":"521:18:1"}]},"condition":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"507:6:1"},{"name":"_2","nodeType":"YulIdentifier","src":"515:2:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"504:2:1"},"nodeType":"YulFunctionCall","src":"504:14:1"},"nodeType":"YulIf","src":"501:2:1"},{"nodeType":"YulVariableDeclaration","src":"550:25:1","value":{"arguments":[{"name":"length","nodeType":"YulIdentifier","src":"564:6:1"},{"name":"_1","nodeType":"YulIdentifier","src":"572:2:1"}],"functionName":{"name":"mul","nodeType":"YulIdentifier","src":"560:3:1"},"nodeType":"YulFunctionCall","src":"560:15:1"},"variables":[{"name":"_4","nodeType":"YulTypedName","src":"554:2:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"584:38:1","value":{"arguments":[{"arguments":[{"name":"_4","nodeType":"YulIdentifier","src":"614:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"618:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"610:3:1"},"nodeType":"YulFunctionCall","src":"610:11:1"}],"functionName":{"name":"allocateMemory","nodeType":"YulIdentifier","src":"595:14:1"},"nodeType":"YulFunctionCall","src":"595:27:1"},"variables":[{"name":"dst","nodeType":"YulTypedName","src":"588:3:1","type":""}]},{"nodeType":"YulVariableDeclaration","src":"631:16:1","value":{"name":"dst","nodeType":"YulIdentifier","src":"644:3:1"},"variables":[{"name":"dst_1","nodeType":"YulTypedName","src":"635:5:1","type":""}]},{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"663:3:1"},{"name":"length","nodeType":"YulIdentifier","src":"668:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"656:6:1"},"nodeType":"YulFunctionCall","src":"656:19:1"},"nodeType":"YulExpressionStatement","src":"656:19:1"},{"nodeType":"YulAssignment","src":"684:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"695:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"700:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"691:3:1"},"nodeType":"YulFunctionCall","src":"691:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"684:3:1"}]},{"nodeType":"YulVariableDeclaration","src":"712:22:1","value":{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"727:2:1"},{"name":"_1","nodeType":"YulIdentifier","src":"731:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"723:3:1"},"nodeType":"YulFunctionCall","src":"723:11:1"},"variables":[{"name":"src","nodeType":"YulTypedName","src":"716:3:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"780:26:1","statements":[{"expression":{"arguments":[{"name":"value0","nodeType":"YulIdentifier","src":"789:6:1"},{"name":"value0","nodeType":"YulIdentifier","src":"797:6:1"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"782:6:1"},"nodeType":"YulFunctionCall","src":"782:22:1"},"nodeType":"YulExpressionStatement","src":"782:22:1"}]},"condition":{"arguments":[{"arguments":[{"arguments":[{"name":"_3","nodeType":"YulIdentifier","src":"757:2:1"},{"name":"_4","nodeType":"YulIdentifier","src":"761:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"753:3:1"},"nodeType":"YulFunctionCall","src":"753:11:1"},{"name":"_1","nodeType":"YulIdentifier","src":"766:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"749:3:1"},"nodeType":"YulFunctionCall","src":"749:20:1"},{"name":"dataEnd","nodeType":"YulIdentifier","src":"771:7:1"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"746:2:1"},"nodeType":"YulFunctionCall","src":"746:33:1"},"nodeType":"YulIf","src":"743:2:1"},{"nodeType":"YulVariableDeclaration","src":"815:15:1","value":{"name":"value0","nodeType":"YulIdentifier","src":"824:6:1"},"variables":[{"name":"i","nodeType":"YulTypedName","src":"819:1:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"888:118:1","statements":[{"expression":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"909:3:1"},{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"927:3:1"}],"functionName":{"name":"calldataload","nodeType":"YulIdentifier","src":"914:12:1"},"nodeType":"YulFunctionCall","src":"914:17:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"902:6:1"},"nodeType":"YulFunctionCall","src":"902:30:1"},"nodeType":"YulExpressionStatement","src":"902:30:1"},{"nodeType":"YulAssignment","src":"945:19:1","value":{"arguments":[{"name":"dst","nodeType":"YulIdentifier","src":"956:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"961:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"952:3:1"},"nodeType":"YulFunctionCall","src":"952:12:1"},"variableNames":[{"name":"dst","nodeType":"YulIdentifier","src":"945:3:1"}]},{"nodeType":"YulAssignment","src":"977:19:1","value":{"arguments":[{"name":"src","nodeType":"YulIdentifier","src":"988:3:1"},{"name":"_1","nodeType":"YulIdentifier","src":"993:2:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"984:3:1"},"nodeType":"YulFunctionCall","src":"984:12:1"},"variableNames":[{"name":"src","nodeType":"YulIdentifier","src":"977:3:1"}]}]},"condition":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"850:1:1"},{"name":"length","nodeType":"YulIdentifier","src":"853:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"847:2:1"},"nodeType":"YulFunctionCall","src":"847:13:1"},"nodeType":"YulForLoop","post":{"nodeType":"YulBlock","src":"861:18:1","statements":[{"nodeType":"YulAssignment","src":"863:14:1","value":{"arguments":[{"name":"i","nodeType":"YulIdentifier","src":"872:1:1"},{"kind":"number","nodeType":"YulLiteral","src":"875:1:1","type":"","value":"1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"868:3:1"},"nodeType":"YulFunctionCall","src":"868:9:1"},"variableNames":[{"name":"i","nodeType":"YulIdentifier","src":"863:1:1"}]}]},"pre":{"nodeType":"YulBlock","src":"843:3:1","statements":[]},"src":"839:167:1"},{"nodeType":"YulAssignment","src":"1015:15:1","value":{"name":"dst_1","nodeType":"YulIdentifier","src":"1025:5:1"},"variableNames":[{"name":"value0","nodeType":"YulIdentifier","src":"1015:6:1"}]}]},"name":"abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"75:9:1","type":""},{"name":"dataEnd","nodeType":"YulTypedName","src":"86:7:1","type":""}],"returnVariables":[{"name":"value0","nodeType":"YulTypedName","src":"98:6:1","type":""}],"src":"14:1022:1"},{"body":{"nodeType":"YulBlock","src":"1142:76:1","statements":[{"nodeType":"YulAssignment","src":"1152:26:1","value":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1164:9:1"},{"kind":"number","nodeType":"YulLiteral","src":"1175:2:1","type":"","value":"32"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1160:3:1"},"nodeType":"YulFunctionCall","src":"1160:18:1"},"variableNames":[{"name":"tail","nodeType":"YulIdentifier","src":"1152:4:1"}]},{"expression":{"arguments":[{"name":"headStart","nodeType":"YulIdentifier","src":"1194:9:1"},{"name":"value0","nodeType":"YulIdentifier","src":"1205:6:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1187:6:1"},"nodeType":"YulFunctionCall","src":"1187:25:1"},"nodeType":"YulExpressionStatement","src":"1187:25:1"}]},"name":"abi_encode_tuple_t_uint256__to_t_uint256__fromStack_reversed","nodeType":"YulFunctionDefinition","parameters":[{"name":"headStart","nodeType":"YulTypedName","src":"1111:9:1","type":""},{"name":"value0","nodeType":"YulTypedName","src":"1122:6:1","type":""}],"returnVariables":[{"name":"tail","nodeType":"YulTypedName","src":"1133:4:1","type":""}],"src":"1041:177:1"},{"body":{"nodeType":"YulBlock","src":"1267:207:1","statements":[{"nodeType":"YulAssignment","src":"1277:19:1","value":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1293:2:1","type":"","value":"64"}],"functionName":{"name":"mload","nodeType":"YulIdentifier","src":"1287:5:1"},"nodeType":"YulFunctionCall","src":"1287:9:1"},"variableNames":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1277:6:1"}]},{"nodeType":"YulVariableDeclaration","src":"1305:35:1","value":{"arguments":[{"name":"memPtr","nodeType":"YulIdentifier","src":"1327:6:1"},{"name":"size","nodeType":"YulIdentifier","src":"1335:4:1"}],"functionName":{"name":"add","nodeType":"YulIdentifier","src":"1323:3:1"},"nodeType":"YulFunctionCall","src":"1323:17:1"},"variables":[{"name":"newFreePtr","nodeType":"YulTypedName","src":"1309:10:1","type":""}]},{"body":{"nodeType":"YulBlock","src":"1415:22:1","statements":[{"expression":{"arguments":[],"functionName":{"name":"panic_error_0x41","nodeType":"YulIdentifier","src":"1417:16:1"},"nodeType":"YulFunctionCall","src":"1417:18:1"},"nodeType":"YulExpressionStatement","src":"1417:18:1"}]},"condition":{"arguments":[{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1358:10:1"},{"kind":"number","nodeType":"YulLiteral","src":"1370:18:1","type":"","value":"0xffffffffffffffff"}],"functionName":{"name":"gt","nodeType":"YulIdentifier","src":"1355:2:1"},"nodeType":"YulFunctionCall","src":"1355:34:1"},{"arguments":[{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1394:10:1"},{"name":"memPtr","nodeType":"YulIdentifier","src":"1406:6:1"}],"functionName":{"name":"lt","nodeType":"YulIdentifier","src":"1391:2:1"},"nodeType":"YulFunctionCall","src":"1391:22:1"}],"functionName":{"name":"or","nodeType":"YulIdentifier","src":"1352:2:1"},"nodeType":"YulFunctionCall","src":"1352:62:1"},"nodeType":"YulIf","src":"1349:2:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1453:2:1","type":"","value":"64"},{"name":"newFreePtr","nodeType":"YulIdentifier","src":"1457:10:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1446:6:1"},"nodeType":"YulFunctionCall","src":"1446:22:1"},"nodeType":"YulExpressionStatement","src":"1446:22:1"}]},"name":"allocateMemory","nodeType":"YulFunctionDefinition","parameters":[{"name":"size","nodeType":"YulTypedName","src":"1247:4:1","type":""}],"returnVariables":[{"name":"memPtr","nodeType":"YulTypedName","src":"1256:6:1","type":""}],"src":"1223:251:1"},{"body":{"nodeType":"YulBlock","src":"1511:95:1","statements":[{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1528:1:1","type":"","value":"0"},{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1535:3:1","type":"","value":"224"},{"kind":"number","nodeType":"YulLiteral","src":"1540:10:1","type":"","value":"0x4e487b71"}],"functionName":{"name":"shl","nodeType":"YulIdentifier","src":"1531:3:1"},"nodeType":"YulFunctionCall","src":"1531:20:1"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1521:6:1"},"nodeType":"YulFunctionCall","src":"1521:31:1"},"nodeType":"YulExpressionStatement","src":"1521:31:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1568:1:1","type":"","value":"4"},{"kind":"number","nodeType":"YulLiteral","src":"1571:4:1","type":"","value":"0x41"}],"functionName":{"name":"mstore","nodeType":"YulIdentifier","src":"1561:6:1"},"nodeType":"YulFunctionCall","src":"1561:15:1"},"nodeType":"YulExpressionStatement","src":"1561:15:1"},{"expression":{"arguments":[{"kind":"number","nodeType":"YulLiteral","src":"1592:1:1","type":"","value":"0"},{"kind":"number","nodeType":"YulLiteral","src":"1595:4:1","type":"","value":"0x24"}],"functionName":{"name":"revert","nodeType":"YulIdentifier","src":"1585:6:1"},"nodeType":"YulFunctionCall","src":"1585:15:1"},"nodeType":"YulExpressionStatement","src":"1585:15:1"}]},"name":"panic_error_0x41","nodeType":"YulFunctionDefinition","src":"1479:127:1"}]},"contents":"{ { } function abi_decode_tuple_t_array$_t_uint256_$dyn_memory_ptr(headStart, dataEnd) -> value0 { @@ -45,5 +45,5 @@ mstore(4, 0x41) revert(0, 0x24) } -}","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;130:7:0;;83:59::o;14:1022:1:-;;129:2;172;160:9;151:7;147:23;143:32;140:2;;;193:6;185;178:22;140:2;238:9;225:23;267:18;308:2;300:6;297:14;294:2;;;329:6;321;314:22;294:2;372:6;361:9;357:22;347:32;;417:7;410:4;406:2;402:13;398:27;388:2;;444:6;436;429:22;388:2;489;476:16;515:2;507:6;504:14;501:2;;;521:18;;:::i;:::-;572:2;564:6;560:15;550:25;;595:27;618:2;614;610:11;595:27;:::i;:::-;656:19;;;691:12;;;;723:11;;;753;;;749:20;;746:33;-1:-1:-1;743:2:1;;;797:6;789;782:22;743:2;824:6;815:15;;839:167;853:6;850:1;847:13;839:167;;;914:17;;902:30;;875:1;868:9;;;;;952:12;;;;984;;839:167;;;-1:-1:-1;1025:5:1;109:927;-1:-1:-1;;;;;;;;109:927:1:o;1041:177::-;1187:25;;;1175:2;1160:18;;1142:76::o;1223:251::-;1293:2;1287:9;1323:17;;;1370:18;1355:34;;1391:22;;;1352:62;1349:2;;;1417:18;;:::i;:::-;1453:2;1446:22;1267:207;;-1:-1:-1;1267:207:1:o;1479:127::-;1540:10;1535:3;1531:20;1528:1;1521:31;1571:4;1568:1;1561:15;1595:4;1592:1;1585:15"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! +}","id":1,"language":"Yul","name":"#utility.yul"}],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":"70:74:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83:59;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;130:7:0;;83:59::o;14:1022:1:-;;129:2;172;160:9;151:7;147:23;143:32;140:2;;;193:6;185;178:22;140:2;238:9;225:23;267:18;308:2;300:6;297:14;294:2;;;329:6;321;314:22;294:2;372:6;361:9;357:22;347:32;;417:7;410:4;406:2;402:13;398:27;388:2;;444:6;436;429:22;388:2;489;476:16;515:2;507:6;504:14;501:2;;;521:18;;:::i;:::-;572:2;564:6;560:15;550:25;;595:27;618:2;614;610:11;595:27;:::i;:::-;656:19;;;691:12;;;;723:11;;;753;;;749:20;;746:33;-1:-1:-1;743:2:1;;;797:6;789;782:22;743:2;824:6;815:15;;839:167;853:6;850:1;847:13;839:167;;;914:17;;902:30;;875:1;868:9;;;;;952:12;;;;984;;839:167;;;-1:-1:-1;1025:5:1;109:927;-1:-1:-1;;;;;;;;109:927:1:o;1041:177::-;1187:25;;;1175:2;1160:18;;1142:76::o;1223:251::-;1293:2;1287:9;1323:17;;;1370:18;1355:34;;1391:22;;;1352:62;1349:2;;;1417:18;;:::i;:::-;1453:2;1446:22;1267:207;;-1:-1:-1;1267:207:1:o;1479:127::-;1540:10;1535:3;1531:20;1528:1;1521:31;1571:4;1568:1;1561:15;1595:4;1592:1;1585:15"}}}}},"errors":[{"component":"general","errorCode":"3420","formattedMessage":"a.sol: Warning: Source file does not specify required compiler version! ","message":"Source file does not specify required compiler version!","severity":"warning","sourceLocation":{"end":-1,"file":"a.sol","start":-1},"type":"Warning"}],"sources":{"a.sol":{"id":0}}} diff --git a/test/cmdlineTests/standard_yul/output.json b/test/cmdlineTests/standard_yul/output.json index 3b048f04e..e6c6e1390 100644 --- a/test/cmdlineTests/standard_yul/output.json +++ b/test/cmdlineTests/standard_yul/output.json @@ -14,7 +14,7 @@ sstore /* \"A\":0:42 */ pop -","bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}},"ir":"object \"object\" { +","bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}},"ir":"object \"object\" { code { let x := mload(0) sstore(add(x, 0), 0) diff --git a/test/cmdlineTests/standard_yul_object/output.json b/test/cmdlineTests/standard_yul_object/output.json index 4e770527b..d4dcb7acd 100644 --- a/test/cmdlineTests/standard_yul_object/output.json +++ b/test/cmdlineTests/standard_yul_object/output.json @@ -13,7 +13,7 @@ pop stop data_4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 616263 -","bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}},"ir":"object \"NamedObject\" { +","bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}},"ir":"object \"NamedObject\" { code { let x := dataoffset(\"DataName\") sstore(add(x, 0), 0) diff --git a/test/cmdlineTests/standard_yul_object_name/output.json b/test/cmdlineTests/standard_yul_object_name/output.json index e23e4a7af..0abd732e4 100644 --- a/test/cmdlineTests/standard_yul_object_name/output.json +++ b/test/cmdlineTests/standard_yul_object_name/output.json @@ -22,7 +22,7 @@ sub_0: assembly { /* \"A\":137:149 */ revert } -","bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"},"deployedBytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}},"ir":"object \"NamedObject\" { +","bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}},"ir":"object \"NamedObject\" { code { let x := dataoffset(\"DataName\") sstore(add(x, 0), 0) diff --git a/test/cmdlineTests/standard_yul_optimiserSteps/output.json b/test/cmdlineTests/standard_yul_optimiserSteps/output.json index 6a1ac3d40..536ee0047 100644 --- a/test/cmdlineTests/standard_yul_optimiserSteps/output.json +++ b/test/cmdlineTests/standard_yul_optimiserSteps/output.json @@ -13,7 +13,7 @@ /* \"A\":20:40 */ sstore pop -","bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}},"ir":"object \"object\" { +","bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}},"ir":"object \"object\" { code { let x := mload(0) sstore(add(x, 0), 0) diff --git a/test/cmdlineTests/standard_yul_optimized/output.json b/test/cmdlineTests/standard_yul_optimized/output.json index 962d92a32..758904e93 100644 --- a/test/cmdlineTests/standard_yul_optimized/output.json +++ b/test/cmdlineTests/standard_yul_optimized/output.json @@ -5,7 +5,7 @@ mload /* \"A\":20:40 */ sstore -","bytecode":{"generatedSources":[],"linkReferences":{},"object":"bytecode removed","opcodes":"opcodes removed","sourceMap":"sourceMap removed"}},"ir":"object \"object\" { +","bytecode":{"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""}},"ir":"object \"object\" { code { let x := mload(0) sstore(add(x, 0), 0) diff --git a/test/cmdlineTests/yul_unimplemented/err b/test/cmdlineTests/yul_unimplemented/err index d4b9fe68d..908cf4411 100644 --- a/test/cmdlineTests/yul_unimplemented/err +++ b/test/cmdlineTests/yul_unimplemented/err @@ -1,4 +1,4 @@ -Error (1834): Unimplemented feature error: Copying from storage to storage is not yet implemented. in FILENAME REMOVED +Error (1834): Unimplemented feature error: Copying from storage to storage is not yet implemented. in --> yul_unimplemented/input.sol:7:9: | 7 | a = b; diff --git a/test/libsolidity/SolidityExecutionFramework.cpp b/test/libsolidity/SolidityExecutionFramework.cpp index 4a0745431..e61f1469e 100644 --- a/test/libsolidity/SolidityExecutionFramework.cpp +++ b/test/libsolidity/SolidityExecutionFramework.cpp @@ -97,6 +97,7 @@ bytes SolidityExecutionFramework::multiSourceCompileContract( { asmStack.optimize(); obj = std::move(*asmStack.assemble(yul::AssemblyStack::Machine::EVM).bytecode); + obj.link(_libraryAddresses); break; } catch (...) diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_1.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_1.sol new file mode 100644 index 000000000..151ea9216 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_1.sol @@ -0,0 +1,24 @@ +pragma experimental SMTChecker; +contract C { + uint x; + modifier m(uint z) { + uint y = 3; + if (z == 10) + x = 2 + y; + _; + if (z == 10) + x = 4 + y; + } + function f() m(10) internal { + x = 3; + } + function g() public { + x = 0; + f(); + assert(x == 7); + // Fails + assert(x == 6); + } +} +// ---- +// Warning 6328: (359-373): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_2.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_2.sol new file mode 100644 index 000000000..e1c66050d --- /dev/null +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_2.sol @@ -0,0 +1,24 @@ +pragma experimental SMTChecker; +contract C { + uint x; + modifier m(uint z) { + uint y = 3; + if (z == 10) + x = 2 + y; + _; + if (z == 10) + x = 4 + y; + } + function f() m(10) m(12) internal { + x = 3; + } + function g() public { + x = 0; + f(); + assert(x == 3); + // Fails + assert(x == 6); + } +} +// ---- +// Warning 6328: (365-379): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_3.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_3.sol new file mode 100644 index 000000000..816ffc600 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_3.sol @@ -0,0 +1,24 @@ +pragma experimental SMTChecker; +contract C { + uint x; + modifier m(uint z) { + uint y = 3; + if (z == 10) + x = 2 + y; + _; + if (z == 10) + x = 4 + y; + } + function f() m(8) internal { + x = 3; + } + function g() public { + x = 0; + f(); + assert(x == 3); + // Fails + assert(x == 6); + } +} +// ---- +// Warning 6328: (358-372): CHC: Assertion violation happens here. diff --git a/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_4.sol b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_4.sol new file mode 100644 index 000000000..2817f16d2 --- /dev/null +++ b/test/libsolidity/smtCheckerTests/control_flow/branches_inside_modifiers_4.sol @@ -0,0 +1,24 @@ +pragma experimental SMTChecker; +contract C { + uint x; + modifier m(uint z) { + uint y = 3; + if (z >= 10) + x = 2 + y; + _; + if (z >= 10) + x = 4 + y; + } + function f() m(10) m(12) internal { + x = 3; + } + function g() public { + x = 0; + f(); + assert(x == 7); + // Fails + assert(x == 6); + } +} +// ---- +// Warning 6328: (365-379): CHC: Assertion violation happens here. diff --git a/test/libsolidity/util/BytesUtils.cpp b/test/libsolidity/util/BytesUtils.cpp index e3a6fd4ed..d8892a4a7 100644 --- a/test/libsolidity/util/BytesUtils.cpp +++ b/test/libsolidity/util/BytesUtils.cpp @@ -36,11 +36,9 @@ using namespace solidity; using namespace solidity::util; -using namespace solidity::langutil; using namespace solidity::frontend; using namespace solidity::frontend::test; using namespace std; -using namespace soltest; bytes BytesUtils::alignLeft(bytes _bytes) { diff --git a/test/libsolidity/util/ContractABIUtils.cpp b/test/libsolidity/util/ContractABIUtils.cpp index 520569907..70e20c185 100644 --- a/test/libsolidity/util/ContractABIUtils.cpp +++ b/test/libsolidity/util/ContractABIUtils.cpp @@ -41,7 +41,6 @@ using namespace solidity::util; using namespace solidity::langutil; using namespace solidity::frontend::test; using namespace std; -using namespace soltest; namespace { diff --git a/test/libsolidity/util/SoltestTypes.h b/test/libsolidity/util/SoltestTypes.h index 7558dbd7d..e0f6caa1f 100644 --- a/test/libsolidity/util/SoltestTypes.h +++ b/test/libsolidity/util/SoltestTypes.h @@ -16,7 +16,6 @@ #include #include -#include namespace solidity::frontend::test { diff --git a/test/libsolidity/util/TestFileParser.cpp b/test/libsolidity/util/TestFileParser.cpp index 11eef3767..675ba5f93 100644 --- a/test/libsolidity/util/TestFileParser.cpp +++ b/test/libsolidity/util/TestFileParser.cpp @@ -34,11 +34,11 @@ #include using namespace solidity; -using namespace solidity::langutil; using namespace solidity::frontend; using namespace solidity::frontend::test; using namespace std; -using namespace soltest; + +using Token = soltest::Token; char TestFileParser::Scanner::peek() const noexcept { @@ -158,7 +158,7 @@ vector TestFileParser::parseFunctionCall return calls; } -bool TestFileParser::accept(soltest::Token _token, bool const _expect) +bool TestFileParser::accept(Token _token, bool const _expect) { if (m_scanner.currentToken() != _token) return false; @@ -167,7 +167,7 @@ bool TestFileParser::accept(soltest::Token _token, bool const _expect) return true; } -bool TestFileParser::expect(soltest::Token _token, bool const _advance) +bool TestFileParser::expect(Token _token, bool const _advance) { if (m_scanner.currentToken() != _token || m_scanner.currentToken() == Token::Invalid) throw TestParserError( @@ -484,31 +484,31 @@ void TestFileParser::Scanner::readStream(istream& _stream) void TestFileParser::Scanner::scanNextToken() { - using namespace langutil; - // Make code coverage happy. assert(formatToken(Token::NUM_TOKENS) == ""); - auto detectKeyword = [](std::string const& _literal = "") -> TokenDesc { - if (_literal == "true") return TokenDesc{Token::Boolean, _literal}; - if (_literal == "false") return TokenDesc{Token::Boolean, _literal}; - if (_literal == "ether") return TokenDesc{Token::Ether, _literal}; - if (_literal == "wei") return TokenDesc{Token::Wei, _literal}; - if (_literal == "left") return TokenDesc{Token::Left, _literal}; - if (_literal == "library") return TokenDesc{Token::Library, _literal}; - if (_literal == "right") return TokenDesc{Token::Right, _literal}; - if (_literal == "hex") return TokenDesc{Token::Hex, _literal}; - if (_literal == "FAILURE") return TokenDesc{Token::Failure, _literal}; - if (_literal == "storage") return TokenDesc{Token::Storage, _literal}; - return TokenDesc{Token::Identifier, _literal}; + auto detectKeyword = [](std::string const& _literal = "") -> std::pair { + if (_literal == "true") return {Token::Boolean, "true"}; + if (_literal == "false") return {Token::Boolean, "false"}; + if (_literal == "ether") return {Token::Ether, ""}; + if (_literal == "wei") return {Token::Wei, ""}; + if (_literal == "left") return {Token::Left, ""}; + if (_literal == "library") return {Token::Library, ""}; + if (_literal == "right") return {Token::Right, ""}; + if (_literal == "hex") return {Token::Hex, ""}; + if (_literal == "FAILURE") return {Token::Failure, ""}; + if (_literal == "storage") return {Token::Storage, ""}; + return {Token::Identifier, _literal}; }; - auto selectToken = [this](Token _token, std::optional _literal = std::nullopt) -> TokenDesc { + auto selectToken = [this](Token _token, std::string const& _literal = "") { advance(); - return make_pair(_token, _literal.has_value() ? *_literal : formatToken(_token)); + m_currentToken = _token; + m_currentLiteral = _literal; }; - TokenDesc token = make_pair(Token::Unknown, ""); + m_currentToken = Token::Unknown; + m_currentLiteral = ""; do { switch(current()) @@ -516,71 +516,73 @@ void TestFileParser::Scanner::scanNextToken() case '/': advance(); if (current() == '/') - token = selectToken(Token::Newline); + selectToken(Token::Newline); else - token = selectToken(Token::Invalid); + selectToken(Token::Invalid); break; case '-': if (peek() == '>') { advance(); - token = selectToken(Token::Arrow); + selectToken(Token::Arrow); } else - token = selectToken(Token::Sub); + selectToken(Token::Sub); break; case ':': - token = selectToken(Token::Colon); + selectToken(Token::Colon); break; case '#': - token = selectToken(Token::Comment, scanComment()); + selectToken(Token::Comment, scanComment()); break; case ',': - token = selectToken(Token::Comma); + selectToken(Token::Comma); break; case '(': - token = selectToken(Token::LParen); + selectToken(Token::LParen); break; case ')': - token = selectToken(Token::RParen); + selectToken(Token::RParen); break; case '[': - token = selectToken(Token::LBrack); + selectToken(Token::LBrack); break; case ']': - token = selectToken(Token::RBrack); + selectToken(Token::RBrack); break; case '\"': - token = selectToken(Token::String, scanString()); + selectToken(Token::String, scanString()); break; default: - if (isIdentifierStart(current())) + if (langutil::isIdentifierStart(current())) { - TokenDesc detectedToken = detectKeyword(scanIdentifierOrKeyword()); - token = selectToken(detectedToken.first, detectedToken.second); + std::tie(m_currentToken, m_currentLiteral) = detectKeyword(scanIdentifierOrKeyword()); + advance(); } - else if (isDecimalDigit(current())) + else if (langutil::isDecimalDigit(current())) { if (current() == '0' && peek() == 'x') { advance(); advance(); - token = selectToken(Token::HexNumber, "0x" + scanHexNumber()); + selectToken(Token::HexNumber, "0x" + scanHexNumber()); } else - token = selectToken(Token::Number, scanDecimalNumber()); + selectToken(Token::Number, scanDecimalNumber()); } - else if (isWhiteSpace(current())) - token = selectToken(Token::Whitespace); + else if (langutil::isWhiteSpace(current())) + selectToken(Token::Whitespace); else if (isEndOfLine()) - token = make_pair(Token::EOS, "EOS"); + { + m_currentToken = Token::EOS; + m_currentLiteral = ""; + } else throw TestParserError("Unexpected character: '" + string{current()} + "'"); break; } } - while (token.first == Token::Whitespace); - m_currentToken = token; + while (m_currentToken == Token::Whitespace); } string TestFileParser::Scanner::scanComment() diff --git a/test/libsolidity/util/TestFileParser.h b/test/libsolidity/util/TestFileParser.h index 8178c721d..63a95dd4a 100644 --- a/test/libsolidity/util/TestFileParser.h +++ b/test/libsolidity/util/TestFileParser.h @@ -15,7 +15,6 @@ #pragma once #include -#include #include #include @@ -64,7 +63,6 @@ public: std::vector parseFunctionCalls(std::size_t _lineOffset); private: - using Token = soltest::Token; /** * Token scanner that is used internally to abstract away character traversal. */ @@ -81,8 +79,8 @@ private: /// Reads character stream and creates token. void scanNextToken(); - soltest::Token currentToken() { return m_currentToken.first; } - std::string currentLiteral() { return m_currentToken.second; } + soltest::Token currentToken() { return m_currentToken; } + std::string currentLiteral() { return m_currentLiteral; } std::string scanComment(); std::string scanIdentifierOrKeyword(); @@ -92,8 +90,6 @@ private: char scanHexPart(); private: - using TokenDesc = std::pair; - /// Advances current position in the input stream. void advance(unsigned n = 1) { @@ -120,7 +116,8 @@ private: std::string m_line; std::string::const_iterator m_char; - TokenDesc m_currentToken; + std::string m_currentLiteral; + soltest::Token m_currentToken = soltest::Token::Unknown; }; bool accept(soltest::Token _token, bool const _expect = false); diff --git a/test/libsolidity/util/TestFunctionCall.cpp b/test/libsolidity/util/TestFunctionCall.cpp index 3061b5f21..e13fccf09 100644 --- a/test/libsolidity/util/TestFunctionCall.cpp +++ b/test/libsolidity/util/TestFunctionCall.cpp @@ -30,6 +30,8 @@ using namespace solidity::util; using namespace solidity::frontend::test; using namespace std; +using Token = soltest::Token; + string TestFunctionCall::format( ErrorReporter& _errorReporter, string const& _linePrefix, @@ -37,9 +39,6 @@ string TestFunctionCall::format( bool const _highlight ) const { - using namespace soltest; - using Token = soltest::Token; - stringstream stream; bool highlight = !matchesExpectation() && _highlight; @@ -279,8 +278,6 @@ string TestFunctionCall::formatFailure( bool _highlight ) const { - using Token = soltest::Token; - stringstream os; os << formatToken(Token::Failure); diff --git a/test/libsolidity/util/TestFunctionCall.h b/test/libsolidity/util/TestFunctionCall.h index 6f21fc9eb..7daac093a 100644 --- a/test/libsolidity/util/TestFunctionCall.h +++ b/test/libsolidity/util/TestFunctionCall.h @@ -17,7 +17,6 @@ #include #include -#include #include #include #include