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+Wp5Ghfc7qG4JAEAClhUTkFzc2V0SUQBIAhlhLcP8IpqGvPiaOguCJAkw9MnWAPNLPYuXgvf2hWkAQljb3VudGRheXMABAdUU19EaWZmCQBlAggFCWxhc3RCbG9jawl0aW1lc3RhbXAFDmRBcHBTaW5jZVN0YXJ0BAlkYXludW1iZXIJAGsDAAEFB1RTX0RpZmYAgLiZKQUJZGF5bnVtYmVyBgFpAQxSZWdpc3RlclBhaXIBDEVudGVyQXNzZXRJRAQEcG10MQkBBXZh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": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8P71hSuJ9JhmbSgmNMNNyDagbF4sJUK73uCeeJ4b9snz Next: none Diff:
OldNewDifferences
3434 let t = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
3535 let u = t.name
3636 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)
4346 if ((r == l))
4447 then throw("Pair Already Exist in List.")
4548 else if ((size(k.payments) != 3))
5457 then throw((("Attached payment[3] amount has to be exact [" + toString(c)) + "/10^8] WAVES."))
5558 else if ((q == true))
5659 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), A, ScriptTransfer(k.caller, z, B), ScriptTransfer(d, fraction(c, 1, 2), unit), ScriptTransfer(e, fraction(c, 1, 2), unit), StringEntry(("LP_" + l), toBase58String(B)), IntegerEntry(("Total_LP_" + l), z)]
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)]
5861 }
5962
6063
6164
6265 @Callable(k)
6366 func oldAddLiquidity (l) = {
64- let C = toBase58String(k.caller.bytes)
67+ let F = toBase58String(k.caller.bytes)
6568 let m = value(k.payments[0])
6669 let n = value(k.payments[1])
67- let D = getString(this, ("Pair_UV_" + l))
68- let E = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated."))
69- let F = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
70- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
71- let H = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
72- let v = H.decimals
73- let I = F
74- let J = G
75- let K = pow((((I * 1000000) / J) * pow(10, 0, v, 0, 0, CEILING)), 0, 1, 0, 0, CEILING)
76- let L = (6 + v)
77- let M = (L / 2)
78- let N = fraction(K, m.amount, pow(10, 0, L, 0, 0, CEILING))
79- let O = 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, M, DOWN)
80- let P = {
81- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
82- if ($isInstanceOf(Q, "Int"))
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"))
8386 then {
84- let R = Q
85- R
87+ let U = T
88+ U
8689 }
8790 else 0
8891 }
89- let S = (P + n.amount)
90- let T = {
91- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
92- if ($isInstanceOf(Q, "Int"))
92+ let V = (S + n.amount)
93+ let W = {
94+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
95+ if ($isInstanceOf(T, "Int"))
9396 then {
94- let R = Q
95- R
97+ let U = T
98+ U
9699 }
97100 else 0
98101 }
99- let U = (T + m.amount)
100- let V = {
101- let Q = getIntegerValue(this, ("Total_LP_" + l))
102- if ($isInstanceOf(Q, "Int"))
102+ let X = (W + m.amount)
103+ let Y = {
104+ let T = getIntegerValue(this, ("Total_LP_" + l))
105+ if ($isInstanceOf(T, "Int"))
103106 then {
104- let R = Q
105- R
107+ let U = T
108+ U
106109 }
107110 else 0
108111 }
109- let W = (V + O)
110- if ((D != l))
112+ let Z = (Y + R)
113+ if ((G != l))
111114 then throw("Pair is not available in Whitelisted Asset.")
112115 else if ((l == toBase58String(g)))
113116 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].")
123126 then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = USDC Token.")
124127 else if ((5000000 > n.amount))
125128 then throw("please attach atleast 5 USDC in payment[2] & Equivalent worth of Token in payment[1]")
126- else if ((n.amount != N))
127- then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(N)) + "] or ") + toString(fraction(N, 1, 1000000))) + ".") + takeRight(toString(N), 6)) + " USDC."))
128- else if ((1 > O))
129- then throw((("LP Token Outcome is going below " + toString(M)) + " Decimals. Please Attach min. 1 LP token or 5 USDC Atleast."))
130- else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), S), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), U), IntegerEntry(("Total_LP_" + l), W), Reissue(E, O, true), ScriptTransfer(k.caller, O, E)]
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)]
131134 }
132135
133136
134137
135138 @Callable(k)
136139 func SwapAssetToXTNPairEntry (l) = {
137- let C = toBase58String(k.caller.bytes)
138- let X = if ((size(k.payments) == 1))
140+ let F = toBase58String(k.caller.bytes)
141+ let aa = if ((size(k.payments) == 1))
139142 then k.payments[0]
140143 else throw("Whitelisted Token is required as Attached payment[1].")
141- let D = getString(this, ("Pair_UV_" + l))
142- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
143- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
144- let Z = fraction(Y, G, (G + X.amount))
145- let aa = (Y - Z)
146- let ab = 5
147- let ac = h()
148- let ad = ((aa * ab) / 1000)
149- let ae = ((aa - ad) - ad)
150- let af = {
151- let Q = getInteger(this, ((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)))
152- if ($isInstanceOf(Q, "Int"))
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"))
153156 then {
154- let R = Q
155- R
157+ let U = T
158+ U
156159 }
157160 else 0
158161 }
159- let ag = ((af + ad) + ad)
160- let ah = {
161- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
162- if ($isInstanceOf(Q, "Int"))
162+ let aj = ((ai + ag) + ag)
163+ let ak = {
164+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
165+ if ($isInstanceOf(T, "Int"))
163166 then {
164- let R = Q
165- R
167+ let U = T
168+ U
166169 }
167170 else 0
168171 }
169- let ai = (G + X.amount)
170- let aj = {
171- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
172- if ($isInstanceOf(Q, "Int"))
172+ let al = (J + aa.amount)
173+ let am = {
174+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
175+ if ($isInstanceOf(T, "Int"))
173176 then {
174- let R = Q
175- R
177+ let U = T
178+ U
176179 }
177180 else 0
178181 }
179- let ak = ((Y - aa) + ad)
180- let al = {
181- let Q = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
182- if ($isInstanceOf(Q, "Int"))
182+ let an = ((ab - ad) + ag)
183+ let ao = {
184+ let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
185+ if ($isInstanceOf(T, "Int"))
183186 then {
184- let R = Q
185- R
187+ let U = T
188+ U
186189 }
187190 else 0
188191 }
189- let am = (al + 1)
192+ let ap = (ao + 1)
190193 if ((l == toBase58String(g)))
191194 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 ((D != l))
195+ else if ((G != l))
193196 then throw("Pair is not available in Whitelisted Asset.")
194- else if ((X.assetId == g))
197+ else if ((aa.assetId == g))
195198 then throw("You can't Attach XTN as an Attached Payment. Only Whitelisted Tokens are accepted.")
196- else if ((X.assetId != fromBase58String(l)))
199+ else if ((aa.assetId != fromBase58String(l)))
197200 then throw(("Incorrect asset attached, please attach or send " + l))
198- else if ((Y == 0))
201+ else if ((ab == 0))
199202 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
200- else if ((G == 0))
203+ else if ((J == 0))
201204 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
202- else if ((100000 > aa))
205+ else if ((100000 > ad))
203206 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 ((aa > Y))
205- then throw((("Pool Only has a Liquidity of " + toString((Y / pow(10, 0, 6, 0, 0, CEILING)))) + " XTN. Add Liquidity into Pool."))
206- else [IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), ag), IntegerEntry("Current_Day", ac), IntegerEntry(("Total_of_Pair_Txns_" + l), am), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), ai), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ak), ScriptTransfer(k.caller, ae, g), ScriptTransfer(d, fraction(ad, 1, 3), g), ScriptTransfer(e, fraction(ad, 1, 3), g), ScriptTransfer(f, fraction(ad, 1, 3), 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)]
207210 }
208211
209212
210213
211214 @Callable(k)
212215 func SwapXTNToAssetPairEntry (l) = {
213- let C = toBase58String(k.caller.bytes)
214- let X = if ((size(k.payments) == 1))
216+ let F = toBase58String(k.caller.bytes)
217+ let aa = if ((size(k.payments) == 1))
215218 then k.payments[0]
216219 else throw((("Only " + toBase58String(g)) + " XTN Token is required as an Attached payment[1]."))
217- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
218- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
219- let an = fraction(Y, G, (Y + X.amount))
220- let aa = (G - an)
221- let D = getString(this, ("Pair_UV_" + l))
222- let ab = 5
223- let ac = h()
224- let ad = ((aa * ab) / 1000)
225- let ae = ((aa - ad) - ad)
226- let ao = {
227- let Q = getInteger(this, ("Total_Swap_Fee_Collected_" + l))
228- if ($isInstanceOf(Q, "Int"))
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"))
229232 then {
230- let R = Q
231- R
233+ let U = T
234+ U
232235 }
233236 else 0
234237 }
235- let ap = ((ao + ad) + ad)
236- let ah = {
237- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
238- if ($isInstanceOf(Q, "Int"))
238+ let as = ((ar + ag) + ag)
239+ let ak = {
240+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
241+ if ($isInstanceOf(T, "Int"))
239242 then {
240- let R = Q
241- R
243+ let U = T
244+ U
242245 }
243246 else 0
244247 }
245- let ai = ((G - aa) + ad)
246- let aj = {
247- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
248- if ($isInstanceOf(Q, "Int"))
248+ let al = ((J - ad) + ag)
249+ let am = {
250+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
251+ if ($isInstanceOf(T, "Int"))
249252 then {
250- let R = Q
251- R
253+ let U = T
254+ U
252255 }
253256 else 0
254257 }
255- let ak = (Y + X.amount)
256- let al = {
257- let Q = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
258- if ($isInstanceOf(Q, "Int"))
258+ let an = (ab + aa.amount)
259+ let ao = {
260+ let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
261+ if ($isInstanceOf(T, "Int"))
259262 then {
260- let R = Q
261- R
263+ let U = T
264+ U
262265 }
263266 else 0
264267 }
265- let am = (al + 1)
266- if ((D != l))
268+ let ap = (ao + 1)
269+ if ((G != l))
267270 then throw("Pair is not available in Whitelisted Asset.")
268271 else if ((l == toBase58String(g)))
269272 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 ((X.assetId != g))
273+ else if ((aa.assetId != g))
271274 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 > X.amount))
275+ else if ((100000 > aa.amount))
273276 then throw("Your Attached XTN Amount is very low. Attach Atleast 0.1 XTN to Claim the minimum Tokens.")
274- else if ((Y == 0))
277+ else if ((ab == 0))
275278 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
276- else if ((G == 0))
279+ else if ((J == 0))
277280 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
278- else if ((aa > G))
279- then throw((("Pool Only has a Liquidity of " + toString(G)) + " Tokens. Add Liquidity into Pool."))
280- else [IntegerEntry(("Total_Swap_Fee_Collected_" + l), ap), IntegerEntry("Current_Day", ac), IntegerEntry(("Total_of_Pair_Txns_" + l), am), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), ai), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ak), ScriptTransfer(k.caller, ae, fromBase58String(l)), ScriptTransfer(d, fraction(ad, 1, 3), fromBase58String(l)), ScriptTransfer(e, fraction(ad, 1, 3), fromBase58String(l)), ScriptTransfer(f, fraction(ad, 1, 3), fromBase58String(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))]
281284 }
282285
283286
284287
285288 @Callable(k)
286289 func AddLiquidity (l) = {
287- let C = toBase58String(k.caller.bytes)
290+ let F = toBase58String(k.caller.bytes)
288291 let m = value(k.payments[0])
289292 let n = value(k.payments[1])
290- let D = getString(this, ("Pair_UV_" + l))
291- let E = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated."))
292- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
293- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
294- let H = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
295- let v = H.decimals
296- let w = fraction((v + 6), 1, 2)
297- let x = (1 * pow(10, 0, w, 0, 0, CEILING))
298- let y = fraction(m.amount, n.amount, x)
299- let z = sqrt(y, w, w, CEILING)
300- let aq = pow(10, 0, v, 0, 0, CEILING)
301- let ar = pow(10, 0, 6, 0, 0, CEILING)
302- let as = fraction(Y, aq, G)
303- let at = fraction(m.amount, as, 1)
304- let au = fraction(at, 1, aq)
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)
305308 let av = au
306309 let aw = {
307- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
308- if ($isInstanceOf(Q, "Int"))
310+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
311+ if ($isInstanceOf(T, "Int"))
309312 then {
310- let R = Q
311- R
313+ let U = T
314+ U
312315 }
313316 else 0
314317 }
315318 let ax = (aw + n.amount)
316- let T = {
317- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
318- if ($isInstanceOf(Q, "Int"))
319+ let W = {
320+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
321+ if ($isInstanceOf(T, "Int"))
319322 then {
320- let R = Q
321- R
323+ let U = T
324+ U
322325 }
323326 else 0
324327 }
325- let U = (T + m.amount)
326- let V = {
327- let Q = getIntegerValue(this, ("Total_LP_" + l))
328- if ($isInstanceOf(Q, "Int"))
328+ let X = (W + m.amount)
329+ let Y = {
330+ let T = getIntegerValue(this, ("Total_LP_" + l))
331+ if ($isInstanceOf(T, "Int"))
329332 then {
330- let R = Q
331- R
333+ let U = T
334+ U
332335 }
333336 else 0
334337 }
335- let W = (V + z)
336- if ((D != l))
338+ let Z = (Y + C)
339+ if ((G != l))
337340 then throw("Pair is not available in Whitelisted Asset.")
338341 else if ((l == toBase58String(g)))
339342 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].")
349352 then throw("please attach atleast 0.1 XTN in payment[2] & Equivalent worth of Token in payment[1]")
350353 else if ((n.amount != av))
351354 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)]
355360 }
356361
357362
358363
359364 @Callable(k)
360365 func RemoveLiquidity (l) = {
361- let C = toBase58String(k.caller.bytes)
362- let X = if ((size(k.payments) == 1))
366+ let F = toBase58String(k.caller.bytes)
367+ let aa = if ((size(k.payments) == 1))
363368 then k.payments[0]
364369 else throw("No payment attached, Please Attach LP Token as payment[1].")
365- let D = getString(this, ("Pair_UV_" + l))
370+ let G = getString(this, ("Pair_UV_" + l))
366371 let ay = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or not Generated."))
367- let H = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
368- let v = H.decimals
369- let L = (6 + v)
370- let M = (L / 2)
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)
371376 let az = getIntegerValue(this, ("Total_LP_" + l))
372- let aA = pow(fraction(X.amount, pow(10, 0, 8, 0, 0, CEILING), az), 6, 1, 0, 6, CEILING)
373- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
374- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
375- let aB = fraction(Y, aA, pow(10, 0, 8, 0, 0, CEILING))
376- let aC = fraction(G, aA, pow(10, 0, 8, 0, 0, CEILING))
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))
377382 let aw = {
378- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
379- if ($isInstanceOf(Q, "Int"))
383+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
384+ if ($isInstanceOf(T, "Int"))
380385 then {
381- let R = Q
382- R
386+ let U = T
387+ U
383388 }
384389 else 0
385390 }
386391 let ax = (aw - aB)
387- let T = {
388- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
389- if ($isInstanceOf(Q, "Int"))
392+ let W = {
393+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
394+ if ($isInstanceOf(T, "Int"))
390395 then {
391- let R = Q
392- R
396+ let U = T
397+ U
393398 }
394399 else 0
395400 }
396- let U = (T - aC)
397- let V = {
398- let Q = getIntegerValue(this, ("Total_LP_" + l))
399- if ($isInstanceOf(Q, "Int"))
401+ let X = (W - aC)
402+ let Y = {
403+ let T = getIntegerValue(this, ("Total_LP_" + l))
404+ if ($isInstanceOf(T, "Int"))
400405 then {
401- let R = Q
402- R
406+ let U = T
407+ U
403408 }
404409 else 0
405410 }
406- let W = (V - X.amount)
407- if ((D != l))
411+ let Z = (Y - aa.amount)
412+ if ((G != l))
408413 then throw("Pair is not available in Whitelist.")
409414 else if ((fromBase58String(l) == g))
410415 then throw("Don't choose XTN AssetID as Input, Only Whitelisted Asset as Input String & Attach LP Tokens as payment[1]")
411- else if ((X.assetId != ay))
416+ else if ((aa.assetId != ay))
412417 then throw("Wrong Asset is attached in payment[1] or LP Token Not Found or Missing.")
413418 else if ((1 > aA))
414419 then throw("Your LP Token amount % is very low to convert.")
416421 then throw("Your LP Token conversion amount is very low to convert or less than 0.000001 XTN.")
417422 else if ((1 > aC))
418423 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, X.amount), IntegerEntry(("Total_LP_" + l), W), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), U), ScriptTransfer(k.caller, aB, g), ScriptTransfer(k.caller, aC, fromBase58String(l))]
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))]
420425 }
421426
422427
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "1.0.0"
55
66 let b = 1694928600000
77
88 let c = 14000000
99
1010 let d = addressFromPublicKey(base58'4Dahqn4MYNrieo9AX8qLWNCseBQNc9skQY81h4DFoote')
1111
1212 let e = addressFromPublicKey(base58'4Dahqn4MYNrieo9AX8qLWNCseBQNc9skQY81h4DFoote')
1313
1414 let f = addressFromPublicKey(base58'EtFSDsn89XfmXQvuQXPQMbLDbaAZ1YWYZHksptpQH4gp')
1515
1616 let g = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H'
1717
1818 func h () = {
1919 let i = (lastBlock.timestamp - b)
2020 let j = fraction(1, i, 86400000)
2121 j
2222 }
2323
2424
2525 @Callable(k)
2626 func RegisterPair (l) = {
2727 let m = value(k.payments[0])
2828 let n = value(k.payments[1])
2929 let o = value(k.payments[2])
3030 let p = toBase58String(k.caller.bytes)
3131 let q = !(isDefined(n.assetId))
3232 let r = getString(this, ("Pair_UV_" + l))
3333 let s = fromBase58String(l)
3434 let t = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
3535 let u = t.name
3636 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)
4346 if ((r == l))
4447 then throw("Pair Already Exist in List.")
4548 else if ((size(k.payments) != 3))
4649 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."))
4750 else if ((m.assetId != g))
4851 then throw("Incorrect asset attached as payment[1], please attach XTN only.")
4952 else if ((100000 > m.amount))
5053 then throw("Attached payment[1] amount is less than 0.1 XTN, please attach 0.1 XTN Minimum.")
5154 else if ((n.assetId != s))
5255 then throw("Input String & Attached AssetID in payment2 is not matching.")
5356 else if ((o.amount != c))
5457 then throw((("Attached payment[3] amount has to be exact [" + toString(c)) + "/10^8] WAVES."))
5558 else if ((q == true))
5659 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), A, ScriptTransfer(k.caller, z, B), ScriptTransfer(d, fraction(c, 1, 2), unit), ScriptTransfer(e, fraction(c, 1, 2), unit), StringEntry(("LP_" + l), toBase58String(B)), IntegerEntry(("Total_LP_" + l), z)]
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)]
5861 }
5962
6063
6164
6265 @Callable(k)
6366 func oldAddLiquidity (l) = {
64- let C = toBase58String(k.caller.bytes)
67+ let F = toBase58String(k.caller.bytes)
6568 let m = value(k.payments[0])
6669 let n = value(k.payments[1])
67- let D = getString(this, ("Pair_UV_" + l))
68- let E = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated."))
69- let F = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
70- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
71- let H = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
72- let v = H.decimals
73- let I = F
74- let J = G
75- let K = pow((((I * 1000000) / J) * pow(10, 0, v, 0, 0, CEILING)), 0, 1, 0, 0, CEILING)
76- let L = (6 + v)
77- let M = (L / 2)
78- let N = fraction(K, m.amount, pow(10, 0, L, 0, 0, CEILING))
79- let O = 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, M, DOWN)
80- let P = {
81- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
82- if ($isInstanceOf(Q, "Int"))
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"))
8386 then {
84- let R = Q
85- R
87+ let U = T
88+ U
8689 }
8790 else 0
8891 }
89- let S = (P + n.amount)
90- let T = {
91- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
92- if ($isInstanceOf(Q, "Int"))
92+ let V = (S + n.amount)
93+ let W = {
94+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
95+ if ($isInstanceOf(T, "Int"))
9396 then {
94- let R = Q
95- R
97+ let U = T
98+ U
9699 }
97100 else 0
98101 }
99- let U = (T + m.amount)
100- let V = {
101- let Q = getIntegerValue(this, ("Total_LP_" + l))
102- if ($isInstanceOf(Q, "Int"))
102+ let X = (W + m.amount)
103+ let Y = {
104+ let T = getIntegerValue(this, ("Total_LP_" + l))
105+ if ($isInstanceOf(T, "Int"))
103106 then {
104- let R = Q
105- R
107+ let U = T
108+ U
106109 }
107110 else 0
108111 }
109- let W = (V + O)
110- if ((D != l))
112+ let Z = (Y + R)
113+ if ((G != l))
111114 then throw("Pair is not available in Whitelisted Asset.")
112115 else if ((l == toBase58String(g)))
113116 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].")
114117 else if ((size(k.payments) != 2))
115118 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.")
116119 else if ((m.assetId == g))
117120 then throw("You Attached USDC asset in payment[1], please attach only whitelisted Token in payment[1] along with USDC in payment[2].")
118121 else if ((m.assetId != fromBase58String(l)))
119122 then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.")
120123 else if ((m.assetId != fromBase58String(l)))
121124 then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.")
122125 else if ((n.assetId != g))
123126 then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = USDC Token.")
124127 else if ((5000000 > n.amount))
125128 then throw("please attach atleast 5 USDC in payment[2] & Equivalent worth of Token in payment[1]")
126- else if ((n.amount != N))
127- then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(N)) + "] or ") + toString(fraction(N, 1, 1000000))) + ".") + takeRight(toString(N), 6)) + " USDC."))
128- else if ((1 > O))
129- then throw((("LP Token Outcome is going below " + toString(M)) + " Decimals. Please Attach min. 1 LP token or 5 USDC Atleast."))
130- else [IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), S), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), U), IntegerEntry(("Total_LP_" + l), W), Reissue(E, O, true), ScriptTransfer(k.caller, O, E)]
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)]
131134 }
132135
133136
134137
135138 @Callable(k)
136139 func SwapAssetToXTNPairEntry (l) = {
137- let C = toBase58String(k.caller.bytes)
138- let X = if ((size(k.payments) == 1))
140+ let F = toBase58String(k.caller.bytes)
141+ let aa = if ((size(k.payments) == 1))
139142 then k.payments[0]
140143 else throw("Whitelisted Token is required as Attached payment[1].")
141- let D = getString(this, ("Pair_UV_" + l))
142- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
143- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
144- let Z = fraction(Y, G, (G + X.amount))
145- let aa = (Y - Z)
146- let ab = 5
147- let ac = h()
148- let ad = ((aa * ab) / 1000)
149- let ae = ((aa - ad) - ad)
150- let af = {
151- let Q = getInteger(this, ((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)))
152- if ($isInstanceOf(Q, "Int"))
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"))
153156 then {
154- let R = Q
155- R
157+ let U = T
158+ U
156159 }
157160 else 0
158161 }
159- let ag = ((af + ad) + ad)
160- let ah = {
161- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
162- if ($isInstanceOf(Q, "Int"))
162+ let aj = ((ai + ag) + ag)
163+ let ak = {
164+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
165+ if ($isInstanceOf(T, "Int"))
163166 then {
164- let R = Q
165- R
167+ let U = T
168+ U
166169 }
167170 else 0
168171 }
169- let ai = (G + X.amount)
170- let aj = {
171- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
172- if ($isInstanceOf(Q, "Int"))
172+ let al = (J + aa.amount)
173+ let am = {
174+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
175+ if ($isInstanceOf(T, "Int"))
173176 then {
174- let R = Q
175- R
177+ let U = T
178+ U
176179 }
177180 else 0
178181 }
179- let ak = ((Y - aa) + ad)
180- let al = {
181- let Q = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
182- if ($isInstanceOf(Q, "Int"))
182+ let an = ((ab - ad) + ag)
183+ let ao = {
184+ let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
185+ if ($isInstanceOf(T, "Int"))
183186 then {
184- let R = Q
185- R
187+ let U = T
188+ U
186189 }
187190 else 0
188191 }
189- let am = (al + 1)
192+ let ap = (ao + 1)
190193 if ((l == toBase58String(g)))
191194 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 ((D != l))
195+ else if ((G != l))
193196 then throw("Pair is not available in Whitelisted Asset.")
194- else if ((X.assetId == g))
197+ else if ((aa.assetId == g))
195198 then throw("You can't Attach XTN as an Attached Payment. Only Whitelisted Tokens are accepted.")
196- else if ((X.assetId != fromBase58String(l)))
199+ else if ((aa.assetId != fromBase58String(l)))
197200 then throw(("Incorrect asset attached, please attach or send " + l))
198- else if ((Y == 0))
201+ else if ((ab == 0))
199202 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
200- else if ((G == 0))
203+ else if ((J == 0))
201204 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
202- else if ((100000 > aa))
205+ else if ((100000 > ad))
203206 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 ((aa > Y))
205- then throw((("Pool Only has a Liquidity of " + toString((Y / pow(10, 0, 6, 0, 0, CEILING)))) + " XTN. Add Liquidity into Pool."))
206- else [IntegerEntry(((("Total_Swap_Fee_Collected_" + l) + "_") + toBase58String(g)), ag), IntegerEntry("Current_Day", ac), IntegerEntry(("Total_of_Pair_Txns_" + l), am), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), ai), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ak), ScriptTransfer(k.caller, ae, g), ScriptTransfer(d, fraction(ad, 1, 3), g), ScriptTransfer(e, fraction(ad, 1, 3), g), ScriptTransfer(f, fraction(ad, 1, 3), 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)]
207210 }
208211
209212
210213
211214 @Callable(k)
212215 func SwapXTNToAssetPairEntry (l) = {
213- let C = toBase58String(k.caller.bytes)
214- let X = if ((size(k.payments) == 1))
216+ let F = toBase58String(k.caller.bytes)
217+ let aa = if ((size(k.payments) == 1))
215218 then k.payments[0]
216219 else throw((("Only " + toBase58String(g)) + " XTN Token is required as an Attached payment[1]."))
217- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
218- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
219- let an = fraction(Y, G, (Y + X.amount))
220- let aa = (G - an)
221- let D = getString(this, ("Pair_UV_" + l))
222- let ab = 5
223- let ac = h()
224- let ad = ((aa * ab) / 1000)
225- let ae = ((aa - ad) - ad)
226- let ao = {
227- let Q = getInteger(this, ("Total_Swap_Fee_Collected_" + l))
228- if ($isInstanceOf(Q, "Int"))
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"))
229232 then {
230- let R = Q
231- R
233+ let U = T
234+ U
232235 }
233236 else 0
234237 }
235- let ap = ((ao + ad) + ad)
236- let ah = {
237- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
238- if ($isInstanceOf(Q, "Int"))
238+ let as = ((ar + ag) + ag)
239+ let ak = {
240+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
241+ if ($isInstanceOf(T, "Int"))
239242 then {
240- let R = Q
241- R
243+ let U = T
244+ U
242245 }
243246 else 0
244247 }
245- let ai = ((G - aa) + ad)
246- let aj = {
247- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
248- if ($isInstanceOf(Q, "Int"))
248+ let al = ((J - ad) + ag)
249+ let am = {
250+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
251+ if ($isInstanceOf(T, "Int"))
249252 then {
250- let R = Q
251- R
253+ let U = T
254+ U
252255 }
253256 else 0
254257 }
255- let ak = (Y + X.amount)
256- let al = {
257- let Q = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
258- if ($isInstanceOf(Q, "Int"))
258+ let an = (ab + aa.amount)
259+ let ao = {
260+ let T = getIntegerValue(this, ("Total_of_Pair_Txns_" + l))
261+ if ($isInstanceOf(T, "Int"))
259262 then {
260- let R = Q
261- R
263+ let U = T
264+ U
262265 }
263266 else 0
264267 }
265- let am = (al + 1)
266- if ((D != l))
268+ let ap = (ao + 1)
269+ if ((G != l))
267270 then throw("Pair is not available in Whitelisted Asset.")
268271 else if ((l == toBase58String(g)))
269272 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 ((X.assetId != g))
273+ else if ((aa.assetId != g))
271274 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 > X.amount))
275+ else if ((100000 > aa.amount))
273276 then throw("Your Attached XTN Amount is very low. Attach Atleast 0.1 XTN to Claim the minimum Tokens.")
274- else if ((Y == 0))
277+ else if ((ab == 0))
275278 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
276- else if ((G == 0))
279+ else if ((J == 0))
277280 then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.")
278- else if ((aa > G))
279- then throw((("Pool Only has a Liquidity of " + toString(G)) + " Tokens. Add Liquidity into Pool."))
280- else [IntegerEntry(("Total_Swap_Fee_Collected_" + l), ap), IntegerEntry("Current_Day", ac), IntegerEntry(("Total_of_Pair_Txns_" + l), am), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), ai), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ak), ScriptTransfer(k.caller, ae, fromBase58String(l)), ScriptTransfer(d, fraction(ad, 1, 3), fromBase58String(l)), ScriptTransfer(e, fraction(ad, 1, 3), fromBase58String(l)), ScriptTransfer(f, fraction(ad, 1, 3), fromBase58String(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))]
281284 }
282285
283286
284287
285288 @Callable(k)
286289 func AddLiquidity (l) = {
287- let C = toBase58String(k.caller.bytes)
290+ let F = toBase58String(k.caller.bytes)
288291 let m = value(k.payments[0])
289292 let n = value(k.payments[1])
290- let D = getString(this, ("Pair_UV_" + l))
291- let E = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or May be not Generated."))
292- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
293- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
294- let H = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
295- let v = H.decimals
296- let w = fraction((v + 6), 1, 2)
297- let x = (1 * pow(10, 0, w, 0, 0, CEILING))
298- let y = fraction(m.amount, n.amount, x)
299- let z = sqrt(y, w, w, CEILING)
300- let aq = pow(10, 0, v, 0, 0, CEILING)
301- let ar = pow(10, 0, 6, 0, 0, CEILING)
302- let as = fraction(Y, aq, G)
303- let at = fraction(m.amount, as, 1)
304- let au = fraction(at, 1, aq)
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)
305308 let av = au
306309 let aw = {
307- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
308- if ($isInstanceOf(Q, "Int"))
310+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
311+ if ($isInstanceOf(T, "Int"))
309312 then {
310- let R = Q
311- R
313+ let U = T
314+ U
312315 }
313316 else 0
314317 }
315318 let ax = (aw + n.amount)
316- let T = {
317- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
318- if ($isInstanceOf(Q, "Int"))
319+ let W = {
320+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
321+ if ($isInstanceOf(T, "Int"))
319322 then {
320- let R = Q
321- R
323+ let U = T
324+ U
322325 }
323326 else 0
324327 }
325- let U = (T + m.amount)
326- let V = {
327- let Q = getIntegerValue(this, ("Total_LP_" + l))
328- if ($isInstanceOf(Q, "Int"))
328+ let X = (W + m.amount)
329+ let Y = {
330+ let T = getIntegerValue(this, ("Total_LP_" + l))
331+ if ($isInstanceOf(T, "Int"))
329332 then {
330- let R = Q
331- R
333+ let U = T
334+ U
332335 }
333336 else 0
334337 }
335- let W = (V + z)
336- if ((D != l))
338+ let Z = (Y + C)
339+ if ((G != l))
337340 then throw("Pair is not available in Whitelisted Asset.")
338341 else if ((l == toBase58String(g)))
339342 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].")
340343 else if ((size(k.payments) != 2))
341344 then throw("Two attached assets are expected in payment. Kindly Attach payment1 = Token you want to add for Liquidity & payment2 = Amount of XTN Token.")
342345 else if ((m.assetId == g))
343346 then throw("You Attached XTN asset in payment[1], please attach only whitelisted Token in payment[1] along with XTN in payment[2].")
344347 else if ((m.assetId != fromBase58String(l)))
345348 then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.")
346349 else if ((n.assetId != g))
347350 then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = XTN Token.")
348351 else if ((100000 > n.amount))
349352 then throw("please attach atleast 0.1 XTN in payment[2] & Equivalent worth of Token in payment[1]")
350353 else if ((n.amount != av))
351354 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)]
355360 }
356361
357362
358363
359364 @Callable(k)
360365 func RemoveLiquidity (l) = {
361- let C = toBase58String(k.caller.bytes)
362- let X = if ((size(k.payments) == 1))
366+ let F = toBase58String(k.caller.bytes)
367+ let aa = if ((size(k.payments) == 1))
363368 then k.payments[0]
364369 else throw("No payment attached, Please Attach LP Token as payment[1].")
365- let D = getString(this, ("Pair_UV_" + l))
370+ let G = getString(this, ("Pair_UV_" + l))
366371 let ay = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + l)), "LP Token is Missing or not Generated."))
367- let H = valueOrErrorMessage(assetInfo(fromBase58String(l)), (("Asset " + l) + " doesn't exist"))
368- let v = H.decimals
369- let L = (6 + v)
370- let M = (L / 2)
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)
371376 let az = getIntegerValue(this, ("Total_LP_" + l))
372- let aA = pow(fraction(X.amount, pow(10, 0, 8, 0, 0, CEILING), az), 6, 1, 0, 6, CEILING)
373- let Y = getIntegerValue(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
374- let G = getIntegerValue(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
375- let aB = fraction(Y, aA, pow(10, 0, 8, 0, 0, CEILING))
376- let aC = fraction(G, aA, pow(10, 0, 8, 0, 0, CEILING))
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))
377382 let aw = {
378- let Q = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
379- if ($isInstanceOf(Q, "Int"))
383+ let T = getInteger(this, ((("Balance_of_" + l) + "_") + toBase58String(g)))
384+ if ($isInstanceOf(T, "Int"))
380385 then {
381- let R = Q
382- R
386+ let U = T
387+ U
383388 }
384389 else 0
385390 }
386391 let ax = (aw - aB)
387- let T = {
388- let Q = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
389- if ($isInstanceOf(Q, "Int"))
392+ let W = {
393+ let T = getInteger(this, ((("Balance_of_" + toBase58String(g)) + "_") + l))
394+ if ($isInstanceOf(T, "Int"))
390395 then {
391- let R = Q
392- R
396+ let U = T
397+ U
393398 }
394399 else 0
395400 }
396- let U = (T - aC)
397- let V = {
398- let Q = getIntegerValue(this, ("Total_LP_" + l))
399- if ($isInstanceOf(Q, "Int"))
401+ let X = (W - aC)
402+ let Y = {
403+ let T = getIntegerValue(this, ("Total_LP_" + l))
404+ if ($isInstanceOf(T, "Int"))
400405 then {
401- let R = Q
402- R
406+ let U = T
407+ U
403408 }
404409 else 0
405410 }
406- let W = (V - X.amount)
407- if ((D != l))
411+ let Z = (Y - aa.amount)
412+ if ((G != l))
408413 then throw("Pair is not available in Whitelist.")
409414 else if ((fromBase58String(l) == g))
410415 then throw("Don't choose XTN AssetID as Input, Only Whitelisted Asset as Input String & Attach LP Tokens as payment[1]")
411- else if ((X.assetId != ay))
416+ else if ((aa.assetId != ay))
412417 then throw("Wrong Asset is attached in payment[1] or LP Token Not Found or Missing.")
413418 else if ((1 > aA))
414419 then throw("Your LP Token amount % is very low to convert.")
415420 else if ((1 > aB))
416421 then throw("Your LP Token conversion amount is very low to convert or less than 0.000001 XTN.")
417422 else if ((1 > aC))
418423 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, X.amount), IntegerEntry(("Total_LP_" + l), W), IntegerEntry(((("Balance_of_" + l) + "_") + toBase58String(g)), ax), IntegerEntry(((("Balance_of_" + toBase58String(g)) + "_") + l), U), ScriptTransfer(k.caller, aB, g), ScriptTransfer(k.caller, aC, fromBase58String(l))]
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))]
420425 }
421426
422427
423428 @Verifier(aD)
424429 func aE () = sigVerify(aD.bodyBytes, aD.proofs[0], aD.senderPublicKey)
425430

github/deemru/w8io/169f3d6 
154.77 ms