tx · AK5pg2Tg4QuVWnDKuJjE8eCmUaGTLeRH5cVS6kdgsK5P 3N99iJ7nhpJnb7RyucdZREx2ESs3XhKfBNh: -0.01400000 Waves 2022.04.09 07:13 [2000538] smart account 3N99iJ7nhpJnb7RyucdZREx2ESs3XhKfBNh > SELF 0.00000000 Waves
{ "type": 13, "id": "AK5pg2Tg4QuVWnDKuJjE8eCmUaGTLeRH5cVS6kdgsK5P", "fee": 1400000, "feeAssetId": null, "timestamp": 1649477617630, "version": 2, "chainId": 84, "sender": "3N99iJ7nhpJnb7RyucdZREx2ESs3XhKfBNh", "senderPublicKey": "5dVaH8nPwDJRpMtdDcdrNMLtiQ51d1VfH6GEKtPQCbDb", "proofs": [ "L4EfMuzjV6nPPTRLJPXAPxGD4Mvs4GSFKcujwqAVo7Dq3YEHV7JDnz24yhfpPJhwcuAuXv4Dnc5rgsgyDdsMW1r" ], "script": "base64:AAIFAAAAAAAAAB8IAhIFCgMIAQQSAwoBCBIDCgEIEgQKAggIEgQKAggIAAAAFAAAAAAQa1Byb3Bvc2VkQXNzZXRJZAIAAAATX3Byb3Bvc2VkX2Fzc2V0MV9pZAAAAAAUa1Byb3Bvc2VkQXNzZXRBbW91bnQCAAAAF19wcm9wb3NlZF9hc3NldDFfYW1vdW50AAAAAA9rRGVzaXJlZEFzc2V0SWQCAAAAEV9kZXNpcmVkX2Fzc2V0X2lkAAAAAA5rRGVzaXJlZEFtb3VudAIAAAAVX2Rlc2lyZWRfYXNzZXRfYW1vdW50AAAAAAdrU3RhdHVzAgAAAAdfc3RhdHVzAAAAAAZrT3duZXICAAAABl9vd25lcgAAAAAKa0Nsb3NlVHhJZAIAAAAMX2Nsb3NlX3R4X2lkAAAAAAhrUGFydGlhbAIAAAAIX3BhcnRpYWwAAAAAB2tGaWxsZWQCAAAAD19kZXNpcmVkX2ZpbGxlZAAAAAAFa1VzZWQCAAAADl9wcm9wb3NlZF91c2VkAAAAAAlrUHJvcG9zYWwCAAAABXByb3BfAAAAAA5r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ded", "spentComplexity": 0 } View: original | compacted Prev: 6NvDoC5DjDT2zk9cn17Zn8fKkrh9SzTDqBFQmtbeHi1L Next: HLPcaFwTwmPuevMDJex6kPG3DxojZC1YHrEgoVLXNbdc Diff:
Old | New | Differences | |
---|---|---|---|
245 | 245 | then aV | |
246 | 246 | else aU | |
247 | 247 | let aY = fraction(A, p, y) | |
248 | - | let aZ = (fraction(aX, ((s - q) * p), (s * aY)) - aW) | |
248 | + | let aZ = ((fraction(aX, ((s - q) * p), (s * aY)) - aW) + 1) | |
249 | 249 | let ba = min([aZ, y]) | |
250 | 250 | let bb = fraction(fraction(aX, ba, (aW + ba)), (s - q), s) | |
251 | 251 | if ((0 > bb)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_proposed_asset1_id" | |
5 | 5 | ||
6 | 6 | let b = "_proposed_asset1_amount" | |
7 | 7 | ||
8 | 8 | let c = "_desired_asset_id" | |
9 | 9 | ||
10 | 10 | let d = "_desired_asset_amount" | |
11 | 11 | ||
12 | 12 | let e = "_status" | |
13 | 13 | ||
14 | 14 | let f = "_owner" | |
15 | 15 | ||
16 | 16 | let g = "_close_tx_id" | |
17 | 17 | ||
18 | 18 | let h = "_partial" | |
19 | 19 | ||
20 | 20 | let i = "_desired_filled" | |
21 | 21 | ||
22 | 22 | let j = "_proposed_used" | |
23 | 23 | ||
24 | 24 | let k = "prop_" | |
25 | 25 | ||
26 | 26 | let l = "prop_total" | |
27 | 27 | ||
28 | 28 | let m = "Active" | |
29 | 29 | ||
30 | 30 | let n = "Canceled" | |
31 | 31 | ||
32 | 32 | let o = "Done" | |
33 | 33 | ||
34 | 34 | let p = 100000000 | |
35 | 35 | ||
36 | 36 | let q = 30 | |
37 | 37 | ||
38 | 38 | let r = 5 | |
39 | 39 | ||
40 | 40 | let s = 10000 | |
41 | 41 | ||
42 | 42 | func t (u) = { | |
43 | 43 | let v = valueOrErrorMessage(getString(this, (u + e)), (("Proposal with id '" + u) + "' not found")) | |
44 | 44 | let w = addressFromStringValue(valueOrErrorMessage(getString(this, (u + f)), "owner not set")) | |
45 | 45 | let x = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (u + a)), "Proposed asset not found")), "Incorrect proposed asset id") | |
46 | 46 | let y = valueOrErrorMessage(getInteger(this, (u + b)), "Proposed amount not found") | |
47 | 47 | let z = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (u + c)), "Desired asset not found")), "Incorrect desired asset id") | |
48 | 48 | let A = valueOrErrorMessage(getInteger(this, (u + d)), "Desired amount not found") | |
49 | 49 | let B = valueOrErrorMessage(getBoolean(this, (u + h)), "Partial setting isn't set") | |
50 | 50 | let C = valueOrElse(getInteger(this, (u + i)), 0) | |
51 | 51 | let D = valueOrElse(getInteger(this, (u + j)), 0) | |
52 | 52 | let E = valueOrElse(getString(this, (u + g)), "") | |
53 | 53 | $Tuple10(v, w, x, y, z, A, B, C, D, E) | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(F) | |
58 | 58 | func placeProposal (G,H,I) = { | |
59 | 59 | let J = $Tuple2(F.payments[0].amount, toBase58String(value(F.payments[0].assetId))) | |
60 | 60 | let K = J._1 | |
61 | 61 | let L = J._2 | |
62 | 62 | let u = toBase58String(F.transactionId) | |
63 | 63 | if (isDefined(getString(this, (u + e)))) | |
64 | 64 | then throw("ID already registered") | |
65 | 65 | else { | |
66 | 66 | let M = valueOrElse(getInteger(this, l), 0) | |
67 | 67 | [StringEntry((k + toString((M + 1))), u), IntegerEntry(l, (M + 1)), StringEntry((u + f), toString(F.caller)), StringEntry((u + a), L), IntegerEntry((u + b), K), StringEntry((u + c), G), IntegerEntry((u + d), H), BooleanEntry((u + h), I), StringEntry((u + e), m), IntegerEntry((u + i), 0), IntegerEntry((u + j), 0)] | |
68 | 68 | } | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | @Callable(F) | |
74 | 74 | func cancelProposal (u) = { | |
75 | 75 | let N = t(u) | |
76 | 76 | let v = N._1 | |
77 | 77 | let w = N._2 | |
78 | 78 | let x = N._3 | |
79 | 79 | let y = N._4 | |
80 | 80 | let z = N._5 | |
81 | 81 | let A = N._6 | |
82 | 82 | let B = N._7 | |
83 | 83 | let C = N._8 | |
84 | 84 | let D = N._9 | |
85 | 85 | let E = N._10 | |
86 | 86 | if ((v != m)) | |
87 | 87 | then throw(((("Proposal with id '" + u) + "' is not active. Status: ") + v)) | |
88 | 88 | else if ((F.caller != w)) | |
89 | 89 | then throw("Only owner can cancel") | |
90 | 90 | else [ScriptTransfer(w, (y - D), x), StringEntry((u + e), n), StringEntry((u + g), ((E + ":") + toBase58String(F.transactionId)))] | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | ||
95 | 95 | @Callable(F) | |
96 | 96 | func acceptProposal (u) = { | |
97 | 97 | let O = $Tuple2(F.payments[0].amount, value(F.payments[0].assetId)) | |
98 | 98 | let K = O._1 | |
99 | 99 | let L = O._2 | |
100 | 100 | let P = t(u) | |
101 | 101 | let v = P._1 | |
102 | 102 | let w = P._2 | |
103 | 103 | let x = P._3 | |
104 | 104 | let y = P._4 | |
105 | 105 | let z = P._5 | |
106 | 106 | let A = P._6 | |
107 | 107 | let B = P._7 | |
108 | 108 | let C = P._8 | |
109 | 109 | let D = P._9 | |
110 | 110 | let E = P._10 | |
111 | 111 | if ((v != m)) | |
112 | 112 | then throw(((("Proposal with id '" + u) + "' is not active. Status: ") + v)) | |
113 | 113 | else if ((z != L)) | |
114 | 114 | then throw("Atatched asset doesn't match desired") | |
115 | 115 | else { | |
116 | 116 | let Q = if (!(B)) | |
117 | 117 | then if ((A != K)) | |
118 | 118 | then throw("Attached asset amount doesn't match") | |
119 | 119 | else $Tuple2(K, A) | |
120 | 120 | else { | |
121 | 121 | let R = min([K, (A - C)]) | |
122 | 122 | $Tuple2(R, fraction(y, R, A)) | |
123 | 123 | } | |
124 | 124 | let S = Q._1 | |
125 | 125 | let T = Q._2 | |
126 | 126 | if ((T == 0)) | |
127 | 127 | then throw("Payment amount is not enough to get something in change") | |
128 | 128 | else { | |
129 | 129 | let U = (C + S) | |
130 | 130 | let V = (D + T) | |
131 | 131 | let W = if ((U == A)) | |
132 | 132 | then o | |
133 | 133 | else m | |
134 | 134 | [ScriptTransfer(w, S, z), ScriptTransfer(F.caller, T, x), ScriptTransfer(F.caller, (K - S), z), IntegerEntry((u + i), U), IntegerEntry((u + j), V), StringEntry((u + e), W), StringEntry((u + g), ((E + ":") + toBase58String(F.transactionId)))] | |
135 | 135 | } | |
136 | 136 | } | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | ||
141 | 141 | @Callable(F) | |
142 | 142 | func matchProposals (X,Y) = { | |
143 | 143 | let Z = t(X) | |
144 | 144 | let aa = Z._1 | |
145 | 145 | let ab = Z._2 | |
146 | 146 | let ac = Z._3 | |
147 | 147 | let ad = Z._4 | |
148 | 148 | let ae = Z._5 | |
149 | 149 | let af = Z._6 | |
150 | 150 | let ag = Z._7 | |
151 | 151 | let ah = Z._8 | |
152 | 152 | let ai = Z._9 | |
153 | 153 | let aj = Z._10 | |
154 | 154 | let ak = t(Y) | |
155 | 155 | let al = ak._1 | |
156 | 156 | let am = ak._2 | |
157 | 157 | let an = ak._3 | |
158 | 158 | let ao = ak._4 | |
159 | 159 | let ap = ak._5 | |
160 | 160 | let aq = ak._6 | |
161 | 161 | let ar = ak._7 | |
162 | 162 | let as = ak._8 | |
163 | 163 | let at = ak._9 | |
164 | 164 | let au = ak._10 | |
165 | 165 | if ((aa != m)) | |
166 | 166 | then throw(((("Proposal with id '" + X) + "' is not active. Status: ") + aa)) | |
167 | 167 | else if ((al != m)) | |
168 | 168 | then throw(((("Proposal with id '" + Y) + "' is not active. Status: ") + al)) | |
169 | 169 | else if (if ((ae != an)) | |
170 | 170 | then true | |
171 | 171 | else (ap != ac)) | |
172 | 172 | then throw("Assets in proposals doesn't match") | |
173 | 173 | else { | |
174 | 174 | let av = fraction(ad, p, af) | |
175 | 175 | let aw = fraction(aq, p, ao) | |
176 | 176 | if ((aw > av)) | |
177 | 177 | then throw(((("Price doesn't match. price1 = " + toString(av)) + ", price2 = ") + toString(aw))) | |
178 | 178 | else { | |
179 | 179 | let ax = ((av + aw) / 2) | |
180 | 180 | let ay = min([ad, (aq - as)]) | |
181 | 181 | let T = min([fraction(ay, p, ax), (af - ah)]) | |
182 | 182 | let S = fraction(T, ax, p) | |
183 | 183 | let az = (ah + T) | |
184 | 184 | let aA = (as + S) | |
185 | 185 | let aB = (ai + S) | |
186 | 186 | let aC = (at + T) | |
187 | 187 | let aD = [ScriptTransfer(ab, T, ae), ScriptTransfer(am, S, ap), IntegerEntry((X + i), az), IntegerEntry((Y + i), aA), IntegerEntry((X + j), aB), IntegerEntry((Y + j), aC), StringEntry((X + g), ((aj + ":") + toBase58String(F.transactionId))), StringEntry((Y + g), ((au + ":") + toBase58String(F.transactionId)))] | |
188 | 188 | func aE (aF,w,u,aG,aH,x) = if (if ((0 > aG)) | |
189 | 189 | then true | |
190 | 190 | else (0 > aH)) | |
191 | 191 | then throw("Internal error with calculation") | |
192 | 192 | else if ((aG == 0)) | |
193 | 193 | then (aF :+ StringEntry((u + e), o)) | |
194 | 194 | else if ((aH == 0)) | |
195 | 195 | then (aF ++ [ScriptTransfer(w, aG, x), StringEntry((u + e), o)]) | |
196 | 196 | else aF | |
197 | 197 | ||
198 | 198 | let aI = (ad - S) | |
199 | 199 | let aJ = (af - T) | |
200 | 200 | let aK = (ad - T) | |
201 | 201 | let aL = (af - S) | |
202 | 202 | let aM = aE(aD, ab, X, aI, aJ, ac) | |
203 | 203 | let aN = aE(aM, am, Y, aK, aL, an) | |
204 | 204 | aN | |
205 | 205 | } | |
206 | 206 | } | |
207 | 207 | } | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | ||
211 | 211 | @Callable(F) | |
212 | 212 | func executeOnSwopfi (u,aO) = { | |
213 | 213 | let aP = t(u) | |
214 | 214 | let v = aP._1 | |
215 | 215 | let w = aP._2 | |
216 | 216 | let x = aP._3 | |
217 | 217 | let y = aP._4 | |
218 | 218 | let z = aP._5 | |
219 | 219 | let A = aP._6 | |
220 | 220 | let B = aP._7 | |
221 | 221 | let C = aP._8 | |
222 | 222 | let D = aP._9 | |
223 | 223 | let E = aP._10 | |
224 | 224 | if ((v != m)) | |
225 | 225 | then throw(((("Proposal with id '" + u) + "' is not active. Status: ") + v)) | |
226 | 226 | else { | |
227 | 227 | let aQ = valueOrErrorMessage(addressFromString(aO), "Wrong pool address") | |
228 | 228 | let aR = getStringValue(aQ, "A_asset_id") | |
229 | 229 | let aS = getStringValue(aQ, "B_asset_id") | |
230 | 230 | let aT = if (if ((aR == toBase58String(x))) | |
231 | 231 | then (aS == toBase58String(z)) | |
232 | 232 | else false) | |
233 | 233 | then "Sell" | |
234 | 234 | else if (if ((aS == toBase58String(x))) | |
235 | 235 | then (aR == toBase58String(z)) | |
236 | 236 | else false) | |
237 | 237 | then "Buy" | |
238 | 238 | else throw("Pool doesn't match proposal") | |
239 | 239 | let aU = getIntegerValue(aQ, "A_asset_balance") | |
240 | 240 | let aV = getIntegerValue(aQ, "B_asset_balance") | |
241 | 241 | let aW = if ((aT == "Sell")) | |
242 | 242 | then aU | |
243 | 243 | else aV | |
244 | 244 | let aX = if ((aT == "Sell")) | |
245 | 245 | then aV | |
246 | 246 | else aU | |
247 | 247 | let aY = fraction(A, p, y) | |
248 | - | let aZ = (fraction(aX, ((s - q) * p), (s * aY)) - aW) | |
248 | + | let aZ = ((fraction(aX, ((s - q) * p), (s * aY)) - aW) + 1) | |
249 | 249 | let ba = min([aZ, y]) | |
250 | 250 | let bb = fraction(fraction(aX, ba, (aW + ba)), (s - q), s) | |
251 | 251 | if ((0 > bb)) | |
252 | 252 | then throw(((("Unable to swop. Pay = " + toString(ba)) + ", Get = ") + toString(bb))) | |
253 | 253 | else { | |
254 | 254 | let bc = fraction(bb, p, ba) | |
255 | 255 | if ((aY > bc)) | |
256 | 256 | then throw("RATIO fucked up") | |
257 | 257 | else { | |
258 | 258 | let bd = invoke(aQ, "exchange", [1], [AttachedPayment(x, ba)]) | |
259 | 259 | if ((bd == bd)) | |
260 | 260 | then { | |
261 | 261 | let be = bd | |
262 | 262 | if ($isInstanceOf(be, "(Int, ByteVector)")) | |
263 | 263 | then { | |
264 | 264 | let bf = be | |
265 | 265 | if (if ((bf._1 != bb)) | |
266 | 266 | then true | |
267 | 267 | else (bf._2 != z)) | |
268 | 268 | then throw(((("exchanger returned unexpected amount of token. Expected: " + toString(bb)) + ", received: ") + toString(bf._1))) | |
269 | 269 | else [ScriptTransfer(w, bb, z), IntegerEntry((u + i), (C + bb)), IntegerEntry((u + j), (D + ba)), StringEntry((u + g), ((E + ":") + toBase58String(F.transactionId)))] | |
270 | 270 | } | |
271 | 271 | else throw("Incorrect invoke of 'exchange' result") | |
272 | 272 | } | |
273 | 273 | else throw("Strict value is not equal to itself.") | |
274 | 274 | } | |
275 | 275 | } | |
276 | 276 | } | |
277 | 277 | } | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | @Verifier(bg) | |
281 | 281 | func bh () = sigVerify(bg.bodyBytes, bg.proofs[0], bg.senderPublicKey) | |
282 | 282 |
github/deemru/w8io/026f985 46.74 ms ◑