updated updateMethod
This commit is contained in:
parent
334f520331
commit
570f0124a3
|
|
@ -20,9 +20,8 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
|
||||||
_;
|
_;
|
||||||
}
|
}
|
||||||
|
|
||||||
modifier tokenBelongsToAddress(uint256 tokenId, address holderAddress) {
|
modifier addressOwnsTokenId(address owner, uint256 tokenId) {
|
||||||
require(ownerOf(tokenId) == holderAddress, "Address doesnt own tokenId.");
|
require(_owners[owner]);
|
||||||
_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(string memory name, string memory symbol) ERC721(name, symbol) {
|
constructor(string memory name, string memory symbol) ERC721(name, symbol) {
|
||||||
|
|
@ -39,8 +38,9 @@ contract SitesNFTs is ERC721URIStorage, AccessControl {
|
||||||
return newItemId;
|
return newItemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTokenURI(address tokenHolderAddress, uint256 tokenId, string memory newTokenURI) public canMint() {
|
function updateTokenURI(address tokenHolderAddress, uint256 tokenId, string memory base64EncodedMetadata) public canMint() {
|
||||||
|
address tokenOwner = ownerOf(tokenId);
|
||||||
|
_setTokenURI(tokenId, base64EncodedMetadata);
|
||||||
}
|
}
|
||||||
|
|
||||||
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) {
|
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue