tx · 7ikwBsbKT3LvtVg9jsZSrQGQkjHiAP4uMCb64TA12yzX

3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn:  -0.00500000 Waves

2023.03.21 17:50 [2499914] smart account 3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn > SELF 0.00000000 Waves

{ "type": 13, "id": "7ikwBsbKT3LvtVg9jsZSrQGQkjHiAP4uMCb64TA12yzX", "fee": 500000, "feeAssetId": null, "timestamp": 1679410230487, "version": 2, "chainId": 84, "sender": "3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn", "senderPublicKey": "CZeucjRLCKrkiP9zuj9KbLe23Wv9DywFzHBqNDnte51B", "proofs": [ "5frZYHrKoaEMrru6mEfid18YMvSQDSEUc3NvsNKEHSEzTCSLitDhMmvs5fRAamsuaZyFaX4wCTBGBoHTk2Z1K6B6" ], "script": "base64:BgIpCAISBAoCCAgSBAoCCAESBgoECAgICBIDCgEIEgYKBAgBAQESBAoCAQEMAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAHYmFzZVVSSQkBEUBleHRyTmF0aXZlKDEwNTgpAQIHYmFzZVVSSQAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAJbGVuZENvdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAglsZW5kQ291bnQBDG9ubHlJbnRlcm5hbAEGY2FsbGVyAwkAAAIFBmNhbGxlcgUEdGhpcwUEdW5pdAkAAgECEk9ubHkgaW50ZXJuYWwgY2FsbAENdHJhbnN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zSW50BRJ0aW1lVW5pdFNlY29uZHNJbnQECHJlbnRKc29uCgABQAkA/AcEBQhkQXBwSnNvbgIIbWFrZUpTT04JAMwIAgkAzAgCAghjdXN0b21lcgkAzAgCAg10aW1lVW5pdENvdW50CQDMCAICDnN0YXJ0VGltZXN0YW1wCQDMCAICDGVuZFRpbWVzdGFtcAkAzAgCAgZjbG9zZWQFA25pbAkAzAgCCQDMCAIJAKUIAQgFAWkGY2FsbGVyCQDMCAIFDXRpbWVVbml0Q291bnQJAMwIAgkApAMBCAUJbGFzdEJsb2NrCXRpbWVzdGFtcAkAzAgCCQCkAwEJAGQCCAUJbGFzdEJsb2NrCXRpbWVzdGFtcAkAaAIFEnRpbWVVbml0U2Vjb25kc0ludAUNdGltZVVuaXRDb3VudAkAzAgCAgEwBQNuaWwFA25pbAUDbmlsAwkAAQIFAUACBlN0cmluZwUBQAkAAgEJAKwCAgkAAwEFAUACGyBjb3VsZG4ndCBiZSBjYXN0IHRvIFN0cmluZwMJAAACBQhyZW50SnNvbgUIcmVudEpzb24JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgIPbGVuZC1yZW50Q291bnQtBQxsZW5kSWRTdHJpbmcJAGQCBQZyZW50SWQAAQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkArAICAgpsZW5kLXJlbnQtBQxsZW5kSWRTdHJpbmcCAS0FDHJlbnRJZFN0cmluZwUIcmVudEpzb24FA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgCypDE5", "height": 2499914, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5bQqQ852P1NQkftgDpNq4M64z7PCpmmDPHfYMfR7ZCUT Next: 5D4csGQEgnVfYtnWxw2QUrq1HTDCKsEi3kAf1fzBKRr1 Diff:
OldNewDifferences
127127 if ((timeUnitSecondsInt == timeUnitSecondsInt))
128128 then {
129129 let rentJson = {
130- let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), "0", timeUnitCount, toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil)
130+ let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), timeUnitCount, toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil)
131131 if ($isInstanceOf(@, "String"))
132132 then @
133133 else throw(($getType(@) + " couldn't be cast to String"))
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 baseURI = getStringValue("baseURI")
1313
1414 let dAppJson = Address(fromBase58String("3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7"))
1515
1616 let lendCount = getIntegerValue("lendCount")
1717
1818 func onlyInternal (caller) = if ((caller == this))
1919 then unit
2020 else throw("Only internal call")
2121
2222
2323 func transferOrNot (to,assetId) = if ((to == this))
2424 then StringEntry("smth", "smth")
2525 else ScriptTransfer(to, 1, assetId)
2626
2727
2828 func parseIdtoAsset (assetId) = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Can't find asset by asset id")
2929
3030
3131 func checkAssetOwner (caller,assetId) = if ((assetBalance(caller, fromBase58String(assetId)) == 1))
3232 then unit
3333 else throw("Only asset owner")
3434
3535
3636 func getRentCount (lendId) = {
3737 let lendIdString = toString(lendId)
3838 getIntegerValue(("lend-rentCount-" + lendIdString))
3939 }
4040
4141
4242 @Callable(i)
4343 func setString (_key,_value) = [StringEntry(_key, _value)]
4444
4545
4646
4747 @Callable(i)
4848 func setInt (_key,_value) = [IntegerEntry(_key, _value)]
4949
5050
5151
5252 @Callable(i)
5353 func init (_collectionName,_symbol,_description,_baseURI) = valueOrElse(onlyInternal(i.caller), [StringEntry("collectionName", _collectionName), StringEntry("symbol", _symbol), StringEntry("description", _description), IntegerEntry("totalAmount", 0), StringEntry("baseURI", _baseURI)])
5454
5555
5656
5757 @Callable(i)
5858 func mint (to) = {
5959 let tokenId = (totalAmount + 1)
6060 let tokenIdString = toString(tokenId)
6161 let preName = ((symbol + "#") + tokenIdString)
6262 let name = if ((16 >= size(preName)))
6363 then preName
6464 else tokenIdString
6565 let tokenURI = (baseURI + tokenIdString)
6666 let json = {
6767 let @ = invoke(dAppJson, "makeJSON", [["tokenURI"], [tokenURI]], nil)
6868 if ($isInstanceOf(@, "String"))
6969 then @
7070 else throw(($getType(@) + " couldn't be cast to String"))
7171 }
7272 let asset = Issue(name, json, 1, 0, false, unit, height)
7373 let assetId = calculateAssetId(asset)
7474 let toAddress = Address(fromBase58String(to))
7575 let transfer = transferOrNot(toAddress, assetId)
7676 if ((transfer == transfer))
7777 then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)]
7878 else throw("Strict value is not equal to itself.")
7979 }
8080
8181
8282
8383 @Callable(i)
8484 func initLend (assetId,timeUnitSeconds,timeUnitPrice,timeUnitCount) = valueOrElse(checkAssetOwner(i.caller, assetId), {
8585 let asset = parseIdtoAsset(assetId)
8686 let tokenURI = {
8787 let @ = invoke(dAppJson, "readByJSONKey", [asset.description, "tokenURI"], nil)
8888 if ($isInstanceOf(@, "String"))
8989 then @
9090 else throw(($getType(@) + " couldn't be cast to String"))
9191 }
9292 if ((tokenURI == tokenURI))
9393 then {
9494 let lendJson = {
9595 let @ = invoke(dAppJson, "makeJSON", [["supportedInterface", "assetdId", "tokenURI", "owner", "timeUnitSeconds", "timeUnitPrice", "timeUnitCount", "startTimestamp", "endTimestamp", "deposit", "claimed"], ["0", assetId, tokenURI, toString(i.caller), toString(timeUnitSeconds), toString(timeUnitPrice), toString(timeUnitCount), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSeconds * timeUnitCount))), "0", "0"]], nil)
9696 if ($isInstanceOf(@, "String"))
9797 then @
9898 else throw(($getType(@) + " couldn't be cast to String"))
9999 }
100100 if ((lendJson == lendJson))
101101 then {
102102 let lendIdString = toString(lendCount)
103103 [IntegerEntry("lendCount", (lendCount + 1)), IntegerEntry(("lend-rentCount-" + lendIdString), 0), StringEntry(("lend-" + lendIdString), lendJson)]
104104 }
105105 else throw("Strict value is not equal to itself.")
106106 }
107107 else throw("Strict value is not equal to itself.")
108108 })
109109
110110
111111
112112 @Callable(i)
113113 func initRent (lendId,timeUnitCount) = {
114114 let lendIdString = toString(lendId)
115115 let lendJson = getStringValue(("lend-" + lendIdString))
116116 let rentId = getRentCount(lendId)
117117 let rentIdString = toString(rentId)
118118 let timeUnitSeconds = {
119119 let @ = invoke(dAppJson, "readByJSONKey", [lendJson, "timeUnitSeconds"], nil)
120120 if ($isInstanceOf(@, "String"))
121121 then @
122122 else throw(($getType(@) + " couldn't be cast to String"))
123123 }
124124 if ((timeUnitSeconds == timeUnitSeconds))
125125 then {
126126 let timeUnitSecondsInt = parseIntValue(timeUnitSeconds)
127127 if ((timeUnitSecondsInt == timeUnitSecondsInt))
128128 then {
129129 let rentJson = {
130- let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), "0", timeUnitCount, toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil)
130+ let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), timeUnitCount, toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil)
131131 if ($isInstanceOf(@, "String"))
132132 then @
133133 else throw(($getType(@) + " couldn't be cast to String"))
134134 }
135135 if ((rentJson == rentJson))
136136 then [IntegerEntry(("lend-rentCount-" + lendIdString), (rentId + 1)), StringEntry(((("lend-rent-" + lendIdString) + "-") + rentIdString), rentJson)]
137137 else throw("Strict value is not equal to itself.")
138138 }
139139 else throw("Strict value is not equal to itself.")
140140 }
141141 else throw("Strict value is not equal to itself.")
142142 }
143143
144144

github/deemru/w8io/026f985 
66.65 ms