diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-03-30 05:00:38 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-21 02:38:00 +0800 |
commit | 63b6d0099f0a8c0aa8f4bd6e8f19c50f063630fd (patch) | |
tree | 684b7ca1ffb3e07356177c58442aa345485c39ff /libsolidity/interface | |
parent | f25efceaf8d168118b2fa8641bd33611bd824d2d (diff) | |
download | dexon-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.cpp | 10 |
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 |