[ethers] Function fragments with struct arrays are falsely represented as `tuple[]`
See original GitHub issueTypechain generates these function fragments:
functions: {
"requestExec(address,bytes,uint64,uint256,uint256,tuple[])": FunctionFragment;
"requestExecWithTimeout(address,bytes,uint64,uint256,uint256,tuple[],uint256)": FunctionFragment;
};
However when outputting the actual function fragments you will see that the fragment keys do not align. This is because typechain represents a (address,uint256)[]
tuple-array as just tuple[]
.
{
'requestExec(address,bytes,uint64,uint256,uint256,(address,uint256)[])': FunctionFragment {
type: 'function',
name: 'requestExec',
constant: false,
inputs: [
[ParamType],
[ParamType],
[ParamType],
[ParamType],
[ParamType],
[ParamType]
],
outputs: [ [ParamType] ],
payable: false,
stateMutability: 'nonpayable',
gas: BigNumber { _hex: '0xaeb690', _isBigNumber: true },
_isFragment: true
},
'requestExecWithTimeout(address,bytes,uint64,uint256,uint256,(address,uint256)[],uint256)': FunctionFragment {
type: 'function',
name: 'requestExecWithTimeout',
constant: false,
inputs: [
[ParamType],
[ParamType],
[ParamType],
[ParamType],
[ParamType],
[ParamType],
[ParamType]
],
outputs: [ [ParamType] ],
payable: false,
stateMutability: 'nonpayable',
gas: BigNumber { _hex: '0xaeb690', _isBigNumber: true },
_isFragment: true
},
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Interface - Ethers.js
Create a new Interface from a JSON string or object representing abi. The abi may be a JSON string or the ... All...
Read more >How to pass array of structs as argument on etherscan ...
I'm trying to pass the format of array of structs as argument on smart contract write function on etherscan,. This is solidity example:....
Read more >Documentation - ethers
The ethers.js library aims to be a complete and compact library for interacting with the Ethereum Blockchain and its ecosystem. It was originally...
Read more >solidity - tuple[] for a function input. How to use it?
When you write a struct in Solidity, it gets mapped as tuple in the ABI. The actual structure of the struct can be...
Read more >SMT-Friendly Formalization of the Solidity Memory Model
ure 1, and the abstract syntax of the targeted fragment is presented in Figure 2. ... other hand, are passed by reference and...
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
@TransmissionsDev tbh I am swamped with work. It would be super useful if you could create a PR for this.
@TransmissionsDev thanks for this issue. Interesting bug. It might be a problem in out abi parser but not sure. Can you create a minimal repro somewhere? or just post here a solidity code that would generate such ABI?