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:AAIDAAAAAAAAAB0IARIGCgQICAgIEgMKAQgSBgoECAgICBIECgIICAAAAAsAAAAAD3N0b3JhZ2VWZXJpZmllcgkBAAAABXZhbHVlAAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAADHNpZ25WZXJpZmllcgkBAAAABXZhbHVlAAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM05DMjhoU2l2cm1zVFVYYVlEMXg2TDM2Mko0WnBVbm9UZEIAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAAGdXNkbklEAgAAACwzS0ZYQkdHTENqQTVaMkR1VzREcTlmRERySGpKSlAxWkVrYW9halN6dUtzQwEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB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XNlcklzUmVnaXN0ZXJlZAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzCQABLAAAAAICAAAADHVzZXJfc3RhdHVzXwUAAAANY2FsbGVyQWRkcmVzcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzBQAAABB1c2VyVW5yZWdpc3RlcmVkAwkBAAAAASEAAAABBQAAAAdpc093bmVyCQAAAgAAAAECAAAAJ1lvdSBhcmUgbm90IHRoZSBjcmVhdG9yIG9mIHRoaXMgYXJ0d29yawMJAAAAAAAAAgUAAAAQdXNlcklzUmVnaXN0ZXJlZAUAAAANdXNlclN1c3BlbmRlZAkAAAIAAAABAgAAABlZb3VyIGFjY291bnQgaXMgc3VzcGVuZGVkAwkAAAAAAAACBQAAAAplbnRyeUV4aXN0AgAAAAAJAAACAAAAAQIAAAAZVGhpcyBhcnR3b3JrIGRlc24ndCBleGlzdAMJAABmAAAAAgkAATEAAAABBQAAAARoYXNoAAAAAAAAAABACQAAAgAAAAECAAAAJEhhc2ggaXMgdG9vIGxvbmcsIDY0IGNoYXJhY3RlcnMgbWF4LgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAJYXJ0X2pzb25fBQAAAAJpZAIAAAABXwUAAAANY2FsbGVyQWRkcmVzcwUAAAAEanNvbgUAAAADbmlsAAAAAAcfBGo=", "chainId": 84, "height": 1101345, "spentComplexity": 0 } View: original | compacted Prev: 9HSRrm4AXbmzfTfcU6ggCQvM9sqHeLaGpj68tb3EENv1 Next: none Diff:
OldNewDifferences
174174 then throw("You are not the creator of this artwork")
175175 else if ((userIsRegistered == userSuspended))
176176 then throw("Your account is suspended")
177- else if ((entryExist != "NONE"))
178- then throw("This artwork is already registered")
177+ else if ((entryExist == ""))
178+ then throw("This artwork desn't exist")
179179 else if ((size(hash) > 64))
180180 then throw("Hash is too long, 64 characters max.")
181181 else WriteSet([DataEntry(((("art_json_" + id) + "_") + callerAddress), json)])
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
55
66 let signVerifier = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB"))
77
88 let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
99
1010 let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
1111
1212 let usdnID = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC"
1313
1414 func getStringByKey (key) = match getString(this, key) {
1515 case a: String =>
1616 a
1717 case _ =>
1818 ""
1919 }
2020
2121
2222 func getStringByAddressKey (addr,key) = match getString(addr, key) {
2323 case a: String =>
2424 a
2525 case _ =>
2626 ""
2727 }
2828
2929
3030 func validateNFTs (accumulator,id) = {
3131 let assetDetails = value(assetInfo(fromBase58String(id)))
3232 if (if (if ((assetDetails.quantity != 1))
3333 then true
3434 else (assetDetails.decimals != 0))
3535 then true
3636 else (assetDetails.reissuable != false))
3737 then (accumulator + 0)
3838 else (accumulator + 1)
3939 }
4040
4141
4242 let userCreated = "CREATED"
4343
4444 let userSuspended = "SUSPENDED"
4545
4646 let userUnregistered = "UNREGISTERED"
4747
4848 @Callable(i)
4949 func registerUpdateUser (name,description,thumb,social) = {
5050 let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
5151 let id = toBase58String(i.transactionId)
5252 let newUser = getStringByKey(("user_" + callerAddr))
5353 if (if ((name == ""))
5454 then true
5555 else (description == ""))
5656 then throw("Name and description cannot be empty")
5757 else if ((newUser == ""))
5858 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)])
5959 else WriteSet([DataEntry(("user_name_" + callerAddr), name), DataEntry(("user_desc_" + callerAddr), description), DataEntry(("user_social_" + callerAddr), social), DataEntry(("user_thumb_" + callerAddr), thumb)])
6060 }
6161
6262
6363
6464 @Callable(invoke)
6565 func test (hash) = throw("Error")
6666
6767
6868
6969 @Callable(invoke)
7070 func addArtwork (hash,json,nfts,signID) = {
7171 let id = toBase58String(invoke.transactionId)
7272 let callerAddress = toBase58String(invoke.caller.bytes)
7373 let entryExist = getStringByKey(((hash + "_") + callerAddress))
7474 let entryDate = lastBlock.timestamp
7575 let nftArray = split(nfts, "|")
7676 let numberOfNFTs = size(nftArray)
7777 let checkIDs = {
7878 let $list28222857 = nftArray
7979 let $size28222857 = size($list28222857)
8080 let $acc028222857 = 0
8181 if (($size28222857 == 0))
8282 then $acc028222857
8383 else {
8484 let $acc128222857 = validateNFTs($acc028222857, $list28222857[0])
8585 if (($size28222857 == 1))
8686 then $acc128222857
8787 else {
8888 let $acc228222857 = validateNFTs($acc128222857, $list28222857[1])
8989 if (($size28222857 == 2))
9090 then $acc228222857
9191 else {
9292 let $acc328222857 = validateNFTs($acc228222857, $list28222857[2])
9393 if (($size28222857 == 3))
9494 then $acc328222857
9595 else {
9696 let $acc428222857 = validateNFTs($acc328222857, $list28222857[3])
9797 if (($size28222857 == 4))
9898 then $acc428222857
9999 else {
100100 let $acc528222857 = validateNFTs($acc428222857, $list28222857[4])
101101 if (($size28222857 == 5))
102102 then $acc528222857
103103 else {
104104 let $acc628222857 = validateNFTs($acc528222857, $list28222857[5])
105105 if (($size28222857 == 6))
106106 then $acc628222857
107107 else {
108108 let $acc728222857 = validateNFTs($acc628222857, $list28222857[6])
109109 if (($size28222857 == 7))
110110 then $acc728222857
111111 else {
112112 let $acc828222857 = validateNFTs($acc728222857, $list28222857[7])
113113 if (($size28222857 == 8))
114114 then $acc828222857
115115 else {
116116 let $acc928222857 = validateNFTs($acc828222857, $list28222857[8])
117117 if (($size28222857 == 9))
118118 then $acc928222857
119119 else {
120120 let $acc1028222857 = validateNFTs($acc928222857, $list28222857[9])
121121 if (($size28222857 == 10))
122122 then $acc1028222857
123123 else {
124124 let $acc1128222857 = validateNFTs($acc1028222857, $list28222857[10])
125125 throw("List size exceed 10")
126126 }
127127 }
128128 }
129129 }
130130 }
131131 }
132132 }
133133 }
134134 }
135135 }
136136 }
137137 }
138138 let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) {
139139 case s: String =>
140140 s
141141 case _ =>
142142 userUnregistered
143143 }
144144 if ((userIsRegistered == userUnregistered))
145145 then throw("Please register this account first")
146146 else if ((userIsRegistered == userSuspended))
147147 then throw("Your account is suspended")
148148 else if ((numberOfNFTs > 10))
149149 then throw("Maximum 10 editions per artwork")
150150 else if ((checkIDs != numberOfNFTs))
151151 then throw("Please verify that all NFT ids are valid.")
152152 else if ((entryExist != ""))
153153 then throw("This artwork is already registered")
154154 else if ((size(hash) > 64))
155155 then throw("Hash is too long, 64 characters max.")
156156 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)])
157157 }
158158
159159
160160
161161 @Callable(invoke)
162162 func updateArtworkInfos (hash,json) = {
163163 let id = toBase58String(invoke.transactionId)
164164 let callerAddress = toBase58String(invoke.caller.bytes)
165165 let entryExist = getStringByKey(((hash + "_") + callerAddress))
166166 let isOwner = isDefined(getString(this, ((hash + "_") + callerAddress)))
167167 let userIsRegistered = match getString(this, ("user_status_" + callerAddress)) {
168168 case s: String =>
169169 s
170170 case _ =>
171171 userUnregistered
172172 }
173173 if (!(isOwner))
174174 then throw("You are not the creator of this artwork")
175175 else if ((userIsRegistered == userSuspended))
176176 then throw("Your account is suspended")
177- else if ((entryExist != "NONE"))
178- then throw("This artwork is already registered")
177+ else if ((entryExist == ""))
178+ then throw("This artwork desn't exist")
179179 else if ((size(hash) > 64))
180180 then throw("Hash is too long, 64 characters max.")
181181 else WriteSet([DataEntry(((("art_json_" + id) + "_") + callerAddress), json)])
182182 }
183183
184184

github/deemru/w8io/169f3d6 
30.81 ms