aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-09-15 18:42:44 +0800
committerchriseth <c@ethdev.com>2015-09-15 18:42:44 +0800
commit9de174ce2e8ec0952c6ea1113238299d82f14165 (patch)
tree72d9f1ba95be7062ef56862e9bbc8b95d8961db0
parent613ba2c3f1b3d26aa4adb5718215e1ececc190d3 (diff)
parentb55cc001801579f4a52b73b1422acad7c5cff779 (diff)
downloaddexon-solidity-9de174ce2e8ec0952c6ea1113238299d82f14165.tar.gz
dexon-solidity-9de174ce2e8ec0952c6ea1113238299d82f14165.tar.zst
dexon-solidity-9de174ce2e8ec0952c6ea1113238299d82f14165.zip
Merge pull request #75 from chriseth/exportRuntimeBytecodeForJson
Export runtime bytecode and version.
-rw-r--r--solc/jsonCompiler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp
index b7bb9fe7..d265ed9c 100644
--- a/solc/jsonCompiler.cpp
+++ b/solc/jsonCompiler.cpp
@@ -36,6 +36,7 @@
#include <libsolidity/CompilerStack.h>
#include <libsolidity/SourceReferenceFormatter.h>
#include <libsolidity/ASTJsonConverter.h>
+#include <libsolidity/Version.h>
using namespace std;
using namespace dev;
@@ -169,6 +170,7 @@ string compile(string _input, bool _optimize)
contractData["solidity_interface"] = compiler.solidityInterface(contractName);
contractData["interface"] = compiler.interface(contractName);
contractData["bytecode"] = compiler.object(contractName).toHex();
+ contractData["runtimeBytecode"] = compiler.runtimeObject(contractName).toHex();
contractData["opcodes"] = eth::disassemble(compiler.object(contractName).bytecode);
contractData["functionHashes"] = functionHashes(compiler.contractDefinition(contractName));
contractData["gasEstimates"] = estimateGas(compiler, contractName);
@@ -188,6 +190,10 @@ static string outputBuffer;
extern "C"
{
+extern char const* version()
+{
+ return VersionString.c_str();
+}
extern char const* compileJSON(char const* _input, bool _optimize)
{
outputBuffer = compile(_input, _optimize);