tx · GiC63WVTWqW7wXixU8rjmYBdnpYbKyTpqyYPuiduiwbu 3N9Tq8RmGw456c1eYphzoMyvtwJGrY98jfr: -0.01400000 Waves 2022.04.07 18:25 [1998324] smart account 3N9Tq8RmGw456c1eYphzoMyvtwJGrY98jfr > SELF 0.00000000 Waves
{ "type": 13, "id": "GiC63WVTWqW7wXixU8rjmYBdnpYbKyTpqyYPuiduiwbu", "fee": 1400000, "feeAssetId": null, "timestamp": 1649345173699, "version": 2, "chainId": 84, "sender": "3N9Tq8RmGw456c1eYphzoMyvtwJGrY98jfr", "senderPublicKey": "He9ZSnjQZGhUkdUsMVVz4t6eAU1c2owedXGCfY1WZvnU", "proofs": [ "3rv6MWs2R9Y13ViBvwCkkD4qvAW6vLdH7FeXpD92JLKJe3gGQVoGRYZy37RFPQLtVuX5nknxXHiDbZ1MEgVBnE2L" ], "script": "base64:AAIFAAAAAAAAAB8IAhIFCgMIAQQSAwoBCBIDCgEIEgQKAggIEgQKAggIAAAAEwAAAAAQa1Byb3Bvc2VkQXNzZXRJZAIAAAATX3Byb3Bvc2VkX2Fzc2V0MV9pZAAAAAAUa1Byb3Bvc2VkQXNzZXRBbW91bnQCAAAAF19wcm9wb3NlZF9hc3NldDFfYW1vdW50AAAAAA9rRGVzaXJlZEFzc2V0SWQCAAAAEV9kZXNpcmVkX2Fzc2V0X2lkAAAAAA5rRGVzaXJlZEFtb3VudAIAAAAVX2Rlc2lyZWRfYXNzZXRfYW1vdW50AAAAAAdrU3RhdHVzAgAAAAdfc3RhdHVzAAAAAAZrT3duZXICAAAABl9vd25lcgAAAAAKa0Nsb3NlVHhJZAIAAAAMX2Nsb3NlX3R4X2lkAAAAAAhrUGFydGlhbAIAAAAIX3BhcnRpYWwAAAAAB2tGaWxsZWQCAAAAB19maWxsZWQAAAAACWtQcm9wb3NhbAIAAAAFcHJvcF8AAAAADmtQcm9wb3NhbFRvdGFsAgAAAApwcm9wX3RvdGFsAAAAAAxzdGF0dXNBY3RpdmUCAAAAB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AABBQAAAAhwb29sQmFsQQUAAAAIcG9vbEJhbEIEAAAABGJhbDIDCQAAAAAAAAIFAAAAAXQAAAAAAAAAAAEFAAAACHBvb2xCYWxCBQAAAAhwb29sQmFsQQQAAAAFcmF0aW8JAABrAAAAAwUAAAASZGVzaXJlZEFzc2V0QW1vdW50BQAAAAZzY2FsZTgFAAAAE3Byb3Bvc2VkQXNzZXRBbW91bnQEAAAABm1heFBheQkAAGUAAAACCQAAawAAAAMFAAAABGJhbDIJAABoAAAAAgkAAGUAAAACCQAAZQAAAAIFAAAADGZlZURlbGltaXRlcgUAAAAHcG9vbEZlZQUAAAAIb3JkZXJGZWUFAAAABnNjYWxlOAkAAGgAAAACBQAAAAxmZWVEZWxpbWl0ZXIFAAAABXJhdGlvBQAAAARiYWwxBAAAAAV0b1BheQkAAZcAAAABCQAETAAAAAIFAAAABm1heFBheQkABEwAAAACBQAAABNwcm9wb3NlZEFzc2V0QW1vdW50BQAAAANuaWwEAAAABXRvR2V0CQAAawAAAAMFAAAABGJhbDIFAAAABXRvUGF5CQAAZAAAAAIFAAAABGJhbDEFAAAABXRvUGF5BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQR/gXw=", "height": 1998324, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8gN7ajwZJL5gjqsiwtrx5vR78dRwSvusHyAnCTNgkC6k Next: none Diff:
Old | New | Differences | |
---|---|---|---|
79 | 79 | let A = L._7 | |
80 | 80 | let B = L._8 | |
81 | 81 | let C = L._9 | |
82 | - | if (( | |
83 | - | then throw(" | |
84 | - | else if (( | |
85 | - | then throw( | |
82 | + | if ((u != l)) | |
83 | + | then throw(((("Proposal with id '" + t) + "' is not active. Status: ") + u)) | |
84 | + | else if ((D.caller != v)) | |
85 | + | then throw("Only owner can cancel") | |
86 | 86 | else { | |
87 | 87 | let M = fraction(B, x, z) | |
88 | 88 | [ScriptTransfer(v, (x - M), w), StringEntry((t + e), m), StringEntry((t + g), ((C + ":") + toBase58String(D.transactionId)))] |
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 = "_filled" | |
21 | 21 | ||
22 | 22 | let j = "prop_" | |
23 | 23 | ||
24 | 24 | let k = "prop_total" | |
25 | 25 | ||
26 | 26 | let l = "Active" | |
27 | 27 | ||
28 | 28 | let m = "Canceled" | |
29 | 29 | ||
30 | 30 | let n = "Done" | |
31 | 31 | ||
32 | 32 | let o = 100000000 | |
33 | 33 | ||
34 | 34 | let p = 30 | |
35 | 35 | ||
36 | 36 | let q = 5 | |
37 | 37 | ||
38 | 38 | let r = 10000 | |
39 | 39 | ||
40 | 40 | func s (t) = { | |
41 | 41 | let u = valueOrErrorMessage(getString(this, (t + e)), (("Proposal with id '" + t) + "' not found")) | |
42 | 42 | let v = addressFromStringValue(valueOrErrorMessage(getString(this, (t + f)), "owner not set")) | |
43 | 43 | let w = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (t + a)), "Proposed asset not found")), "Incorrect proposed asset id") | |
44 | 44 | let x = valueOrErrorMessage(getInteger(this, (t + b)), "Proposed amount not found") | |
45 | 45 | let y = valueOrErrorMessage(fromBase58String(valueOrErrorMessage(getString(this, (t + c)), "Desired asset not found")), "Incorrect desired asset id") | |
46 | 46 | let z = valueOrErrorMessage(getInteger(this, (t + d)), "Desired amount not found") | |
47 | 47 | let A = valueOrErrorMessage(getBoolean(this, (t + h)), "Partial setting isn't set") | |
48 | 48 | let B = valueOrElse(getInteger(this, (t + i)), 0) | |
49 | 49 | let C = valueOrElse(getString(this, (t + g)), "") | |
50 | 50 | $Tuple9(u, v, w, x, y, z, A, B, C) | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(D) | |
55 | 55 | func placeProposal (E,F,G) = { | |
56 | 56 | let H = $Tuple2(D.payments[0].amount, toBase58String(value(D.payments[0].assetId))) | |
57 | 57 | let I = H._1 | |
58 | 58 | let J = H._2 | |
59 | 59 | let t = toBase58String(D.transactionId) | |
60 | 60 | if (isDefined(getString(this, (t + e)))) | |
61 | 61 | then throw("ID already registered") | |
62 | 62 | else { | |
63 | 63 | let K = valueOrElse(getInteger(this, k), 0) | |
64 | 64 | [StringEntry((j + toString((K + 1))), t), IntegerEntry(k, (K + 1)), StringEntry((t + f), toString(D.caller)), StringEntry((t + a), J), IntegerEntry((t + b), I), StringEntry((t + c), E), IntegerEntry((t + d), F), BooleanEntry((t + h), G), StringEntry((t + e), l), IntegerEntry((t + i), 0), IntegerEntry(("6HWWAqci8fPbnQf6DMGgPcHgzkzHnaJNHjsskLEJypjJ" + i), 0)] | |
65 | 65 | } | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(D) | |
71 | 71 | func cancelProposal (t) = { | |
72 | 72 | let L = s(t) | |
73 | 73 | let u = L._1 | |
74 | 74 | let v = L._2 | |
75 | 75 | let w = L._3 | |
76 | 76 | let x = L._4 | |
77 | 77 | let y = L._5 | |
78 | 78 | let z = L._6 | |
79 | 79 | let A = L._7 | |
80 | 80 | let B = L._8 | |
81 | 81 | let C = L._9 | |
82 | - | if (( | |
83 | - | then throw(" | |
84 | - | else if (( | |
85 | - | then throw( | |
82 | + | if ((u != l)) | |
83 | + | then throw(((("Proposal with id '" + t) + "' is not active. Status: ") + u)) | |
84 | + | else if ((D.caller != v)) | |
85 | + | then throw("Only owner can cancel") | |
86 | 86 | else { | |
87 | 87 | let M = fraction(B, x, z) | |
88 | 88 | [ScriptTransfer(v, (x - M), w), StringEntry((t + e), m), StringEntry((t + g), ((C + ":") + toBase58String(D.transactionId)))] | |
89 | 89 | } | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | ||
94 | 94 | @Callable(D) | |
95 | 95 | func acceptProposal (t) = { | |
96 | 96 | let N = $Tuple2(D.payments[0].amount, value(D.payments[0].assetId)) | |
97 | 97 | let I = N._1 | |
98 | 98 | let J = N._2 | |
99 | 99 | let O = s(t) | |
100 | 100 | let u = O._1 | |
101 | 101 | let v = O._2 | |
102 | 102 | let w = O._3 | |
103 | 103 | let x = O._4 | |
104 | 104 | let y = O._5 | |
105 | 105 | let z = O._6 | |
106 | 106 | let A = O._7 | |
107 | 107 | let B = O._8 | |
108 | 108 | let C = O._9 | |
109 | 109 | if ((u != l)) | |
110 | 110 | then throw(((("Proposal with id '" + t) + "' is not active. Status: ") + u)) | |
111 | 111 | else if ((y != J)) | |
112 | 112 | then throw("Atatched asset doesn't match desired") | |
113 | 113 | else { | |
114 | 114 | let P = if (!(A)) | |
115 | 115 | then if ((z != I)) | |
116 | 116 | then throw("Attached asset amount doesn't match") | |
117 | 117 | else $Tuple2(I, z) | |
118 | 118 | else { | |
119 | 119 | let Q = min([I, (z - B)]) | |
120 | 120 | $Tuple2(Q, fraction(x, Q, z)) | |
121 | 121 | } | |
122 | 122 | let R = P._1 | |
123 | 123 | let S = P._2 | |
124 | 124 | if ((S == 0)) | |
125 | 125 | then throw("Payment amount is not enough to get something in change") | |
126 | 126 | else { | |
127 | 127 | let T = (B + R) | |
128 | 128 | let U = if ((T == z)) | |
129 | 129 | then n | |
130 | 130 | else l | |
131 | 131 | [ScriptTransfer(v, R, y), ScriptTransfer(D.caller, S, w), ScriptTransfer(D.caller, (I - R), y), IntegerEntry((t + i), T), StringEntry((t + e), U), StringEntry((t + g), ((C + ":") + toBase58String(D.transactionId)))] | |
132 | 132 | } | |
133 | 133 | } | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(D) | |
139 | 139 | func matchProposals (V,W) = { | |
140 | 140 | let X = s(V) | |
141 | 141 | let Y = X._1 | |
142 | 142 | let Z = X._2 | |
143 | 143 | let aa = X._3 | |
144 | 144 | let ab = X._4 | |
145 | 145 | let ac = X._5 | |
146 | 146 | let ad = X._6 | |
147 | 147 | let ae = X._7 | |
148 | 148 | let af = X._8 | |
149 | 149 | let ag = X._9 | |
150 | 150 | let ah = s(W) | |
151 | 151 | let ai = ah._1 | |
152 | 152 | let aj = ah._2 | |
153 | 153 | let ak = ah._3 | |
154 | 154 | let al = ah._4 | |
155 | 155 | let am = ah._5 | |
156 | 156 | let an = ah._6 | |
157 | 157 | let ao = ah._7 | |
158 | 158 | let ap = ah._8 | |
159 | 159 | let aq = ah._9 | |
160 | 160 | if ((Y != l)) | |
161 | 161 | then throw(((("Proposal with id '" + V) + "' is not active. Status: ") + Y)) | |
162 | 162 | else if ((ai != l)) | |
163 | 163 | then throw(((("Proposal with id '" + W) + "' is not active. Status: ") + ai)) | |
164 | 164 | else if (if ((ac != ak)) | |
165 | 165 | then true | |
166 | 166 | else (am != aa)) | |
167 | 167 | then throw("Assets in proposals doesn't match") | |
168 | 168 | else { | |
169 | 169 | let ar = fraction(ab, o, ad) | |
170 | 170 | let as = fraction(an, o, al) | |
171 | 171 | if ((as > ar)) | |
172 | 172 | then throw(((("Price doesn't match. price1 = " + toString(ar)) + ", price2 = ") + toString(as))) | |
173 | 173 | else { | |
174 | 174 | let at = ((ar + as) / 2) | |
175 | 175 | let au = min([ab, (an - ap)]) | |
176 | 176 | let S = min([fraction(au, o, at), (ad - af)]) | |
177 | 177 | let R = fraction(S, at, o) | |
178 | 178 | let av = (af + S) | |
179 | 179 | let aw = (ap + R) | |
180 | 180 | let ax = [ScriptTransfer(Z, S, ac), ScriptTransfer(aj, R, am), IntegerEntry((V + i), av), IntegerEntry((W + i), aw), StringEntry((V + g), ((ag + ":") + toBase58String(D.transactionId))), StringEntry((W + g), ((aq + ":") + toBase58String(D.transactionId)))] | |
181 | 181 | func ay (az,v,t,aA,aB,w) = if (if ((0 > aA)) | |
182 | 182 | then true | |
183 | 183 | else (0 > aB)) | |
184 | 184 | then throw("Internal error with calculation") | |
185 | 185 | else if ((aA == 0)) | |
186 | 186 | then (az :+ StringEntry((t + e), n)) | |
187 | 187 | else if ((aB == 0)) | |
188 | 188 | then (az ++ [ScriptTransfer(v, aA, w), StringEntry((t + e), n)]) | |
189 | 189 | else az | |
190 | 190 | ||
191 | 191 | let aC = (ab - R) | |
192 | 192 | let aD = (ad - S) | |
193 | 193 | let aE = (ab - S) | |
194 | 194 | let aF = (ad - R) | |
195 | 195 | let aG = ay(ax, Z, V, aC, aD, aa) | |
196 | 196 | let aH = ay(aG, aj, W, aE, aF, ak) | |
197 | 197 | aH | |
198 | 198 | } | |
199 | 199 | } | |
200 | 200 | } | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | ||
204 | 204 | @Callable(D) | |
205 | 205 | func executeOnSwopfi (t,aI) = { | |
206 | 206 | let aJ = s(t) | |
207 | 207 | let u = aJ._1 | |
208 | 208 | let v = aJ._2 | |
209 | 209 | let w = aJ._3 | |
210 | 210 | let x = aJ._4 | |
211 | 211 | let y = aJ._5 | |
212 | 212 | let z = aJ._6 | |
213 | 213 | let A = aJ._7 | |
214 | 214 | let B = aJ._8 | |
215 | 215 | let C = aJ._9 | |
216 | 216 | if ((u != l)) | |
217 | 217 | then throw(((("Proposal with id '" + t) + "' is not active. Status: ") + u)) | |
218 | 218 | else { | |
219 | 219 | let aK = valueOrErrorMessage(addressFromString(aI), "Wrong pool address") | |
220 | 220 | let aL = getStringValue(aK, "A_asset_id") | |
221 | 221 | let aM = getStringValue(aK, "B_asset_id") | |
222 | 222 | let aa = "" | |
223 | 223 | let ac = "" | |
224 | 224 | let aN = if (if ((aL == aa)) | |
225 | 225 | then (aM == ac) | |
226 | 226 | else false) | |
227 | 227 | then 1 | |
228 | 228 | else if (if ((aM == aa)) | |
229 | 229 | then (aL == ac) | |
230 | 230 | else false) | |
231 | 231 | then 2 | |
232 | 232 | else throw("Pool doesn't match proposal") | |
233 | 233 | let aO = getIntegerValue(aK, "A_asset_balance") | |
234 | 234 | let aP = getIntegerValue(aK, "B_asset_balance") | |
235 | 235 | let aQ = if ((aN == 1)) | |
236 | 236 | then aO | |
237 | 237 | else aP | |
238 | 238 | let aR = if ((aN == 1)) | |
239 | 239 | then aP | |
240 | 240 | else aO | |
241 | 241 | let aS = fraction(z, o, x) | |
242 | 242 | let aT = (fraction(aR, (((r - p) - q) * o), (r * aS)) - aQ) | |
243 | 243 | let aU = min([aT, x]) | |
244 | 244 | let aV = fraction(aR, aU, (aQ + aU)) | |
245 | 245 | nil | |
246 | 246 | } | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | @Verifier(aW) | |
251 | 251 | func aX () = sigVerify(aW.bodyBytes, aW.proofs[0], aW.senderPublicKey) | |
252 | 252 |
github/deemru/w8io/169f3d6 47.69 ms ◑