【发布时间】:2022-12-03 10:17:48
【问题描述】:
我在测试网上测试了我的合约,它显示了 NFT,但没有在主网上显示。
我在合约中设置了一些变量来打开和关闭 NFT。
bool public revealed = true;
此外,tokenURI 具有以下功能:
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
require(tokenId < _tokenIdCounter.current(), "Token ID must be less than the total supply");
if(!revealed) {
return notRevealedUri;
}
string memory currentBaseURI = _baseURI();
return bytes(currentBaseURI).length > 0
? string(
abi.encodePacked(
currentBaseURI,
tokenId.toString(),
baseExtension))
: "";
}
这是测试网 rinkeby 链接: https://rinkeby.etherscan.io/address/0x8b631a5528df6d9383a636af81fc1233ed8736f4 https://testnets.opensea.io/assets/0x8B631a5528dF6d9383a636Af81FC1233eD8736F4/0
主网未在 opensea 上显示: https://opensea.io/collection/sacc
我将相同的合约部署到 rinkeby 和主网上,所以很惊讶 NFT 在测试网上显示时没有在主网上显示。
如果有人能在这里帮助我,我会很高兴。
【问题讨论】:
标签: blockchain solidity smartcontracts nft opensea