ABI coder fails to process Vyper-generated tuples
See original GitHub issueEthers Version
5.4.0
Search Terms
tuple abi vyper
Describe the Problem
When using structs in external functions in the latest Vyper release (0.3.3), the resulting ABI causes ethers to error out when attempting to encode data for them.
I provide snippets for an example of a constructor that fails in such a way.
Code Snippet
struct MyStruct:
bar: address
baz: address
qux: int256
qyz: uint256
bazoo: uint256
ka: uint256
@external
def __init__(foo: MyStruct[10]):
Contract ABI
{
"stateMutability": "nonpayable",
"type": "constructor",
"inputs": [
{
"name": "foo",
"type": "(address,address,int256,uint256,uint256,uint256)[10]"
},
],
"outputs": []
}
Errors
Error: invalid type (argument="type", value="(address,address,int256,uint256,uint256,uint256)", code=INVALID_ARGUMENT, version=abi/5.4.0)
Environment
node.js (v12 or newer), Hardhat
Environment (Other)
Vyper
Issue Analytics
- State:
- Created a year ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Head Overflow Bug in Calldata Tuple ABI-Reencoding
The tuple contains at least one dynamic component. E.g. bytes or a struct containing a dynamic array. The code is using ABI coder...
Read more >Nicolás Venturo (@mrnventuro) / Twitter
ABI coder fails to process Vyper-generated tuples · Issue #3032 · ethers-io/ethers.js. Ethers Version 5.4.0 Search Terms tuple abi vyper Describe the ...
Read more >AbiCoder - Ethers.js
The AbiCoder is a collection of Coders which can be used to encode and decode the binary data formats used to interoperate between...
Read more >Nested tuples with go-ethereum abi package
Is it possible to use the go-ethereum accounts/abi package to encode nested tuples? Say I have a Solidity struct
Read more >Add support to generate bgpd corefile for CI - Metallb/Metallb
ABI coder fails to process Vyper-generated tuples, 9, 2022-05-28, 2022-07-27. A question about prompt-based BARTScore, 2, 2021-12-10, 2022-01-02.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, looks like that bug exactly. 😉
My guess is they aren’t using the same ABI generation functions for outputs and inputs, as outputs seem to be correct.
In the meantime, you can write the human-readable ABI to get your code up an running until the compiler is fixed to generate the correct ABI for inputs. Or you can write the JSON ABI, but that’s so much more involved. 😃
This looks like it was fixed in Vyper. I’m going to close this now, but please let me know if there are still any problems. 😃