Skip to content

Commit

Permalink
Remove setTokenURI function (#139)
Browse files Browse the repository at this point in the history
* Remove setTokenURI function

* Remove unused assertIsOwner function
  • Loading branch information
Ben-Rey authored Jan 3, 2024
1 parent 089d641 commit 8743ed2
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions smart-contracts/assembly/contracts/NFT/NFT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
_isApprovedForAll,
_updateBalanceOf,
_getBalanceOf,
assertIsOwner,
_constructor,
} from './NFT-internals';

Expand Down Expand Up @@ -135,26 +134,6 @@ export function nft1_tokenURI(binaryArgs: StaticArray<u8>): StaticArray<u8> {
}
}

/**
* Set a token URI (external link written in NFT where pictures or others are stored).
* If not set the tokenURI will be the baseURI + tokenId
* @param binaryArgs - u64 serialized tokenID with `Args` + URI string
*/
export function nft1_setTokenURI(binaryArgs: StaticArray<u8>): void {
const args = new Args(binaryArgs);
const tokenId = args
.nextU64()
.expect('token id argument is missing or invalid');

assertIsMinted(tokenId);
assertIsOwner(Context.caller().toString(), tokenId);

Storage.set(
tokenURIKey + tokenId.toString(),
args.nextString().expect('tokenURI argument is missing or invalid'),
);
}

/**
* Returns the base URI
* @param _ - unused see https://github.com/massalabs/massa-sc-std/issues/18
Expand Down

0 comments on commit 8743ed2

Please sign in to comment.