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

ERC721 #166

Open
sajal-garg-ion opened this issue May 4, 2023 · 0 comments
Open

ERC721 #166

sajal-garg-ion opened this issue May 4, 2023 · 0 comments

Comments

@sajal-garg-ion
Copy link

ERC721Tocken.sol is giving compilation error
TypeError: Function has override specified but does not override anything.
--> contracts/tokens/ERC721Token.sol:59:22:
|
59 | ) internal virtual override(ERC721, ERC721Enumerable, ERC721Pausable) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: Invalid contracts specified in override list: "ERC721", "ERC721Enumerable" and "ERC721Pausable".
--> contracts/tokens/ERC721Token.sol:59:22:
|
59 | ) internal virtual override(ERC721, ERC721Enumerable, ERC721Pausable) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts/token/ERC721/ERC721.sol:19:1:
|
19 | contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol:14:1:
|
14 | abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol:22:1:
|
22 | abstract contract ERC721Pausable is ERC721, Pausable {
| ^ (Relevant source part starts here and spans across multiple lines).

TypeError: Derived contract must override function "_beforeTokenTransfer". Two or more base classes define function with same name and parameter types.
--> contracts/tokens/ERC721Token.sol:15:1:
|
15 | contract ERC721Token is Ownable, ER ... lementer, AccessControlEnumerable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: Definition in "ERC721":
--> @openzeppelin/contracts/token/ERC721/ERC721.sol:467:5:
|
467 | function _beforeTokenTransfer(
| ^ (Relevant source part starts here and spans across multiple lines).
Note: Definition in "ERC721Enumerable":
--> @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol:60:5:
|
60 | function _beforeTokenTransfer(
| ^ (Relevant source part starts here and spans across multiple lines).
Note: Definition in "ERC721Pausable":
--> @openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol:30:5:
|
30 | function _beforeTokenTransfer(
| ^ (Relevant source part starts here and spans across multiple lines).

Error HH600: Compilation failed

For more info go to https://hardhat.org/HH600 or run Hardhat with --show-stack-traces
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lseg@1.0.0 compile: npx hardhat compile
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lseg@1.0.0 compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/sajal-garg-ion/.npm/_logs/2023-05-04T06_30_11_896Z-debug.log
sajal-garg-ion@AS-3Q5V9V3-L:/mnt/c/Sajal/Blockchain/lseg-dmi-poc$ npm run compile

lseg@1.0.0 compile /mnt/c/Sajal/Blockchain/lseg-dmi-poc
npx hardhat compile

ParserError: Unexpected trailing comma in parameter list.
--> contracts/tokens/ERC721Token.sol:59:23:
|
59 | uint256 tokenId2,
| ^

Error HH600: Compilation failed

For more info go to https://hardhat.org/HH600 or run Hardhat with --show-stack-traces
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lseg@1.0.0 compile: npx hardhat compile
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lseg@1.0.0 compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Expected Behavior

No Compilation error

We fixed it by fixing overridden function

Current Behavior

Possible Solution

We fixed it by fixing overridden function

Steps to Reproduce (for bugs)

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. node 12 on macos):
  • Server type and version:
  • Operating System and version:
  • Link to your project:
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

1 participant