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:AAIFAAAAAAAAAB8IAhIFCgMIAQQSAwoBCBIDCgEIEgQKAggIEgQKAggIAAAAFAAAAAAQa1Byb3Bvc2VkQXNzZXRJZAIAAAATX3Byb3Bvc2VkX2Fzc2V0MV9pZAAAAAAUa1Byb3Bvc2VkQXNzZXRBbW91bnQCAAAAF19wcm9wb3NlZF9hc3NldDFfYW1vdW50AAAAAA9rRGVzaXJlZEFzc2V0SWQCAAAAEV9kZXNpcmVkX2Fzc2V0X2lkAAAAAA5rRGVzaXJlZEFtb3VudAIAAAAVX2Rlc2lyZWRfYXNzZXRfYW1vdW50AAAAAAdrU3RhdHVzAgAAAAdfc3RhdHVzAAAAAAZrT3duZXICAAAABl9vd25lcgAAAAAKa0Nsb3NlVHhJZAIAAAAMX2Nsb3NlX3R4X2lkAAAAAAhrUGFydGlhbAIAAAAIX3BhcnRpYWwAAAAAB2tGaWxsZWQCAAAAD19kZXNpcmVkX2ZpbGxlZAAAAAAFa1VzZWQCAAAADl9wcm9wb3NlZF91c2VkAAAAAAlrUHJvcG9zYWwCAAAABXByb3BfAAAAAA5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eded", "spentComplexity": 0 } View: original | compacted Prev: 6NvDoC5DjDT2zk9cn17Zn8fKkrh9SzTDqBFQmtbeHi1L Next: HLPcaFwTwmPuevMDJex6kPG3DxojZC1YHrEgoVLXNbdc Diff:
OldNewDifferences
245245 then aV
246246 else aU
247247 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)
249249 let ba = min([aZ, y])
250250 let bb = fraction(fraction(aX, ba, (aW + ba)), (s - q), s)
251251 if ((0 > bb))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "_proposed_asset1_id"
55
66 let b = "_proposed_asset1_amount"
77
88 let c = "_desired_asset_id"
99
1010 let d = "_desired_asset_amount"
1111
1212 let e = "_status"
1313
1414 let f = "_owner"
1515
1616 let g = "_close_tx_id"
1717
1818 let h = "_partial"
1919
2020 let i = "_desired_filled"
2121
2222 let j = "_proposed_used"
2323
2424 let k = "prop_"
2525
2626 let l = "prop_total"
2727
2828 let m = "Active"
2929
3030 let n = "Canceled"
3131
3232 let o = "Done"
3333
3434 let p = 100000000
3535
3636 let q = 30
3737
3838 let r = 5
3939
4040 let s = 10000
4141
4242 func t (u) = {
4343 let v = valueOrErrorMessage(getString(this, (u + e)), (("Proposal with id '" + u) + "' not found"))
4444 let w = addressFromStringValue(valueOrErrorMessage(getString(this, (u + f)), "owner not set"))
4545 let x = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (u + a)), "Proposed asset not found")), "Incorrect proposed asset id")
4646 let y = valueOrErrorMessage(getInteger(this, (u + b)), "Proposed amount not found")
4747 let z = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (u + c)), "Desired asset not found")), "Incorrect desired asset id")
4848 let A = valueOrErrorMessage(getInteger(this, (u + d)), "Desired amount not found")
4949 let B = valueOrErrorMessage(getBoolean(this, (u + h)), "Partial setting isn't set")
5050 let C = valueOrElse(getInteger(this, (u + i)), 0)
5151 let D = valueOrElse(getInteger(this, (u + j)), 0)
5252 let E = valueOrElse(getString(this, (u + g)), "")
5353 $Tuple10(v, w, x, y, z, A, B, C, D, E)
5454 }
5555
5656
5757 @Callable(F)
5858 func placeProposal (G,H,I) = {
5959 let J = $Tuple2(F.payments[0].amount, toBase58String(value(F.payments[0].assetId)))
6060 let K = J._1
6161 let L = J._2
6262 let u = toBase58String(F.transactionId)
6363 if (isDefined(getString(this, (u + e))))
6464 then throw("ID already registered")
6565 else {
6666 let M = valueOrElse(getInteger(this, l), 0)
6767 [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)]
6868 }
6969 }
7070
7171
7272
7373 @Callable(F)
7474 func cancelProposal (u) = {
7575 let N = t(u)
7676 let v = N._1
7777 let w = N._2
7878 let x = N._3
7979 let y = N._4
8080 let z = N._5
8181 let A = N._6
8282 let B = N._7
8383 let C = N._8
8484 let D = N._9
8585 let E = N._10
8686 if ((v != m))
8787 then throw(((("Proposal with id '" + u) + "' is not active. Status: ") + v))
8888 else if ((F.caller != w))
8989 then throw("Only owner can cancel")
9090 else [ScriptTransfer(w, (y - D), x), StringEntry((u + e), n), StringEntry((u + g), ((E + ":") + toBase58String(F.transactionId)))]
9191 }
9292
9393
9494
9595 @Callable(F)
9696 func acceptProposal (u) = {
9797 let O = $Tuple2(F.payments[0].amount, value(F.payments[0].assetId))
9898 let K = O._1
9999 let L = O._2
100100 let P = t(u)
101101 let v = P._1
102102 let w = P._2
103103 let x = P._3
104104 let y = P._4
105105 let z = P._5
106106 let A = P._6
107107 let B = P._7
108108 let C = P._8
109109 let D = P._9
110110 let E = P._10
111111 if ((v != m))
112112 then throw(((("Proposal with id '" + u) + "' is not active. Status: ") + v))
113113 else if ((z != L))
114114 then throw("Atatched asset doesn't match desired")
115115 else {
116116 let Q = if (!(B))
117117 then if ((A != K))
118118 then throw("Attached asset amount doesn't match")
119119 else $Tuple2(K, A)
120120 else {
121121 let R = min([K, (A - C)])
122122 $Tuple2(R, fraction(y, R, A))
123123 }
124124 let S = Q._1
125125 let T = Q._2
126126 if ((T == 0))
127127 then throw("Payment amount is not enough to get something in change")
128128 else {
129129 let U = (C + S)
130130 let V = (D + T)
131131 let W = if ((U == A))
132132 then o
133133 else m
134134 [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)))]
135135 }
136136 }
137137 }
138138
139139
140140
141141 @Callable(F)
142142 func matchProposals (X,Y) = {
143143 let Z = t(X)
144144 let aa = Z._1
145145 let ab = Z._2
146146 let ac = Z._3
147147 let ad = Z._4
148148 let ae = Z._5
149149 let af = Z._6
150150 let ag = Z._7
151151 let ah = Z._8
152152 let ai = Z._9
153153 let aj = Z._10
154154 let ak = t(Y)
155155 let al = ak._1
156156 let am = ak._2
157157 let an = ak._3
158158 let ao = ak._4
159159 let ap = ak._5
160160 let aq = ak._6
161161 let ar = ak._7
162162 let as = ak._8
163163 let at = ak._9
164164 let au = ak._10
165165 if ((aa != m))
166166 then throw(((("Proposal with id '" + X) + "' is not active. Status: ") + aa))
167167 else if ((al != m))
168168 then throw(((("Proposal with id '" + Y) + "' is not active. Status: ") + al))
169169 else if (if ((ae != an))
170170 then true
171171 else (ap != ac))
172172 then throw("Assets in proposals doesn't match")
173173 else {
174174 let av = fraction(ad, p, af)
175175 let aw = fraction(aq, p, ao)
176176 if ((aw > av))
177177 then throw(((("Price doesn't match. price1 = " + toString(av)) + ", price2 = ") + toString(aw)))
178178 else {
179179 let ax = ((av + aw) / 2)
180180 let ay = min([ad, (aq - as)])
181181 let T = min([fraction(ay, p, ax), (af - ah)])
182182 let S = fraction(T, ax, p)
183183 let az = (ah + T)
184184 let aA = (as + S)
185185 let aB = (ai + S)
186186 let aC = (at + T)
187187 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)))]
188188 func aE (aF,w,u,aG,aH,x) = if (if ((0 > aG))
189189 then true
190190 else (0 > aH))
191191 then throw("Internal error with calculation")
192192 else if ((aG == 0))
193193 then (aF :+ StringEntry((u + e), o))
194194 else if ((aH == 0))
195195 then (aF ++ [ScriptTransfer(w, aG, x), StringEntry((u + e), o)])
196196 else aF
197197
198198 let aI = (ad - S)
199199 let aJ = (af - T)
200200 let aK = (ad - T)
201201 let aL = (af - S)
202202 let aM = aE(aD, ab, X, aI, aJ, ac)
203203 let aN = aE(aM, am, Y, aK, aL, an)
204204 aN
205205 }
206206 }
207207 }
208208
209209
210210
211211 @Callable(F)
212212 func executeOnSwopfi (u,aO) = {
213213 let aP = t(u)
214214 let v = aP._1
215215 let w = aP._2
216216 let x = aP._3
217217 let y = aP._4
218218 let z = aP._5
219219 let A = aP._6
220220 let B = aP._7
221221 let C = aP._8
222222 let D = aP._9
223223 let E = aP._10
224224 if ((v != m))
225225 then throw(((("Proposal with id '" + u) + "' is not active. Status: ") + v))
226226 else {
227227 let aQ = valueOrErrorMessage(addressFromString(aO), "Wrong pool address")
228228 let aR = getStringValue(aQ, "A_asset_id")
229229 let aS = getStringValue(aQ, "B_asset_id")
230230 let aT = if (if ((aR == toBase58String(x)))
231231 then (aS == toBase58String(z))
232232 else false)
233233 then "Sell"
234234 else if (if ((aS == toBase58String(x)))
235235 then (aR == toBase58String(z))
236236 else false)
237237 then "Buy"
238238 else throw("Pool doesn't match proposal")
239239 let aU = getIntegerValue(aQ, "A_asset_balance")
240240 let aV = getIntegerValue(aQ, "B_asset_balance")
241241 let aW = if ((aT == "Sell"))
242242 then aU
243243 else aV
244244 let aX = if ((aT == "Sell"))
245245 then aV
246246 else aU
247247 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)
249249 let ba = min([aZ, y])
250250 let bb = fraction(fraction(aX, ba, (aW + ba)), (s - q), s)
251251 if ((0 > bb))
252252 then throw(((("Unable to swop. Pay = " + toString(ba)) + ", Get = ") + toString(bb)))
253253 else {
254254 let bc = fraction(bb, p, ba)
255255 if ((aY > bc))
256256 then throw("RATIO fucked up")
257257 else {
258258 let bd = invoke(aQ, "exchange", [1], [AttachedPayment(x, ba)])
259259 if ((bd == bd))
260260 then {
261261 let be = bd
262262 if ($isInstanceOf(be, "(Int, ByteVector)"))
263263 then {
264264 let bf = be
265265 if (if ((bf._1 != bb))
266266 then true
267267 else (bf._2 != z))
268268 then throw(((("exchanger returned unexpected amount of token. Expected: " + toString(bb)) + ", received: ") + toString(bf._1)))
269269 else [ScriptTransfer(w, bb, z), IntegerEntry((u + i), (C + bb)), IntegerEntry((u + j), (D + ba)), StringEntry((u + g), ((E + ":") + toBase58String(F.transactionId)))]
270270 }
271271 else throw("Incorrect invoke of 'exchange' result")
272272 }
273273 else throw("Strict value is not equal to itself.")
274274 }
275275 }
276276 }
277277 }
278278
279279
280280 @Verifier(bg)
281281 func bh () = sigVerify(bg.bodyBytes, bg.proofs[0], bg.senderPublicKey)
282282

github/deemru/w8io/026f985 
46.74 ms