tx · 53cL4pKtkqFyYGiTQK9XZQmGo1AqMdZJdd2kyfji9HV2 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.07.23 01:38 [2677670] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "53cL4pKtkqFyYGiTQK9XZQmGo1AqMdZJdd2kyfji9HV2", "fee": 1000000, "feeAssetId": null, "timestamp": 1690065622259, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "57UxKajr35eUfRvdZvi2Ti8h1hjUMBh5WLbmuppssjrHjxrqmEPMmujgN2CxBC5s2n6ETFmCkyP9veaWQ7NkM7pZ" ], "script": "base64:BgIwCAISBAoCAQgSABIAEgASAwoBARIDCgEBEgMKAQESBAoCCAESABIECgIIARIDCgEIBgADYXJyCQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUFA25pbAAEYXJyMgkAzAgCAAEJAMwIAgACBQNuaWwBA3N1bQIBYQFiCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgZib3Jyb3cJAMwIAgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAMwIAgDAhD0FA25pbAUDbmlsAQpnZXRCYWxhbmNlAgphc3NldElkU3RyB2FkZHJlc3MDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgEPZ2V0Q3VycmVudFByaWNlAQphc3NldElkU3RyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTAAIJAAIBAgVFcnJv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1wTU5kAgh3aXRoZHJhdwkAzAgCBQphc3NldElkU3RyCQDMCAIFC2Fzc2V0QW1vdW50BQNuaWwFA25pbAMJAAACBQNyZXMFA3JlcwkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCsAgIFB2FkZHJlc3MCCl93aXRoZHJld18FCmFzc2V0SWRTdHIFC2Fzc2V0QW1vdW50BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEMY2hlY2tCYWxhbmNlAQphc3NldElkU3RyBAdhZGRyZXNzCAUBaQZjYWxsZXIDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMJAMwIAgkBDEludGVnZXJFbnRyeQICDVdhdmVzIEJhbGFuY2UICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlBQNuaWwJAMwIAgkBDEludGVnZXJFbnRyeQICDUFzc2V0IEJhbGFuY2UJAPAHAgUHYWRkcmVzcwkA2QQBBQphc3NldElkU3RyBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5UWfKlg==", "height": 2677670, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6CqhigeMh2Q6o3TVvdUPscBzA7WQWHJaspy2j9nq7wMr Next: Ek1EsNBSA4uajrc2CEbfy547voZmvqDfaAPHomMc3kfN Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | - | func issue3xLong () = $Tuple2([Issue("WAVES3L", "WAVES_USDN_LONG3X Token", | |
32 | + | func issue3xLong () = $Tuple2([Issue("WAVES3L", "WAVES_USDN_LONG3X Token", 8, 6, true)], unit) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let arr = [1, 2, 3, 4, 5] | |
5 | 5 | ||
6 | 6 | let arr2 = [1, 2] | |
7 | 7 | ||
8 | 8 | func sum (a,b) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES")) | |
12 | 12 | then wavesBalance(address).available | |
13 | 13 | else assetBalance(address, fromBase58String(assetIdStr)) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getCurrentPrice (assetIdStr) = if ((assetIdStr == "WAVES")) | |
17 | 17 | then 2 | |
18 | 18 | else throw("Error") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func transferWavesTestInternal (assetIdStr,assetAmount,address) = [IntegerEntry(((address + "_deposited_") + assetIdStr), assetAmount)] | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func transferWaves (assetAmount,senderAddress) = if ((i.caller != this)) | |
26 | 26 | then throw("only for internal smart contract invocations") | |
27 | 27 | else [ScriptTransfer(this, assetAmount, unit), IntegerEntry((senderAddress + "_deposited_WAVES"), assetAmount)] | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | - | func issue3xLong () = $Tuple2([Issue("WAVES3L", "WAVES_USDN_LONG3X Token", | |
32 | + | func issue3xLong () = $Tuple2([Issue("WAVES3L", "WAVES_USDN_LONG3X Token", 8, 6, true)], unit) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func transferWavesTest () = if (if ((size(i.payments) != 1)) | |
38 | 38 | then true | |
39 | 39 | else (i.payments[0].amount == 0)) | |
40 | 40 | then throw("1 payment has to be attached") | |
41 | 41 | else { | |
42 | 42 | let assetIdStr = "WAVES" | |
43 | 43 | let assetAmount = i.payments[0].amount | |
44 | 44 | transferWavesTestInternal(assetIdStr, assetAmount, toString(i.caller)) | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(i) | |
50 | 50 | func long2x_v2 () = if (if ((size(i.payments) != 1)) | |
51 | 51 | then true | |
52 | 52 | else (i.payments[0].amount == 0)) | |
53 | 53 | then throw("1 payment has to be attached") | |
54 | 54 | else { | |
55 | 55 | let address = toString(i.caller) | |
56 | 56 | let assetIdStr = "WAVES" | |
57 | 57 | let wavesAmount = i.payments[0].amount | |
58 | 58 | let currentWavesAmount = getBalance(assetIdStr, i.caller) | |
59 | 59 | if ((currentWavesAmount > wavesAmount)) | |
60 | 60 | then { | |
61 | 61 | let depositResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, wavesAmount)]) | |
62 | 62 | if ((depositResult == depositResult)) | |
63 | 63 | then { | |
64 | 64 | func repeatFunc (accum,next) = { | |
65 | 65 | let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((wavesAmount * getCurrentPrice("WAVES")) / 100)], nil) | |
66 | 66 | if ((borrowResult == borrowResult)) | |
67 | 67 | then (accum + next) | |
68 | 68 | else throw("Strict value is not equal to itself.") | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | let array = [wavesAmount, wavesAmount] | |
72 | 72 | let res = { | |
73 | 73 | let $l = array | |
74 | 74 | let $s = size($l) | |
75 | 75 | let $acc0 = 0 | |
76 | 76 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
77 | 77 | then $a | |
78 | 78 | else repeatFunc($a, $l[$i]) | |
79 | 79 | ||
80 | 80 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
81 | 81 | then $a | |
82 | 82 | else throw("List size exceeds 2") | |
83 | 83 | ||
84 | 84 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
85 | 85 | } | |
86 | 86 | [IntegerEntry((address + "_deposited_WAVES"), wavesAmount), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (wavesAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, ((res * getCurrentPrice("WAVES")) / 100), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
87 | 87 | } | |
88 | 88 | else throw("Strict value is not equal to itself.") | |
89 | 89 | } | |
90 | 90 | else throw("Not enough WAVES to deposit!") | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | ||
95 | 95 | @Callable(i) | |
96 | 96 | func long2x (assetAmount) = { | |
97 | 97 | let address = toString(i.caller) | |
98 | 98 | let currentAmount = getBalance("WAVES", i.caller) | |
99 | 99 | if ((currentAmount > assetAmount)) | |
100 | 100 | then { | |
101 | 101 | func repeatFunc (accum,next) = { | |
102 | 102 | let transferResult = invoke(this, "transferWaves", [assetAmount, i.caller], nil) | |
103 | 103 | if ((transferResult == transferResult)) | |
104 | 104 | then { | |
105 | 105 | let supplyResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, assetAmount)]) | |
106 | 106 | if ((supplyResult == supplyResult)) | |
107 | 107 | then { | |
108 | 108 | let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((assetAmount * getCurrentPrice("WAVES")) / 100)], nil) | |
109 | 109 | if ((borrowResult == borrowResult)) | |
110 | 110 | then (accum + next) | |
111 | 111 | else throw("Strict value is not equal to itself.") | |
112 | 112 | } | |
113 | 113 | else throw("Strict value is not equal to itself.") | |
114 | 114 | } | |
115 | 115 | else throw("Strict value is not equal to itself.") | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | let array = [assetAmount, assetAmount] | |
119 | 119 | let res = { | |
120 | 120 | let $l = array | |
121 | 121 | let $s = size($l) | |
122 | 122 | let $acc0 = 0 | |
123 | 123 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
124 | 124 | then $a | |
125 | 125 | else repeatFunc($a, $l[$i]) | |
126 | 126 | ||
127 | 127 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
128 | 128 | then $a | |
129 | 129 | else throw("List size exceeds 2") | |
130 | 130 | ||
131 | 131 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
132 | 132 | } | |
133 | 133 | [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), (assetAmount * getCurrentPrice("WAVES"))), ScriptTransfer(i.caller, ((res * getCurrentPrice("WAVES")) / 100), base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), ScriptTransfer(this, res, unit)] | |
134 | 134 | } | |
135 | 135 | else throw("Error!") | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | ||
140 | 140 | @Callable(i) | |
141 | 141 | func borrow (assetAmount) = { | |
142 | 142 | let address = toString(i.caller) | |
143 | 143 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
144 | 144 | if ((res == res)) | |
145 | 145 | then [ScriptTransfer(i.caller, assetAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT'), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount)] | |
146 | 146 | else throw("Strict value is not equal to itself.") | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | ||
151 | 151 | @Callable(i) | |
152 | 152 | func borrow2 (assetAmount) = { | |
153 | 153 | let address = toString(i.caller) | |
154 | 154 | func repeatFunc (accum,next) = { | |
155 | 155 | let result = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", assetAmount], nil) | |
156 | 156 | if ((result == result)) | |
157 | 157 | then (accum + next) | |
158 | 158 | else throw("Strict value is not equal to itself.") | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | let array = [assetAmount, assetAmount] | |
162 | 162 | let res = { | |
163 | 163 | let $l = array | |
164 | 164 | let $s = size($l) | |
165 | 165 | let $acc0 = 0 | |
166 | 166 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
167 | 167 | then $a | |
168 | 168 | else repeatFunc($a, $l[$i]) | |
169 | 169 | ||
170 | 170 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
171 | 171 | then $a | |
172 | 172 | else throw("List size exceeds 2") | |
173 | 173 | ||
174 | 174 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
175 | 175 | } | |
176 | 176 | [IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), assetAmount), ScriptTransfer(i.caller, res, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | ||
181 | 181 | @Callable(i) | |
182 | 182 | func borrow5 (assetIdStr,assetAmount) = { | |
183 | 183 | let address = toString(i.caller) | |
184 | 184 | let res = { | |
185 | 185 | let $l = arr | |
186 | 186 | let $s = size($l) | |
187 | 187 | let $acc0 = 0 | |
188 | 188 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
189 | 189 | then $a | |
190 | 190 | else sum($a, $l[$i]) | |
191 | 191 | ||
192 | 192 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
193 | 193 | then $a | |
194 | 194 | else throw("List size exceeds 5") | |
195 | 195 | ||
196 | 196 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
197 | 197 | } | |
198 | 198 | if ((res == res)) | |
199 | 199 | then [IntegerEntry(((address + "_borrowed_") + assetIdStr), assetAmount)] | |
200 | 200 | else throw("Strict value is not equal to itself.") | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | ||
205 | 205 | @Callable(i) | |
206 | 206 | func deposit () = { | |
207 | 207 | let address = toString(i.caller) | |
208 | 208 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, 1000000)]) | |
209 | 209 | if ((res == res)) | |
210 | 210 | then [IntegerEntry((address + "supply_waves"), 1000000)] | |
211 | 211 | else throw("Strict value is not equal to itself.") | |
212 | 212 | } | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | ||
216 | 216 | @Callable(i) | |
217 | 217 | func withdraw (assetIdStr,assetAmount) = { | |
218 | 218 | let address = toString(i.caller) | |
219 | 219 | let res = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "withdraw", [assetIdStr, assetAmount], nil) | |
220 | 220 | if ((res == res)) | |
221 | 221 | then [IntegerEntry(((address + "_withdrew_") + assetIdStr), assetAmount)] | |
222 | 222 | else throw("Strict value is not equal to itself.") | |
223 | 223 | } | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | ||
227 | 227 | @Callable(i) | |
228 | 228 | func checkBalance (assetIdStr) = { | |
229 | 229 | let address = i.caller | |
230 | 230 | if ((assetIdStr == "WAVES")) | |
231 | 231 | then [IntegerEntry("Waves Balance", wavesBalance(address).available)] | |
232 | 232 | else [IntegerEntry("Asset Balance", assetBalance(address, fromBase58String(assetIdStr)))] | |
233 | 233 | } | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | @Verifier(tx) | |
237 | 237 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
238 | 238 |
github/deemru/w8io/026f985 41.30 ms ◑