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

Unable to Import Deployed Goreli Contract Into OpenSea #411

Closed
advra opened this issue Aug 20, 2022 · 6 comments
Closed

Unable to Import Deployed Goreli Contract Into OpenSea #411

advra opened this issue Aug 20, 2022 · 6 comments

Comments

@advra
Copy link

advra commented Aug 20, 2022

I made a contract based off erc721A 4.x. I deployed it to Goreli and minted fine. I wen to opensea to import the contract and when trying I ran into the notorious error "We couldn't find this contract. Please ensure that this is a valid ERC721 or ERC1155 contract deployed on Goerli and that you have already minted items on the contract".

image

So I deployed a lean contract based off 721A and arrived at the same error when trying to import it to opensea. Heres the deployed small contract address on Goreli Etherscan.

Anyone else ran into this issue lately?

@advra
Copy link
Author

advra commented Aug 20, 2022

Looks like same issue with #354. Any new developments on this? Looks like somewhere in 721A v4.x the contract cannot import to opensea? Im using "erc721a": "^4.2.2",

@Vectorized
Copy link
Collaborator

Vectorized commented Aug 20, 2022

@advra After a lil try and error, it seems that OpenSea checks if the tokenURI actually returns a non-empty string before considering the contract as valid.

Try this:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/access/Ownable.sol";
import "erc721a/contracts/ERC721A.sol";
import "solady/src/utils/LibString.sol";

contract TryThis is ERC721A, Ownable {
    string private _tokenURI;

    constructor() ERC721A("Try", "THIS") {
        _tokenURI = "ipfs://QmQFkLSQysj94s5GvTHPyzTxrawwtjgiiYS2TBLgrvw8CW/{id}";
    }

    function mintMulti(uint256 quantity) public virtual onlyOwner {
        _mint(msg.sender, quantity);
    }

    function _startTokenId() internal view virtual override returns (uint256) {
        return 1;
    }

    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        return LibString.replace(_tokenURI, '{id}', _toString(tokenId));
    }

    function setTokenURI(string calldata value) external onlyOwner {
        _tokenURI = value;
    }
}

If all else fails, but you really wanna get it working on testnet, just contact OpenSea.

Tbh, I wouldn't worry too much. There are successful contracts on mainnet using v4.0+.

@advra
Copy link
Author

advra commented Aug 21, 2022

So here's my original contract (https://goerli.etherscan.io/address/0xbeb9ab39d45672af96b634232141dfdf131cde84) which has a mapping id->uri. The uri is passed in mint()for each NFT. So it should have a valid URI since that us passed during mint.

@advra
Copy link
Author

advra commented Aug 21, 2022

I've contacted opensea but it's been days with no response unfortunately.

Does anything in the second contract I linked have any implementation issues that opensea doesn't like?

@Vectorized
Copy link
Collaborator

Try Rinkeby Opensea.

@advra
Copy link
Author

advra commented Aug 22, 2022

Wow that actually worked. Maybe opensea's checks on Goreli need to be updated on their end.

Thanks again @Vectorized. Closing this as its now resolved.

@advra advra closed this as completed Aug 22, 2022
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

2 participants