SC CODE: Function InitializePrivate(collection String, metadataFormat String, metadata String) Uint64
1 IF EXISTS("minter") == 1 THEN GOTO 11
2 STORE("minter", SIGNER())
3 STORE("type", "G45-NFT")
4 STORE("owner", "")
5 STORE("timestamp", BLOCK_TIMESTAMP())
6 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())
7 STORE("collection", collection)
8 STORE("metadataFormat", metadataFormat)
9 STORE("metadata", metadata)
10 RETURN 0
11 RETURN 1
End Function
Function DisplayNFT() Uint64
1 IF ADDRESS_STRING(SIGNER()) == "" THEN GOTO 5
2 IF ASSETVALUE(SCID()) != 1 THEN GOTO 5
3 STORE("owner", ADDRESS_STRING(SIGNER()))
4 RETURN 0
5 RETURN 1
End Function
Function RetrieveNFT() Uint64
1 IF LOAD("owner") != ADDRESS_STRING(SIGNER()) THEN GOTO 5
2 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())
3 STORE("owner", "")
4 RETURN 0
5 RETURN 1
End Function |
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate(collection String, metadataFormat String, metadata String) Uint64
1 IF EXISTS("minter") == 1 THEN GOTO 11
2 STORE("minter", SIGNER())
3 STORE("type", "G45-NFT")
4 STORE("owner", "")
5 STORE("timestamp", BLOCK_TIMESTAMP())
6 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())
7 STORE("collection", collection)
8 STORE("metadataFormat", metadataFormat)
9 STORE("metadata", metadata)
10 RETURN 0
11 RETURN 1
End Function
Function DisplayNFT() Uint64
1 IF ADDRESS_STRING(SIGNER()) == "" THEN GOTO 5
2 IF ASSETVALUE(SCID()) != 1 THEN GOTO 5
3 STORE("owner", ADDRESS_STRING(SIGNER()))
4 RETURN 0
5 RETURN 1
End Function
Function RetrieveNFT() Uint64
1 IF LOAD("owner") != ADDRESS_STRING(SIGNER()) THEN GOTO 5
2 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())
3 STORE("owner", "")
4 RETURN 0
5 RETURN 1
End Function' Name:collection Type:string Value:'b3abec90704939099b25379230dfcebebf8e3be92d28feddde8f2383c9de4ec0' Name:metadata Type:string Value:'{"attributes":{"Hobo Kingdom":"Filthlandia","Hobo Name":"Fin the Dumpster Yeti"},"description":"Fin the Dumpster Yeti is a creative force to be reckoned with in the world of garbage fashion. With an eye for color and a nose for stench, Fin designs technicolor trash coats that turn heads and stomachs. From discarded candy wrappers to old denim, nothing is off-limits for this dumpster diva. And with each coat custom-tailored to fit its wearer's unique dumpster-diving style, Fin's designs are as functional as they are fashionable. So if you're looking to stand out from the crowd and smell like a garbage dump, look no further than Fin the Dumpster Yeti's trash coats of Filthlandia.","id":47,"image":"ipfs://QmbXwMGM5bWGp2kpF1KnPiZs2f64vKPGtwpnFJ1HNXsNk3/hobo47.jpg","name":"Dero Hobo #47"}' Name:metadataFormat Type:string Value:'json'] |