tx · 6UizN46Thsu4CYNoex9qvHATgwUN7amsVoqCP5Rq1qar

3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb:  -0.00700000 Waves

2023.03.17 20:50 [2494327] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves

{ "type": 13, "id": "6UizN46Thsu4CYNoex9qvHATgwUN7amsVoqCP5Rq1qar", "fee": 700000, "feeAssetId": null, "timestamp": 1679075428756, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "5byEuysrUEHRgWeeqoddwcF9GyN4um5mP4LKkWuDe345zf879rtdPGjx6dev7FL7uKseXYDb8GAVjaQYCYtxL9dz" ], "script": "base64:BgJTCAISBAoCGBgSBQoDCBgYEgQKAggIEgQKAggIEgQKAggIEgUKAwgICBIDCgECEgMKAQgSBAoCCAgSBQoDCAgIEgQKAggIEgYKBAgBAQESBAoCAQEKAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAMdG9rZW5QYXltZW50CQEHQWRkcmVzcwEJARFAZXh0ck5hdGl2ZSgxMDU3KQECDHRva2VuUGF5bWVudAEMb25seUludGVybmFsAQZjYWxsZXIDCQAAAgUGY2FsbGVyBQR0aGlzBQR1bml0CQACAQIST25seS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29uBQtuZXdMZW5kSnNvbgQGaW5zZXJ0CgABQAkA/AcEBQhkQXBwSnNvbgIJYWRkVG9KU09OCQDMCAIIBQpkZWxldGVMZW5kAl8yCQDMCAIJAMwIAgUGbGVuZElkCQDMCAICCWxlbmRDb3VudAUDbmlsCQDMCAIJAMwIAgULbmV3TGVuZEpzb24JAMwIAgUMbmV3TGVuZENvdW50BQNuaWwFA25pbAUDbmlsAwkAAQIFAUACBlN0cmluZwUBQAkAAgEJAKwCAgkAAwEFAUACGyBjb3VsZG4ndCBiZSBjYXN0IHRvIFN0cmluZwMJAAACBQZpbnNlcnQFBmluc2VydAkAzAgCCQELU3RyaW5nRW50cnkCAgVMZW5kcwUGaW5zZXJ0BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AyMIqnQ==", "height": 2494327, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EoYXaCXCFLuJZWJCV1wBATPTUHo4SKcbf5PTQNyMA3Bj Next: Ac7KgJShdfGeVRyAYi9gHEqRks3d8tp4u92cfn2k2T1Y Diff:
OldNewDifferences
156156 if ((delete == delete))
157157 then {
158158 let lendId = delete._1
159- let newCount = toString((parseIntValue(lendId) + 1))
160- let make = {
161- let @ = invoke(dAppJson, "makeJSON", [["supportedInterface", "assetdId", "tokenURI", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed", "rents"], ["0", assetId, tokenURI, toString(i.caller), toString(timeUnitSeconds), toString(timeUnitPrice), toString(timeUnitCount), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSeconds * timeUnitCount))), "0", "0", "{\"name\":\"Rents\",\"rentCount\":\"0\"}"]], nil)
162- if ($isInstanceOf(@, "String"))
163- then @
164- else throw(($getType(@) + " couldn't be cast to String"))
165- }
166- if ((make == make))
167- then {
168- let insert = {
169- let @ = invoke(dAppJson, "addToJSON", [delete._2, [lendId, "lendCount"], [make, newCount]], nil)
170- if ($isInstanceOf(@, "String"))
171- then @
172- else throw(($getType(@) + " couldn't be cast to String"))
173- }
174- if ((insert == insert))
175- then [StringEntry("Lends", insert)]
176- else throw("Strict value is not equal to itself.")
177- }
178- else throw("Strict value is not equal to itself.")
159+[StringEntry("Debug", lendId)]
179160 }
180161 else throw("Strict value is not equal to itself.")
181162 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let collectionName = getStringValue("collectionName")
55
66 let symbol = getStringValue("symbol")
77
88 let description = getStringValue("description")
99
1010 let totalAmount = getIntegerValue("totalAmount")
1111
1212 let dAppJson = Address(fromBase58String("3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7"))
1313
1414 let tokenPayment = Address(getBinaryValue("tokenPayment"))
1515
1616 func onlyInternal (caller) = if ((caller == this))
1717 then unit
1818 else throw("Only internal call")
1919
2020
2121 func transferOrNot (to,assetId) = if ((to == this))
2222 then StringEntry("костыль", "костыль")
2323 else ScriptTransfer(to, 1, assetId)
2424
2525
2626 func parseIdtoAsset (assetId) = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Can't find asset by asset id")
2727
2828
2929 func checkAssetOwner (caller,assetId) = if ((assetBalance(caller, fromBase58String(assetId)) == 1))
3030 then unit
3131 else throw("Only asset owner")
3232
3333
3434 @Callable(i)
3535 func makeJSONInternal (arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), {
3636 let res = invoke(dAppJson, "makeJSON", [arrKeys, arrValues], nil)
3737 if ((res == res))
3838 then $Tuple2(nil, res)
3939 else throw("Strict value is not equal to itself.")
4040 })
4141
4242
4343
4444 @Callable(i)
4545 func addToJSONInternal (json,arrKeys,arrValues) = valueOrElse(onlyInternal(i.caller), {
4646 let res = invoke(dAppJson, "addToJSON", [json, arrKeys, arrValues], nil)
4747 if ((res == res))
4848 then $Tuple2(nil, res)
4949 else throw("Strict value is not equal to itself.")
5050 })
5151
5252
5353
5454 @Callable(i)
5555 func readByJSONKeyInternal (json,key) = valueOrElse(onlyInternal(i.caller), {
5656 let res = invoke(dAppJson, "readByJSONKey", [json, key], nil)
5757 if ((res == res))
5858 then $Tuple2(nil, res)
5959 else throw("Strict value is not equal to itself.")
6060 })
6161
6262
6363
6464 @Callable(i)
6565 func deleteByJSONKeyInternal (json,key) = valueOrElse(onlyInternal(i.caller), {
6666 let res = invoke(dAppJson, "deleteByJSONKey", [json, key], nil)
6767 if ((res == res))
6868 then $Tuple2(nil, res)
6969 else throw("Strict value is not equal to itself.")
7070 })
7171
7272
7373
7474 @Callable(i)
7575 func storageJsonInternal (jsonKey,jsonString) = valueOrElse(onlyInternal(i.caller), [StringEntry(jsonKey, jsonString)])
7676
7777
7878
7979 @Callable(i)
8080 func setUser (assetId,user,expires) = {
8181 let res = invoke(dAppJson, "makeJSON", [["user", "expires"], [user, expires]], nil)
8282 if ((res == res))
8383 then $Tuple2([StringEntry(("userOf-" + assetId), {
8484 let @ = res
8585 if ($isInstanceOf(@, "String"))
8686 then @
8787 else throw(($getType(@) + " couldn't be cast to String"))
8888 })], res)
8989 else throw("Strict value is not equal to itself.")
9090 }
9191
9292
9393
9494 @Callable(i)
9595 func setTokenPayment (assetId) = valueOrElse(onlyInternal(i.caller), [BinaryEntry("tokenPayment", assetId)])
9696
9797
9898
9999 @Callable(i)
100100 func deleteValueByKey (key) = valueOrElse(onlyInternal(i.caller), [DeleteEntry(key)])
101101
102102
103103
104104 @Callable(i)
105105 func setString (key,value) = valueOrElse(onlyInternal(i.caller), [StringEntry(key, value)])
106106
107107
108108
109109 @Callable(i)
110110 func init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)])
111111
112112
113113
114114 @Callable(i)
115115 func mint (to,tokenURI) = {
116116 let tokenId = (totalAmount + 1)
117117 let preName = ((symbol + "#") + toString(tokenId))
118118 let name = if ((16 >= size(preName)))
119119 then preName
120120 else toString(tokenId)
121121 let json = {
122122 let @ = invoke(dAppJson, "makeJSON", [["tokenURI"], [tokenURI]], nil)
123123 if ($isInstanceOf(@, "String"))
124124 then @
125125 else throw(($getType(@) + " couldn't be cast to String"))
126126 }
127127 let asset = Issue(name, json, 1, 0, false, unit, height)
128128 let assetId = calculateAssetId(asset)
129129 let toAddress = Address(fromBase58String(to))
130130 let transfer = transferOrNot(toAddress, assetId)
131131 if ((transfer == transfer))
132132 then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)]
133133 else throw("Strict value is not equal to itself.")
134134 }
135135
136136
137137
138138 @Callable(i)
139139 func initLend (assetId,timeUnitSeconds,timeUnitPrice,timeUnitCount) = valueOrElse(checkAssetOwner(i.caller, assetId), {
140140 let asset = parseIdtoAsset(assetId)
141141 let tokenURI = {
142142 let @ = invoke(dAppJson, "readByJSONKey", [asset.description, "tokenURI"], nil)
143143 if ($isInstanceOf(@, "String"))
144144 then @
145145 else throw(($getType(@) + " couldn't be cast to String"))
146146 }
147147 if ((tokenURI == tokenURI))
148148 then {
149149 let lends = getStringValue("Lends")
150150 let delete = {
151151 let @ = invoke(dAppJson, "deleteByJSONKey", [lends, "lendCount"], nil)
152152 if ($isInstanceOf(@, "(String, String)"))
153153 then @
154154 else throw(($getType(@) + " couldn't be cast to (String, String)"))
155155 }
156156 if ((delete == delete))
157157 then {
158158 let lendId = delete._1
159- let newCount = toString((parseIntValue(lendId) + 1))
160- let make = {
161- let @ = invoke(dAppJson, "makeJSON", [["supportedInterface", "assetdId", "tokenURI", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed", "rents"], ["0", assetId, tokenURI, toString(i.caller), toString(timeUnitSeconds), toString(timeUnitPrice), toString(timeUnitCount), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSeconds * timeUnitCount))), "0", "0", "{\"name\":\"Rents\",\"rentCount\":\"0\"}"]], nil)
162- if ($isInstanceOf(@, "String"))
163- then @
164- else throw(($getType(@) + " couldn't be cast to String"))
165- }
166- if ((make == make))
167- then {
168- let insert = {
169- let @ = invoke(dAppJson, "addToJSON", [delete._2, [lendId, "lendCount"], [make, newCount]], nil)
170- if ($isInstanceOf(@, "String"))
171- then @
172- else throw(($getType(@) + " couldn't be cast to String"))
173- }
174- if ((insert == insert))
175- then [StringEntry("Lends", insert)]
176- else throw("Strict value is not equal to itself.")
177- }
178- else throw("Strict value is not equal to itself.")
159+[StringEntry("Debug", lendId)]
179160 }
180161 else throw("Strict value is not equal to itself.")
181162 }
182163 else throw("Strict value is not equal to itself.")
183164 })
184165
185166
186167
187168 @Callable(i)
188169 func initRent (lendId,timeUnitCount) = {
189170 let lendIdString = toString(lendId)
190171 let lends = getStringValue("Lends")
191172 let deleteLendCount = {
192173 let @ = invoke(dAppJson, "deleteByJSONKey", [lends, "lendCount"], nil)
193174 if ($isInstanceOf(@, "(String, String)"))
194175 then @
195176 else throw(($getType(@) + " couldn't be cast to (String, String)"))
196177 }
197178 if ((deleteLendCount == deleteLendCount))
198179 then {
199180 let deleteLend = {
200181 let @ = invoke(dAppJson, "deleteByJSONKey", [deleteLendCount._2, lendIdString], nil)
201182 if ($isInstanceOf(@, "(String, String)"))
202183 then @
203184 else throw(($getType(@) + " couldn't be cast to (String, String)"))
204185 }
205186 if ((deleteLend == deleteLend))
206187 then {
207188 let deleteRents = {
208189 let @ = invoke(dAppJson, "deleteByJSONKey", [deleteLend._1, "rents"], nil)
209190 if ($isInstanceOf(@, "(String, String)"))
210191 then @
211192 else throw(($getType(@) + " couldn't be cast to (String, String)"))
212193 }
213194 if ((deleteRents == deleteRents))
214195 then {
215196 let deleteRentCount = {
216197 let @ = invoke(dAppJson, "deleteByJSONKey", [deleteRents._1, "rentCount"], nil)
217198 if ($isInstanceOf(@, "(String, String)"))
218199 then @
219200 else throw(($getType(@) + " couldn't be cast to (String, String)"))
220201 }
221202 if ((deleteRentCount == deleteRentCount))
222203 then {
223204 let rentId = deleteRentCount._1
224205 let newLendCount = toString((parseIntValue(deleteLendCount._1) + 1))
225206 let newRentCount = toString((parseIntValue(rentId) + 1))
226207 let timeUnitSeconds = parseIntValue({
227208 let @ = invoke(dAppJson, "readByJSONKey", [deleteRents._2, "timeUnitSeconds"], nil)
228209 if ($isInstanceOf(@, "String"))
229210 then @
230211 else throw(($getType(@) + " couldn't be cast to String"))
231212 })
232213 if ((timeUnitSeconds == timeUnitSeconds))
233214 then {
234215 let rentJson = {
235216 let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), "0", timeUnitCount, toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSeconds * timeUnitCount))), "0"]], nil)
236217 if ($isInstanceOf(@, "String"))
237218 then @
238219 else throw(($getType(@) + " couldn't be cast to String"))
239220 }
240221 if ((rentJson == rentJson))
241222 then {
242223 let newRentsJson = invoke(dAppJson, "addToJSON", [deleteRentCount._2, [rentId, "rentCount"], [rentJson, newRentCount]], nil)
243224 if ((newRentsJson == newRentsJson))
244225 then {
245226 let newLendJson = invoke(dAppJson, "addToJSON", [deleteRents._2, ["rents"], [newRentsJson]], nil)
246227 if ((newLendJson == newLendJson))
247228 then {
248229 let insert = {
249230 let @ = invoke(dAppJson, "addToJSON", [deleteLend._2, [lendId, "lendCount"], [newLendJson, newLendCount]], nil)
250231 if ($isInstanceOf(@, "String"))
251232 then @
252233 else throw(($getType(@) + " couldn't be cast to String"))
253234 }
254235 if ((insert == insert))
255236 then [StringEntry("Lends", insert)]
256237 else throw("Strict value is not equal to itself.")
257238 }
258239 else throw("Strict value is not equal to itself.")
259240 }
260241 else throw("Strict value is not equal to itself.")
261242 }
262243 else throw("Strict value is not equal to itself.")
263244 }
264245 else throw("Strict value is not equal to itself.")
265246 }
266247 else throw("Strict value is not equal to itself.")
267248 }
268249 else throw("Strict value is not equal to itself.")
269250 }
270251 else throw("Strict value is not equal to itself.")
271252 }
272253 else throw("Strict value is not equal to itself.")
273254 }
274255
275256

github/deemru/w8io/169f3d6 
36.15 ms