I have an erc1155 (NFT) contract, that should be able to update the metadata dynamically, because i have overriden the uri function like so:
packOpened basically returns false intially, but will end up being set to true eventually.
function uri(uint256 packid) public view virtual override returns (string memory) {
if(packOpened(packid) == false) {
return _uri;
} else {
return _uriOpened;
}
}
when i call the uri function from the smart contract itself, it works properly, it gives me the correct metadata url.
However for some reason when i click refresh metadata for the NFT on opensea, or any other website for that matter, the metadata/image isn't updating, and remains the initial metadata.
Does any one know why this could potentially happen?
Any help would be appreciated! thankx