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:BgJKCAISBAoCCAgSBAoCCAESAwoBCBIGCgQICAgIEgUKAwgICBIDCgECEgQKAggBEgMKAQgSBgoECAEBARIECgIBARIDCgEBEgMKAQEWAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAHYmFzZVVSSQkBEUBleHRyTmF0aXZlKDEwNTgpAQIHYmFzZVVSSQAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAMdG9rZW5QYXltZW50CQERQGV4dHJOYXRpdmUoMTA1NykBAgx0b2tlblBheW1lbnQAEXRva2VuUGF5bWVudEFzc2V0CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAOwH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wgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQljbG9zZUxlbmQBBmxlbmRJZAkBC3ZhbHVlT3JFbHNlAgkBDmNoZWNrTGVuZE93bmVyAggFAWkGY2FsbGVyBQZsZW5kSWQEDGxlbmRJZFN0cmluZwkApAMBBQZsZW5kSWQJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICAgVsZW5kLQUMbGVuZElkU3RyaW5nCQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgIPbGVuZC1yZW50Q291bnQtBQxsZW5kSWRTdHJpbmcJAMwIAgkBDEludGVnZXJFbnRyeQICEGxlbmRDdXJyZW50Q291bnQJAGUCBRBsZW5kQ3VycmVudENvdW50AAEJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICAgpsZW5kLWNvc3QtBQxsZW5kSWRTdHJpbmcJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyCQELZ2V0TGVuZENvc3QBBQZsZW5kSWQFDHRva2VuUGF5bWVudAUDbmlsAWkBBHRlc3QBBmxlbmRJZAkAzAgCCQELU3RyaW5nRW50cnkCAgVEZWJ1ZwkBBmdldEtleQIJAQtnZXRMZW5kSnNvbgEFBmxlbmRJZAIFb3duZXIFA25pbACVUS1O", "height": 2501429, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JEFwwZT4fVoMmHv4gjiWJ4y4wSdtqpHXfjxGHyop9d5k Next: 8AiSkdmrXgbmFcy87nQZf8UaMohXacCJ1xcW8T94VV8v Diff:
Old | New | Differences | |
---|---|---|---|
137 | 137 | @Callable(i) | |
138 | 138 | func mintTokens (to,amount) = { | |
139 | 139 | 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) | |
141 | 142 | if ((transfer == transfer)) | |
142 | 143 | then [transfer, reisue] | |
143 | 144 | else throw("Strict value is not equal to itself.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let collectionName = getStringValue("collectionName") | |
5 | 5 | ||
6 | 6 | let symbol = getStringValue("symbol") | |
7 | 7 | ||
8 | 8 | let description = getStringValue("description") | |
9 | 9 | ||
10 | 10 | let totalAmount = getIntegerValue("totalAmount") | |
11 | 11 | ||
12 | 12 | let baseURI = getStringValue("baseURI") | |
13 | 13 | ||
14 | 14 | let dAppJson = Address(fromBase58String("3MrGaZVRhknEGfHJ19ttUPNnDRoFqcHhVN7")) | |
15 | 15 | ||
16 | 16 | let tokenPayment = getBinaryValue("tokenPayment") | |
17 | 17 | ||
18 | 18 | let tokenPaymentAsset = valueOrErrorMessage(assetInfo(getBinaryValue("tokenPayment")), "token payment asset doesn't connect") | |
19 | 19 | ||
20 | 20 | let lendCount = getIntegerValue("lendCount") | |
21 | 21 | ||
22 | 22 | let lendCurrentCount = getIntegerValue("lendCurrentCount") | |
23 | 23 | ||
24 | 24 | func parseIdtoAsset (assetId) = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Can't find asset by asset id") | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func transferOrNot (to,amount,assetId) = if ((to == this)) | |
28 | 28 | then StringEntry("smth", "smth") | |
29 | 29 | else ScriptTransfer(to, amount, assetId) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func getLendJson (lendId) = { | |
33 | 33 | let lendIdString = toString(lendId) | |
34 | 34 | getStringValue(("lend-" + lendIdString)) | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func getKey (lendJson,key) = { | |
39 | 39 | let timeUnitSeconds = { | |
40 | 40 | let @ = invoke(dAppJson, "readByJSONKey", [lendJson, key], nil) | |
41 | 41 | if ($isInstanceOf(@, "String")) | |
42 | 42 | then @ | |
43 | 43 | else throw(($getType(@) + " couldn't be cast to String")) | |
44 | 44 | } | |
45 | 45 | if ((timeUnitSeconds == timeUnitSeconds)) | |
46 | 46 | then timeUnitSeconds | |
47 | 47 | else throw("Strict value is not equal to itself.") | |
48 | 48 | } | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getRentCount (lendId) = { | |
52 | 52 | let lendIdString = toString(lendId) | |
53 | 53 | getIntegerValue(("lend-rentCount-" + lendIdString)) | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func calcLendCost (lendId,timeUnitSeconds) = { | |
58 | 58 | let lendJson = getLendJson(lendId) | |
59 | 59 | let timeUnitPriceString = getKey(lendJson, "timeUnitPrice") | |
60 | 60 | if ((timeUnitPriceString == timeUnitPriceString)) | |
61 | 61 | then { | |
62 | 62 | let timeUnitPrice = parseIntValue(timeUnitPriceString) | |
63 | 63 | (timeUnitSeconds * timeUnitPrice) | |
64 | 64 | } | |
65 | 65 | else throw("Strict value is not equal to itself.") | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getLendCost (lendId) = valueOrElse(getIntegerValue(("lend-cost-" + toString(lendId))), 0) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func onlyInternal (caller) = if ((caller == this)) | |
73 | 73 | then unit | |
74 | 74 | else throw("Only internal call") | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func checkAssetOwner (caller,assetId) = if ((assetBalance(caller, fromBase58String(assetId)) == 1)) | |
78 | 78 | then unit | |
79 | 79 | else throw("Only asset owner") | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func checkPayment (payments,amount) = if ((payments[0].amount >= amount)) | |
83 | 83 | then unit | |
84 | 84 | else throw("amount less then need") | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func checkAssetExists (assetId) = if (valueOrElse(getBoolean(assetId), false)) | |
88 | 88 | then throw("this token already use") | |
89 | 89 | else unit | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func checkLendOwner (caller,lendId) = if ((getKey(getLendJson(lendId), "owner") != toString(caller))) | |
93 | 93 | then throw("you haven't perms") | |
94 | 94 | else unit | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | @Callable(i) | |
98 | 98 | func setString (_key,_value) = valueOrElse(onlyInternal(i.caller), [StringEntry(_key, _value)]) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func setInt (_key,_value) = valueOrElse(onlyInternal(i.caller), [IntegerEntry(_key, _value)]) | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | ||
107 | 107 | @Callable(i) | |
108 | 108 | func deleteEntry (_key) = valueOrElse(onlyInternal(i.caller), [DeleteEntry(_key)]) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | @Callable(i) | |
113 | 113 | 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)]) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | 117 | @Callable(i) | |
118 | 118 | func setUser (assetId,user,expires) = { | |
119 | 119 | let res = invoke(dAppJson, "makeJSON", [["user", "expires"], [user, expires]], nil) | |
120 | 120 | if ((res == res)) | |
121 | 121 | then $Tuple2([StringEntry(("userOf-" + assetId), { | |
122 | 122 | let @ = res | |
123 | 123 | if ($isInstanceOf(@, "String")) | |
124 | 124 | then @ | |
125 | 125 | else throw(($getType(@) + " couldn't be cast to String")) | |
126 | 126 | })], res) | |
127 | 127 | else throw("Strict value is not equal to itself.") | |
128 | 128 | } | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | ||
132 | 132 | @Callable(i) | |
133 | 133 | func setTokenPayment (assetBinary) = valueOrElse(onlyInternal(i.caller), [BinaryEntry("tokenPayment", assetBinary)]) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | ||
137 | 137 | @Callable(i) | |
138 | 138 | func mintTokens (to,amount) = { | |
139 | 139 | 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) | |
141 | 142 | if ((transfer == transfer)) | |
142 | 143 | then [transfer, reisue] | |
143 | 144 | else throw("Strict value is not equal to itself.") | |
144 | 145 | } | |
145 | 146 | ||
146 | 147 | ||
147 | 148 | ||
148 | 149 | @Callable(i) | |
149 | 150 | func mintNFT (to) = { | |
150 | 151 | let tokenId = (totalAmount + 1) | |
151 | 152 | let tokenIdString = toString(tokenId) | |
152 | 153 | let preName = ((symbol + "#") + tokenIdString) | |
153 | 154 | let name = if ((16 >= size(preName))) | |
154 | 155 | then preName | |
155 | 156 | else tokenIdString | |
156 | 157 | let tokenURI = (baseURI + tokenIdString) | |
157 | 158 | let json = { | |
158 | 159 | let @ = invoke(dAppJson, "makeJSON", [["tokenURI"], [tokenURI]], nil) | |
159 | 160 | if ($isInstanceOf(@, "String")) | |
160 | 161 | then @ | |
161 | 162 | else throw(($getType(@) + " couldn't be cast to String")) | |
162 | 163 | } | |
163 | 164 | let asset = Issue(name, json, 1, 0, false, unit, height) | |
164 | 165 | let assetId = calculateAssetId(asset) | |
165 | 166 | let toAddress = Address(fromBase58String(to)) | |
166 | 167 | let transfer = transferOrNot(toAddress, 1, assetId) | |
167 | 168 | if ((transfer == transfer)) | |
168 | 169 | then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
169 | 170 | else throw("Strict value is not equal to itself.") | |
170 | 171 | } | |
171 | 172 | ||
172 | 173 | ||
173 | 174 | ||
174 | 175 | @Callable(i) | |
175 | 176 | func initLend (assetId,timeUnitSeconds,timeUnitPrice,timeUnitCount) = valueOrElse(checkAssetOwner(i.caller, assetId), valueOrElse(checkAssetExists(assetId), { | |
176 | 177 | let asset = parseIdtoAsset(assetId) | |
177 | 178 | let tokenURI = { | |
178 | 179 | let @ = invoke(dAppJson, "readByJSONKey", [asset.description, "tokenURI"], nil) | |
179 | 180 | if ($isInstanceOf(@, "String")) | |
180 | 181 | then @ | |
181 | 182 | else throw(($getType(@) + " couldn't be cast to String")) | |
182 | 183 | } | |
183 | 184 | if ((tokenURI == tokenURI)) | |
184 | 185 | then { | |
185 | 186 | let lendJson = { | |
186 | 187 | 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) | |
187 | 188 | if ($isInstanceOf(@, "String")) | |
188 | 189 | then @ | |
189 | 190 | else throw(($getType(@) + " couldn't be cast to String")) | |
190 | 191 | } | |
191 | 192 | if ((lendJson == lendJson)) | |
192 | 193 | then { | |
193 | 194 | let lendIdString = toString(lendCount) | |
194 | 195 | [IntegerEntry("lendCount", (lendCount + 1)), IntegerEntry("lendCurrentCount", (lendCurrentCount + 1)), IntegerEntry(("lend-rentCount-" + lendIdString), 0), StringEntry(("lend-" + lendIdString), lendJson), BooleanEntry(assetId, true)] | |
195 | 196 | } | |
196 | 197 | else throw("Strict value is not equal to itself.") | |
197 | 198 | } | |
198 | 199 | else throw("Strict value is not equal to itself.") | |
199 | 200 | })) | |
200 | 201 | ||
201 | 202 | ||
202 | 203 | ||
203 | 204 | @Callable(i) | |
204 | 205 | func initRent (lendId,timeUnitCount) = valueOrElse(checkPayment(i.payments, calcLendCost(lendId, timeUnitCount)), { | |
205 | 206 | let lendIdString = toString(lendId) | |
206 | 207 | let lendJson = getStringValue(("lend-" + lendIdString)) | |
207 | 208 | let rentId = getRentCount(lendId) | |
208 | 209 | let rentIdString = toString(rentId) | |
209 | 210 | let timeUnitSeconds = { | |
210 | 211 | let @ = invoke(dAppJson, "readByJSONKey", [lendJson, "timeUnitSeconds"], nil) | |
211 | 212 | if ($isInstanceOf(@, "String")) | |
212 | 213 | then @ | |
213 | 214 | else throw(($getType(@) + " couldn't be cast to String")) | |
214 | 215 | } | |
215 | 216 | if ((timeUnitSeconds == timeUnitSeconds)) | |
216 | 217 | then { | |
217 | 218 | let timeUnitSecondsInt = parseIntValue(timeUnitSeconds) | |
218 | 219 | if ((timeUnitSecondsInt == timeUnitSecondsInt)) | |
219 | 220 | then { | |
220 | 221 | let rentJson = { | |
221 | 222 | let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), toString(timeUnitCount), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil) | |
222 | 223 | if ($isInstanceOf(@, "String")) | |
223 | 224 | then @ | |
224 | 225 | else throw(($getType(@) + " couldn't be cast to String")) | |
225 | 226 | } | |
226 | 227 | if ((rentJson == rentJson)) | |
227 | 228 | then [IntegerEntry(("lend-rentCount-" + lendIdString), (rentId + 1)), StringEntry(((("lend-rent-" + lendIdString) + "-") + rentIdString), rentJson), IntegerEntry(("lend-cost-" + lendIdString), (calcLendCost(lendId, timeUnitCount) + getLendCost(lendId)))] | |
228 | 229 | else throw("Strict value is not equal to itself.") | |
229 | 230 | } | |
230 | 231 | else throw("Strict value is not equal to itself.") | |
231 | 232 | } | |
232 | 233 | else throw("Strict value is not equal to itself.") | |
233 | 234 | }) | |
234 | 235 | ||
235 | 236 | ||
236 | 237 | ||
237 | 238 | @Callable(i) | |
238 | 239 | func closeLend (lendId) = valueOrElse(checkLendOwner(i.caller, lendId), { | |
239 | 240 | let lendIdString = toString(lendId) | |
240 | 241 | [DeleteEntry(("lend-" + lendIdString)), DeleteEntry(("lend-rentCount-" + lendIdString)), IntegerEntry("lendCurrentCount", (lendCurrentCount - 1)), DeleteEntry(("lend-cost-" + lendIdString)), ScriptTransfer(i.caller, getLendCost(lendId), tokenPayment)] | |
241 | 242 | }) | |
242 | 243 | ||
243 | 244 | ||
244 | 245 | ||
245 | 246 | @Callable(i) | |
246 | 247 | func test (lendId) = [StringEntry("Debug", getKey(getLendJson(lendId), "owner"))] | |
247 | 248 | ||
248 | 249 |
github/deemru/w8io/026f985 48.23 ms ◑