You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.
I am using the example upgradeable contact, and modify some code to add the ERC721EnumerableUpgradeable, like as blow: abstract contract ExampleERC721Upgradeable is ERC721Upgradeable, DefaultOperatorFiltererUpgradeable, OwnableUpgradeable, ERC721EnumerableUpgradeable
and I override the functions of ERC721EnumerableUpgradeable accordingly. Then I will get the error message:
The detail error message is :
`TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:50:72:
|
50 | function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:54:64:
|
54 | function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:58:77:
|
58 | function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:62:81:
|
62 | function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:68:9:
|
68 | override
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Wrong argument count for modifier invocation: 0 arguments given but expected 1.
--> contracts/TEST.sol:50:81:
|
50 | function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`
Could somebody help me fix this? thx in advance!
The text was updated successfully, but these errors were encountered:
You can remove the import of IERC721Upgradeable from the IERC721EnumerableUpgradeable file, which is imported in ERC721Enumerable; instead of that import IERC165Upgradeable from @openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol in IERC721EnumerableUpgradeable. This will help you solve your issue.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am using the example upgradeable contact, and modify some code to add the ERC721EnumerableUpgradeable, like as blow:
abstract contract ExampleERC721Upgradeable is ERC721Upgradeable, DefaultOperatorFiltererUpgradeable, OwnableUpgradeable, ERC721EnumerableUpgradeable
and I override the functions of ERC721EnumerableUpgradeable accordingly. Then I will get the error message:
The detail error message is :
`TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:50:72:
|
50 | function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:54:64:
|
54 | function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:58:77:
|
58 | function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:62:81:
|
62 | function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Function needs to specify overridden contracts "ERC721Upgradeable" and "IERC721Upgradeable".
--> contracts/TEST.sol:68:9:
|
68 | override
| ^^^^^^^^
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol:20:1:
|
20 | contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
Note: This contract:
--> @openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol:11:1:
|
11 | interface IERC721Upgradeable is IERC165Upgradeable {
| ^ (Relevant source part starts here and spans across multiple lines).
TypeError: Wrong argument count for modifier invocation: 0 arguments given but expected 1.
--> contracts/TEST.sol:50:81:
|
50 | function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
`
Could somebody help me fix this? thx in advance!
The text was updated successfully, but these errors were encountered: