aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-03-30 05:00:38 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-04-21 02:38:00 +0800
commit63b6d0099f0a8c0aa8f4bd6e8f19c50f063630fd (patch)
tree684b7ca1ffb3e07356177c58442aa345485c39ff /libsolidity/interface
parentf25efceaf8d168118b2fa8641bd33611bd824d2d (diff)
downloaddexon-solidity-63b6d0099f0a8c0aa8f4bd6e8f19c50f063630fd.tar.gz
dexon-solidity-63b6d0099f0a8c0aa8f4bd6e8f19c50f063630fd.tar.zst
dexon-solidity-63b6d0099f0a8c0aa8f4bd6e8f19c50f063630fd.zip
Support methodIdentifiers
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/StandardCompiler.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index aa14d2b0..9e425d36 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -99,6 +99,14 @@ StringMap createSourceList(Json::Value const& _input)
return sources;
}
+Json::Value methodIdentifiers(ContractDefinition const& _contract)
+{
+ Json::Value methodIdentifiers(Json::objectValue);
+ for (auto const& it: _contract.interfaceFunctions())
+ methodIdentifiers[it.second->externalSignature()] = toHex(it.first.ref());
+ return methodIdentifiers;
+}
+
Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
{
m_compilerStack.reset(false);
@@ -259,7 +267,7 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
ostringstream unused;
evmData["legacyAssembly"] = m_compilerStack.streamAssembly(unused, contractName, createSourceList(_input), true);
evmData["opcodes"] = solidity::disassemble(m_compilerStack.object(contractName).bytecode);
- // @TODO: add methodIdentifiers
+ evmData["methodIdentifiers"] = methodIdentifiers(m_compilerStack.contractDefinition(contractName));
// @TODO: add gasEstimates
// EVM bytecode