aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/Assembly.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-11-24 17:32:52 +0800
committerchriseth <c@ethdev.com>2016-12-01 23:03:59 +0800
commit91ecc4533dffbe67fa27adfaff27780ddf69c21a (patch)
tree665bbbe1a0396e56ade492c1a544b1eb1fb4310b /libevmasm/Assembly.h
parent36c6fe2b698b1a05cae954dcee5d9e0fcea85d05 (diff)
downloaddexon-solidity-91ecc4533dffbe67fa27adfaff27780ddf69c21a.tar.gz
dexon-solidity-91ecc4533dffbe67fa27adfaff27780ddf69c21a.tar.zst
dexon-solidity-91ecc4533dffbe67fa27adfaff27780ddf69c21a.zip
Add swarm hash to the end of the bytecode.
Diffstat (limited to 'libevmasm/Assembly.h')
-rw-r--r--libevmasm/Assembly.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h
index a5fd4d51..9e7f9f7b 100644
--- a/libevmasm/Assembly.h
+++ b/libevmasm/Assembly.h
@@ -71,6 +71,9 @@ public:
AssemblyItem appendJumpI(AssemblyItem const& _tag) { auto ret = append(_tag.pushTag()); append(solidity::Instruction::JUMPI); return ret; }
AssemblyItem errorTag() { return AssemblyItem(PushTag, 0); }
+ /// Appends @a _data literally to the very end of the bytecode.
+ void appendAuxiliaryDataToEnd(bytes const& _data) { m_auxiliaryData += _data; }
+
template <class T> Assembly& operator<<(T const& _d) { append(_d); return *this; }
AssemblyItems const& items() const { return m_items; }
AssemblyItem const& back() const { return m_items.back(); }
@@ -125,10 +128,12 @@ private:
Json::Value createJsonValue(std::string _name, int _begin, int _end, std::string _value = std::string(), std::string _jumpType = std::string()) const;
protected:
- // 0 is reserved for exception
+ /// 0 is reserved for exception
unsigned m_usedTags = 1;
AssemblyItems m_items;
std::map<h256, bytes> m_data;
+ /// Data that is appended to the very end of the contract.
+ bytes m_auxiliaryData;
std::vector<std::shared_ptr<Assembly>> m_subs;
std::map<h256, std::string> m_strings;
std::map<h256, std::string> m_libraries; ///< Identifiers of libraries to be linked.