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

EE Error: unexpected tokens: <TokenString ID:override KEYWORD:returns OPEN_PAREN... #4514

Closed
jurosh opened this issue Dec 18, 2023 · 1 comment
Assignees
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published. v6 Issues regarding v6

Comments

@jurosh
Copy link

jurosh commented Dec 18, 2023

Ethers Version

6.9.0

Search Terms

No response

Describe the Problem

Seems like v6 regression of calling contract when overrides return is used - see abi. If I remove override keyword before returns then it works.

Maybe related to #4412 regression.

Code Snippet

const contract = new ethers.Contract(feeContract, abi, provider);
await contract.getFees() // error

Contract ABI

const SwapObjStruct = `(uint256 amount, uint256 eqFee, uint256 eqReward, uint256 lpFee, uint256 protocolFee, uint256 lkbRemove)`;
const abi = [
    `function getFees(uint256 _srcPoolId, uint256 _dstPoolId, uint16 _dstChainId, address, uint256 _amountSD ) external view override returns (${SwapObjStruct} memory s)`
 ];

Errors

EE Error: unexpected tokens: <TokenString ID:override KEYWORD:returns OPEN_PAREN:( OPEN_PAREN:( TYPE:uint256 ID:amount COMMA:, TYPE:uint256 ID:eqFee COMMA:, TYPE:uint256 ID:eqReward COMMA:, TYPE:uint256 ID:lpFee COMMA:, TYPE:uint256 ID:protocolFee COMMA:, TYPE:uint256 ID:lkbRemove CLOSE_PAREN:) KEYWORD:memory ID:s CLOSE_PAREN:)>

Environment

No response

Environment (Other)

No response

@jurosh jurosh added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Dec 18, 2023
@ricmoo ricmoo added enhancement New feature or improvement. on-deck This Enhancement or Bug is currently being worked on. next-patch Issues scheduled for the next arch release. and removed investigate Under investigation and may be a bug. labels Dec 20, 2023
@ricmoo
Copy link
Member

ricmoo commented Feb 9, 2024

This has been fixed in v6.11.0, as well as slightly more descriptive better error messages when parsing fails.

Thanks! :)

@ricmoo ricmoo closed this as completed Feb 9, 2024
@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. next-patch Issues scheduled for the next arch release. labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. 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