1

I have smart contract which takes care for multiple ERC721 smart contracts, additionally I have function which mint nft from a one of the ERC721 created by the contract but when i call:

ERC721(collectionAddress)._safeMint(msg.sender, 1);

I hit following error:

Member "_safeMint" not found or not visible after argument-dependent lookup in contract ERC721.

Any idea how to fix it? :S

enter image description here

1 Answer 1

3

_safeMint is usually an internal/private function, so you don't have access to it from your external CollectionManager contract.

(Additionally, the ERC721 interface does not contain a "mint" function.)

If you are in control of the ERC721 contracts you take care of, you can add a function and call it from CollectionManager:

function mint(address _to, uint _amount) external {
    require(msg.sender == address(collectionManager));
    _safeMint(_to, _amount);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.