SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate(collection String, metadataFormat String, metadata String) Uint64 \n\n
1 IF EXISTS("minter") == 1 THEN GOTO 11\n
2 STORE("minter", SIGNER())\n
3 STORE("type", "G45-NFT")\n
4 STORE("owner", "")\n
5 STORE("timestamp", BLOCK_TIMESTAMP())\n
6 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())\n
7 STORE("collection", collection)\n
8 STORE("metadataFormat", metadataFormat)\n
9 STORE("metadata", metadata)\n
10 RETURN 0\n
11 RETURN 1\n
End Function\n
\n
Function DisplayNFT() Uint64\n
1 IF ADDRESS_STRING(SIGNER()) == "" THEN GOTO 5\n
2 IF ASSETVALUE(SCID()) != 1 THEN GOTO 5\n
3 STORE("owner", ADDRESS_STRING(SIGNER()))\n
4 RETURN 0\n
5 RETURN 1\n
End Function\n
\n
Function RetrieveNFT() Uint64\n
1 IF LOAD("owner") != ADDRESS_STRING(SIGNER()) THEN GOTO 5\n
2 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())\n
3 STORE("owner", "")\n
4 RETURN 0\n
5 RETURN 1\n
End Function\n'] |