Skip to content

Instantly share code, notes, and snippets.

@ilamanov
Created May 9, 2022 23:20
Show Gist options
  • Save ilamanov/fd837cbdce426da96d61bbcd55da4a0c to your computer and use it in GitHub Desktop.
Save ilamanov/fd837cbdce426da96d61bbcd55da4a0c to your computer and use it in GitHub Desktop.
contract OKPC is ERC721A {
address public metadataAddress;
function setMetadataAddress(address addr) external onlyOwner {
if (addr == address(0)) revert InvalidAddress();
metadataAddress = addr;
emit MetadataAddressUpdated(addr);
}
function tokenURI(uint256 pcId) public view override returns (string memory) {
if (!_exists(pcId)) revert OKPCNotFound();
return IOKPCMetadata(metadataAddress).tokenURI(pcId);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment