tx · GTTi4UKnkUWCi9M6iYDc3wNYu6cR5r5MEoWkoMJKcJQj 3N1bfGrC9iBWbv1Rhb64cccc3cQswW8VyCV: -0.01400000 Waves 2020.07.24 11:23 [1101345] smart account 3N1bfGrC9iBWbv1Rhb64cccc3cQswW8VyCV > SELF 0.00000000 Waves
{ "type": 13, "id": "GTTi4UKnkUWCi9M6iYDc3wNYu6cR5r5MEoWkoMJKcJQj", "fee": 1400000, "feeAssetId": null, "timestamp": 1595579098803, "version": 1, "sender": "3N1bfGrC9iBWbv1Rhb64cccc3cQswW8VyCV", "senderPublicKey": "BF56eooJyMKnwSL3B65fqLBFPfubUbW6wdky9pCGQajE", "proofs": [ "4rnMB3aTRcM6JN9PQaHCAizvqoxLZPAG1qiWNZncMmPkQcexZEfFCT33xyxktWnGpBGYrXs9wkowRcDgxYutSiLS" ], "script": "base64:AAIDAAAAAAAAAB0IARIGCgQICAgIEgMKAQgSBgoECAgICBIECgIICAAAAAsAAAAAD3N0b3JhZ2VWZXJpZmllcgkBAAAABXZhbHVlAAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAADHNpZ25WZXJpZmllcgkBAAAABXZhbHVlAAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM05DMjhoU2l2cm1zVFVYYVlEMXg2TDM2Mko0WnBVbm9UZEIAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAAGdXNkbklEAgAAACwzS0ZYQkdHTENqQTVaMkR1VzREcTlmRERySGpKSlAxWkVrYW9halN6dUtzQwEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0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NlcklzUmVnaXN0ZXJlZAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzCQABLAAAAAICAAAADHVzZXJfc3RhdHVzXwUAAAANY2FsbGVyQWRkcmVzcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAABB1c2VyVW5yZWdpc3RlcmVkAwkBAAAAASEAAAABBQAAAAdpc093bmVyCQAAAgAAAAECAAAAJ1lvdSBhcmUgbm90IHRoZSBjcmVhdG9yIG9mIHRoaXMgYXJ0d29yawMJAAAAAAAAAgUAAAAQdXNlcklzUmVnaXN0ZXJlZAUAAAANdXNlclN1c3BlbmRlZAkAAAIAAAABAgAAABlZb3VyIGFjY291bnQgaXMgc3VzcGVuZGVkAwkAAAAAAAACBQAAAAplbnRyeUV4aXN0AgAAAAAJAAACAAAAAQIAAAAZVGhpcyBhcnR3b3JrIGRlc24ndCBleGlzdAMJAABmAAAAAgkAATEAAAABBQAAAARoYXNoAAAAAAAAAABACQAAAgAAAAECAAAAJEhhc2ggaXMgdG9vIGxvbmcsIDY0IGNoYXJhY3RlcnMgbWF4LgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAJYXJ0X2pzb25fBQAAAAJpZAIAAAABXwUAAAANY2FsbGVyQWRkcmVzcwUAAAAEanNvbgUAAAADbmlsAAAAAAcfBGo=", "chainId": 84, "height": 1101345, "spentComplexity": 0 } View: original | compacted Prev: 9HSRrm4AXbmzfTfcU6ggCQvM9sqHeLaGpj68tb3EENv1 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
174 | 174 | then throw("You are not the creator of this artwork") | |
175 | 175 | else if ((userIsRegistered == userSuspended)) | |
176 | 176 | then throw("Your account is suspended") | |
177 | - | else if ((entryExist | |
178 | - | then throw("This artwork | |
177 | + | else if ((entryExist == "")) | |
178 | + | then throw("This artwork desn't exist") | |
179 | 179 | else if ((size(hash) > 64)) | |
180 | 180 | then throw("Hash is too long, 64 characters max.") | |
181 | 181 | else WriteSet([DataEntry(((("art_json_" + id) + "_") + callerAddress), json)]) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let signVerifier = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB")) | |
7 | 7 | ||
8 | 8 | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
9 | 9 | ||
10 | 10 | let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
11 | 11 | ||
12 | 12 | let usdnID = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC" | |
13 | 13 | ||
14 | 14 | func getStringByKey (key) = match getString(this, key) { | |
15 | 15 | case a: String => | |
16 | 16 | a | |
17 | 17 | case _ => | |
18 | 18 | "" | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getStringByAddressKey (addr,key) = match getString(addr, key) { | |
23 | 23 | case a: String => | |
24 | 24 | a | |
25 | 25 | case _ => | |
26 | 26 | "" | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func validateNFTs (accumulator,id) = { | |
31 | 31 | let assetDetails = value(assetInfo(fromBase58String(id))) | |
32 | 32 | if (if (if ((assetDetails.quantity != 1)) | |
33 | 33 | then true | |
34 | 34 | else (assetDetails.decimals != 0)) | |
35 | 35 | then true | |
36 | 36 | else (assetDetails.reissuable != false)) | |
37 | 37 | then (accumulator + 0) | |
38 | 38 | else (accumulator + 1) | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | let userCreated = "CREATED" | |
43 | 43 | ||
44 | 44 | let userSuspended = "SUSPENDED" | |
45 | 45 | ||
46 | 46 | let userUnregistered = "UNREGISTERED" | |
47 | 47 | ||
48 | 48 | @Callable(i) | |
49 | 49 | func registerUpdateUser (name,description,thumb,social) = { | |
50 | 50 | let callerAddr = toString(addressFromPublicKey(i.callerPublicKey)) | |
51 | 51 | let id = toBase58String(i.transactionId) | |
52 | 52 | let newUser = getStringByKey(("user_" + callerAddr)) | |
53 | 53 | if (if ((name == "")) | |
54 | 54 | then true | |
55 | 55 | else (description == "")) | |
56 | 56 | then throw("Name and description cannot be empty") | |
57 | 57 | else if ((newUser == "")) | |
58 | 58 | then WriteSet([DataEntry(("user_" + callerAddr), ((id + "_") + toString(lastBlock.timestamp))), DataEntry(("user_name_" + callerAddr), name), DataEntry(("user_desc_" + callerAddr), description), DataEntry(("user_social_" + callerAddr), social), DataEntry(("user_thumb_" + callerAddr), thumb), DataEntry(("user_status_" + callerAddr), userCreated)]) | |
59 | 59 | else WriteSet([DataEntry(("user_name_" + callerAddr), name), DataEntry(("user_desc_" + callerAddr), description), DataEntry(("user_social_" + callerAddr), social), DataEntry(("user_thumb_" + callerAddr), thumb)]) | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(invoke) | |
65 | 65 | func test (hash) = throw("Error") | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Callable(invoke) | |
70 | 70 | func addArtwork (hash,json,nfts,signID) = { | |
71 | 71 | let id = toBase58String(invoke.transactionId) | |
72 | 72 | let callerAddress = toBase58String(invoke.caller.bytes) | |
73 | 73 | let entryExist = getStringByKey(((hash + "_") + callerAddress)) | |
74 | 74 | let entryDate = lastBlock.timestamp | |
75 | 75 | let nftArray = split(nfts, "|") | |
76 | 76 | let numberOfNFTs = size(nftArray) | |
77 | 77 | let checkIDs = { | |
78 | 78 | let $list28222857 = nftArray | |
79 | 79 | let $size28222857 = size($list28222857) | |
80 | 80 | let $acc028222857 = 0 | |
81 | 81 | if (($size28222857 == 0)) | |
82 | 82 | then $acc028222857 | |
83 | 83 | else { | |
84 | 84 | let $acc128222857 = validateNFTs($acc028222857, $list28222857[0]) | |
85 | 85 | if (($size28222857 == 1)) | |
86 | 86 | then $acc128222857 | |
87 | 87 | else { | |
88 | 88 | let $acc228222857 = validateNFTs($acc128222857, $list28222857[1]) | |
89 | 89 | if (($size28222857 == 2)) | |
90 | 90 | then $acc228222857 | |
91 | 91 | else { | |
92 | 92 | let $acc328222857 = validateNFTs($acc228222857, $list28222857[2]) | |
93 | 93 | if (($size28222857 == 3)) | |
94 | 94 | then $acc328222857 | |
95 | 95 | else { | |
96 | 96 | let $acc428222857 = validateNFTs($acc328222857, $list28222857[3]) | |
97 | 97 | if (($size28222857 == 4)) | |
98 | 98 | then $acc428222857 | |
99 | 99 | else { | |
100 | 100 | let $acc528222857 = validateNFTs($acc428222857, $list28222857[4]) | |
101 | 101 | if (($size28222857 == 5)) | |
102 | 102 | then $acc528222857 | |
103 | 103 | else { | |
104 | 104 | let $acc628222857 = validateNFTs($acc528222857, $list28222857[5]) | |
105 | 105 | if (($size28222857 == 6)) | |
106 | 106 | then $acc628222857 | |
107 | 107 | else { | |
108 | 108 | let $acc728222857 = validateNFTs($acc628222857, $list28222857[6]) | |
109 | 109 | if (($size28222857 == 7)) | |
110 | 110 | then $acc728222857 | |
111 | 111 | else { | |
112 | 112 | let $acc828222857 = validateNFTs($acc728222857, $list28222857[7]) | |
113 | 113 | if (($size28222857 == 8)) | |
114 | 114 | then $acc828222857 | |
115 | 115 | else { | |
116 | 116 | let $acc928222857 = validateNFTs($acc828222857, $list28222857[8]) | |
117 | 117 | if (($size28222857 == 9)) | |
118 | 118 | then $acc928222857 | |
119 | 119 | else { | |
120 | 120 | let $acc1028222857 = validateNFTs($acc928222857, $list28222857[9]) | |
121 | 121 | if (($size28222857 == 10)) | |
122 | 122 | then $acc1028222857 | |
123 | 123 | else { | |
124 | 124 | let $acc1128222857 = validateNFTs($acc1028222857, $list28222857[10]) | |
125 | 125 | throw("List size exceed 10") | |
126 | 126 | } | |
127 | 127 | } | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 | } | |
131 | 131 | } | |
132 | 132 | } | |
133 | 133 | } | |
134 | 134 | } | |
135 | 135 | } | |
136 | 136 | } | |
137 | 137 | } | |
138 | 138 | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
139 | 139 | case s: String => | |
140 | 140 | s | |
141 | 141 | case _ => | |
142 | 142 | userUnregistered | |
143 | 143 | } | |
144 | 144 | if ((userIsRegistered == userUnregistered)) | |
145 | 145 | then throw("Please register this account first") | |
146 | 146 | else if ((userIsRegistered == userSuspended)) | |
147 | 147 | then throw("Your account is suspended") | |
148 | 148 | else if ((numberOfNFTs > 10)) | |
149 | 149 | then throw("Maximum 10 editions per artwork") | |
150 | 150 | else if ((checkIDs != numberOfNFTs)) | |
151 | 151 | then throw("Please verify that all NFT ids are valid.") | |
152 | 152 | else if ((entryExist != "")) | |
153 | 153 | then throw("This artwork is already registered") | |
154 | 154 | else if ((size(hash) > 64)) | |
155 | 155 | then throw("Hash is too long, 64 characters max.") | |
156 | 156 | else WriteSet([DataEntry(((hash + "_") + callerAddress), id), DataEntry(((("art_date_" + id) + "_") + callerAddress), entryDate), DataEntry(((("art_json_" + id) + "_") + callerAddress), json), DataEntry(((("art_nfts_" + id) + "_") + callerAddress), nfts), DataEntry(((("art_sign_" + id) + "_") + callerAddress), signID)]) | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Callable(invoke) | |
162 | 162 | func updateArtworkInfos (hash,json) = { | |
163 | 163 | let id = toBase58String(invoke.transactionId) | |
164 | 164 | let callerAddress = toBase58String(invoke.caller.bytes) | |
165 | 165 | let entryExist = getStringByKey(((hash + "_") + callerAddress)) | |
166 | 166 | let isOwner = isDefined(getString(this, ((hash + "_") + callerAddress))) | |
167 | 167 | let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) { | |
168 | 168 | case s: String => | |
169 | 169 | s | |
170 | 170 | case _ => | |
171 | 171 | userUnregistered | |
172 | 172 | } | |
173 | 173 | if (!(isOwner)) | |
174 | 174 | then throw("You are not the creator of this artwork") | |
175 | 175 | else if ((userIsRegistered == userSuspended)) | |
176 | 176 | then throw("Your account is suspended") | |
177 | - | else if ((entryExist | |
178 | - | then throw("This artwork | |
177 | + | else if ((entryExist == "")) | |
178 | + | then throw("This artwork desn't exist") | |
179 | 179 | else if ((size(hash) > 64)) | |
180 | 180 | then throw("Hash is too long, 64 characters max.") | |
181 | 181 | else WriteSet([DataEntry(((("art_json_" + id) + "_") + callerAddress), json)]) | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 |
github/deemru/w8io/169f3d6 30.81 ms ◑