tx · GZAxqHoHsKmeybDgHhXdzusp6ATCnfDN2X5T5pE4k2nX

3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb:  -0.00500000 Waves

2023.03.16 23:00 [2493031] smart account 3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb > SELF 0.00000000 Waves

{ "type": 13, "id": "GZAxqHoHsKmeybDgHhXdzusp6ATCnfDN2X5T5pE4k2nX", "fee": 500000, "feeAssetId": null, "timestamp": 1678996884121, "version": 2, "chainId": 84, "sender": "3MrQ4g9YCsAN2Wr4QUXiWAPhNPv7DGdQNWb", "senderPublicKey": "2VQGRNRWyFAZvjDtkgZwdZcTwZvBJJ61n8zJfYYxm5eK", "proofs": [ "tfYWkiWpHG7mNGPZfK1R6i6rtDeJ2WhBoeFUQqieu91pW1h9H8s6kSePZEVFQDW2D96jH7ZZwUULshZUiaz8xQD" ], "script": "base64:BgJCCAISBAoCGBgSBQoDCBgYEgQKAggIEgQKAggIEgQKAggIEgUKAwgICBIDCgECEgUKAwgICBIECgIICBIGCgQIAQEBCgAOY29sbGVjdGlvbk5hbWUJARFAZXh0ck5hdGl2ZSgxMDU4KQECDmNvbGxlY3Rpb25OYW1lAAZzeW1ib2wJARFAZXh0ck5hdGl2ZSgxMDU4KQECBnN5bWJvbAALZGVzY3JpcHRpb24JARFAZXh0ck5hdGl2ZSgxMDU4KQECC2Rlc2NyaXB0aW9uAAt0b3RhbEFtb3VudAkBEUBleHRyTmF0aXZlKDEwNTUpAQILdG90YWxBbW91bnQACGRBcHBKc29uCQEHQWRkcmVzcwEJANkEAQIjM01yR2FaVlJoa25FR2ZISjE5dHRVUE5uRFJvRnFjSGhWTjcADHRva2VuUGF5bWVudAkBB0FkZHJlc3MBCQERQGV4dHJOYXRpdmUoMTA1NykBAgx0b2tlblBheW1lbnQBDG9ubHlJbnRlcm5hbAEGY2FsbGVyAwkAAAIFBmNhbGxlcgUEdGhpcwUEdW5pdAkAAgECEk9ubHkgaW50ZXJuY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wCQDMCAICB2RlcG9zaXQJAMwIAgIHY2xhaW1lZAkAzAgCAgVyZW50cwUDbmlsCQDMCAIJAMwIAgAACQDMCAIFB2Fzc2V0SWQJAMwIAgUIdG9rZW5VcmkJAMwIAgkApQgBCAUBaQZjYWxsZXIJAMwIAgUPdGltZVVuaXRTZWNvbmRzCQDMCAIFDXRpbWVVbml0UHJpY2UJAMwIAgUNdGltZVVuaXRDb3VudAkAzAgCCAUJbGFzdEJsb2NrCXRpbWVzdGFtcAkAzAgCCQBkAggFCWxhc3RCbG9jawl0aW1lc3RhbXAJAGgCBQ90aW1lVW5pdFNlY29uZHMFDXRpbWVVbml0Q291bnQJAMwIAgAACQDMCAIHCQDMCAICDXsiY291bnQiOiIwIn0FA25pbAUDbmlsBQNuaWwDCQAAAgUEcmVzMgUEcmVzMgkAzAgCCQELU3RyaW5nRW50cnkCAgVMZW5kcwoAAUAFBHJlczIDCQABAgUBQAIGU3RyaW5nBQFACQACAQkArAICCQADAQUBQAIbIGNvdWxkbid0IGJlIGNhc3QgdG8gU3RyaW5nBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4APwP32Q==", "height": 2493031, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bgc366aQ2T1tEam2r6AE3DYdSodG8owVmXG6tyBBF7eU Next: 4FvmnaNaKh3PmNYgNXtzRoPqrJ3Ma7XB5zusAWNVJJxL Diff:
OldNewDifferences
131131 then @
132132 else throw(($getType(@) + " couldn't be cast to String"))
133133 }) + 1)
134- nil
134+ let res2 = invoke(dAppJson, "makeJSON", [["supportedInterface", "assetdId", "tokenUri", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed", "rents"], [0, assetId, tokenUri, toString(i.caller), timeUnitSeconds, timeUnitPrice, timeUnitCount, lastBlock.timestamp, (lastBlock.timestamp + (timeUnitSeconds * timeUnitCount)), 0, false, "{\"count\":\"0\"}"]], nil)
135+ if ((res2 == res2))
136+ then [StringEntry("Lends", {
137+ let @ = res2
138+ if ($isInstanceOf(@, "String"))
139+ then @
140+ else throw(($getType(@) + " couldn't be cast to String"))
141+ })]
142+ else throw("Strict value is not equal to itself.")
135143 })
136144
137145
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 init (collectionName,symbol,description) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", collectionName), StringEntry("symbol", symbol), StringEntry("description", description), IntegerEntry("totalAmount", 0)])
101101
102102
103103
104104 @Callable(i)
105105 func mint (to,tokenURI) = valueOrElse(onlyInternal(i.caller), {
106106 let tokenId = (totalAmount + 1)
107107 let preName = ((symbol + "#") + toString(tokenId))
108108 let name = if ((16 >= size(preName)))
109109 then preName
110110 else toString(tokenId)
111111 let asset = Issue(name, (("{uri:\"" + tokenURI) + "\"}"), 1, 0, false, unit, height)
112112 let assetId = calculateAssetId(asset)
113113 let toAddress = Address(fromBase58String(to))
114114 let transfer = transferOrNot(toAddress, assetId)
115115 if ((transfer == transfer))
116116 then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)]
117117 else throw("Strict value is not equal to itself.")
118118 })
119119
120120
121121
122122 @Callable(i)
123123 func initLend (assetId,timeUnitSeconds,timeUnitPrice,timeUnitCount) = valueOrElse(checkAssetOwner(i.caller, assetId), {
124124 let asset = parseIdtoAsset(assetId)
125125 let tokenUri = asset.description
126126 let lends = getStringValue("Lends")
127127 let res1 = invoke(dAppJson, "readByJSONKey", [lends, "count"], nil)
128128 let lendId = (parseIntValue({
129129 let @ = res1
130130 if ($isInstanceOf(@, "String"))
131131 then @
132132 else throw(($getType(@) + " couldn't be cast to String"))
133133 }) + 1)
134- nil
134+ let res2 = invoke(dAppJson, "makeJSON", [["supportedInterface", "assetdId", "tokenUri", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed", "rents"], [0, assetId, tokenUri, toString(i.caller), timeUnitSeconds, timeUnitPrice, timeUnitCount, lastBlock.timestamp, (lastBlock.timestamp + (timeUnitSeconds * timeUnitCount)), 0, false, "{\"count\":\"0\"}"]], nil)
135+ if ((res2 == res2))
136+ then [StringEntry("Lends", {
137+ let @ = res2
138+ if ($isInstanceOf(@, "String"))
139+ then @
140+ else throw(($getType(@) + " couldn't be cast to String"))
141+ })]
142+ else throw("Strict value is not equal to itself.")
135143 })
136144
137145

github/deemru/w8io/026f985 
27.91 ms