aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/codegen/ContractCompiler.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-09-01 19:59:21 +0800
committerchriseth <chris@ethereum.org>2017-11-30 00:08:44 +0800
commitbdc1ff8ec71bdf96e0706c951dd92def3aee4aa2 (patch)
treebcc4a52df3ea9487e56b1bd32f7fce881fb33970 /libsolidity/codegen/ContractCompiler.cpp
parent7c69d88f937324b64ed8825f9e611e417421434b (diff)
downloaddexon-solidity-bdc1ff8ec71bdf96e0706c951dd92def3aee4aa2.tar
dexon-solidity-bdc1ff8ec71bdf96e0706c951dd92def3aee4aa2.tar.gz
dexon-solidity-bdc1ff8ec71bdf96e0706c951dd92def3aee4aa2.tar.bz2
dexon-solidity-bdc1ff8ec71bdf96e0706c951dd92def3aee4aa2.tar.lz
dexon-solidity-bdc1ff8ec71bdf96e0706c951dd92def3aee4aa2.tar.xz
dexon-solidity-bdc1ff8ec71bdf96e0706c951dd92def3aee4aa2.tar.zst
dexon-solidity-bdc1ff8ec71bdf96e0706c951dd92def3aee4aa2.zip
ABI decoder.
Diffstat (limited to 'libsolidity/codegen/ContractCompiler.cpp')
-rw-r--r--libsolidity/codegen/ContractCompiler.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp
index 74565ae4..1ae44165 100644
--- a/libsolidity/codegen/ContractCompiler.cpp
+++ b/libsolidity/codegen/ContractCompiler.cpp
@@ -322,6 +322,15 @@ void ContractCompiler::appendCalldataUnpacker(TypePointers const& _typeParameter
{
// We do not check the calldata size, everything is zero-padded
+ if (m_context.experimentalFeatureActive(ExperimentalFeature::ABIEncoderV2))
+ {
+ // Use the new JULIA-based decoding function
+ auto stackHeightBefore = m_context.stackHeight();
+ CompilerUtils(m_context).abiDecodeV2(_typeParameters, _fromMemory);
+ solAssert(m_context.stackHeight() - stackHeightBefore == CompilerUtils(m_context).sizeOnStack(_typeParameters) - 1, "");
+ return;
+ }
+
//@todo this does not yet support nested dynamic arrays
// Retain the offset pointer as base_offset, the point from which the data offsets are computed.
@@ -892,6 +901,7 @@ void ContractCompiler::appendMissingFunctions()
}
m_context.appendMissingLowLevelFunctions();
string abiFunctions = m_context.abiFunctions().requestedFunctions();
+// cout << abiFunctions << endl;
if (!abiFunctions.empty())
m_context.appendInlineAssembly("{" + move(abiFunctions) + "}", {}, true);
}