aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerStack.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-08-01 01:23:31 +0800
committerchriseth <c@ethdev.com>2015-08-01 01:23:31 +0800
commit943fd623e16829ad93c05b60b44676485b989620 (patch)
tree2fb06c27db50f9f533261e424f1c531f6849d94d /CompilerStack.cpp
parentf2f1e0300793ea5686a4ad1c5c46b9e454c01bdc (diff)
downloaddexon-solidity-943fd623e16829ad93c05b60b44676485b989620.tar
dexon-solidity-943fd623e16829ad93c05b60b44676485b989620.tar.gz
dexon-solidity-943fd623e16829ad93c05b60b44676485b989620.tar.bz2
dexon-solidity-943fd623e16829ad93c05b60b44676485b989620.tar.lz
dexon-solidity-943fd623e16829ad93c05b60b44676485b989620.tar.xz
dexon-solidity-943fd623e16829ad93c05b60b44676485b989620.tar.zst
dexon-solidity-943fd623e16829ad93c05b60b44676485b989620.zip
Create and output clone contracts.
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r--CompilerStack.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index f056bb9b..a85738eb 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -166,7 +166,13 @@ void CompilerStack::compile(bool _optimize, unsigned _runs)
compiledContract.bytecode = compiler->getAssembledBytecode();
compiledContract.runtimeBytecode = compiler->getRuntimeBytecode();
compiledContract.compiler = move(compiler);
+ compiler = make_shared<Compiler>(_optimize, _runs);
+ compiler->compileContract(*contract, contractBytecode);
contractBytecode[compiledContract.contract] = &compiledContract.bytecode;
+
+ Compiler cloneCompiler(_optimize, _runs);
+ cloneCompiler.compileClone(*contract, contractBytecode);
+ compiledContract.cloneBytecode = cloneCompiler.getAssembledBytecode();
}
}
@@ -199,6 +205,11 @@ bytes const& CompilerStack::getRuntimeBytecode(string const& _contractName) cons
return getContract(_contractName).runtimeBytecode;
}
+bytes const& CompilerStack::getCloneBytecode(string const& _contractName) const
+{
+ return getContract(_contractName).cloneBytecode;
+}
+
dev::h256 CompilerStack::getContractCodeHash(string const& _contractName) const
{
return dev::sha3(getRuntimeBytecode(_contractName));