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:BgJKCAISBAoCCAgSBAoCCAESAwoBCBIGCgQICAgIEgUKAwgICBIDCgECEgQKAggBEgMKAQgSBgoECAEBARIECgIBARIDCgEBEgMKAQEWAA5jb2xsZWN0aW9uTmFtZQkBEUBleHRyTmF0aXZlKDEwNTgpAQIOY29sbGVjdGlvbk5hbWUABnN5bWJvbAkBEUBleHRyTmF0aXZlKDEwNTgpAQIGc3ltYm9sAAtkZXNjcmlwdGlvbgkBEUBleHRyTmF0aXZlKDEwNTgpAQILZGVzY3JpcHRpb24AC3RvdGFsQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBAgt0b3RhbEFtb3VudAAHYmFzZVVSSQkBEUBleHRyTmF0aXZlKDEwNTgpAQIHYmFzZVVSSQAIZEFwcEpzb24JAQdBZGRyZXNzAQkA2QQBAiMzTXJHYVpWUmhrbkVHZkhKMTl0dFVQTm5EUm9GcWNIaFZONwAMdG9rZW5QYXltZW50CQERQGV4dHJOYXRpdmUoMTA1NykBAgx0b2tlblBheW1lbnQAEXRva2VuUGF5bWVudEFzc2V0CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAOwHAQk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lcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBCWNsb3NlTGVuZAEGbGVuZElkCQELdmFsdWVPckVsc2UCCQEOY2hlY2tMZW5kT3duZXICCAUBaQZjYWxsZXIFBmxlbmRJZAQMbGVuZElkU3RyaW5nCQCkAwEFBmxlbmRJZAkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgICBWxlbmQtBQxsZW5kSWRTdHJpbmcJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICAg9sZW5kLXJlbnRDb3VudC0FDGxlbmRJZFN0cmluZwkAzAgCCQEMSW50ZWdlckVudHJ5AgIQbGVuZEN1cnJlbnRDb3VudAkAZQIFEGxlbmRDdXJyZW50Q291bnQAAQkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgICCmxlbmQtY29zdC0FDGxlbmRJZFN0cmluZwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAQtnZXRMZW5kQ29zdAEFBmxlbmRJZAUMdG9rZW5QYXltZW50BQNuaWwBaQEEdGVzdAEGbGVuZElkCQDMCAIJAQtTdHJpbmdFbnRyeQICBURlYnVnCQEGZ2V0S2V5AgkBC2dldExlbmRKc29uAQUGbGVuZElkAgVvd25lcgUDbmlsAGmgafM=", "height": 2501425, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hoj3MygE6WA8z5r5zCeE5Agm1KMYykuCbKaT8kGP3jpN Next: CfkyJcb6xH9p9VRwqPKcLhfkoBsyqZRsFWRqF6VaZZJE Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | func parseIdtoAsset (assetId) = valueOrErrorMessage(assetInfo(fromBase58String(assetId)), "Can't find asset by asset id") | |
25 | 25 | ||
26 | 26 | ||
27 | - | func transferOrNot (to,assetId) = if ((to == this)) | |
27 | + | func transferOrNot (to,amount,assetId) = if ((to == this)) | |
28 | 28 | then StringEntry("smth", "smth") | |
29 | - | else ScriptTransfer(to, | |
29 | + | else ScriptTransfer(to, amount, assetId) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func getLendJson (lendId) = { | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | @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) = { | |
139 | 150 | let tokenId = (totalAmount + 1) | |
140 | 151 | let tokenIdString = toString(tokenId) | |
141 | 152 | let preName = ((symbol + "#") + tokenIdString) | |
152 | 163 | let asset = Issue(name, json, 1, 0, false, unit, height) | |
153 | 164 | let assetId = calculateAssetId(asset) | |
154 | 165 | let toAddress = Address(fromBase58String(to)) | |
155 | - | let transfer = transferOrNot(toAddress, assetId) | |
166 | + | let transfer = transferOrNot(toAddress, 1, assetId) | |
156 | 167 | if ((transfer == transfer)) | |
157 | 168 | then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
158 | 169 | 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 | - | func transferOrNot (to,assetId) = if ((to == this)) | |
27 | + | func transferOrNot (to,amount,assetId) = if ((to == this)) | |
28 | 28 | then StringEntry("smth", "smth") | |
29 | - | else ScriptTransfer(to, | |
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 | - | 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) = { | |
139 | 150 | let tokenId = (totalAmount + 1) | |
140 | 151 | let tokenIdString = toString(tokenId) | |
141 | 152 | let preName = ((symbol + "#") + tokenIdString) | |
142 | 153 | let name = if ((16 >= size(preName))) | |
143 | 154 | then preName | |
144 | 155 | else tokenIdString | |
145 | 156 | let tokenURI = (baseURI + tokenIdString) | |
146 | 157 | let json = { | |
147 | 158 | let @ = invoke(dAppJson, "makeJSON", [["tokenURI"], [tokenURI]], nil) | |
148 | 159 | if ($isInstanceOf(@, "String")) | |
149 | 160 | then @ | |
150 | 161 | else throw(($getType(@) + " couldn't be cast to String")) | |
151 | 162 | } | |
152 | 163 | let asset = Issue(name, json, 1, 0, false, unit, height) | |
153 | 164 | let assetId = calculateAssetId(asset) | |
154 | 165 | let toAddress = Address(fromBase58String(to)) | |
155 | - | let transfer = transferOrNot(toAddress, assetId) | |
166 | + | let transfer = transferOrNot(toAddress, 1, assetId) | |
156 | 167 | if ((transfer == transfer)) | |
157 | 168 | then [asset, transfer, IntegerEntry("totalAmount", tokenId), StringEntry(name, tokenURI)] | |
158 | 169 | else throw("Strict value is not equal to itself.") | |
159 | 170 | } | |
160 | 171 | ||
161 | 172 | ||
162 | 173 | ||
163 | 174 | @Callable(i) | |
164 | 175 | func initLend (assetId,timeUnitSeconds,timeUnitPrice,timeUnitCount) = valueOrElse(checkAssetOwner(i.caller, assetId), valueOrElse(checkAssetExists(assetId), { | |
165 | 176 | let asset = parseIdtoAsset(assetId) | |
166 | 177 | let tokenURI = { | |
167 | 178 | let @ = invoke(dAppJson, "readByJSONKey", [asset.description, "tokenURI"], nil) | |
168 | 179 | if ($isInstanceOf(@, "String")) | |
169 | 180 | then @ | |
170 | 181 | else throw(($getType(@) + " couldn't be cast to String")) | |
171 | 182 | } | |
172 | 183 | if ((tokenURI == tokenURI)) | |
173 | 184 | then { | |
174 | 185 | let lendJson = { | |
175 | 186 | 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) | |
176 | 187 | if ($isInstanceOf(@, "String")) | |
177 | 188 | then @ | |
178 | 189 | else throw(($getType(@) + " couldn't be cast to String")) | |
179 | 190 | } | |
180 | 191 | if ((lendJson == lendJson)) | |
181 | 192 | then { | |
182 | 193 | let lendIdString = toString(lendCount) | |
183 | 194 | [IntegerEntry("lendCount", (lendCount + 1)), IntegerEntry("lendCurrentCount", (lendCurrentCount + 1)), IntegerEntry(("lend-rentCount-" + lendIdString), 0), StringEntry(("lend-" + lendIdString), lendJson), BooleanEntry(assetId, true)] | |
184 | 195 | } | |
185 | 196 | else throw("Strict value is not equal to itself.") | |
186 | 197 | } | |
187 | 198 | else throw("Strict value is not equal to itself.") | |
188 | 199 | })) | |
189 | 200 | ||
190 | 201 | ||
191 | 202 | ||
192 | 203 | @Callable(i) | |
193 | 204 | func initRent (lendId,timeUnitCount) = valueOrElse(checkPayment(i.payments, calcLendCost(lendId, timeUnitCount)), { | |
194 | 205 | let lendIdString = toString(lendId) | |
195 | 206 | let lendJson = getStringValue(("lend-" + lendIdString)) | |
196 | 207 | let rentId = getRentCount(lendId) | |
197 | 208 | let rentIdString = toString(rentId) | |
198 | 209 | let timeUnitSeconds = { | |
199 | 210 | let @ = invoke(dAppJson, "readByJSONKey", [lendJson, "timeUnitSeconds"], nil) | |
200 | 211 | if ($isInstanceOf(@, "String")) | |
201 | 212 | then @ | |
202 | 213 | else throw(($getType(@) + " couldn't be cast to String")) | |
203 | 214 | } | |
204 | 215 | if ((timeUnitSeconds == timeUnitSeconds)) | |
205 | 216 | then { | |
206 | 217 | let timeUnitSecondsInt = parseIntValue(timeUnitSeconds) | |
207 | 218 | if ((timeUnitSecondsInt == timeUnitSecondsInt)) | |
208 | 219 | then { | |
209 | 220 | let rentJson = { | |
210 | 221 | let @ = invoke(dAppJson, "makeJSON", [["customer", "timeUnitCount", "startTimestamp", "endTimestamp", "closed"], [toString(i.caller), toString(timeUnitCount), toString(lastBlock.timestamp), toString((lastBlock.timestamp + (timeUnitSecondsInt * timeUnitCount))), "0"]], nil) | |
211 | 222 | if ($isInstanceOf(@, "String")) | |
212 | 223 | then @ | |
213 | 224 | else throw(($getType(@) + " couldn't be cast to String")) | |
214 | 225 | } | |
215 | 226 | if ((rentJson == rentJson)) | |
216 | 227 | then [IntegerEntry(("lend-rentCount-" + lendIdString), (rentId + 1)), StringEntry(((("lend-rent-" + lendIdString) + "-") + rentIdString), rentJson), IntegerEntry(("lend-cost-" + lendIdString), (calcLendCost(lendId, timeUnitCount) + getLendCost(lendId)))] | |
217 | 228 | else throw("Strict value is not equal to itself.") | |
218 | 229 | } | |
219 | 230 | else throw("Strict value is not equal to itself.") | |
220 | 231 | } | |
221 | 232 | else throw("Strict value is not equal to itself.") | |
222 | 233 | }) | |
223 | 234 | ||
224 | 235 | ||
225 | 236 | ||
226 | 237 | @Callable(i) | |
227 | 238 | func closeLend (lendId) = valueOrElse(checkLendOwner(i.caller, lendId), { | |
228 | 239 | let lendIdString = toString(lendId) | |
229 | 240 | [DeleteEntry(("lend-" + lendIdString)), DeleteEntry(("lend-rentCount-" + lendIdString)), IntegerEntry("lendCurrentCount", (lendCurrentCount - 1)), DeleteEntry(("lend-cost-" + lendIdString)), ScriptTransfer(i.caller, getLendCost(lendId), tokenPayment)] | |
230 | 241 | }) | |
231 | 242 | ||
232 | 243 | ||
233 | 244 | ||
234 | 245 | @Callable(i) | |
235 | 246 | func test (lendId) = [StringEntry("Debug", getKey(getLendJson(lendId), "owner"))] | |
236 | 247 | ||
237 | 248 |
github/deemru/w8io/169f3d6 61.08 ms ◑