diff options
Diffstat (limited to 'libsolidity/interface/StandardCompiler.cpp')
-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 |