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 fragment object for ApprovalCallerNotOwnerNorApproved #3111

Closed
jetsloth opened this issue Jun 24, 2022 · 6 comments
Closed

Invalid fragment object for ApprovalCallerNotOwnerNorApproved #3111

jetsloth opened this issue Jun 24, 2022 · 6 comments
Assignees

Comments

@jetsloth
Copy link

Ethers Version

5.6.0

Search Terms

ApprovalCallerNotOwnerNorApproved

Describe the Problem

Failed to parse ABI for contract: [REDACTED]. (Its method data will not be collected).
NB: Some Solidity 0.6.x syntax is not supported by Ethers.js V5 AbiCoder yet.
Please report the error below to github.com/ethers-io/ethers.js

ApprovalCallerNotOwnerNorApproved is found in the ERC721A
https://github.com/chiru-labs/ERC721A

Code Snippet

No response

Contract ABI

No response

Errors

Error: invalid fragment object (argument="value", value={"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"}, code=INVALID_ARGUMENT, version=abi/5.0.7)

Environment

No response

Environment (Other)

No response

@jetsloth jetsloth added the investigate Under investigation and may be a bug. label Jun 24, 2022
@zemse
Copy link
Collaborator

zemse commented Jun 26, 2022

Though in the issue template you've mentioned ethers 5.6, but from the error it seems the application is using 5.0, this might be coming from a dependency. Support for custom errors was provided in 5.1.4 (see #1493). In case it's from a dependency, you might try adding resolutions to your package json for overriding the ethers version in the dependency.

"resolutions": {
  "depencency-name/ethers": "^5.6"
},

@jetsloth
Copy link
Author

jetsloth commented Jun 27, 2022

Weird. These are my deps below.
I have another project with the same deps and don't get that error when running the tests

{
	"@nomiclabs/hardhat-ethers": "^2.0.5",
	"@nomiclabs/hardhat-etherscan": "^3.0.3",
	"chai": "^4.3.6",
	"ethereum-waffle": "^3.4.4",
	"ethers": "^5.6.0",
	"hardhat": "^2.9.1",
	"hardhat-gas-reporter": "^1.0.8",
	"mocha": "^10.0.0",
	"@alch/alchemy-web3": "^1.2.5",
	"@chainlink/contracts": "^0.4.0",
	"@maticnetwork/pos-portal": "^1.5.2",
	"@openzeppelin/contracts": "^4.5.0",
	"bn.js": "^5.2.0",
	"dotenv": "^10.0.0",
	"erc721a": "^3.1.0"
}

@ricmoo
Copy link
Member

ricmoo commented Jun 29, 2022

Closing this, as @zemse the error indicates that this error is coming from the v5.0 branch (probably from a dependency?), while Error fragments were not introduced until a v5.2 (@zemse is correct that the parser was extending in 5.1.4 to not throw an error, but actual support hadn't been included yet).

Here is the article announcing it.

You can continue debugging your issue here, I'm just trying to clean things up a bit so I can better handle what to focus on for getting the next minor and major bumps ready.

@ricmoo ricmoo closed this as completed Jun 29, 2022
@ricmoo ricmoo removed the investigate Under investigation and may be a bug. label Jun 29, 2022
@IanDorion
Copy link

Getting the same result;

"ethers": "^5.6.9",

"resolutions": {
    "depencency-name/ethers": "^5.6.9"
  }

Did not fix it.

I have updated all the packages to the latest and the issue resolved itself.

@jetsloth

This comment was marked as spam.

1 similar comment
@jetsloth
Copy link
Author

jetsloth commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants