SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate(collection String, metadataFormat String, metadata String) Uint64
01 IF EXISTS("minter") == 1 THEN GOTO 11
02 STORE("minter", SIGNER())
03 STORE("type", "G45-NFT")
04 STORE("owner", "")
05 STORE("timestamp", BLOCK_TIMESTAMP())
06 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())
07 STORE("collection", collection)
08 STORE("metadataFormat", metadataFormat)
09 STORE("metadata", metadata)
10 RETURN 0
11 RETURN 1
End Function
Function DisplayNFT() Uint64
01 IF ADDRESS_STRING(SIGNER()) == "" THEN GOTO 5
02 IF ASSETVALUE(SCID()) != 1 THEN GOTO 5
03 STORE("owner", ADDRESS_STRING(SIGNER()))
04 RETURN 0
05 RETURN 1
End Function
Function RetrieveNFT() Uint64
01 IF LOAD("owner") != ADDRESS_STRING(SIGNER()) THEN GOTO 5
02 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())
03 STORE("owner", "")
04 RETURN 0
05 RETURN 1
End Function
'] |