tx · DURn9sV47qsxFEYToQ83YEbPCQBr5W2bzF3QYKwUYSLn 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.07.23 01:53 [2677685] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "DURn9sV47qsxFEYToQ83YEbPCQBr5W2bzF3QYKwUYSLn", "fee": 1000000, "feeAssetId": null, "timestamp": 1690066416014, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "4Xso6CghfojqdBeWi2aDi1Ua9BNMjqD9Tw92DBQRR2MKLwkuKoLJCb6br8poi3PsQVcKorAiezWraeejM1LtKKPh" ], "script": "base64:BgIwCAISBAoCAQgSABIAEgASAwoBARIDCgEBEgMKAQESBAoCCAESABIECgIIARIDCgEIBgADYXJyCQDMCAIAAQkAzAgCAAIJAMwIAgADCQDMCAIABAkAzAgCAAUFA25pbAAEYXJyMgkAzAgCAAEJAMwIAgACBQNuaWwBA3N1bQIBYQFiCQD8BwQJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOM0RuVmZmblV5WnR6Mk1SYms1VTdnaU4xMTJXZW1wTU5kAgZib3Jyb3cJAMwIAgIsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAMwIAgDAhD0FA25pbAUDbmlsAQpnZXRCYWxhbmNlAgphc3NldElkU3RyB2FkZHJlc3MDCQAAAgUKYXNzZXRJZFN0cgIFV0FWRVMICQDvBwEFB2FkZHJlc3MJYXZhaWxhYmxlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgEPZ2V0Q3VycmVudFByaWNlAQphc3NldElkU3RyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTAAIJAAIBAgVFcnJvcgEZdH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UKYXNzZXRJZFN0cgkAzAgCBQthc3NldEFtb3VudAUDbmlsBQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICBQdhZGRyZXNzAgpfd2l0aGRyZXdfBQphc3NldElkU3RyBQthc3NldEFtb3VudAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAWkBDGNoZWNrQmFsYW5jZQEKYXNzZXRJZFN0cgQHYWRkcmVzcwgFAWkGY2FsbGVyAwkAAAIFCmFzc2V0SWRTdHICBVdBVkVTCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1XYXZlcyBCYWxhbmNlCAkA7wcBBQdhZGRyZXNzCWF2YWlsYWJsZQUDbmlsCQDMCAIJAQxJbnRlZ2VyRW50cnkCAg1Bc3NldCBCYWxhbmNlCQDwBwIFB2FkZHJlc3MJANkEAQUKYXNzZXRJZFN0cgUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleS1NI8M=", "height": 2677685, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HtPmNnLpdeD5zt9bdAvAtTXqDp1sxNSguxp2hAmH6g1u Next: HtDBzMYxdiwYJcRwU5yyencsjz37PGkukaWddjgAZKjM 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", 10000000000, 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", 10000000000, 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/169f3d6 36.33 ms ◑