Questions tagged [abiencoderv2]
The new ABI encoder is able to encode and decode arbitrarily nested arrays and structs. It produces less optimal code (the optimizer for this part of the code is still under development).
49 questions
2 votes
0 answers
40 views
Does EIP 712 used packed Solidity encoding or standard padded ABI encoding?
EIP 712 defines typed structured data hashing and signing. It is very well documented and also supplies basic test cases. I implemented it in Ruby. Now, here is a question. It seems the specification ...
1 vote
0 answers
73 views
Create Call Data for function input using Nethereum
I want to call it a smart contract function. I am signing the transaction using Metamask so I need to create call data for the transaction. I want to use Nethereum for creating the call data of the ...
2 votes
0 answers
116 views
How to really encode dynamicall length array of structs in Solidity ? Or how to use the Muliplex Feature of 0x?
I need to use the Multiplex Feature of 0x in order to perform a specific trade that perform a UniswapV3 call followed by a _FillOTCorder using the SelfBalance feature of the the Multiplex Feature. As ...
1 vote
1 answer
45 views
abi.decode() does not accept "address payable" as type
function myStatic() public returns (uint256[] memory, address payable[] memory, bytes32, string memory) { bytes memory encodedResult; bool success; (success, encodedResult) = address(...
0 votes
0 answers
68 views
Access imported contract's function on behalf of another contract using delegatecall
So I have two contracts. the firt one is a contract that imports a token import {testToken} from "./testToken.sol"; testToken public token; and has this functionality AddressUpgradeable....
1 vote
1 answer
118 views
The simplest way to return a list of items + gas limits on long lists when using pragma experimental ABIEncoderV2?
This question has two parts. I would like to return a list of items from my smart contract in a simple way, ideally a one-liner solution, something that I consume on the front-end. I tried some of the ...
1 vote
1 answer
1k views
How to encode a solidity struct in python?
I have in solidity: struct MyStruct { string data; address issuer; } function getHash(MyStruct calldata myStruct) public pure returns (bytes32) { return keccak256(abi.encode(myStruct)); } ...
1 vote
1 answer
805 views
How to decode ABI such that i get From, To, For in python
Currently my implementations of abi decode gets only token amount and not the From, To, address and token amount is without decimal point value = decode(['uint256'],log['data']) ouptput Token ...
3 votes
3 answers
527 views
How to decode a nested encodePacked?
The structure of the encoding is abi.encodePacked( abi.encodePacked( address, uint256, uint256, address, uint256, address, ...
2 votes
4 answers
615 views
How to batch list into a single bytes object?
Let's say I have a string list of parameters ["Example String", "vitalikbuterin", "1000"] How can I encode this list into a bytes object, and then decode the bytes to get ...
1 vote
0 answers
304 views
ABI-encoding in Nethereum of a struct that contains a bytes-array (variable size)
I have a custom struct defined in solidity. When calling the decode-function of the contract, I want to decode an encoded MyStruct (in bytes). This works perfectly as long as a previous defined ...
0 votes
1 answer
13 views
Can the Aragon SDK pass any encoded action abitrarily?
In the examples section of the SDK documentation, there are encoders for a bunch of common DAO operations. However I can't see an encoding for an arbitrary contract call in the examples. Does the SDK ...
2 votes
1 answer
2k views
How can I decode an array of structs that is encoded with arbitrary data?
I'm using calldata of abi.encode(123 , arrayOfStructs) and abi.decode(data[:32], (uint256)) to get 123. But I'm unable to get the array of structs with abi.decode(data[32:], (myStruct[])) On the other ...
1 vote
1 answer
99 views
Byte32 to uint and then back to byte32
I have to bitpack two uint128 values into a uint256, then get back the two original uint128s. To encode the values I'm using: function encode256(uint128 a, uint128 b) pure public returns (uint256) { ...
1 vote
1 answer
1k views
What is the difference between encodeWithSelector and encode?
I've been messing around with the abi.encode... functions and I think I have a good grasp of the differences, except abi.encode and abi.encodeWithSelector. Because, they give similar but slightly ...