tx · JEFwwZT4fVoMmHv4gjiWJ4y4wSdtqpHXfjxGHyop9d5k

3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn:  -0.00800000 Waves

2023.03.22 19:01 [2501425] smart account 3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn > SELF 0.00000000 Waves

{ "type": 13, "id": "JEFwwZT4fVoMmHv4gjiWJ4y4wSdtqpHXfjxGHyop9d5k", "fee": 800000, "feeAssetId": null, "timestamp": 1679500910488, "version": 2, "chainId": 84, "sender": "3MxVYj6ScMArhAamy7nB6b342kh1Pso1LTn", "senderPublicKey": "CZeucjRLCKrkiP9zuj9KbLe23Wv9DywFzHBqNDnte51B", "proofs": [ "E7vNudjL2sWNKSz8ScauKi3crZiKJUsSfbncvpETwj26A6TmhJ7QHEru64WsAPy4fAeh3rVapcpuP3mAz5skGLC" ], "script": "base64:BgJKCAISBAoCCAgSBAoCCAESAwoBCBIGCgQICAgIEgUKAwgICBIDCgECEgQKAggBEgMKAQgSBgoECAEBARIECgIBARIDCgEBEgMKAQEWAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAHYmFzZVVSSQkBEUBleHRyTmF0aXZlKDEwNTgpAQIHYmFzZVVSSQAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAMdG9rZW5QYXltZW50CQERQGV4dHJOYXRpdmUoMTA1NykBAgx0b2tlblBheW1lbnQAEXRva2VuUGF5bWVudEFzc2V0CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAOwHAQ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BlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBCWNsb3NlTGVuZAEGbGVuZElkCQELdmFsdWVPckVsc2UCCQEOY2hlY2tMZW5kT3duZXICCAUBaQZjYWxsZXIFBmxlbmRJZAQMbGVuZElkU3RyaW5nCQCkAwEFBmxlbmRJZAkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgICBWxlbmQtBQxsZW5kSWRTdHJpbmcJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICAg9sZW5kLXJlbnRDb3VudC0FDGxlbmRJZFN0cmluZwkAzAgCCQEMSW50ZWdlckVudHJ5AgIQbGVuZEN1cnJlbnRDb3VudAkAZQIFEGxlbmRDdXJyZW50Q291bnQAAQkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgICCmxlbmQtY29zdC0FDGxlbmRJZFN0cmluZwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAQtnZXRMZW5kQ29zdAEFBmxlbmRJZAUMdG9rZW5QYXltZW50BQNuaWwBaQEEdGVzdAEGbGVuZElkCQDMCAIJAQtTdHJpbmdFbnRyeQICBURlYnVnCQEGZ2V0S2V5AgkBC2dldExlbmRKc29uAQUGbGVuZElkAgVvd25lcgUDbmlsAGmgafM=", "height": 2501425, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hoj3MygE6WA8z5r5zCeE5Agm1KMYykuCbKaT8kGP3jpN Next: CfkyJcb6xH9p9VRwqPKcLhfkoBsyqZRsFWRqF6VaZZJE Diff:
OldNewDifferences
2424 func parseIdtoAsset (assetId) = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Can't find asset by asset id")
2525
2626
27-func transferOrNot (to,assetId) = if ((to == this))
27+func transferOrNot (to,amount,assetId) = if ((to == this))
2828 then StringEntry("smth", "smth")
29- else ScriptTransfer(to, 1, assetId)
29+ else ScriptTransfer(to, amount, assetId)
3030
3131
3232 func getLendJson (lendId) = {
135135
136136
137137 @Callable(i)
138-func mint (to) = {
138+func mintTokens (to,amount) = {
139+ let reisue = Reissue(tokenPayment, amount, true)
140+ let transfer = transferOrNot(i.caller, amount, tokenPayment)
141+ if ((transfer == transfer))
142+ then [transfer, reisue]
143+ else throw("Strict value is not equal to itself.")
144+ }
145+
146+
147+
148+@Callable(i)
149+func mintNFT (to) = {
139150 let tokenId = (totalAmount + 1)
140151 let tokenIdString = toString(tokenId)
141152 let preName = ((symbol + "#") + tokenIdString)
152163 let asset = Issue(name, json, 1, 0, false, unit, height)
153164 let assetId = calculateAssetId(asset)
154165 let toAddress = Address(fromBase58String(to))
155- let transfer = transferOrNot(toAddress, assetId)
166+ let transfer = transferOrNot(toAddress, 1, assetId)
156167 if ((transfer == transfer))
157168 then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)]
158169 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
27-func transferOrNot (to,assetId) = if ((to == this))
27+func transferOrNot (to,amount,assetId) = if ((to == this))
2828 then StringEntry("smth", "smth")
29- else ScriptTransfer(to, 1, assetId)
29+ 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)
138-func mint (to) = {
138+func mintTokens (to,amount) = {
139+ let reisue = Reissue(tokenPayment, amount, true)
140+ let transfer = transferOrNot(i.caller, amount, tokenPayment)
141+ if ((transfer == transfer))
142+ then [transfer, reisue]
143+ else throw("Strict value is not equal to itself.")
144+ }
145+
146+
147+
148+@Callable(i)
149+func mintNFT (to) = {
139150 let tokenId = (totalAmount + 1)
140151 let tokenIdString = toString(tokenId)
141152 let preName = ((symbol + "#") + tokenIdString)
142153 let name = if ((16 >= size(preName)))
143154 then preName
144155 else tokenIdString
145156 let tokenURI = (baseURI + tokenIdString)
146157 let json = {
147158 let @ = invoke(dAppJson, "makeJSON", [["tokenURI"], [tokenURI]], nil)
148159 if ($isInstanceOf(@, "String"))
149160 then @
150161 else throw(($getType(@) + " couldn't be cast to String"))
151162 }
152163 let asset = Issue(name, json, 1, 0, false, unit, height)
153164 let assetId = calculateAssetId(asset)
154165 let toAddress = Address(fromBase58String(to))
155- let transfer = transferOrNot(toAddress, assetId)
166+ let transfer = transferOrNot(toAddress, 1, assetId)
156167 if ((transfer == transfer))
157168 then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)]
158169 else throw("Strict value is not equal to itself.")
159170 }
160171
161172
162173
163174 @Callable(i)
164175 func initLend (assetId,timeUnitSeconds,timeUnitPrice,timeUnitCount) = valueOrElse(checkAssetOwner(i.caller, assetId), valueOrElse(checkAssetExists(assetId), {
165176 let asset = parseIdtoAsset(assetId)
166177 let tokenURI = {
167178 let @ = invoke(dAppJson, "readByJSONKey", [asset.description, "tokenURI"], nil)
168179 if ($isInstanceOf(@, "String"))
169180 then @
170181 else throw(($getType(@) + " couldn't be cast to String"))
171182 }
172183 if ((tokenURI == tokenURI))
173184 then {
174185 let lendJson = {
175186 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)
176187 if ($isInstanceOf(@, "String"))
177188 then @
178189 else throw(($getType(@) + " couldn't be cast to String"))
179190 }
180191 if ((lendJson == lendJson))
181192 then {
182193 let lendIdString = toString(lendCount)
183194 [IntegerEntry("lendCount", (lendCount + 1)), IntegerEntry("lendCurrentCount", (lendCurrentCount + 1)), IntegerEntry(("lend-rentCount-" + lendIdString), 0), StringEntry(("lend-" + lendIdString), lendJson), BooleanEntry(assetId, true)]
184195 }
185196 else throw("Strict value is not equal to itself.")
186197 }
187198 else throw("Strict value is not equal to itself.")
188199 }))
189200
190201
191202
192203 @Callable(i)
193204 func initRent (lendId,timeUnitCount) = valueOrElse(checkPayment(i.payments, calcLendCost(lendId, timeUnitCount)), {
194205 let lendIdString = toString(lendId)
195206 let lendJson = getStringValue(("lend-" + lendIdString))
196207 let rentId = getRentCount(lendId)
197208 let rentIdString = toString(rentId)
198209 let timeUnitSeconds = {
199210 let @ = invoke(dAppJson, "readByJSONKey", [lendJson, "timeUnitSeconds"], nil)
200211 if ($isInstanceOf(@, "String"))
201212 then @
202213 else throw(($getType(@) + " couldn't be cast to String"))
203214 }
204215 if ((timeUnitSeconds == timeUnitSeconds))
205216 then {
206217 let timeUnitSecondsInt = parseIntValue(timeUnitSeconds)
207218 if ((timeUnitSecondsInt == timeUnitSecondsInt))
208219 then {
209220 let rentJson = {
210221 let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), toString(timeUnitCount), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil)
211222 if ($isInstanceOf(@, "String"))
212223 then @
213224 else throw(($getType(@) + " couldn't be cast to String"))
214225 }
215226 if ((rentJson == rentJson))
216227 then [IntegerEntry(("lend-rentCount-" + lendIdString), (rentId + 1)), StringEntry(((("lend-rent-" + lendIdString) + "-") + rentIdString), rentJson), IntegerEntry(("lend-cost-" + lendIdString), (calcLendCost(lendId, timeUnitCount) + getLendCost(lendId)))]
217228 else throw("Strict value is not equal to itself.")
218229 }
219230 else throw("Strict value is not equal to itself.")
220231 }
221232 else throw("Strict value is not equal to itself.")
222233 })
223234
224235
225236
226237 @Callable(i)
227238 func closeLend (lendId) = valueOrElse(checkLendOwner(i.caller, lendId), {
228239 let lendIdString = toString(lendId)
229240 [DeleteEntry(("lend-" + lendIdString)), DeleteEntry(("lend-rentCount-" + lendIdString)), IntegerEntry("lendCurrentCount", (lendCurrentCount - 1)), DeleteEntry(("lend-cost-" + lendIdString)), ScriptTransfer(i.caller, getLendCost(lendId), tokenPayment)]
230241 })
231242
232243
233244
234245 @Callable(i)
235246 func test (lendId) = [StringEntry("Debug", getKey(getLendJson(lendId), "owner"))]
236247
237248

github/deemru/w8io/026f985 
35.03 ms