mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
ABI decoder.
This commit is contained in:
1 parent
7c69d88f93
commit
bdc1ff8ec7
7 files changed
+505
-4
No files matched your search
@@ -319,6 +319,23 @@ void CompilerUtils::abiEncodeV2(
|
||||
m_context << ret.tag();
|
||||
}
|
||||
|
||||
void CompilerUtils::abiDecodeV2(TypePointers const& _parameterTypes, bool _fromMemory)
|
||||
{
|
||||
// stack: <source_offset>
|
||||
auto ret = m_context.pushNewTag();
|
||||
m_context << Instruction::SWAP1;
|
||||
if (_fromMemory)
|
||||
// TODO pass correct size for the memory case
|
||||
m_context << (u256(1) << 63);
|
||||
else
|
||||
m_context << Instruction::CALLDATASIZE;
|
||||
m_context << Instruction::SWAP1;
|
||||
string decoderName = m_context.abiFunctions().tupleDecoder(_parameterTypes, _fromMemory);
|
||||
m_context.appendJumpTo(m_context.namedTag(decoderName));
|
||||
m_context.adjustStackOffset(int(sizeOnStack(_parameterTypes)) - 3);
|
||||
m_context << ret.tag();
|
||||
}
|
||||
|
||||
void CompilerUtils::zeroInitialiseMemoryArray(ArrayType const& _type)
|
||||
{
|
||||
auto repeat = m_context.newTag();
|
||||
|
||||
Reference in new issue
Block a user