Smart Contract Details

Open on Dero Explorer
Internal ID:
11899
Block:
Timestamp:
2023-01-20 00:23:41 UTC (2.6 years ago)
Creator:
LUXY (+32 more) (1385490)
Raw Data:
[{"name":"SC_ACTION","datatype":"U","value":1},{"name":"SC_CODE","datatype":"S","value":"Function InitializePrivate(collection String, metadataFormat String, metadata String) Uint64\r\n1 IF EXISTS(\"minter\") == 1 THEN GOTO 11\r\n2 STORE(\"minter\", SIGNER())\r\n3 STORE(\"type\", \"G45-NFT\")\r\n4 STORE(\"owner\", \"\")\r\n5 STORE(\"timestamp\", BLOCK_TIMESTAMP())\r\n6 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())\r\n7 STORE(\"collection\", collection)\r\n8 STORE(\"metadataFormat\", metadataFormat)\r\n9 STORE(\"metadata\", metadata)\r\n10 RETURN 0\r\n11 RETURN 1\r\nEnd Function\r\n\r\nFunction DisplayNFT() Uint64\r\n1 IF ADDRESS_STRING(SIGNER()) == \"\" THEN GOTO 5\r\n2 IF ASSETVALUE(SCID()) != 1 THEN GOTO 5\r\n3 STORE(\"owner\", ADDRESS_STRING(SIGNER()))\r\n4 RETURN 0\r\n5 RETURN 1\r\nEnd Function\r\n\r\nFunction RetrieveNFT() Uint64\r\n1 IF LOAD(\"owner\") != ADDRESS_STRING(SIGNER()) THEN GOTO 5\r\n2 SEND_ASSET_TO_ADDRESS(SIGNER(), 1, SCID())\r\n3 STORE(\"owner\", \"\")\r\n4 RETURN 0\r\n5 RETURN 1\r\nEnd Function"},{"name":"collection","datatype":"S","value":"ec90b4365fff397d2cd3d6b023f37f6c4397d78d34f17617febf4ec8a7e920de"},{"name":"metadata","datatype":"S","value":"{\"attributes\":{\"Alchemical Potency\":\"2\",\"Arcanum\":\"The Royal Arcana\",\"Card Number\":\"Knight\",\"Rarity\":\"Uncommon\",\"Suit\":\"Swords\"},\"description\":\"The plans have been put in motion and this is a time for action! Carpe momentum temporis! Make haste, come in and claim what is rightfully yours! This is not a time to mull it over and over. Instead, go directly to your spirit, rely on your body's intelligence to decide, as your vessel knows instinctively what Truth truly is. Trust your instincts as they are precise. Speed journal if needed to access this inner wisdom.\",\"id\":62,\"image\":\"ipfs://QmPv9KfjF1QGFKexavxDVes6PB2x4Pz2ZT4689EMVffcnQ/\",\"name\":\"Knight of Swords\"}"},{"name":"metadataFormat","datatype":"S","value":"json"}]
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