tx · CfkyJcb6xH9p9VRwqPKcLhfkoBsyqZRsFWRqF6VaZZJE

3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn:  -0.00800000 Waves

2023.03.22 19:04 [2501429] smart account 3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn > SELF 0.00000000 Waves

{ "type": 13, "id": "CfkyJcb6xH9p9VRwqPKcLhfkoBsyqZRsFWRqF6VaZZJE", "fee": 800000, "feeAssetId": null, "timestamp": 1679501104181, "version": 2, "chainId": 84, "sender": "3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn", "senderPublicKey": "CZeucjRLCKrkiP9zuj9KbLe23Wv9DywFzHBqNDnte51B", "proofs": [ "4m6v81fp72siFdwNbc5vPW39VjeGYkowZYisisNqH89Nj4qE1jz3ikGqqFs1wJ8225Pcnm1PpJFfmnXMTtwFWN8H" ], "script": "base64:BgJKCAISBAoCCAgSBAoCCAESAwoBCBIGCgQICAgIEgUKAwgICBIDCgECEgQKAggBEgMKAQgSBgoECAEBARIECgIBARIDCgEBEgMKAQEWAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAHYmFzZVVSSQkBEUBleHRyTmF0aXZlKDEwNTgpAQIHYmFzZVVSSQAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAMdG9rZW5QYXltZW50CQERQGV4dHJOYXRpdmUoMTA1NykBAgx0b2tlblBheW1lbnQAEXRva2VuUGF5bWVudEFzc2V0CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAOw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WwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQljbG9zZUxlbmQBBmxlbmRJZAkBC3ZhbHVlT3JFbHNlAgkBDmNoZWNrTGVuZE93bmVyAggFAWkGY2FsbGVyBQZsZW5kSWQEDGxlbmRJZFN0cmluZwkApAMBBQZsZW5kSWQJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICAgVsZW5kLQUMbGVuZElkU3RyaW5nCQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgIPbGVuZC1yZW50Q291bnQtBQxsZW5kSWRTdHJpbmcJAMwIAgkBDEludGVnZXJFbnRyeQICEGxlbmRDdXJyZW50Q291bnQJAGUCBRBsZW5kQ3VycmVudENvdW50AAEJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICAgpsZW5kLWNvc3QtBQxsZW5kSWRTdHJpbmcJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyCQELZ2V0TGVuZENvc3QBBQZsZW5kSWQFDHRva2VuUGF5bWVudAUDbmlsAWkBBHRlc3QBBmxlbmRJZAkAzAgCCQELU3RyaW5nRW50cnkCAgVEZWJ1ZwkBBmdldEtleQIJAQtnZXRMZW5kSnNvbgEFBmxlbmRJZAIFb3duZXIFA25pbACVUS1O", "height": 2501429, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JEFwwZT4fVoMmHv4gjiWJ4y4wSdtqpHXfjxGHyop9d5k Next: 8AiSkdmrXgbmFcy87nQZf8UaMohXacCJ1xcW8T94VV8v Diff:
OldNewDifferences
137137 @Callable(i)
138138 func mintTokens (to,amount) = {
139139 let reisue = Reissue(tokenPayment, amount, true)
140- let transfer = transferOrNot(i.caller, amount, tokenPayment)
140+ let toAddress = Address(fromBase58String(to))
141+ let transfer = transferOrNot(toAddress, amount, tokenPayment)
141142 if ((transfer == transfer))
142143 then [transfer, reisue]
143144 else throw("Strict value is not equal to itself.")
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 tokenPayment = getBinaryValue("tokenPayment")
1717
1818 let tokenPaymentAsset = valueOrErrorMessage(assetInfo(getBinaryValue("tokenPayment")), "token payment asset doesn't connect")
1919
2020 let lendCount = getIntegerValue("lendCount")
2121
2222 let lendCurrentCount = getIntegerValue("lendCurrentCount")
2323
2424 func parseIdtoAsset (assetId) = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Can't find asset by asset id")
2525
2626
2727 func transferOrNot (to,amount,assetId) = if ((to == this))
2828 then StringEntry("smth", "smth")
2929 else ScriptTransfer(to, amount, assetId)
3030
3131
3232 func getLendJson (lendId) = {
3333 let lendIdString = toString(lendId)
3434 getStringValue(("lend-" + lendIdString))
3535 }
3636
3737
3838 func getKey (lendJson,key) = {
3939 let timeUnitSeconds = {
4040 let @ = invoke(dAppJson, "readByJSONKey", [lendJson, key], nil)
4141 if ($isInstanceOf(@, "String"))
4242 then @
4343 else throw(($getType(@) + " couldn't be cast to String"))
4444 }
4545 if ((timeUnitSeconds == timeUnitSeconds))
4646 then timeUnitSeconds
4747 else throw("Strict value is not equal to itself.")
4848 }
4949
5050
5151 func getRentCount (lendId) = {
5252 let lendIdString = toString(lendId)
5353 getIntegerValue(("lend-rentCount-" + lendIdString))
5454 }
5555
5656
5757 func calcLendCost (lendId,timeUnitSeconds) = {
5858 let lendJson = getLendJson(lendId)
5959 let timeUnitPriceString = getKey(lendJson, "timeUnitPrice")
6060 if ((timeUnitPriceString == timeUnitPriceString))
6161 then {
6262 let timeUnitPrice = parseIntValue(timeUnitPriceString)
6363 (timeUnitSeconds * timeUnitPrice)
6464 }
6565 else throw("Strict value is not equal to itself.")
6666 }
6767
6868
6969 func getLendCost (lendId) = valueOrElse(getIntegerValue(("lend-cost-" + toString(lendId))), 0)
7070
7171
7272 func onlyInternal (caller) = if ((caller == this))
7373 then unit
7474 else throw("Only internal call")
7575
7676
7777 func checkAssetOwner (caller,assetId) = if ((assetBalance(caller, fromBase58String(assetId)) == 1))
7878 then unit
7979 else throw("Only asset owner")
8080
8181
8282 func checkPayment (payments,amount) = if ((payments[0].amount >= amount))
8383 then unit
8484 else throw("amount less then need")
8585
8686
8787 func checkAssetExists (assetId) = if (valueOrElse(getBoolean(assetId), false))
8888 then throw("this token already use")
8989 else unit
9090
9191
9292 func checkLendOwner (caller,lendId) = if ((getKey(getLendJson(lendId), "owner") != toString(caller)))
9393 then throw("you haven't perms")
9494 else unit
9595
9696
9797 @Callable(i)
9898 func setString (_key,_value) = valueOrElse(onlyInternal(i.caller), [StringEntry(_key, _value)])
9999
100100
101101
102102 @Callable(i)
103103 func setInt (_key,_value) = valueOrElse(onlyInternal(i.caller), [IntegerEntry(_key, _value)])
104104
105105
106106
107107 @Callable(i)
108108 func deleteEntry (_key) = valueOrElse(onlyInternal(i.caller), [DeleteEntry(_key)])
109109
110110
111111
112112 @Callable(i)
113113 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)])
114114
115115
116116
117117 @Callable(i)
118118 func setUser (assetId,user,expires) = {
119119 let res = invoke(dAppJson, "makeJSON", [["user", "expires"], [user, expires]], nil)
120120 if ((res == res))
121121 then $Tuple2([StringEntry(("userOf-" + assetId), {
122122 let @ = res
123123 if ($isInstanceOf(@, "String"))
124124 then @
125125 else throw(($getType(@) + " couldn't be cast to String"))
126126 })], res)
127127 else throw("Strict value is not equal to itself.")
128128 }
129129
130130
131131
132132 @Callable(i)
133133 func setTokenPayment (assetBinary) = valueOrElse(onlyInternal(i.caller), [BinaryEntry("tokenPayment", assetBinary)])
134134
135135
136136
137137 @Callable(i)
138138 func mintTokens (to,amount) = {
139139 let reisue = Reissue(tokenPayment, amount, true)
140- let transfer = transferOrNot(i.caller, amount, tokenPayment)
140+ let toAddress = Address(fromBase58String(to))
141+ let transfer = transferOrNot(toAddress, amount, tokenPayment)
141142 if ((transfer == transfer))
142143 then [transfer, reisue]
143144 else throw("Strict value is not equal to itself.")
144145 }
145146
146147
147148
148149 @Callable(i)
149150 func mintNFT (to) = {
150151 let tokenId = (totalAmount + 1)
151152 let tokenIdString = toString(tokenId)
152153 let preName = ((symbol + "#") + tokenIdString)
153154 let name = if ((16 >= size(preName)))
154155 then preName
155156 else tokenIdString
156157 let tokenURI = (baseURI + tokenIdString)
157158 let json = {
158159 let @ = invoke(dAppJson, "makeJSON", [["tokenURI"], [tokenURI]], nil)
159160 if ($isInstanceOf(@, "String"))
160161 then @
161162 else throw(($getType(@) + " couldn't be cast to String"))
162163 }
163164 let asset = Issue(name, json, 1, 0, false, unit, height)
164165 let assetId = calculateAssetId(asset)
165166 let toAddress = Address(fromBase58String(to))
166167 let transfer = transferOrNot(toAddress, 1, assetId)
167168 if ((transfer == transfer))
168169 then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)]
169170 else throw("Strict value is not equal to itself.")
170171 }
171172
172173
173174
174175 @Callable(i)
175176 func initLend (assetId,timeUnitSeconds,timeUnitPrice,timeUnitCount) = valueOrElse(checkAssetOwner(i.caller, assetId), valueOrElse(checkAssetExists(assetId), {
176177 let asset = parseIdtoAsset(assetId)
177178 let tokenURI = {
178179 let @ = invoke(dAppJson, "readByJSONKey", [asset.description, "tokenURI"], nil)
179180 if ($isInstanceOf(@, "String"))
180181 then @
181182 else throw(($getType(@) + " couldn't be cast to String"))
182183 }
183184 if ((tokenURI == tokenURI))
184185 then {
185186 let lendJson = {
186187 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)
187188 if ($isInstanceOf(@, "String"))
188189 then @
189190 else throw(($getType(@) + " couldn't be cast to String"))
190191 }
191192 if ((lendJson == lendJson))
192193 then {
193194 let lendIdString = toString(lendCount)
194195 [IntegerEntry("lendCount", (lendCount + 1)), IntegerEntry("lendCurrentCount", (lendCurrentCount + 1)), IntegerEntry(("lend-rentCount-" + lendIdString), 0), StringEntry(("lend-" + lendIdString), lendJson), BooleanEntry(assetId, true)]
195196 }
196197 else throw("Strict value is not equal to itself.")
197198 }
198199 else throw("Strict value is not equal to itself.")
199200 }))
200201
201202
202203
203204 @Callable(i)
204205 func initRent (lendId,timeUnitCount) = valueOrElse(checkPayment(i.payments, calcLendCost(lendId, timeUnitCount)), {
205206 let lendIdString = toString(lendId)
206207 let lendJson = getStringValue(("lend-" + lendIdString))
207208 let rentId = getRentCount(lendId)
208209 let rentIdString = toString(rentId)
209210 let timeUnitSeconds = {
210211 let @ = invoke(dAppJson, "readByJSONKey", [lendJson, "timeUnitSeconds"], nil)
211212 if ($isInstanceOf(@, "String"))
212213 then @
213214 else throw(($getType(@) + " couldn't be cast to String"))
214215 }
215216 if ((timeUnitSeconds == timeUnitSeconds))
216217 then {
217218 let timeUnitSecondsInt = parseIntValue(timeUnitSeconds)
218219 if ((timeUnitSecondsInt == timeUnitSecondsInt))
219220 then {
220221 let rentJson = {
221222 let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), toString(timeUnitCount), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil)
222223 if ($isInstanceOf(@, "String"))
223224 then @
224225 else throw(($getType(@) + " couldn't be cast to String"))
225226 }
226227 if ((rentJson == rentJson))
227228 then [IntegerEntry(("lend-rentCount-" + lendIdString), (rentId + 1)), StringEntry(((("lend-rent-" + lendIdString) + "-") + rentIdString), rentJson), IntegerEntry(("lend-cost-" + lendIdString), (calcLendCost(lendId, timeUnitCount) + getLendCost(lendId)))]
228229 else throw("Strict value is not equal to itself.")
229230 }
230231 else throw("Strict value is not equal to itself.")
231232 }
232233 else throw("Strict value is not equal to itself.")
233234 })
234235
235236
236237
237238 @Callable(i)
238239 func closeLend (lendId) = valueOrElse(checkLendOwner(i.caller, lendId), {
239240 let lendIdString = toString(lendId)
240241 [DeleteEntry(("lend-" + lendIdString)), DeleteEntry(("lend-rentCount-" + lendIdString)), IntegerEntry("lendCurrentCount", (lendCurrentCount - 1)), DeleteEntry(("lend-cost-" + lendIdString)), ScriptTransfer(i.caller, getLendCost(lendId), tokenPayment)]
241242 })
242243
243244
244245
245246 @Callable(i)
246247 func test (lendId) = [StringEntry("Debug", getKey(getLendJson(lendId), "owner"))]
247248
248249

github/deemru/w8io/026f985 
48.23 ms