-
Notifications
You must be signed in to change notification settings - Fork 440
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
Cannot parse ABI with tuple[] #358
Comments
also, the method signatures are different to what js library produces when there are tuples involved web3swift created method signature |
Can you create a basic smart contract with a tuple for us to test? If not I can try to create one and test. What solidity version are you using to compile the contract? |
As I said, I was using multicall smart contract when faced the issue... I cannot create a testing one :( My fixes are in this PR: #379 |
Well that's good news!! |
I am trying to use multicall smart contract (https://etherscan.io/address/0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696#code), but there is an issue when parsing the ABI with web3swift:
The tuple[] input parameter is parsed as an array of tuples, but there is a missing information about the tuple components which later prevents correct execution of the function...
the ABI:
"[ { \"inputs\": [ { \"internalType\": \"bool\", \"name\": \"requireSuccess\", \"type\": \"bool\" }, { \"components\": [ {\"internalType\": \"address\", \"name\": \"target\", \"type\": \"address\" }, { \"internalType\": \"bytes\", \"name\": \"callData\", \"type\": \"bytes\" } ], \"internalType\": \"struct Multicall2.Call[]\", \"name\": \"calls\", \"type\": \"tuple[]\" } ], \"name\": \"tryAggregate\", \"outputs\": [ { \"components\": [ { \"internalType\": \"bool\", \"name\": \"success\", \"type\": \"bool\" }, { \"internalType\": \"bytes\", \"name\": \"returnData\", \"type\": \"bytes\" } ], \"internalType\": \"struct Multicall2.Result[]\", \"name\": \"returnData\", \"type\": \"tuple[]\" } ], \"stateMutability\": \"nonpayable\", \"type\": \"function\" } ]"
The text was updated successfully, but these errors were encountered: