tx · HExcxCk2Sadz9hQTGvPfRDis2evKqESvkLzztrYmPfTQ 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.08.29 23:01 [2732439] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "HExcxCk2Sadz9hQTGvPfRDis2evKqESvkLzztrYmPfTQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1693339316213, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "2ZqWZqPAiXdcqLGzZVZsQdXo4FvXTCPiNsjTAn2p246rxMAYaNUso6FL8hYEqzVyxNg2w1xmHEeESdWZgUt67Nvs" ], "script": "base64:BgIOCAISABIAEgASABIAEgAOAAl3YXZlczFMSWQJAQdBZGRyZXNzAQEgsfXkVqM/0+6J9kArnDxMgAk2oJh4WqfkxR9uWw/pRoUACXdhdmVzM0xJZAkBB0FkZHJlc3MBASB3Vww16jaU307TFdx6AQCZu00QR9cMiqtX4etxi+C4ZAAJd2F2ZXM1TElkCQEHQWRkcmVzcwEBIBtGaJJlOVgU0G5tRCLl1N4g5dbuu+aJfhfESzP16GakAAZ1c2RuSWQBIA/yHBKs5MQ8muxGGqslqLDsugcrRsxtiHLwteKSSQG0AANhcnIJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQUDbmlsAARhcnIyCQDMCAIAAQkAzAgCAAIFA25pbAAEYXJyMwkAzAgCAAEJAMwIAgACCQDMCAIAAwUDbmlsAQNzdW0CAWEBYgkA/AcECQERQGV4dHJOYXRpdmUoMTA2MikBAiMzTjNEblZmZm5VeVp0ejJNUmJrNVU3Z2lOMTEyV2VtcE1OZAIGYm9ycm93CQDMCAICLDI1RkVxRWpSa3FLNnlDa2lUN0x6NlNBWXo3Z1VGQ3R4Z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GVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5rskayA==", "height": 2732439, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9kBJohuSW8s7Cw5zdDv2EC5qaatBJJ2ZLwRtMsu5Boti Next: Fz6LGpE3GGRJfP6AVycXBdpF2w85tr82uQWoSoYEEBXj Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let waves3LId = Address(base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM') | |
7 | 7 | ||
8 | 8 | let waves5LId = Address(base58'2qUH6Nh6cgC8dxj8fwH3bTJi261PNr5nMQKRbBXBuwmM') | |
9 | + | ||
10 | + | let usdnId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
9 | 11 | ||
10 | 12 | let arr = [1, 2, 3, 4, 5] | |
11 | 13 | ||
160 | 162 | } | |
161 | 163 | ||
162 | 164 | ||
165 | + | ||
166 | + | @Callable(i) | |
167 | + | func long3 () = if (if ((size(i.payments) != 1)) | |
168 | + | then true | |
169 | + | else (i.payments[0].amount == 0)) | |
170 | + | then throw("1 payment has to be attached") | |
171 | + | else { | |
172 | + | let firstAmountIn = i.payments[0].amount | |
173 | + | let firstSwappedAmount = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(usdnId, firstAmountIn)]) | |
174 | + | if ((firstSwappedAmount == firstSwappedAmount)) | |
175 | + | then match firstSwappedAmount { | |
176 | + | case r: Int => | |
177 | + | let fistDepositResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, r)]) | |
178 | + | if ((fistDepositResult == fistDepositResult)) | |
179 | + | then { | |
180 | + | let firstBorrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((firstAmountIn * 75) / 100)], nil) | |
181 | + | if ((firstBorrowResult == firstBorrowResult)) | |
182 | + | then { | |
183 | + | func repeatFunc (accum,next) = (accum + next) | |
184 | + | ||
185 | + | let array = [1, 1, 1] | |
186 | + | let res = { | |
187 | + | let $l = array | |
188 | + | let $s = size($l) | |
189 | + | let $acc0 = 0 | |
190 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
191 | + | then $a | |
192 | + | else repeatFunc($a, $l[$i]) | |
193 | + | ||
194 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
195 | + | then $a | |
196 | + | else throw("List size exceeds 5") | |
197 | + | ||
198 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
199 | + | } | |
200 | + | nil | |
201 | + | } | |
202 | + | else throw("Strict value is not equal to itself.") | |
203 | + | } | |
204 | + | else throw("Strict value is not equal to itself.") | |
205 | + | case _ => | |
206 | + | throw("Incorrect invoke result") | |
207 | + | } | |
208 | + | else throw("Strict value is not equal to itself.") | |
209 | + | } | |
210 | + | ||
211 | + | ||
212 | + | ||
213 | + | @Callable(i) | |
214 | + | func long3test () = if (if ((size(i.payments) != 1)) | |
215 | + | then true | |
216 | + | else (i.payments[0].amount == 0)) | |
217 | + | then throw("1 payment has to be attached") | |
218 | + | else { | |
219 | + | let firstAmountIn = i.payments[0].amount | |
220 | + | let firstSwappedAmount = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(usdnId, firstAmountIn)]) | |
221 | + | if ((firstSwappedAmount == firstSwappedAmount)) | |
222 | + | then match firstSwappedAmount { | |
223 | + | case r: Int => | |
224 | + | [IntegerEntry("Returned_SwappedAmount", r)] | |
225 | + | case _ => | |
226 | + | throw("Incorrect invoke result") | |
227 | + | } | |
228 | + | else throw("Strict value is not equal to itself.") | |
229 | + | } | |
230 | + | ||
231 | + | ||
163 | 232 | @Verifier(tx) | |
164 | 233 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
165 | 234 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let waves1LId = Address(base58'CygdaJKZfxRrHyYMwkNdz9ZgSD5FpJLtk5s5B4q1DKV6') | |
5 | 5 | ||
6 | 6 | let waves3LId = Address(base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM') | |
7 | 7 | ||
8 | 8 | let waves5LId = Address(base58'2qUH6Nh6cgC8dxj8fwH3bTJi261PNr5nMQKRbBXBuwmM') | |
9 | + | ||
10 | + | let usdnId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
9 | 11 | ||
10 | 12 | let arr = [1, 2, 3, 4, 5] | |
11 | 13 | ||
12 | 14 | let arr2 = [1, 2] | |
13 | 15 | ||
14 | 16 | let arr3 = [1, 2, 3] | |
15 | 17 | ||
16 | 18 | func sum (a,b) = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", 1000000], nil) | |
17 | 19 | ||
18 | 20 | ||
19 | 21 | func getBalance (assetIdStr,address) = if ((assetIdStr == "WAVES")) | |
20 | 22 | then wavesBalance(address).available | |
21 | 23 | else assetBalance(address, fromBase58String(assetIdStr)) | |
22 | 24 | ||
23 | 25 | ||
24 | 26 | func getCurrentPrice (assetIdStr) = if ((assetIdStr == "WAVES")) | |
25 | 27 | then 2 | |
26 | 28 | else throw("Error") | |
27 | 29 | ||
28 | 30 | ||
29 | 31 | func getWavesCurrentPrice () = 2000000 | |
30 | 32 | ||
31 | 33 | ||
32 | 34 | func getWavesNewPrice () = 3000000 | |
33 | 35 | ||
34 | 36 | ||
35 | 37 | func getWaves3LCurrentPrice () = 1200000 | |
36 | 38 | ||
37 | 39 | ||
38 | 40 | func getWaves3LNewPrice () = 2000000 | |
39 | 41 | ||
40 | 42 | ||
41 | 43 | @Callable(i) | |
42 | 44 | func mintWaves3L_v1 () = if (if ((size(i.payments) != 1)) | |
43 | 45 | then true | |
44 | 46 | else (i.payments[0].amount == 0)) | |
45 | 47 | then throw("1 payment has to be attached") | |
46 | 48 | else { | |
47 | 49 | let address = toString(i.caller) | |
48 | 50 | let stableCoinAmount = i.payments[0].amount | |
49 | 51 | let convertedWavesAmount = ((stableCoinAmount / getWavesCurrentPrice()) * 100000000) | |
50 | 52 | let userWavesAmount = getBalance("WAVES", i.caller) | |
51 | 53 | if ((userWavesAmount > convertedWavesAmount)) | |
52 | 54 | then { | |
53 | 55 | let depositResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, convertedWavesAmount)]) | |
54 | 56 | if ((depositResult == depositResult)) | |
55 | 57 | then { | |
56 | 58 | func repeatFunc (accum,next) = { | |
57 | 59 | let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", stableCoinAmount], nil) | |
58 | 60 | if ((borrowResult == borrowResult)) | |
59 | 61 | then (accum + next) | |
60 | 62 | else throw("Strict value is not equal to itself.") | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 | let array = [stableCoinAmount, stableCoinAmount, stableCoinAmount] | |
64 | 66 | let res = { | |
65 | 67 | let $l = array | |
66 | 68 | let $s = size($l) | |
67 | 69 | let $acc0 = 0 | |
68 | 70 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
69 | 71 | then $a | |
70 | 72 | else repeatFunc($a, $l[$i]) | |
71 | 73 | ||
72 | 74 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
73 | 75 | then $a | |
74 | 76 | else throw("List size exceeds 3") | |
75 | 77 | ||
76 | 78 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
77 | 79 | } | |
78 | 80 | let returnedTokenAmount = ((res / getWaves3LCurrentPrice()) * 1000000) | |
79 | 81 | [IntegerEntry((address + "_gave_USDN"), stableCoinAmount), IntegerEntry((address + "_deposited_WAVES"), convertedWavesAmount), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), res), IntegerEntry((address + "_received_WAVES3L"), returnedTokenAmount), ScriptTransfer(i.caller, returnedTokenAmount, base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM')] | |
80 | 82 | } | |
81 | 83 | else throw("Strict value is not equal to itself.") | |
82 | 84 | } | |
83 | 85 | else throw("Not enough WAVES to deposit!") | |
84 | 86 | } | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | ||
88 | 90 | @Callable(i) | |
89 | 91 | func redeemWaves3L_v1 () = if (if ((size(i.payments) != 1)) | |
90 | 92 | then true | |
91 | 93 | else (i.payments[0].amount == 0)) | |
92 | 94 | then throw("1 payment has to be attached") | |
93 | 95 | else { | |
94 | 96 | let address = toString(i.caller) | |
95 | 97 | let tokenAmount = i.payments[0].amount | |
96 | 98 | let returnedUSDNAmount = (tokenAmount * (getWaves3LNewPrice() / 1000000)) | |
97 | 99 | [IntegerEntry((address + "_redeemed_WAVES3L"), tokenAmount), IntegerEntry((address + "_received_USDN"), returnedUSDNAmount), ScriptTransfer(i.caller, returnedUSDNAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
98 | 100 | } | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | ||
102 | 104 | @Callable(i) | |
103 | 105 | func mintWaves3L_v2 () = if (if ((size(i.payments) != 1)) | |
104 | 106 | then true | |
105 | 107 | else (i.payments[0].amount == 0)) | |
106 | 108 | then throw("1 payment has to be attached") | |
107 | 109 | else { | |
108 | 110 | let address = toString(i.caller) | |
109 | 111 | let stableCoinAmount = i.payments[0].amount | |
110 | 112 | let convertedWavesAmount = ((stableCoinAmount / 2000000) * 100000000) | |
111 | 113 | let userWavesAmount = getBalance("WAVES", i.caller) | |
112 | 114 | let bedingung = ((3 - 1) * getWavesCurrentPrice()) | |
113 | 115 | if ((stableCoinAmount >= bedingung)) | |
114 | 116 | then { | |
115 | 117 | let depositResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, convertedWavesAmount)]) | |
116 | 118 | if ((depositResult == depositResult)) | |
117 | 119 | then { | |
118 | 120 | func repeatFunc (accum,next) = { | |
119 | 121 | let borrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", stableCoinAmount], nil) | |
120 | 122 | if ((borrowResult == borrowResult)) | |
121 | 123 | then (accum + next) | |
122 | 124 | else throw("Strict value is not equal to itself.") | |
123 | 125 | } | |
124 | 126 | ||
125 | 127 | let array = [stableCoinAmount, stableCoinAmount, stableCoinAmount] | |
126 | 128 | let res = { | |
127 | 129 | let $l = array | |
128 | 130 | let $s = size($l) | |
129 | 131 | let $acc0 = 0 | |
130 | 132 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
131 | 133 | then $a | |
132 | 134 | else repeatFunc($a, $l[$i]) | |
133 | 135 | ||
134 | 136 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
135 | 137 | then $a | |
136 | 138 | else throw("List size exceeds 3") | |
137 | 139 | ||
138 | 140 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
139 | 141 | } | |
140 | 142 | let byWavesKaufen = ((res / getWavesCurrentPrice()) * 100000000) | |
141 | 143 | [IntegerEntry((address + "_gave_USDN"), stableCoinAmount), IntegerEntry((address + "_deposited_WAVES"), convertedWavesAmount), IntegerEntry(((address + "_borrowed_") + "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), res), IntegerEntry((address + "_received_WAVES3L"), 1000000), ScriptTransfer(i.caller, 1000000, base58'92rW5ucGkH84YeXLnLs8dMN1P7RAFocmR8zfBqUy4gPM')] | |
142 | 144 | } | |
143 | 145 | else throw("Strict value is not equal to itself.") | |
144 | 146 | } | |
145 | 147 | else throw("Not enough WAVES to deposit!") | |
146 | 148 | } | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | ||
150 | 152 | @Callable(i) | |
151 | 153 | func redeemWaves3L_v2 () = if (if ((size(i.payments) != 1)) | |
152 | 154 | then true | |
153 | 155 | else (i.payments[0].amount == 0)) | |
154 | 156 | then throw("1 payment has to be attached") | |
155 | 157 | else { | |
156 | 158 | let address = toString(i.caller) | |
157 | 159 | let tokenAmount = 6 | |
158 | 160 | let returnedUSDNAmount = (((tokenAmount * (getWavesNewPrice() / 1000000)) - 4) * 1000000) | |
159 | 161 | [IntegerEntry((address + "_redeemed_WAVES3L"), tokenAmount), IntegerEntry((address + "_received_USDN"), returnedUSDNAmount), ScriptTransfer(i.caller, returnedUSDNAmount, base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT')] | |
160 | 162 | } | |
161 | 163 | ||
162 | 164 | ||
165 | + | ||
166 | + | @Callable(i) | |
167 | + | func long3 () = if (if ((size(i.payments) != 1)) | |
168 | + | then true | |
169 | + | else (i.payments[0].amount == 0)) | |
170 | + | then throw("1 payment has to be attached") | |
171 | + | else { | |
172 | + | let firstAmountIn = i.payments[0].amount | |
173 | + | let firstSwappedAmount = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(usdnId, firstAmountIn)]) | |
174 | + | if ((firstSwappedAmount == firstSwappedAmount)) | |
175 | + | then match firstSwappedAmount { | |
176 | + | case r: Int => | |
177 | + | let fistDepositResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "supply", nil, [AttachedPayment(unit, r)]) | |
178 | + | if ((fistDepositResult == fistDepositResult)) | |
179 | + | then { | |
180 | + | let firstBorrowResult = invoke(addressFromStringValue("3N3DnVffnUyZtz2MRbk5U7giN112WempMNd"), "borrow", ["25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT", ((firstAmountIn * 75) / 100)], nil) | |
181 | + | if ((firstBorrowResult == firstBorrowResult)) | |
182 | + | then { | |
183 | + | func repeatFunc (accum,next) = (accum + next) | |
184 | + | ||
185 | + | let array = [1, 1, 1] | |
186 | + | let res = { | |
187 | + | let $l = array | |
188 | + | let $s = size($l) | |
189 | + | let $acc0 = 0 | |
190 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
191 | + | then $a | |
192 | + | else repeatFunc($a, $l[$i]) | |
193 | + | ||
194 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
195 | + | then $a | |
196 | + | else throw("List size exceeds 5") | |
197 | + | ||
198 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
199 | + | } | |
200 | + | nil | |
201 | + | } | |
202 | + | else throw("Strict value is not equal to itself.") | |
203 | + | } | |
204 | + | else throw("Strict value is not equal to itself.") | |
205 | + | case _ => | |
206 | + | throw("Incorrect invoke result") | |
207 | + | } | |
208 | + | else throw("Strict value is not equal to itself.") | |
209 | + | } | |
210 | + | ||
211 | + | ||
212 | + | ||
213 | + | @Callable(i) | |
214 | + | func long3test () = if (if ((size(i.payments) != 1)) | |
215 | + | then true | |
216 | + | else (i.payments[0].amount == 0)) | |
217 | + | then throw("1 payment has to be attached") | |
218 | + | else { | |
219 | + | let firstAmountIn = i.payments[0].amount | |
220 | + | let firstSwappedAmount = invoke(addressFromStringValue("3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA"), "swapToWaves", nil, [AttachedPayment(usdnId, firstAmountIn)]) | |
221 | + | if ((firstSwappedAmount == firstSwappedAmount)) | |
222 | + | then match firstSwappedAmount { | |
223 | + | case r: Int => | |
224 | + | [IntegerEntry("Returned_SwappedAmount", r)] | |
225 | + | case _ => | |
226 | + | throw("Incorrect invoke result") | |
227 | + | } | |
228 | + | else throw("Strict value is not equal to itself.") | |
229 | + | } | |
230 | + | ||
231 | + | ||
163 | 232 | @Verifier(tx) | |
164 | 233 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
165 | 234 |
github/deemru/w8io/169f3d6 45.25 ms ◑