Skip to content
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

Invalid FunctionFragment full format string for tuple #4311

Closed
vserpokryl opened this issue Aug 11, 2023 · 2 comments
Closed

Invalid FunctionFragment full format string for tuple #4311

vserpokryl opened this issue Aug 11, 2023 · 2 comments
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6

Comments

@vserpokryl
Copy link

vserpokryl commented Aug 11, 2023

Ethers Version

6.7.0

Search Terms

abi

Describe the Problem

Seems like FunctionFragment generates invalid full/minimal format from "full/minimal format string" with tuples
tuple(uint256)(uint256) - (uint256) is redundant here. Is it so?

Code Snippet

import { FunctionFragment } from 'ethers';

const fn1 = FunctionFragment.from('function swap(address,tuple(uint256))');
const fn2 = FunctionFragment.from(JSON.parse(fn1.format('json')));

console.log(fn1.format('full')); // function swap(address, tuple(uint256)(uint256))
console.log(fn2.format('full')); // function swap(address, tuple(uint256))

// FunctionFragment.from(fn1.format('full')); // Error
FunctionFragment.from(fn2.format('full')); // OK

Contract ABI

['function swap(address,tuple(uint256))']

Environment

node.js (v12 or newer)

@vserpokryl vserpokryl added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Aug 11, 2023
@ricmoo ricmoo added on-deck This Enhancement or Bug is currently being worked on. next-patch Issues scheduled for the next arch release. labels Aug 11, 2023
@ricmoo
Copy link
Member

ricmoo commented Aug 11, 2023

Looking into this…

@ricmoo
Copy link
Member

ricmoo commented Nov 27, 2023

Sorry. I missed tagging this in the fix included in v6.9.0. It was tagged with the issues #4329 and #4479.

Adding a note here with the tag GitPoap to remind me to flag this when building the GitPoap claim JSON.

Thanks! :)

@ricmoo ricmoo closed this as completed Nov 27, 2023
@ricmoo ricmoo added bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. and removed investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. next-patch Issues scheduled for the next arch release. labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants