-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tuple with struct incorrectly parsed - always errors #701
Comments
Hi @bradyjoestar for that you can use a value like this:
|
Hi @W3stside sorry for the late response. For this tuple
You can use a value like this:
but in the method A basic example of a valid value for that matrix is:
Could you provide me the contract address and the method that you want to use? |
@DaniSomoza will give it a go, thanks! |
It worked ! Thank you for your help. |
Hello @DaniSomoza!
{
"name":"s",
"type":"tuple[]",
"internalType":"struct Period[]",
"components":[
{
"internalType":"int64",
"name":"length",
"type":"int64"
},
{
"name":"c",
"type":"tuple[]",
"internalType":"struct Coin[]",
"components":[
{
"internalType":"string",
"name":"denom",
"type":"string"
},
{
"internalType":"uint256",
"name":"amount",
"type":"uint256"
}
]
}
]
}
During interacting with tx-builder the error is thrown at this line. And it looks like the issue is on web3-eth-abi side (web3/web3.js#6307). Do you have any advice how to use such structures as an argument? |
Given this struct:
Block explorers like Etherscan accept the format below for an array of tuples for that struct:
Could we leverage this thread/issue for supporting this format? |
I’m not sure if this issue is still relevant, but it looks like updating to the latest version of web3.js should resolve it. The fix was merged in September 2023. See web3/web3.js#6307 |
Description
Struct tuple incorrectly parsed, never passes validation:
Example tuple: (whitespace here for legibility)
contract tuple:
Running this on etherscan works fine. I checked the tests written in this PR, which addresses the original issue opened, but I don't see any tests for struct tuples
Environment
Steps to reproduce
For reasons of security on our side I don't want to give our contract, but any other contract requiring a struct tuple as a param will encounter this problem.
Expected result
Passes validation
Obtained result
Invalidated with:
format error. details: typeerror: cannot read properties of undefined (reading 'length')
Screenshots
Also hi to the Safe team!
The text was updated successfully, but these errors were encountered: