tx · Hw4QL2c1zkv59epBuV2mLBsr3UZaVDk4CiSH7eDoqzDy 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq: -0.01000000 Waves 2023.09.19 00:13 [2761360] smart account 3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq > SELF 0.00000000 Waves
{ "type": 13, "id": "Hw4QL2c1zkv59epBuV2mLBsr3UZaVDk4CiSH7eDoqzDy", "fee": 1000000, "feeAssetId": null, "timestamp": 1695071606251, "version": 2, "chainId": 84, "sender": "3NBbFNBed9tcU5AmsJAuExWvgJyNmJxqjWq", "senderPublicKey": "ERewvWFUFQfR1eCnipNAv9n7SdQhof2ESP6PGVjTueLd", "proofs": [ "2iyZFuAbFnh9Hm4mdsKAXA6Kva7U3p9h2CAa3p8Zx6nZqgcQ8H8zwTAV3piux37Vq76HZkXvjgxkubCuYPVrpjpR" ], "script": "base64:BgINCAISABIAEgASAwoBAQcABnVzZG5JZAEgD/IcEqzkxDya7EYaqyWosOy6BytGzG2IcvC14pJJAbQADndhdmVzMkxUb2tlbklkASDkzSnqu8EXlTZRNkvkaX2ITlFTrbuGFIX8CY7Zd2/OsQAMcHV6emxlTGVuZFNDAiMzTjNEblZmZm5VeVp0ejJNUmJrNVU3Z2lOMTEyV2VtcE1OZAAQZmFrZVB1enpsZVN3YXBTQwIjM01zOGZxYlhNNFJobU02Q1BUcjQ0aFV3SGUyQ0NtVkNmVkEADnVzZG5BZGRyZXNzU3RyAiwyNUZFcUVqUmtxSzZ5Q2tpVDdMejZTQVl6N2dVRkN0eGZDQ2huclZGRDVBVAAPd2F2ZXMyTFRva2VuU3RyAixHUTlRTlZMR2ZZU2JOWjRkUzhOUnl2R0dFTFpMNHNXUEtpVmo4OENWMXJKTAENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAQBaQEJbWludExvbmcyAAMDCQECIT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vZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXnuK7ti", "height": 2761360, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FgcvHAynJKxeBzDkdHCKhbPXYY3cDjUJLAPMHBwHRjub Next: 3U9MAr1SrfkDsYCkVapfdMonK1pvdtrebsivixk3fQky Diff:
Old | New | Differences | |
---|---|---|---|
92 | 92 | let firstDepositedWavesAmount = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, firstSwappedAmountValue)]) | |
93 | 93 | if ((firstDepositedWavesAmount == firstDepositedWavesAmount)) | |
94 | 94 | then { | |
95 | - | let listPercentage = [70, 49 | |
95 | + | let listPercentage = [70, 49] | |
96 | 96 | func repeatFunc (accum,next) = { | |
97 | 97 | let borrowedUsdn = invoke(addressFromStringValue(puzzleLendSC), "borrow", [usdnAddressStr, ((firstAmountIn * next) / 100)], nil) | |
98 | 98 | if ((borrowedUsdn == borrowedUsdn)) | |
101 | 101 | if ((swappedAmount == swappedAmount)) | |
102 | 102 | then match swappedAmount { | |
103 | 103 | case swappedAmountValue: Int => | |
104 | - | (accum + next) | |
104 | + | let depositedWaves = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, swappedAmountValue)]) | |
105 | + | if ((depositedWaves == depositedWaves)) | |
106 | + | then (accum + next) | |
107 | + | else throw("Strict value is not equal to itself.") | |
105 | 108 | case _ => | |
106 | 109 | throw("Incorrect invoke result") | |
107 | 110 | } | |
120 | 123 | ||
121 | 124 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
122 | 125 | then $a | |
123 | - | else throw("List size exceeds | |
126 | + | else throw("List size exceeds 2") | |
124 | 127 | ||
125 | - | $f0_2($f0_1($f0_1($ | |
128 | + | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
126 | 129 | } | |
127 | 130 | [IntegerEntry("firstSwappedAmountValue", firstSwappedAmountValue), ScriptTransfer(i.caller, ((firstSwappedAmountValue * res) / 100), waves2LTokenId), IntegerEntry("res", res)] | |
128 | 131 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdnId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
5 | 5 | ||
6 | 6 | let waves2LTokenId = base58'GQ9QNVLGfYSbNZ4dS8NRyvGGELZL4sWPKiVj88CV1rJL' | |
7 | 7 | ||
8 | 8 | let puzzleLendSC = "3N3DnVffnUyZtz2MRbk5U7giN112WempMNd" | |
9 | 9 | ||
10 | 10 | let fakePuzzleSwapSC = "3Ms8fqbXM4RhmM6CPTr44hUwHe2CCmVCfVA" | |
11 | 11 | ||
12 | 12 | let usdnAddressStr = "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT" | |
13 | 13 | ||
14 | 14 | let waves2LTokenStr = "GQ9QNVLGfYSbNZ4dS8NRyvGGELZL4sWPKiVj88CV1rJL" | |
15 | 15 | ||
16 | 16 | func tryGetInteger (key) = match getInteger(this, key) { | |
17 | 17 | case b: Int => | |
18 | 18 | b | |
19 | 19 | case _ => | |
20 | 20 | 0 | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | @Callable(i) | |
25 | 25 | func mintLong2 () = if (if ((size(i.payments) != 1)) | |
26 | 26 | then true | |
27 | 27 | else (i.payments[0].amount == 0)) | |
28 | 28 | then throw("1 payment has to be attached mint") | |
29 | 29 | else { | |
30 | 30 | let firstAmountIn = i.payments[0].amount | |
31 | 31 | let callerId = toString(i.caller) | |
32 | 32 | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), firstAmountIn], nil) | |
33 | 33 | if ((firstSwappedWavesAmount == firstSwappedWavesAmount)) | |
34 | 34 | then match firstSwappedWavesAmount { | |
35 | 35 | case firstSwappedAmountValue: Int => | |
36 | 36 | let firstDepositedWavesAmount = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, firstSwappedAmountValue)]) | |
37 | 37 | if ((firstDepositedWavesAmount == firstDepositedWavesAmount)) | |
38 | 38 | then { | |
39 | 39 | let listPercentage = [70, 49, 34, 24, 17] | |
40 | 40 | func repeatFunc (accum,next) = { | |
41 | 41 | let swappedAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), ((firstSwappedAmountValue * accum) / 100)], nil) | |
42 | 42 | if ((swappedAmount == swappedAmount)) | |
43 | 43 | then match swappedAmount { | |
44 | 44 | case swappedAmountValue: Int => | |
45 | 45 | let depositedWaves = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, swappedAmountValue)]) | |
46 | 46 | if ((depositedWaves == depositedWaves)) | |
47 | 47 | then (accum + next) | |
48 | 48 | else throw("Strict value is not equal to itself.") | |
49 | 49 | case _ => | |
50 | 50 | throw("Incorrect invoke result") | |
51 | 51 | } | |
52 | 52 | else throw("Strict value is not equal to itself.") | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | let res = { | |
56 | 56 | let $l = listPercentage | |
57 | 57 | let $s = size($l) | |
58 | 58 | let $acc0 = 0 | |
59 | 59 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
60 | 60 | then $a | |
61 | 61 | else repeatFunc($a, $l[$i]) | |
62 | 62 | ||
63 | 63 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
64 | 64 | then $a | |
65 | 65 | else throw("List size exceeds 5") | |
66 | 66 | ||
67 | 67 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
68 | 68 | } | |
69 | 69 | [ScriptTransfer(i.caller, ((firstSwappedAmountValue * res) / 100), waves2LTokenId)] | |
70 | 70 | } | |
71 | 71 | else throw("Strict value is not equal to itself.") | |
72 | 72 | case _ => | |
73 | 73 | throw("Incorrect invoke result") | |
74 | 74 | } | |
75 | 75 | else throw("Strict value is not equal to itself.") | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(i) | |
81 | 81 | func mintLong2_3 () = if (if ((size(i.payments) != 1)) | |
82 | 82 | then true | |
83 | 83 | else (i.payments[0].amount == 0)) | |
84 | 84 | then throw("1 payment has to be attached mint") | |
85 | 85 | else { | |
86 | 86 | let firstAmountIn = i.payments[0].amount | |
87 | 87 | let callerId = toString(i.caller) | |
88 | 88 | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), firstAmountIn], nil) | |
89 | 89 | if ((firstSwappedWavesAmount == firstSwappedWavesAmount)) | |
90 | 90 | then match firstSwappedWavesAmount { | |
91 | 91 | case firstSwappedAmountValue: Int => | |
92 | 92 | let firstDepositedWavesAmount = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, firstSwappedAmountValue)]) | |
93 | 93 | if ((firstDepositedWavesAmount == firstDepositedWavesAmount)) | |
94 | 94 | then { | |
95 | - | let listPercentage = [70, 49 | |
95 | + | let listPercentage = [70, 49] | |
96 | 96 | func repeatFunc (accum,next) = { | |
97 | 97 | let borrowedUsdn = invoke(addressFromStringValue(puzzleLendSC), "borrow", [usdnAddressStr, ((firstAmountIn * next) / 100)], nil) | |
98 | 98 | if ((borrowedUsdn == borrowedUsdn)) | |
99 | 99 | then { | |
100 | 100 | let swappedAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), ((firstAmountIn * next) / 100)], nil) | |
101 | 101 | if ((swappedAmount == swappedAmount)) | |
102 | 102 | then match swappedAmount { | |
103 | 103 | case swappedAmountValue: Int => | |
104 | - | (accum + next) | |
104 | + | let depositedWaves = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, swappedAmountValue)]) | |
105 | + | if ((depositedWaves == depositedWaves)) | |
106 | + | then (accum + next) | |
107 | + | else throw("Strict value is not equal to itself.") | |
105 | 108 | case _ => | |
106 | 109 | throw("Incorrect invoke result") | |
107 | 110 | } | |
108 | 111 | else throw("Strict value is not equal to itself.") | |
109 | 112 | } | |
110 | 113 | else throw("Strict value is not equal to itself.") | |
111 | 114 | } | |
112 | 115 | ||
113 | 116 | let res = { | |
114 | 117 | let $l = listPercentage | |
115 | 118 | let $s = size($l) | |
116 | 119 | let $acc0 = 0 | |
117 | 120 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
118 | 121 | then $a | |
119 | 122 | else repeatFunc($a, $l[$i]) | |
120 | 123 | ||
121 | 124 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
122 | 125 | then $a | |
123 | - | else throw("List size exceeds | |
126 | + | else throw("List size exceeds 2") | |
124 | 127 | ||
125 | - | $f0_2($f0_1($f0_1($ | |
128 | + | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
126 | 129 | } | |
127 | 130 | [IntegerEntry("firstSwappedAmountValue", firstSwappedAmountValue), ScriptTransfer(i.caller, ((firstSwappedAmountValue * res) / 100), waves2LTokenId), IntegerEntry("res", res)] | |
128 | 131 | } | |
129 | 132 | else throw("Strict value is not equal to itself.") | |
130 | 133 | case _ => | |
131 | 134 | throw("Incorrect invoke result") | |
132 | 135 | } | |
133 | 136 | else throw("Strict value is not equal to itself.") | |
134 | 137 | } | |
135 | 138 | ||
136 | 139 | ||
137 | 140 | ||
138 | 141 | @Callable(i) | |
139 | 142 | func mintLong2_test () = if (if ((size(i.payments) != 1)) | |
140 | 143 | then true | |
141 | 144 | else (i.payments[0].amount == 0)) | |
142 | 145 | then throw("1 payment has to be attached mint") | |
143 | 146 | else { | |
144 | 147 | let firstAmountIn = i.payments[0].amount | |
145 | 148 | let callerId = toString(i.caller) | |
146 | 149 | let firstSwappedWavesAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToWaves", [toString(i.caller), firstAmountIn], nil) | |
147 | 150 | if ((firstSwappedWavesAmount == firstSwappedWavesAmount)) | |
148 | 151 | then match firstSwappedWavesAmount { | |
149 | 152 | case firstSwappedAmountValue: Int => | |
150 | 153 | let firstDepositedWavesAmount = invoke(addressFromStringValue(puzzleLendSC), "supply", nil, [AttachedPayment(unit, firstSwappedAmountValue)]) | |
151 | 154 | if ((firstDepositedWavesAmount == firstDepositedWavesAmount)) | |
152 | 155 | then { | |
153 | 156 | let listPercentage = [70, 49, 34, 24, 17] | |
154 | 157 | func repeatFunc (accum,next) = (accum + next) | |
155 | 158 | ||
156 | 159 | let res = { | |
157 | 160 | let $l = listPercentage | |
158 | 161 | let $s = size($l) | |
159 | 162 | let $acc0 = 0 | |
160 | 163 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
161 | 164 | then $a | |
162 | 165 | else repeatFunc($a, $l[$i]) | |
163 | 166 | ||
164 | 167 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
165 | 168 | then $a | |
166 | 169 | else throw("List size exceeds 5") | |
167 | 170 | ||
168 | 171 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
169 | 172 | } | |
170 | 173 | [IntegerEntry("res", res), IntegerEntry("firstAmountIn", firstAmountIn), IntegerEntry("firstSwappedAmountValue", firstSwappedAmountValue), ScriptTransfer(i.caller, ((firstSwappedAmountValue * res) / 100), waves2LTokenId)] | |
171 | 174 | } | |
172 | 175 | else throw("Strict value is not equal to itself.") | |
173 | 176 | case _ => | |
174 | 177 | throw("Incorrect invoke result") | |
175 | 178 | } | |
176 | 179 | else throw("Strict value is not equal to itself.") | |
177 | 180 | } | |
178 | 181 | ||
179 | 182 | ||
180 | 183 | ||
181 | 184 | @Callable(i) | |
182 | 185 | func redeem (wavesAmount) = { | |
183 | 186 | let userAddress = toString(i.caller) | |
184 | 187 | let redeemedUSDNAmount = invoke(addressFromStringValue(fakePuzzleSwapSC), "swapToUSDN", [wavesAmount, userAddress], nil) | |
185 | 188 | if ((redeemedUSDNAmount == redeemedUSDNAmount)) | |
186 | 189 | then match redeemedUSDNAmount { | |
187 | 190 | case redeemedAmountValue: Int => | |
188 | 191 | [IntegerEntry((userAddress + "_redeemed"), redeemedAmountValue)] | |
189 | 192 | case _ => | |
190 | 193 | throw("Incorrect invoke result") | |
191 | 194 | } | |
192 | 195 | else throw("Strict value is not equal to itself.") | |
193 | 196 | } | |
194 | 197 | ||
195 | 198 | ||
196 | 199 | @Verifier(tx) | |
197 | 200 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
198 | 201 |
github/deemru/w8io/169f3d6 42.43 ms ◑