aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-14 20:31:04 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-06-15 03:14:15 +0800
commit585b3ea3e3197e05349c13d24a3d99fba2fee887 (patch)
tree1913ad7bcb657024c8f5b35bae119198b89b9941
parent3273e865ecf5755f8f74d1db3e8bf283de1efe0d (diff)
downloaddexon-solidity-585b3ea3e3197e05349c13d24a3d99fba2fee887.tar
dexon-solidity-585b3ea3e3197e05349c13d24a3d99fba2fee887.tar.gz
dexon-solidity-585b3ea3e3197e05349c13d24a3d99fba2fee887.tar.bz2
dexon-solidity-585b3ea3e3197e05349c13d24a3d99fba2fee887.tar.lz
dexon-solidity-585b3ea3e3197e05349c13d24a3d99fba2fee887.tar.xz
dexon-solidity-585b3ea3e3197e05349c13d24a3d99fba2fee887.tar.zst
dexon-solidity-585b3ea3e3197e05349c13d24a3d99fba2fee887.zip
Print auxiliary data in the assembly
-rw-r--r--Changelog.md3
-rw-r--r--libevmasm/Assembly.cpp6
-rw-r--r--test/libsolidity/StandardCompiler.cpp3
3 files changed, 10 insertions, 2 deletions
diff --git a/Changelog.md b/Changelog.md
index 5315dc59..878a78df 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,8 +1,9 @@
### 0.4.12 (unreleased)
Features:
- * Assembly: renamed ``SHA3`` to ``KECCAK256``.
* Assembly: Add ``CREATE2`` (EIP86), ``RETURNDATASIZE`` and ``RETURNDATACOPY`` (EIP211) instructions.
+ * Assembly: Display auxiliary data in the assembly output.
+ * Assembly: Renamed ``SHA3`` to ``KECCAK256``.
* AST: export all attributes to JSON format.
* Inline Assembly: Present proper error message when not supplying enough arguments to a functional
instruction.
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 72571b56..f2a292b0 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -216,6 +216,9 @@ ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap con
}
}
+ if (m_auxiliaryData.size() > 0)
+ _out << endl << _prefix << "auxdata: 0x" << toHex(m_auxiliaryData) << endl;
+
return _out;
}
@@ -317,6 +320,9 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes
root[".data"] = data;
}
+ if (m_auxiliaryData.size() > 0)
+ root[".auxdata"] = toHex(m_auxiliaryData);
+
_out << root;
return root;
diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp
index 92bb471b..6dd64130 100644
--- a/test/libsolidity/StandardCompiler.cpp
+++ b/test/libsolidity/StandardCompiler.cpp
@@ -205,7 +205,8 @@ BOOST_AUTO_TEST_CASE(basic_compilation)
" /* \"fileA\":0:14 contract A { } */\n mstore(0x40, 0x60)\n jumpi(tag_1, iszero(callvalue))\n"
" invalid\ntag_1:\ntag_2:\n dataSize(sub_0)\n dup1\n dataOffset(sub_0)\n 0x0\n codecopy\n 0x0\n"
" return\nstop\n\nsub_0: assembly {\n /* \"fileA\":0:14 contract A { } */\n"
- " mstore(0x40, 0x60)\n tag_1:\n invalid\n}\n");
+ " mstore(0x40, 0x60)\n tag_1:\n invalid\n\n"
+ " auxdata: 0xa165627a7a72305820e4855da8c6a5e8a35933acba62e02f4842146bb9655b81cb06547caf8ea743b40029\n}\n");
BOOST_CHECK(contract["evm"]["gasEstimates"].isObject());
BOOST_CHECK(dev::jsonCompactPrint(contract["evm"]["gasEstimates"]) ==
"{\"creation\":{\"codeDepositCost\":\"10200\",\"executionCost\":\"62\",\"totalCost\":\"10262\"}}");