Smart Contract Details
Open on Dero ExplorerInternal ID:
11888
Hash / Transaction:
Block:
Timestamp:
2023-01-20 00:19:59 UTC (2.7 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\":\"1\",\"Arcanum\":\"The Minor Arcana\",\"Card Number\":\"Ace\",\"Rarity\":\"Common\",\"Suit\":\"Swords\"},\"description\":\"Intellectual breakthroughs and fresh ideas. A paradigm shatters, only to reveal a new sense of awe and wonder. If you have been holding on to ideas out of fear, it is safe to let them go so you can experience life from a sense of childlike curiosity and awe. Settle into a humble unknowingness and enjoy all that this flowstate has to offer. This is the true beginner's mind! Adventure awaits!\",\"id\":51,\"image\":\"ipfs://QmTNcmBXkwf9tQE9H5Yjd4onCojbSBw9TZ1ZBHcZamHgoK/\",\"name\":\"Ace 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