ethers: bytes argument generating the wrong type
See original GitHub issuegreat project and works quite well with ethers v4
however, for a function declaration like function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes _data)
typechain for ethers generates the following declaration:
safeTransferFrom(
_from: string,
_to: string,
_id: number | string,
_amount: number | string,
_data: (string)[]
): Promise<ContractTransaction>;
the _data: (string)[]
argument is wrong, and should be: _data: Uint8Array
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
No results found
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
I haven’t pushed it yet, because it does support tuples yet. Should I push it now and worry about tuples later?
Any update on this? BTW: the culprit here looks to be in parsing the evm types –
bytes
actually gets interpreted asbytes1[]
, hence in ethers output it’s mapped tostring[]
. Isn’t this interpretation wrong in the first place? IMHObytes
should be interpreted as a separateEvmType
and mapped toBuffer | Uint8Array
or something.