tx · AYog9KWbbxzzUQrmXJjbF5U8UuVpbqFLx3QtaR7bX2BU 3MsVsEgTUxTm6ETYkHGaqMhMhiY2Nb3yDN5: -0.02000000 Waves 2023.09.25 00:13 [2770018] smart account 3MsVsEgTUxTm6ETYkHGaqMhMhiY2Nb3yDN5 > SELF 0.00000000 Waves
{ "type": 13, "id": "AYog9KWbbxzzUQrmXJjbF5U8UuVpbqFLx3QtaR7bX2BU", "fee": 2000000, "feeAssetId": null, "timestamp": 1695590006392, "version": 2, "chainId": 84, "sender": "3MsVsEgTUxTm6ETYkHGaqMhMhiY2Nb3yDN5", "senderPublicKey": "2LmNyaN5YAXdg9C5vsXcTLU66hsW2KUNPsN7KcHBYhUo", "proofs": [ "3mPfDDaBmtYCHxcANR1aifzLQqqRjcucnuUVog6A4v72RyEsRJxMYzuB8F8PFcBuEVqY5XxZdCq7HaQz9uwQfJsn" ], "script": "base64:BgIgCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgIAAdWZXJzaW9uAgUxLjAuMAAOZEFwcFNpbmNlU3RhcnQAwPf3jKoxAAtsaXN0aW5nX2ZlZQCAv9YGAAlrZXkxb3duZXIJAKcIAQEgL8wj0E+YdymCOLPkHvyUyyV6f105rlHZhoS1aMWmpnsACWtleTJvd25lcgkApwgBASAvzCPQT5h3KYI4s+Qe/JTLJXp/XTmuUdmGhLVoxaamewAIVHJlYXN1cnkJAKcIAQEgzkjfc3pzZ3kooMBny03g4HEHbv5A+Wp5Ghfc7qG4JAEAClhUTkFzc2V0SUQBIAhlhLcP8IpqGvPiaOguCJAkw9MnWAPNLPYuXgvf2hWkAQljb3VudGRheXMABAdUU19EaWZmCQBlAggFCWxhc3RCbG9jawl0aW1lc3RhbXAFDmRBcHBTaW5jZVN0YXJ0BAlkYXludW1iZXIJAGsDAAEFB1RTX0RpZmYAgLiZKQUJZGF5bnVtYmVyBgFpAQxSZWdpc3RlclBhaXIBDEVudGVyQXNzZXRJRAQEcG10MQkBBXZhb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"succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8P71hSuJ9JhmbSgmNMNNyDagbF4sJUK73uCeeJ4b9snz Next: none Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | let t = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
35 | 35 | let u = t.name | |
36 | 36 | let v = t.decimals | |
37 | - | let w = fraction((v + 6), 1, 2) | |
38 | - | let x = (1 * pow(10, 0, w, 0, 0, CEILING)) | |
39 | - | let y = fraction(m.amount, n.amount, x) | |
40 | - | let z = sqrt(y, w, w, CEILING) | |
41 | - | let A = Issue((("LP-" + take(u, 8)) + "-XTN"), (((("LP-" + u) + "-XTN") + " is a Liquidity Provider Token Issued Against ") + l), z, w, true) | |
42 | - | let B = calculateAssetId(A) | |
37 | + | let w = pow(10, 0, v, 0, 0, CEILING) | |
38 | + | let x = pow(10, 0, 6, 0, 0, CEILING) | |
39 | + | let y = fraction(m.amount, w, n.amount) | |
40 | + | let z = fraction((v + 6), 1, 2) | |
41 | + | let A = (1 * pow(10, 0, z, 0, 0, CEILING)) | |
42 | + | let B = fraction(m.amount, n.amount, A) | |
43 | + | let C = sqrt(B, z, z, CEILING) | |
44 | + | let D = Issue((("LP-" + take(u, 8)) + "-XTN"), (((("LP-" + u) + "-XTN") + " is a Liquidity Provider Token Issued Against ") + l), C, z, true) | |
45 | + | let E = calculateAssetId(D) | |
43 | 46 | if ((r == l)) | |
44 | 47 | then throw("Pair Already Exist in List.") | |
45 | 48 | else if ((size(k.payments) != 3)) | |
54 | 57 | then throw((("Attached payment[3] amount has to be exact [" + toString(c)) + "/10^8] WAVES.")) | |
55 | 58 | else if ((q == true)) | |
56 | 59 | then throw("You Attached WAVES Asset ID for Listing, please attach Tokens You want to list in payment[2].") | |
57 | - | else [StringEntry(("Pair_UV_" + l), l), IntegerEntry(("Listing_Fee_" + l), o.amount), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), m.amount), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), n.amount), IntegerEntry(("Total_of_Pair_Txns_" + l), 0), IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), 0), IntegerEntry(("Total_Swap_Fee_Collected_" + l), 0), | |
60 | + | else [StringEntry(("Pair_UV_" + l), l), IntegerEntry(("Listing_Fee_" + l), o.amount), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), m.amount), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), n.amount), IntegerEntry(("Total_of_Pair_Txns_" + l), 0), IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), 0), IntegerEntry(("Total_Swap_Fee_Collected_" + l), 0), IntegerEntry("Token_Price", y), D, ScriptTransfer(k.caller, C, E), ScriptTransfer(d, fraction(c, 1, 2), unit), ScriptTransfer(e, fraction(c, 1, 2), unit), StringEntry(("LP_" + l), toBase58String(E)), IntegerEntry(("Total_LP_" + l), C)] | |
58 | 61 | } | |
59 | 62 | ||
60 | 63 | ||
61 | 64 | ||
62 | 65 | @Callable(k) | |
63 | 66 | func oldAddLiquidity (l) = { | |
64 | - | let | |
67 | + | let F = toBase58String(k.caller.bytes) | |
65 | 68 | let m = value(k.payments[0]) | |
66 | 69 | let n = value(k.payments[1]) | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | let | |
72 | - | let v = | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | let | |
82 | - | if ($isInstanceOf( | |
70 | + | let G = getString(this, ("Pair_UV_" + l)) | |
71 | + | let H = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated.")) | |
72 | + | let I = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
73 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
74 | + | let K = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
75 | + | let v = K.decimals | |
76 | + | let L = I | |
77 | + | let M = J | |
78 | + | let N = pow((((L * 1000000) / M) * pow(10, 0, v, 0, 0, CEILING)), 0, 1, 0, 0, CEILING) | |
79 | + | let O = (6 + v) | |
80 | + | let P = (O / 2) | |
81 | + | let Q = fraction(N, m.amount, pow(10, 0, O, 0, 0, CEILING)) | |
82 | + | let R = pow((fraction(m.amount, 1, pow(10, 0, v, 0, 0, CEILING)) * fraction(n.amount, 1, pow(10, 0, 6, 0, 0, CEILING))), 0, 5, 1, P, DOWN) | |
83 | + | let S = { | |
84 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
85 | + | if ($isInstanceOf(T, "Int")) | |
83 | 86 | then { | |
84 | - | let | |
85 | - | | |
87 | + | let U = T | |
88 | + | U | |
86 | 89 | } | |
87 | 90 | else 0 | |
88 | 91 | } | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | if ($isInstanceOf( | |
92 | + | let V = (S + n.amount) | |
93 | + | let W = { | |
94 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
95 | + | if ($isInstanceOf(T, "Int")) | |
93 | 96 | then { | |
94 | - | let | |
95 | - | | |
97 | + | let U = T | |
98 | + | U | |
96 | 99 | } | |
97 | 100 | else 0 | |
98 | 101 | } | |
99 | - | let | |
100 | - | let | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
102 | + | let X = (W + m.amount) | |
103 | + | let Y = { | |
104 | + | let T = getIntegerValue(this, ("Total_LP_" + l)) | |
105 | + | if ($isInstanceOf(T, "Int")) | |
103 | 106 | then { | |
104 | - | let | |
105 | - | | |
107 | + | let U = T | |
108 | + | U | |
106 | 109 | } | |
107 | 110 | else 0 | |
108 | 111 | } | |
109 | - | let | |
110 | - | if (( | |
112 | + | let Z = (Y + R) | |
113 | + | if ((G != l)) | |
111 | 114 | then throw("Pair is not available in Whitelisted Asset.") | |
112 | 115 | else if ((l == toBase58String(g))) | |
113 | 116 | then throw("Input can Never be a USDC AssetID. Enter Whitelisted AssetID in input as well as in payment[1] & Attach USDC as an attachment Token in payment[2].") | |
123 | 126 | then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = USDC Token.") | |
124 | 127 | else if ((5000000 > n.amount)) | |
125 | 128 | then throw("please attach atleast 5 USDC in payment[2] & Equivalent worth of Token in payment[1]") | |
126 | - | else if ((n.amount != | |
127 | - | then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString( | |
128 | - | else if ((1 > | |
129 | - | then throw((("LP Token Outcome is going below " + toString( | |
130 | - | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), | |
129 | + | else if ((n.amount != Q)) | |
130 | + | then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(Q)) + "] or ") + toString(fraction(Q, 1, 1000000))) + ".") + takeRight(toString(Q), 6)) + " USDC.")) | |
131 | + | else if ((1 > R)) | |
132 | + | then throw((("LP Token Outcome is going below " + toString(P)) + " Decimals. Please Attach min. 1 LP token or 5 USDC Atleast.")) | |
133 | + | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), V), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), X), IntegerEntry(("Total_LP_" + l), Z), Reissue(H, R, true), ScriptTransfer(k.caller, R, H)] | |
131 | 134 | } | |
132 | 135 | ||
133 | 136 | ||
134 | 137 | ||
135 | 138 | @Callable(k) | |
136 | 139 | func SwapAssetToXTNPairEntry (l) = { | |
137 | - | let | |
138 | - | let | |
140 | + | let F = toBase58String(k.caller.bytes) | |
141 | + | let aa = if ((size(k.payments) == 1)) | |
139 | 142 | then k.payments[0] | |
140 | 143 | else throw("Whitelisted Token is required as Attached payment[1].") | |
141 | - | let | |
142 | - | let | |
143 | - | let | |
144 | - | let | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | let | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | if ($isInstanceOf( | |
144 | + | let G = getString(this, ("Pair_UV_" + l)) | |
145 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
146 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
147 | + | let ac = fraction(ab, J, (J + aa.amount)) | |
148 | + | let ad = (ab - ac) | |
149 | + | let ae = 5 | |
150 | + | let af = h() | |
151 | + | let ag = ((ad * ae) / 1000) | |
152 | + | let ah = ((ad - ag) - ag) | |
153 | + | let ai = { | |
154 | + | let T = getInteger(this, ((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g))) | |
155 | + | if ($isInstanceOf(T, "Int")) | |
153 | 156 | then { | |
154 | - | let | |
155 | - | | |
157 | + | let U = T | |
158 | + | U | |
156 | 159 | } | |
157 | 160 | else 0 | |
158 | 161 | } | |
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | if ($isInstanceOf( | |
162 | + | let aj = ((ai + ag) + ag) | |
163 | + | let ak = { | |
164 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
165 | + | if ($isInstanceOf(T, "Int")) | |
163 | 166 | then { | |
164 | - | let | |
165 | - | | |
167 | + | let U = T | |
168 | + | U | |
166 | 169 | } | |
167 | 170 | else 0 | |
168 | 171 | } | |
169 | - | let | |
170 | - | let | |
171 | - | let | |
172 | - | if ($isInstanceOf( | |
172 | + | let al = (J + aa.amount) | |
173 | + | let am = { | |
174 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
175 | + | if ($isInstanceOf(T, "Int")) | |
173 | 176 | then { | |
174 | - | let | |
175 | - | | |
177 | + | let U = T | |
178 | + | U | |
176 | 179 | } | |
177 | 180 | else 0 | |
178 | 181 | } | |
179 | - | let | |
180 | - | let | |
181 | - | let | |
182 | - | if ($isInstanceOf( | |
182 | + | let an = ((ab - ad) + ag) | |
183 | + | let ao = { | |
184 | + | let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l)) | |
185 | + | if ($isInstanceOf(T, "Int")) | |
183 | 186 | then { | |
184 | - | let | |
185 | - | | |
187 | + | let U = T | |
188 | + | U | |
186 | 189 | } | |
187 | 190 | else 0 | |
188 | 191 | } | |
189 | - | let | |
192 | + | let ap = (ao + 1) | |
190 | 193 | if ((l == toBase58String(g))) | |
191 | 194 | then throw("Input can Never be a XTN AssetID. Enter Whitelisted AssetID in input & Attach Whitelisted Asset as an attachment Token in payment[1].") | |
192 | - | else if (( | |
195 | + | else if ((G != l)) | |
193 | 196 | then throw("Pair is not available in Whitelisted Asset.") | |
194 | - | else if (( | |
197 | + | else if ((aa.assetId == g)) | |
195 | 198 | then throw("You can't Attach XTN as an Attached Payment. Only Whitelisted Tokens are accepted.") | |
196 | - | else if (( | |
199 | + | else if ((aa.assetId != fromBase58String(l))) | |
197 | 200 | then throw(("Incorrect asset attached, please attach or send " + l)) | |
198 | - | else if (( | |
201 | + | else if ((ab == 0)) | |
199 | 202 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
200 | - | else if (( | |
203 | + | else if ((J == 0)) | |
201 | 204 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
202 | - | else if ((100000 > | |
205 | + | else if ((100000 > ad)) | |
203 | 206 | then throw((("Your Attached Asset Amount is very low. Attach More " + l) + " Tokens to Claim the minimum Amount of 0.1 dollar atleast.")) | |
204 | - | else if (( | |
205 | - | then throw((("Pool Only has a Liquidity of " + toString(( | |
206 | - | else [IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), | |
207 | + | else if ((ad > ab)) | |
208 | + | then throw((("Pool Only has a Liquidity of " + toString((ab / pow(10, 0, 6, 0, 0, CEILING)))) + " XTN. Add Liquidity into Pool.")) | |
209 | + | else [IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), aj), IntegerEntry("Current_Day", af), IntegerEntry(("Total_of_Pair_Txns_" + l), ap), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), al), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), an), ScriptTransfer(k.caller, ah, g), ScriptTransfer(d, fraction(ag, 1, 3), g), ScriptTransfer(e, fraction(ag, 1, 3), g), ScriptTransfer(f, fraction(ag, 1, 3), g)] | |
207 | 210 | } | |
208 | 211 | ||
209 | 212 | ||
210 | 213 | ||
211 | 214 | @Callable(k) | |
212 | 215 | func SwapXTNToAssetPairEntry (l) = { | |
213 | - | let | |
214 | - | let | |
216 | + | let F = toBase58String(k.caller.bytes) | |
217 | + | let aa = if ((size(k.payments) == 1)) | |
215 | 218 | then k.payments[0] | |
216 | 219 | else throw((("Only " + toBase58String(g)) + " XTN Token is required as an Attached payment[1].")) | |
217 | - | let | |
218 | - | let | |
219 | - | let | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | let | |
225 | - | let | |
226 | - | let | |
227 | - | let | |
228 | - | if ($isInstanceOf( | |
220 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
221 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
222 | + | let aq = fraction(ab, J, (ab + aa.amount)) | |
223 | + | let ad = (J - aq) | |
224 | + | let G = getString(this, ("Pair_UV_" + l)) | |
225 | + | let ae = 5 | |
226 | + | let af = h() | |
227 | + | let ag = ((ad * ae) / 1000) | |
228 | + | let ah = ((ad - ag) - ag) | |
229 | + | let ar = { | |
230 | + | let T = getInteger(this, ("Total_Swap_Fee_Collected_" + l)) | |
231 | + | if ($isInstanceOf(T, "Int")) | |
229 | 232 | then { | |
230 | - | let | |
231 | - | | |
233 | + | let U = T | |
234 | + | U | |
232 | 235 | } | |
233 | 236 | else 0 | |
234 | 237 | } | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | if ($isInstanceOf( | |
238 | + | let as = ((ar + ag) + ag) | |
239 | + | let ak = { | |
240 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
241 | + | if ($isInstanceOf(T, "Int")) | |
239 | 242 | then { | |
240 | - | let | |
241 | - | | |
243 | + | let U = T | |
244 | + | U | |
242 | 245 | } | |
243 | 246 | else 0 | |
244 | 247 | } | |
245 | - | let | |
246 | - | let | |
247 | - | let | |
248 | - | if ($isInstanceOf( | |
248 | + | let al = ((J - ad) + ag) | |
249 | + | let am = { | |
250 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
251 | + | if ($isInstanceOf(T, "Int")) | |
249 | 252 | then { | |
250 | - | let | |
251 | - | | |
253 | + | let U = T | |
254 | + | U | |
252 | 255 | } | |
253 | 256 | else 0 | |
254 | 257 | } | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | if ($isInstanceOf( | |
258 | + | let an = (ab + aa.amount) | |
259 | + | let ao = { | |
260 | + | let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l)) | |
261 | + | if ($isInstanceOf(T, "Int")) | |
259 | 262 | then { | |
260 | - | let | |
261 | - | | |
263 | + | let U = T | |
264 | + | U | |
262 | 265 | } | |
263 | 266 | else 0 | |
264 | 267 | } | |
265 | - | let | |
266 | - | if (( | |
268 | + | let ap = (ao + 1) | |
269 | + | if ((G != l)) | |
267 | 270 | then throw("Pair is not available in Whitelisted Asset.") | |
268 | 271 | else if ((l == toBase58String(g))) | |
269 | 272 | then throw("Input can Never be a XTN AssetID. Enter Whitelisted AssetID in input & Attach XTN as an attachment Token in payment[1].") | |
270 | - | else if (( | |
273 | + | else if ((aa.assetId != g)) | |
271 | 274 | then throw((("You can Attach " + toBase58String(g)) + " as an Attached Payment[1] to Swap XTN To Required Token. Any other asset else than XTN will be rejected.")) | |
272 | - | else if ((100000 > | |
275 | + | else if ((100000 > aa.amount)) | |
273 | 276 | then throw("Your Attached XTN Amount is very low. Attach Atleast 0.1 XTN to Claim the minimum Tokens.") | |
274 | - | else if (( | |
277 | + | else if ((ab == 0)) | |
275 | 278 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
276 | - | else if (( | |
279 | + | else if ((J == 0)) | |
277 | 280 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
278 | - | else if (( | |
279 | - | then throw((("Pool Only has a Liquidity of " + toString( | |
280 | - | else [IntegerEntry(("Total_Swap_Fee_Collected_" + l), | |
281 | + | else if ((ad > J)) | |
282 | + | then throw((("Pool Only has a Liquidity of " + toString(J)) + " Tokens. Add Liquidity into Pool.")) | |
283 | + | else [IntegerEntry(("Total_Swap_Fee_Collected_" + l), as), IntegerEntry("Current_Day", af), IntegerEntry(("Total_of_Pair_Txns_" + l), ap), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), al), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), an), ScriptTransfer(k.caller, ah, fromBase58String(l)), ScriptTransfer(d, fraction(ag, 1, 3), fromBase58String(l)), ScriptTransfer(e, fraction(ag, 1, 3), fromBase58String(l)), ScriptTransfer(f, fraction(ag, 1, 3), fromBase58String(l))] | |
281 | 284 | } | |
282 | 285 | ||
283 | 286 | ||
284 | 287 | ||
285 | 288 | @Callable(k) | |
286 | 289 | func AddLiquidity (l) = { | |
287 | - | let | |
290 | + | let F = toBase58String(k.caller.bytes) | |
288 | 291 | let m = value(k.payments[0]) | |
289 | 292 | let n = value(k.payments[1]) | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | let v = | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | let | |
300 | - | let | |
301 | - | let | |
302 | - | let | |
303 | - | let at = fraction(m.amount, | |
304 | - | let au = fraction(at, 1, | |
293 | + | let G = getString(this, ("Pair_UV_" + l)) | |
294 | + | let H = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated.")) | |
295 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
296 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
297 | + | let K = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
298 | + | let v = K.decimals | |
299 | + | let z = fraction((v + 6), 1, 2) | |
300 | + | let A = (1 * pow(10, 0, z, 0, 0, CEILING)) | |
301 | + | let B = fraction(m.amount, n.amount, A) | |
302 | + | let C = sqrt(B, z, z, CEILING) | |
303 | + | let w = pow(10, 0, v, 0, 0, CEILING) | |
304 | + | let x = pow(10, 0, 6, 0, 0, CEILING) | |
305 | + | let y = fraction(ab, w, J) | |
306 | + | let at = fraction(m.amount, y, 1) | |
307 | + | let au = fraction(at, 1, w) | |
305 | 308 | let av = au | |
306 | 309 | let aw = { | |
307 | - | let | |
308 | - | if ($isInstanceOf( | |
310 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
311 | + | if ($isInstanceOf(T, "Int")) | |
309 | 312 | then { | |
310 | - | let | |
311 | - | | |
313 | + | let U = T | |
314 | + | U | |
312 | 315 | } | |
313 | 316 | else 0 | |
314 | 317 | } | |
315 | 318 | let ax = (aw + n.amount) | |
316 | - | let | |
317 | - | let | |
318 | - | if ($isInstanceOf( | |
319 | + | let W = { | |
320 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
321 | + | if ($isInstanceOf(T, "Int")) | |
319 | 322 | then { | |
320 | - | let | |
321 | - | | |
323 | + | let U = T | |
324 | + | U | |
322 | 325 | } | |
323 | 326 | else 0 | |
324 | 327 | } | |
325 | - | let | |
326 | - | let | |
327 | - | let | |
328 | - | if ($isInstanceOf( | |
328 | + | let X = (W + m.amount) | |
329 | + | let Y = { | |
330 | + | let T = getIntegerValue(this, ("Total_LP_" + l)) | |
331 | + | if ($isInstanceOf(T, "Int")) | |
329 | 332 | then { | |
330 | - | let | |
331 | - | | |
333 | + | let U = T | |
334 | + | U | |
332 | 335 | } | |
333 | 336 | else 0 | |
334 | 337 | } | |
335 | - | let | |
336 | - | if (( | |
338 | + | let Z = (Y + C) | |
339 | + | if ((G != l)) | |
337 | 340 | then throw("Pair is not available in Whitelisted Asset.") | |
338 | 341 | else if ((l == toBase58String(g))) | |
339 | 342 | then throw("Input can Never be a XTN AssetID. Enter Whitelisted AssetID in input as well as in payment[1] & Attach XTN as an attachment Token in payment[2].") | |
349 | 352 | then throw("please attach atleast 0.1 XTN in payment[2] & Equivalent worth of Token in payment[1]") | |
350 | 353 | else if ((n.amount != av)) | |
351 | 354 | then throw((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(av)) + "]/10^6 XTN.")) | |
352 | - | else if ((1 > z)) | |
353 | - | then throw("LP Token Outcome is going below 1 in Fractional. Please Attach more amount.") | |
354 | - | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), U), IntegerEntry(("Total_LP_" + l), W), IntegerEntry("Token_Price", as), IntegerEntry("User_XTN_Deposit_Amount", av), Reissue(E, z, true), ScriptTransfer(k.caller, z, E)] | |
355 | + | else if ((1 > y)) | |
356 | + | then throw("Token Price Outcome is going below 1 in Fractional.") | |
357 | + | else if ((1 > C)) | |
358 | + | then throw("LP Token Outcome is going below 1 in Fractional. Please Attach more amount.") | |
359 | + | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), X), IntegerEntry(("Total_LP_" + l), Z), IntegerEntry("Token_Price", y), IntegerEntry("User_XTN_Deposit_Amount", av), Reissue(H, C, true), ScriptTransfer(k.caller, C, H)] | |
355 | 360 | } | |
356 | 361 | ||
357 | 362 | ||
358 | 363 | ||
359 | 364 | @Callable(k) | |
360 | 365 | func RemoveLiquidity (l) = { | |
361 | - | let | |
362 | - | let | |
366 | + | let F = toBase58String(k.caller.bytes) | |
367 | + | let aa = if ((size(k.payments) == 1)) | |
363 | 368 | then k.payments[0] | |
364 | 369 | else throw("No payment attached, Please Attach LP Token as payment[1].") | |
365 | - | let | |
370 | + | let G = getString(this, ("Pair_UV_" + l)) | |
366 | 371 | let ay = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or not Generated.")) | |
367 | - | let | |
368 | - | let v = | |
369 | - | let | |
370 | - | let | |
372 | + | let K = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
373 | + | let v = K.decimals | |
374 | + | let O = (6 + v) | |
375 | + | let P = (O / 2) | |
371 | 376 | let az = getIntegerValue(this, ("Total_LP_" + l)) | |
372 | - | let aA = pow(fraction( | |
373 | - | let | |
374 | - | let | |
375 | - | let aB = fraction( | |
376 | - | let aC = fraction( | |
377 | + | let aA = pow(fraction(aa.amount, pow(10, 0, 8, 0, 0, CEILING), az), 6, 1, 0, 6, CEILING) | |
378 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
379 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
380 | + | let aB = fraction(ab, aA, pow(10, 0, 8, 0, 0, CEILING)) | |
381 | + | let aC = fraction(J, aA, pow(10, 0, 8, 0, 0, CEILING)) | |
377 | 382 | let aw = { | |
378 | - | let | |
379 | - | if ($isInstanceOf( | |
383 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
384 | + | if ($isInstanceOf(T, "Int")) | |
380 | 385 | then { | |
381 | - | let | |
382 | - | | |
386 | + | let U = T | |
387 | + | U | |
383 | 388 | } | |
384 | 389 | else 0 | |
385 | 390 | } | |
386 | 391 | let ax = (aw - aB) | |
387 | - | let | |
388 | - | let | |
389 | - | if ($isInstanceOf( | |
392 | + | let W = { | |
393 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
394 | + | if ($isInstanceOf(T, "Int")) | |
390 | 395 | then { | |
391 | - | let | |
392 | - | | |
396 | + | let U = T | |
397 | + | U | |
393 | 398 | } | |
394 | 399 | else 0 | |
395 | 400 | } | |
396 | - | let | |
397 | - | let | |
398 | - | let | |
399 | - | if ($isInstanceOf( | |
401 | + | let X = (W - aC) | |
402 | + | let Y = { | |
403 | + | let T = getIntegerValue(this, ("Total_LP_" + l)) | |
404 | + | if ($isInstanceOf(T, "Int")) | |
400 | 405 | then { | |
401 | - | let | |
402 | - | | |
406 | + | let U = T | |
407 | + | U | |
403 | 408 | } | |
404 | 409 | else 0 | |
405 | 410 | } | |
406 | - | let | |
407 | - | if (( | |
411 | + | let Z = (Y - aa.amount) | |
412 | + | if ((G != l)) | |
408 | 413 | then throw("Pair is not available in Whitelist.") | |
409 | 414 | else if ((fromBase58String(l) == g)) | |
410 | 415 | then throw("Don't choose XTN AssetID as Input, Only Whitelisted Asset as Input String & Attach LP Tokens as payment[1]") | |
411 | - | else if (( | |
416 | + | else if ((aa.assetId != ay)) | |
412 | 417 | then throw("Wrong Asset is attached in payment[1] or LP Token Not Found or Missing.") | |
413 | 418 | else if ((1 > aA)) | |
414 | 419 | then throw("Your LP Token amount % is very low to convert.") | |
416 | 421 | then throw("Your LP Token conversion amount is very low to convert or less than 0.000001 XTN.") | |
417 | 422 | else if ((1 > aC)) | |
418 | 423 | then throw("Your LP Token conversion amount is very low to convert or less than fraction value of Token.") | |
419 | - | else [IntegerEntry("Withdraw_LP_Percentage", aA), Burn(ay, | |
424 | + | else [IntegerEntry("Withdraw_LP_Percentage", aA), Burn(ay, aa.amount), IntegerEntry(("Total_LP_" + l), Z), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), X), ScriptTransfer(k.caller, aB, g), ScriptTransfer(k.caller, aC, fromBase58String(l))] | |
420 | 425 | } | |
421 | 426 | ||
422 | 427 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "1.0.0" | |
5 | 5 | ||
6 | 6 | let b = 1694928600000 | |
7 | 7 | ||
8 | 8 | let c = 14000000 | |
9 | 9 | ||
10 | 10 | let d = addressFromPublicKey(base58'4Dahqn4MYNrieo9AX8qLWNCseBQNc9skQY81h4DFoote') | |
11 | 11 | ||
12 | 12 | let e = addressFromPublicKey(base58'4Dahqn4MYNrieo9AX8qLWNCseBQNc9skQY81h4DFoote') | |
13 | 13 | ||
14 | 14 | let f = addressFromPublicKey(base58'EtFSDsn89XfmXQvuQXPQMbLDbaAZ1YWYZHksptpQH4gp') | |
15 | 15 | ||
16 | 16 | let g = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
17 | 17 | ||
18 | 18 | func h () = { | |
19 | 19 | let i = (lastBlock.timestamp - b) | |
20 | 20 | let j = fraction(1, i, 86400000) | |
21 | 21 | j | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(k) | |
26 | 26 | func RegisterPair (l) = { | |
27 | 27 | let m = value(k.payments[0]) | |
28 | 28 | let n = value(k.payments[1]) | |
29 | 29 | let o = value(k.payments[2]) | |
30 | 30 | let p = toBase58String(k.caller.bytes) | |
31 | 31 | let q = !(isDefined(n.assetId)) | |
32 | 32 | let r = getString(this, ("Pair_UV_" + l)) | |
33 | 33 | let s = fromBase58String(l) | |
34 | 34 | let t = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
35 | 35 | let u = t.name | |
36 | 36 | let v = t.decimals | |
37 | - | let w = fraction((v + 6), 1, 2) | |
38 | - | let x = (1 * pow(10, 0, w, 0, 0, CEILING)) | |
39 | - | let y = fraction(m.amount, n.amount, x) | |
40 | - | let z = sqrt(y, w, w, CEILING) | |
41 | - | let A = Issue((("LP-" + take(u, 8)) + "-XTN"), (((("LP-" + u) + "-XTN") + " is a Liquidity Provider Token Issued Against ") + l), z, w, true) | |
42 | - | let B = calculateAssetId(A) | |
37 | + | let w = pow(10, 0, v, 0, 0, CEILING) | |
38 | + | let x = pow(10, 0, 6, 0, 0, CEILING) | |
39 | + | let y = fraction(m.amount, w, n.amount) | |
40 | + | let z = fraction((v + 6), 1, 2) | |
41 | + | let A = (1 * pow(10, 0, z, 0, 0, CEILING)) | |
42 | + | let B = fraction(m.amount, n.amount, A) | |
43 | + | let C = sqrt(B, z, z, CEILING) | |
44 | + | let D = Issue((("LP-" + take(u, 8)) + "-XTN"), (((("LP-" + u) + "-XTN") + " is a Liquidity Provider Token Issued Against ") + l), C, z, true) | |
45 | + | let E = calculateAssetId(D) | |
43 | 46 | if ((r == l)) | |
44 | 47 | then throw("Pair Already Exist in List.") | |
45 | 48 | else if ((size(k.payments) != 3)) | |
46 | 49 | then throw((("Two attached assets expected as payment. Kindly Attach payment1 = XTN Token & payment2 = Token you want to List & payment3 = [" + toString(c)) + "/10^8] Waves.")) | |
47 | 50 | else if ((m.assetId != g)) | |
48 | 51 | then throw("Incorrect asset attached as payment[1], please attach XTN only.") | |
49 | 52 | else if ((100000 > m.amount)) | |
50 | 53 | then throw("Attached payment[1] amount is less than 0.1 XTN, please attach 0.1 XTN Minimum.") | |
51 | 54 | else if ((n.assetId != s)) | |
52 | 55 | then throw("Input String & Attached AssetID in payment2 is not matching.") | |
53 | 56 | else if ((o.amount != c)) | |
54 | 57 | then throw((("Attached payment[3] amount has to be exact [" + toString(c)) + "/10^8] WAVES.")) | |
55 | 58 | else if ((q == true)) | |
56 | 59 | then throw("You Attached WAVES Asset ID for Listing, please attach Tokens You want to list in payment[2].") | |
57 | - | else [StringEntry(("Pair_UV_" + l), l), IntegerEntry(("Listing_Fee_" + l), o.amount), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), m.amount), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), n.amount), IntegerEntry(("Total_of_Pair_Txns_" + l), 0), IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), 0), IntegerEntry(("Total_Swap_Fee_Collected_" + l), 0), | |
60 | + | else [StringEntry(("Pair_UV_" + l), l), IntegerEntry(("Listing_Fee_" + l), o.amount), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), m.amount), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), n.amount), IntegerEntry(("Total_of_Pair_Txns_" + l), 0), IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), 0), IntegerEntry(("Total_Swap_Fee_Collected_" + l), 0), IntegerEntry("Token_Price", y), D, ScriptTransfer(k.caller, C, E), ScriptTransfer(d, fraction(c, 1, 2), unit), ScriptTransfer(e, fraction(c, 1, 2), unit), StringEntry(("LP_" + l), toBase58String(E)), IntegerEntry(("Total_LP_" + l), C)] | |
58 | 61 | } | |
59 | 62 | ||
60 | 63 | ||
61 | 64 | ||
62 | 65 | @Callable(k) | |
63 | 66 | func oldAddLiquidity (l) = { | |
64 | - | let | |
67 | + | let F = toBase58String(k.caller.bytes) | |
65 | 68 | let m = value(k.payments[0]) | |
66 | 69 | let n = value(k.payments[1]) | |
67 | - | let | |
68 | - | let | |
69 | - | let | |
70 | - | let | |
71 | - | let | |
72 | - | let v = | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | let | |
77 | - | let | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | let | |
82 | - | if ($isInstanceOf( | |
70 | + | let G = getString(this, ("Pair_UV_" + l)) | |
71 | + | let H = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated.")) | |
72 | + | let I = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
73 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
74 | + | let K = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
75 | + | let v = K.decimals | |
76 | + | let L = I | |
77 | + | let M = J | |
78 | + | let N = pow((((L * 1000000) / M) * pow(10, 0, v, 0, 0, CEILING)), 0, 1, 0, 0, CEILING) | |
79 | + | let O = (6 + v) | |
80 | + | let P = (O / 2) | |
81 | + | let Q = fraction(N, m.amount, pow(10, 0, O, 0, 0, CEILING)) | |
82 | + | let R = pow((fraction(m.amount, 1, pow(10, 0, v, 0, 0, CEILING)) * fraction(n.amount, 1, pow(10, 0, 6, 0, 0, CEILING))), 0, 5, 1, P, DOWN) | |
83 | + | let S = { | |
84 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
85 | + | if ($isInstanceOf(T, "Int")) | |
83 | 86 | then { | |
84 | - | let | |
85 | - | | |
87 | + | let U = T | |
88 | + | U | |
86 | 89 | } | |
87 | 90 | else 0 | |
88 | 91 | } | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | if ($isInstanceOf( | |
92 | + | let V = (S + n.amount) | |
93 | + | let W = { | |
94 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
95 | + | if ($isInstanceOf(T, "Int")) | |
93 | 96 | then { | |
94 | - | let | |
95 | - | | |
97 | + | let U = T | |
98 | + | U | |
96 | 99 | } | |
97 | 100 | else 0 | |
98 | 101 | } | |
99 | - | let | |
100 | - | let | |
101 | - | let | |
102 | - | if ($isInstanceOf( | |
102 | + | let X = (W + m.amount) | |
103 | + | let Y = { | |
104 | + | let T = getIntegerValue(this, ("Total_LP_" + l)) | |
105 | + | if ($isInstanceOf(T, "Int")) | |
103 | 106 | then { | |
104 | - | let | |
105 | - | | |
107 | + | let U = T | |
108 | + | U | |
106 | 109 | } | |
107 | 110 | else 0 | |
108 | 111 | } | |
109 | - | let | |
110 | - | if (( | |
112 | + | let Z = (Y + R) | |
113 | + | if ((G != l)) | |
111 | 114 | then throw("Pair is not available in Whitelisted Asset.") | |
112 | 115 | else if ((l == toBase58String(g))) | |
113 | 116 | then throw("Input can Never be a USDC AssetID. Enter Whitelisted AssetID in input as well as in payment[1] & Attach USDC as an attachment Token in payment[2].") | |
114 | 117 | else if ((size(k.payments) != 2)) | |
115 | 118 | then throw("Two attached assets expected as payment in 50%-50%. Kindly Attach payment1 = Token you want to add for Liquidity & payment2 = Equivalent Amount of USDC Token.") | |
116 | 119 | else if ((m.assetId == g)) | |
117 | 120 | then throw("You Attached USDC asset in payment[1], please attach only whitelisted Token in payment[1] along with USDC in payment[2].") | |
118 | 121 | else if ((m.assetId != fromBase58String(l))) | |
119 | 122 | then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.") | |
120 | 123 | else if ((m.assetId != fromBase58String(l))) | |
121 | 124 | then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.") | |
122 | 125 | else if ((n.assetId != g)) | |
123 | 126 | then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = USDC Token.") | |
124 | 127 | else if ((5000000 > n.amount)) | |
125 | 128 | then throw("please attach atleast 5 USDC in payment[2] & Equivalent worth of Token in payment[1]") | |
126 | - | else if ((n.amount != | |
127 | - | then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString( | |
128 | - | else if ((1 > | |
129 | - | then throw((("LP Token Outcome is going below " + toString( | |
130 | - | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), | |
129 | + | else if ((n.amount != Q)) | |
130 | + | then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(Q)) + "] or ") + toString(fraction(Q, 1, 1000000))) + ".") + takeRight(toString(Q), 6)) + " USDC.")) | |
131 | + | else if ((1 > R)) | |
132 | + | then throw((("LP Token Outcome is going below " + toString(P)) + " Decimals. Please Attach min. 1 LP token or 5 USDC Atleast.")) | |
133 | + | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), V), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), X), IntegerEntry(("Total_LP_" + l), Z), Reissue(H, R, true), ScriptTransfer(k.caller, R, H)] | |
131 | 134 | } | |
132 | 135 | ||
133 | 136 | ||
134 | 137 | ||
135 | 138 | @Callable(k) | |
136 | 139 | func SwapAssetToXTNPairEntry (l) = { | |
137 | - | let | |
138 | - | let | |
140 | + | let F = toBase58String(k.caller.bytes) | |
141 | + | let aa = if ((size(k.payments) == 1)) | |
139 | 142 | then k.payments[0] | |
140 | 143 | else throw("Whitelisted Token is required as Attached payment[1].") | |
141 | - | let | |
142 | - | let | |
143 | - | let | |
144 | - | let | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | let | |
149 | - | let | |
150 | - | let | |
151 | - | let | |
152 | - | if ($isInstanceOf( | |
144 | + | let G = getString(this, ("Pair_UV_" + l)) | |
145 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
146 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
147 | + | let ac = fraction(ab, J, (J + aa.amount)) | |
148 | + | let ad = (ab - ac) | |
149 | + | let ae = 5 | |
150 | + | let af = h() | |
151 | + | let ag = ((ad * ae) / 1000) | |
152 | + | let ah = ((ad - ag) - ag) | |
153 | + | let ai = { | |
154 | + | let T = getInteger(this, ((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g))) | |
155 | + | if ($isInstanceOf(T, "Int")) | |
153 | 156 | then { | |
154 | - | let | |
155 | - | | |
157 | + | let U = T | |
158 | + | U | |
156 | 159 | } | |
157 | 160 | else 0 | |
158 | 161 | } | |
159 | - | let | |
160 | - | let | |
161 | - | let | |
162 | - | if ($isInstanceOf( | |
162 | + | let aj = ((ai + ag) + ag) | |
163 | + | let ak = { | |
164 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
165 | + | if ($isInstanceOf(T, "Int")) | |
163 | 166 | then { | |
164 | - | let | |
165 | - | | |
167 | + | let U = T | |
168 | + | U | |
166 | 169 | } | |
167 | 170 | else 0 | |
168 | 171 | } | |
169 | - | let | |
170 | - | let | |
171 | - | let | |
172 | - | if ($isInstanceOf( | |
172 | + | let al = (J + aa.amount) | |
173 | + | let am = { | |
174 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
175 | + | if ($isInstanceOf(T, "Int")) | |
173 | 176 | then { | |
174 | - | let | |
175 | - | | |
177 | + | let U = T | |
178 | + | U | |
176 | 179 | } | |
177 | 180 | else 0 | |
178 | 181 | } | |
179 | - | let | |
180 | - | let | |
181 | - | let | |
182 | - | if ($isInstanceOf( | |
182 | + | let an = ((ab - ad) + ag) | |
183 | + | let ao = { | |
184 | + | let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l)) | |
185 | + | if ($isInstanceOf(T, "Int")) | |
183 | 186 | then { | |
184 | - | let | |
185 | - | | |
187 | + | let U = T | |
188 | + | U | |
186 | 189 | } | |
187 | 190 | else 0 | |
188 | 191 | } | |
189 | - | let | |
192 | + | let ap = (ao + 1) | |
190 | 193 | if ((l == toBase58String(g))) | |
191 | 194 | then throw("Input can Never be a XTN AssetID. Enter Whitelisted AssetID in input & Attach Whitelisted Asset as an attachment Token in payment[1].") | |
192 | - | else if (( | |
195 | + | else if ((G != l)) | |
193 | 196 | then throw("Pair is not available in Whitelisted Asset.") | |
194 | - | else if (( | |
197 | + | else if ((aa.assetId == g)) | |
195 | 198 | then throw("You can't Attach XTN as an Attached Payment. Only Whitelisted Tokens are accepted.") | |
196 | - | else if (( | |
199 | + | else if ((aa.assetId != fromBase58String(l))) | |
197 | 200 | then throw(("Incorrect asset attached, please attach or send " + l)) | |
198 | - | else if (( | |
201 | + | else if ((ab == 0)) | |
199 | 202 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
200 | - | else if (( | |
203 | + | else if ((J == 0)) | |
201 | 204 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
202 | - | else if ((100000 > | |
205 | + | else if ((100000 > ad)) | |
203 | 206 | then throw((("Your Attached Asset Amount is very low. Attach More " + l) + " Tokens to Claim the minimum Amount of 0.1 dollar atleast.")) | |
204 | - | else if (( | |
205 | - | then throw((("Pool Only has a Liquidity of " + toString(( | |
206 | - | else [IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), | |
207 | + | else if ((ad > ab)) | |
208 | + | then throw((("Pool Only has a Liquidity of " + toString((ab / pow(10, 0, 6, 0, 0, CEILING)))) + " XTN. Add Liquidity into Pool.")) | |
209 | + | else [IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), aj), IntegerEntry("Current_Day", af), IntegerEntry(("Total_of_Pair_Txns_" + l), ap), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), al), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), an), ScriptTransfer(k.caller, ah, g), ScriptTransfer(d, fraction(ag, 1, 3), g), ScriptTransfer(e, fraction(ag, 1, 3), g), ScriptTransfer(f, fraction(ag, 1, 3), g)] | |
207 | 210 | } | |
208 | 211 | ||
209 | 212 | ||
210 | 213 | ||
211 | 214 | @Callable(k) | |
212 | 215 | func SwapXTNToAssetPairEntry (l) = { | |
213 | - | let | |
214 | - | let | |
216 | + | let F = toBase58String(k.caller.bytes) | |
217 | + | let aa = if ((size(k.payments) == 1)) | |
215 | 218 | then k.payments[0] | |
216 | 219 | else throw((("Only " + toBase58String(g)) + " XTN Token is required as an Attached payment[1].")) | |
217 | - | let | |
218 | - | let | |
219 | - | let | |
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | let | |
225 | - | let | |
226 | - | let | |
227 | - | let | |
228 | - | if ($isInstanceOf( | |
220 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
221 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
222 | + | let aq = fraction(ab, J, (ab + aa.amount)) | |
223 | + | let ad = (J - aq) | |
224 | + | let G = getString(this, ("Pair_UV_" + l)) | |
225 | + | let ae = 5 | |
226 | + | let af = h() | |
227 | + | let ag = ((ad * ae) / 1000) | |
228 | + | let ah = ((ad - ag) - ag) | |
229 | + | let ar = { | |
230 | + | let T = getInteger(this, ("Total_Swap_Fee_Collected_" + l)) | |
231 | + | if ($isInstanceOf(T, "Int")) | |
229 | 232 | then { | |
230 | - | let | |
231 | - | | |
233 | + | let U = T | |
234 | + | U | |
232 | 235 | } | |
233 | 236 | else 0 | |
234 | 237 | } | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | if ($isInstanceOf( | |
238 | + | let as = ((ar + ag) + ag) | |
239 | + | let ak = { | |
240 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
241 | + | if ($isInstanceOf(T, "Int")) | |
239 | 242 | then { | |
240 | - | let | |
241 | - | | |
243 | + | let U = T | |
244 | + | U | |
242 | 245 | } | |
243 | 246 | else 0 | |
244 | 247 | } | |
245 | - | let | |
246 | - | let | |
247 | - | let | |
248 | - | if ($isInstanceOf( | |
248 | + | let al = ((J - ad) + ag) | |
249 | + | let am = { | |
250 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
251 | + | if ($isInstanceOf(T, "Int")) | |
249 | 252 | then { | |
250 | - | let | |
251 | - | | |
253 | + | let U = T | |
254 | + | U | |
252 | 255 | } | |
253 | 256 | else 0 | |
254 | 257 | } | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | if ($isInstanceOf( | |
258 | + | let an = (ab + aa.amount) | |
259 | + | let ao = { | |
260 | + | let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l)) | |
261 | + | if ($isInstanceOf(T, "Int")) | |
259 | 262 | then { | |
260 | - | let | |
261 | - | | |
263 | + | let U = T | |
264 | + | U | |
262 | 265 | } | |
263 | 266 | else 0 | |
264 | 267 | } | |
265 | - | let | |
266 | - | if (( | |
268 | + | let ap = (ao + 1) | |
269 | + | if ((G != l)) | |
267 | 270 | then throw("Pair is not available in Whitelisted Asset.") | |
268 | 271 | else if ((l == toBase58String(g))) | |
269 | 272 | then throw("Input can Never be a XTN AssetID. Enter Whitelisted AssetID in input & Attach XTN as an attachment Token in payment[1].") | |
270 | - | else if (( | |
273 | + | else if ((aa.assetId != g)) | |
271 | 274 | then throw((("You can Attach " + toBase58String(g)) + " as an Attached Payment[1] to Swap XTN To Required Token. Any other asset else than XTN will be rejected.")) | |
272 | - | else if ((100000 > | |
275 | + | else if ((100000 > aa.amount)) | |
273 | 276 | then throw("Your Attached XTN Amount is very low. Attach Atleast 0.1 XTN to Claim the minimum Tokens.") | |
274 | - | else if (( | |
277 | + | else if ((ab == 0)) | |
275 | 278 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
276 | - | else if (( | |
279 | + | else if ((J == 0)) | |
277 | 280 | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
278 | - | else if (( | |
279 | - | then throw((("Pool Only has a Liquidity of " + toString( | |
280 | - | else [IntegerEntry(("Total_Swap_Fee_Collected_" + l), | |
281 | + | else if ((ad > J)) | |
282 | + | then throw((("Pool Only has a Liquidity of " + toString(J)) + " Tokens. Add Liquidity into Pool.")) | |
283 | + | else [IntegerEntry(("Total_Swap_Fee_Collected_" + l), as), IntegerEntry("Current_Day", af), IntegerEntry(("Total_of_Pair_Txns_" + l), ap), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), al), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), an), ScriptTransfer(k.caller, ah, fromBase58String(l)), ScriptTransfer(d, fraction(ag, 1, 3), fromBase58String(l)), ScriptTransfer(e, fraction(ag, 1, 3), fromBase58String(l)), ScriptTransfer(f, fraction(ag, 1, 3), fromBase58String(l))] | |
281 | 284 | } | |
282 | 285 | ||
283 | 286 | ||
284 | 287 | ||
285 | 288 | @Callable(k) | |
286 | 289 | func AddLiquidity (l) = { | |
287 | - | let | |
290 | + | let F = toBase58String(k.caller.bytes) | |
288 | 291 | let m = value(k.payments[0]) | |
289 | 292 | let n = value(k.payments[1]) | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | let v = | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | let | |
300 | - | let | |
301 | - | let | |
302 | - | let | |
303 | - | let at = fraction(m.amount, | |
304 | - | let au = fraction(at, 1, | |
293 | + | let G = getString(this, ("Pair_UV_" + l)) | |
294 | + | let H = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated.")) | |
295 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
296 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
297 | + | let K = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
298 | + | let v = K.decimals | |
299 | + | let z = fraction((v + 6), 1, 2) | |
300 | + | let A = (1 * pow(10, 0, z, 0, 0, CEILING)) | |
301 | + | let B = fraction(m.amount, n.amount, A) | |
302 | + | let C = sqrt(B, z, z, CEILING) | |
303 | + | let w = pow(10, 0, v, 0, 0, CEILING) | |
304 | + | let x = pow(10, 0, 6, 0, 0, CEILING) | |
305 | + | let y = fraction(ab, w, J) | |
306 | + | let at = fraction(m.amount, y, 1) | |
307 | + | let au = fraction(at, 1, w) | |
305 | 308 | let av = au | |
306 | 309 | let aw = { | |
307 | - | let | |
308 | - | if ($isInstanceOf( | |
310 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
311 | + | if ($isInstanceOf(T, "Int")) | |
309 | 312 | then { | |
310 | - | let | |
311 | - | | |
313 | + | let U = T | |
314 | + | U | |
312 | 315 | } | |
313 | 316 | else 0 | |
314 | 317 | } | |
315 | 318 | let ax = (aw + n.amount) | |
316 | - | let | |
317 | - | let | |
318 | - | if ($isInstanceOf( | |
319 | + | let W = { | |
320 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
321 | + | if ($isInstanceOf(T, "Int")) | |
319 | 322 | then { | |
320 | - | let | |
321 | - | | |
323 | + | let U = T | |
324 | + | U | |
322 | 325 | } | |
323 | 326 | else 0 | |
324 | 327 | } | |
325 | - | let | |
326 | - | let | |
327 | - | let | |
328 | - | if ($isInstanceOf( | |
328 | + | let X = (W + m.amount) | |
329 | + | let Y = { | |
330 | + | let T = getIntegerValue(this, ("Total_LP_" + l)) | |
331 | + | if ($isInstanceOf(T, "Int")) | |
329 | 332 | then { | |
330 | - | let | |
331 | - | | |
333 | + | let U = T | |
334 | + | U | |
332 | 335 | } | |
333 | 336 | else 0 | |
334 | 337 | } | |
335 | - | let | |
336 | - | if (( | |
338 | + | let Z = (Y + C) | |
339 | + | if ((G != l)) | |
337 | 340 | then throw("Pair is not available in Whitelisted Asset.") | |
338 | 341 | else if ((l == toBase58String(g))) | |
339 | 342 | then throw("Input can Never be a XTN AssetID. Enter Whitelisted AssetID in input as well as in payment[1] & Attach XTN as an attachment Token in payment[2].") | |
340 | 343 | else if ((size(k.payments) != 2)) | |
341 | 344 | then throw("Two attached assets are expected in payment. Kindly Attach payment1 = Token you want to add for Liquidity & payment2 = Amount of XTN Token.") | |
342 | 345 | else if ((m.assetId == g)) | |
343 | 346 | then throw("You Attached XTN asset in payment[1], please attach only whitelisted Token in payment[1] along with XTN in payment[2].") | |
344 | 347 | else if ((m.assetId != fromBase58String(l))) | |
345 | 348 | then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.") | |
346 | 349 | else if ((n.assetId != g)) | |
347 | 350 | then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = XTN Token.") | |
348 | 351 | else if ((100000 > n.amount)) | |
349 | 352 | then throw("please attach atleast 0.1 XTN in payment[2] & Equivalent worth of Token in payment[1]") | |
350 | 353 | else if ((n.amount != av)) | |
351 | 354 | then throw((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(av)) + "]/10^6 XTN.")) | |
352 | - | else if ((1 > z)) | |
353 | - | then throw("LP Token Outcome is going below 1 in Fractional. Please Attach more amount.") | |
354 | - | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), U), IntegerEntry(("Total_LP_" + l), W), IntegerEntry("Token_Price", as), IntegerEntry("User_XTN_Deposit_Amount", av), Reissue(E, z, true), ScriptTransfer(k.caller, z, E)] | |
355 | + | else if ((1 > y)) | |
356 | + | then throw("Token Price Outcome is going below 1 in Fractional.") | |
357 | + | else if ((1 > C)) | |
358 | + | then throw("LP Token Outcome is going below 1 in Fractional. Please Attach more amount.") | |
359 | + | else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), X), IntegerEntry(("Total_LP_" + l), Z), IntegerEntry("Token_Price", y), IntegerEntry("User_XTN_Deposit_Amount", av), Reissue(H, C, true), ScriptTransfer(k.caller, C, H)] | |
355 | 360 | } | |
356 | 361 | ||
357 | 362 | ||
358 | 363 | ||
359 | 364 | @Callable(k) | |
360 | 365 | func RemoveLiquidity (l) = { | |
361 | - | let | |
362 | - | let | |
366 | + | let F = toBase58String(k.caller.bytes) | |
367 | + | let aa = if ((size(k.payments) == 1)) | |
363 | 368 | then k.payments[0] | |
364 | 369 | else throw("No payment attached, Please Attach LP Token as payment[1].") | |
365 | - | let | |
370 | + | let G = getString(this, ("Pair_UV_" + l)) | |
366 | 371 | let ay = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or not Generated.")) | |
367 | - | let | |
368 | - | let v = | |
369 | - | let | |
370 | - | let | |
372 | + | let K = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist")) | |
373 | + | let v = K.decimals | |
374 | + | let O = (6 + v) | |
375 | + | let P = (O / 2) | |
371 | 376 | let az = getIntegerValue(this, ("Total_LP_" + l)) | |
372 | - | let aA = pow(fraction( | |
373 | - | let | |
374 | - | let | |
375 | - | let aB = fraction( | |
376 | - | let aC = fraction( | |
377 | + | let aA = pow(fraction(aa.amount, pow(10, 0, 8, 0, 0, CEILING), az), 6, 1, 0, 6, CEILING) | |
378 | + | let ab = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
379 | + | let J = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
380 | + | let aB = fraction(ab, aA, pow(10, 0, 8, 0, 0, CEILING)) | |
381 | + | let aC = fraction(J, aA, pow(10, 0, 8, 0, 0, CEILING)) | |
377 | 382 | let aw = { | |
378 | - | let | |
379 | - | if ($isInstanceOf( | |
383 | + | let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g))) | |
384 | + | if ($isInstanceOf(T, "Int")) | |
380 | 385 | then { | |
381 | - | let | |
382 | - | | |
386 | + | let U = T | |
387 | + | U | |
383 | 388 | } | |
384 | 389 | else 0 | |
385 | 390 | } | |
386 | 391 | let ax = (aw - aB) | |
387 | - | let | |
388 | - | let | |
389 | - | if ($isInstanceOf( | |
392 | + | let W = { | |
393 | + | let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l)) | |
394 | + | if ($isInstanceOf(T, "Int")) | |
390 | 395 | then { | |
391 | - | let | |
392 | - | | |
396 | + | let U = T | |
397 | + | U | |
393 | 398 | } | |
394 | 399 | else 0 | |
395 | 400 | } | |
396 | - | let | |
397 | - | let | |
398 | - | let | |
399 | - | if ($isInstanceOf( | |
401 | + | let X = (W - aC) | |
402 | + | let Y = { | |
403 | + | let T = getIntegerValue(this, ("Total_LP_" + l)) | |
404 | + | if ($isInstanceOf(T, "Int")) | |
400 | 405 | then { | |
401 | - | let | |
402 | - | | |
406 | + | let U = T | |
407 | + | U | |
403 | 408 | } | |
404 | 409 | else 0 | |
405 | 410 | } | |
406 | - | let | |
407 | - | if (( | |
411 | + | let Z = (Y - aa.amount) | |
412 | + | if ((G != l)) | |
408 | 413 | then throw("Pair is not available in Whitelist.") | |
409 | 414 | else if ((fromBase58String(l) == g)) | |
410 | 415 | then throw("Don't choose XTN AssetID as Input, Only Whitelisted Asset as Input String & Attach LP Tokens as payment[1]") | |
411 | - | else if (( | |
416 | + | else if ((aa.assetId != ay)) | |
412 | 417 | then throw("Wrong Asset is attached in payment[1] or LP Token Not Found or Missing.") | |
413 | 418 | else if ((1 > aA)) | |
414 | 419 | then throw("Your LP Token amount % is very low to convert.") | |
415 | 420 | else if ((1 > aB)) | |
416 | 421 | then throw("Your LP Token conversion amount is very low to convert or less than 0.000001 XTN.") | |
417 | 422 | else if ((1 > aC)) | |
418 | 423 | then throw("Your LP Token conversion amount is very low to convert or less than fraction value of Token.") | |
419 | - | else [IntegerEntry("Withdraw_LP_Percentage", aA), Burn(ay, | |
424 | + | else [IntegerEntry("Withdraw_LP_Percentage", aA), Burn(ay, aa.amount), IntegerEntry(("Total_LP_" + l), Z), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), X), ScriptTransfer(k.caller, aB, g), ScriptTransfer(k.caller, aC, fromBase58String(l))] | |
420 | 425 | } | |
421 | 426 | ||
422 | 427 | ||
423 | 428 | @Verifier(aD) | |
424 | 429 | func aE () = sigVerify(aD.bodyBytes, aD.proofs[0], aD.senderPublicKey) | |
425 | 430 |
github/deemru/w8io/169f3d6 154.77 ms ◑