tx · C4XZSBFndDbybXHs9EzPDfkXAvhrG7sWnKHANTw58CxQ 3MxiR4vDPzVeaEPgznfS4zi4uLd2nnQuGy9: -0.01000000 Waves 2023.10.06 11:29 [2786525] smart account 3MxiR4vDPzVeaEPgznfS4zi4uLd2nnQuGy9 > SELF 0.00000000 Waves
{ "type": 13, "id": "C4XZSBFndDbybXHs9EzPDfkXAvhrG7sWnKHANTw58CxQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1696580947698, "version": 2, "chainId": 84, "sender": "3MxiR4vDPzVeaEPgznfS4zi4uLd2nnQuGy9", "senderPublicKey": "4AVkL2DQJ8sngCNyArYueNuPS7cvygnakPJhU65LfPfu", "proofs": [ "2c785faqZZewAuGyxnkNh7UQkcXo8ZGTKuTcMfm32AJk6uD1TP119wsAEDoVv2RKSiz7BCePBAsTJL7e51tdHYt3", "3ozynsi9iySg3cFMTFiqHWB2A9YQEPv1e1QnHKtNe9DpQEaPMwdBkVYDFZZMVYM2N8VPmytE3vQVRNgou4PnK3r1" ], "script": "base64:BgIMCAISAwoBGBIDCgEYEQAOQVhMWV9NQUlOX0FERFIJAQdBZGRyZXNzAQEaAVRHYdFKTc5/+9vupfS91sItmkjqQtK5YZsAB1NGX1BPT0wCAlNGAAdXWF9QT09MAgJXWAAKa1NoYXJlUG9vbAIMX3Bvb2xTaGFyZUlkAAVrUG9vbAIFcG9vbF8ACWtBZG1pbjFQSwIVZ3JvdXAxX2FkbWluMV9wdWJfa2V5AAlrQWRtaW4yUEsCFWdyb3VwMV9hZG1pbjJfcHViX2tleQAJa0FkbWluM1BLAhVncm91cDFfYWRtaW4zX3B1Yl9rZXkAD2tPcGVyYXRvckNhbGxQSwISYWRtaW5fY2FsbF9wdWJfa2V5AAhhZG1pbjFQSwkA2QQBCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUOQVhMWV9NQUlOX0FERFIFCWtBZG1pbjFQSwISQ2FuJ3QgZ2V0IGFkbWluMVBLAAhhZG1pbjJQSw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QSwABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFCGFkbWluMlBLAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUIYWRtaW4zUEsAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAKnrvk9", "height": 2786525, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: KcDP7dECm24742GLrcxsJrfdci3sMYsEYeBj6PpJPpj Next: AEWQDPGy8gZPtmCjHCTbEmw7MYrNENUFpeUekH5LXinY Diff:
Old | New | Differences | |
---|---|---|---|
83 | 83 | $f1_2($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3) | |
84 | 84 | } | |
85 | 85 | let routingAssetsKeys = split(eArgs[4], ",") | |
86 | - | let minToRecive = parseIntValue(eArgs[ | |
86 | + | let minToRecive = parseIntValue(eArgs[5]) | |
87 | 87 | [exchangers, exchangersType, args1, args2, routingAssetsKeys, minToRecive] | |
88 | 88 | } | |
89 | 89 | invoke(dApp, "routingTrade", args, pmt) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let AXLY_MAIN_ADDR = Address(base58'3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS') | |
5 | 5 | ||
6 | 6 | let SF_POOL = "SF" | |
7 | 7 | ||
8 | 8 | let WX_POOL = "WX" | |
9 | 9 | ||
10 | 10 | let kSharePool = "_poolShareId" | |
11 | 11 | ||
12 | 12 | let kPool = "pool_" | |
13 | 13 | ||
14 | 14 | let kAdmin1PK = "group1_admin1_pub_key" | |
15 | 15 | ||
16 | 16 | let kAdmin2PK = "group1_admin2_pub_key" | |
17 | 17 | ||
18 | 18 | let kAdmin3PK = "group1_admin3_pub_key" | |
19 | 19 | ||
20 | 20 | let kOperatorCallPK = "admin_call_pub_key" | |
21 | 21 | ||
22 | 22 | let admin1PK = fromBase58String(valueOrErrorMessage(getString(AXLY_MAIN_ADDR, kAdmin1PK), "Can't get admin1PK")) | |
23 | 23 | ||
24 | 24 | let admin2PK = fromBase58String(valueOrErrorMessage(getString(AXLY_MAIN_ADDR, kAdmin2PK), "Can't get admin2PK")) | |
25 | 25 | ||
26 | 26 | let admin3PK = fromBase58String(valueOrErrorMessage(getString(AXLY_MAIN_ADDR, kAdmin3PK), "Can't get admin3PK")) | |
27 | 27 | ||
28 | 28 | let operatorPK = fromBase58String(valueOrErrorMessage(getString(AXLY_MAIN_ADDR, kOperatorCallPK), "Can't get operatorPK")) | |
29 | 29 | ||
30 | 30 | func unknownPoolType () = throw("Wrong pool type") | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func listToInt (a,item) = (a :+ parseIntValue(item)) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func directSwopfiCPMM (rArgs) = { | |
37 | 37 | let dApp = addressFromStringValue(rArgs[1]) | |
38 | 38 | let pmt = { | |
39 | 39 | let pmtP = split(rArgs[2], "|") | |
40 | 40 | [AttachedPayment(fromBase58String(pmtP[0]), parseIntValue(pmtP[1]))] | |
41 | 41 | } | |
42 | 42 | let minToRecive = rArgs[3] | |
43 | 43 | invoke(dApp, "callFunction", ["exchange", [minToRecive]], pmt) | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func directRoutingSwopfi (rArgs) = { | |
48 | 48 | let dApp = addressFromStringValue(rArgs[1]) | |
49 | 49 | let pmt = { | |
50 | 50 | let pmtP = split(rArgs[2], "|") | |
51 | 51 | [AttachedPayment(fromBase58String(pmtP[0]), parseIntValue(pmtP[1]))] | |
52 | 52 | } | |
53 | 53 | let args = { | |
54 | 54 | let eArgs = split(rArgs[3], "|") | |
55 | 55 | let exchangers = split(eArgs[0], ",") | |
56 | 56 | let exchangersType = split(eArgs[1], ",") | |
57 | 57 | let args1 = { | |
58 | 58 | let $l = split(eArgs[2], ",") | |
59 | 59 | let $s = size($l) | |
60 | 60 | let $acc0 = nil | |
61 | 61 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
62 | 62 | then $a | |
63 | 63 | else listToInt($a, $l[$i]) | |
64 | 64 | ||
65 | 65 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
66 | 66 | then $a | |
67 | 67 | else throw("List size exceeds 3") | |
68 | 68 | ||
69 | 69 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
70 | 70 | } | |
71 | 71 | let args2 = { | |
72 | 72 | let $l = split(eArgs[3], ",") | |
73 | 73 | let $s = size($l) | |
74 | 74 | let $acc0 = nil | |
75 | 75 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
76 | 76 | then $a | |
77 | 77 | else listToInt($a, $l[$i]) | |
78 | 78 | ||
79 | 79 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
80 | 80 | then $a | |
81 | 81 | else throw("List size exceeds 3") | |
82 | 82 | ||
83 | 83 | $f1_2($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3) | |
84 | 84 | } | |
85 | 85 | let routingAssetsKeys = split(eArgs[4], ",") | |
86 | - | let minToRecive = parseIntValue(eArgs[ | |
86 | + | let minToRecive = parseIntValue(eArgs[5]) | |
87 | 87 | [exchangers, exchangersType, args1, args2, routingAssetsKeys, minToRecive] | |
88 | 88 | } | |
89 | 89 | invoke(dApp, "routingTrade", args, pmt) | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Callable(i) | |
94 | 94 | func exchangeLps (lps) = { | |
95 | 95 | func exLP (a,lp) = { | |
96 | 96 | let lpB = fromBase58String(lp) | |
97 | 97 | let balance = assetBalance(this, lpB) | |
98 | 98 | let pool = valueOrErrorMessage(getString(AXLY_MAIN_ADDR, (lp + kSharePool)), ("Can't get pool of lp:" + lp)) | |
99 | 99 | let pType = valueOrErrorMessage(getString(AXLY_MAIN_ADDR, (kPool + pool)), "Pool is not inited") | |
100 | 100 | let poolAddr = valueOrErrorMessage(addressFromString(pool), "unknown addr") | |
101 | 101 | if ((balance > 0)) | |
102 | 102 | then { | |
103 | 103 | let inv = if ((pType == SF_POOL)) | |
104 | 104 | then invoke(poolAddr, "callFunction", ["withdraw", ["0"]], [AttachedPayment(lpB, balance)]) | |
105 | 105 | else if ((pType == WX_POOL)) | |
106 | 106 | then invoke(poolAddr, "get", nil, [AttachedPayment(lpB, balance)]) | |
107 | 107 | else unknownPoolType() | |
108 | 108 | if ((inv == inv)) | |
109 | 109 | then (a :+ true) | |
110 | 110 | else throw("Strict value is not equal to itself.") | |
111 | 111 | } | |
112 | 112 | else (a :+ false) | |
113 | 113 | } | |
114 | 114 | ||
115 | 115 | let res = { | |
116 | 116 | let $l = lps | |
117 | 117 | let $s = size($l) | |
118 | 118 | let $acc0 = nil | |
119 | 119 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
120 | 120 | then $a | |
121 | 121 | else exLP($a, $l[$i]) | |
122 | 122 | ||
123 | 123 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
124 | 124 | then $a | |
125 | 125 | else throw("List size exceeds 50") | |
126 | 126 | ||
127 | 127 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
128 | 128 | } | |
129 | 129 | $Tuple2(nil, res) | |
130 | 130 | } | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | ||
134 | 134 | @Callable(i) | |
135 | 135 | func exchangeTokens (routes) = { | |
136 | 136 | func exchangeToken (r,route) = { | |
137 | 137 | let rArgs = split(route, "__") | |
138 | 138 | if ((rArgs[0] == "directSwopfiCPMM")) | |
139 | 139 | then { | |
140 | 140 | let inv = directSwopfiCPMM(rArgs) | |
141 | 141 | if ((inv == inv)) | |
142 | 142 | then (r :+ inv) | |
143 | 143 | else throw("Strict value is not equal to itself.") | |
144 | 144 | } | |
145 | 145 | else if ((rArgs[0] == "routingSwopfi")) | |
146 | 146 | then { | |
147 | 147 | let inv = directRoutingSwopfi(rArgs) | |
148 | 148 | if ((inv == inv)) | |
149 | 149 | then (r :+ inv) | |
150 | 150 | else throw("Strict value is not equal to itself.") | |
151 | 151 | } | |
152 | 152 | else throw("Unknown route type") | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | let res = { | |
156 | 156 | let $l = routes | |
157 | 157 | let $s = size($l) | |
158 | 158 | let $acc0 = nil | |
159 | 159 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
160 | 160 | then $a | |
161 | 161 | else exchangeToken($a, $l[$i]) | |
162 | 162 | ||
163 | 163 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
164 | 164 | then $a | |
165 | 165 | else throw("List size exceeds 30") | |
166 | 166 | ||
167 | 167 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
168 | 168 | } | |
169 | 169 | if ((res == res)) | |
170 | 170 | then nil | |
171 | 171 | else throw("Strict value is not equal to itself.") | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | @Verifier(tx) | |
176 | 176 | func verify () = match tx { | |
177 | 177 | case inv: InvokeScriptTransaction => | |
178 | 178 | let isRightFee = if ((inv.fee == 900000)) | |
179 | 179 | then (inv.feeAssetId == unit) | |
180 | 180 | else false | |
181 | 181 | let isExLpCall = (inv.function == "exchangeLps") | |
182 | 182 | let isExTokensCall = (inv.function == "exchangeTokens") | |
183 | 183 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK)) | |
184 | 184 | then 1 | |
185 | 185 | else 0 | |
186 | 186 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin2PK)) | |
187 | 187 | then 1 | |
188 | 188 | else 0 | |
189 | 189 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin3PK)) | |
190 | 190 | then 1 | |
191 | 191 | else 0 | |
192 | 192 | let adminPubKeyCallSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], operatorPK)) | |
193 | 193 | then 1 | |
194 | 194 | else 0 | |
195 | 195 | let signedByOneAdmin = ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKeyCallSigned) >= 1) | |
196 | 196 | if (if (isRightFee) | |
197 | 197 | then if (isExLpCall) | |
198 | 198 | then true | |
199 | 199 | else isExTokensCall | |
200 | 200 | else false) | |
201 | 201 | then signedByOneAdmin | |
202 | 202 | else false | |
203 | 203 | case _ => | |
204 | 204 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], admin1PK)) | |
205 | 205 | then 1 | |
206 | 206 | else 0 | |
207 | 207 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], admin2PK)) | |
208 | 208 | then 1 | |
209 | 209 | else 0 | |
210 | 210 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], admin3PK)) | |
211 | 211 | then 1 | |
212 | 212 | else 0 | |
213 | 213 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
214 | 214 | } | |
215 | 215 |
github/deemru/w8io/026f985 44.24 ms ◑