tx · 1QNeTeHCe1pdRCVb56tJpoiDN3MKCAakP3JSWn1zBvU 3MsVsEgTUxTm6ETYkHGaqMhMhiY2Nb3yDN5: -0.01600000 Waves 2023.09.19 15:05 [2762247] smart account 3MsVsEgTUxTm6ETYkHGaqMhMhiY2Nb3yDN5 > SELF 0.00000000 Waves
{ "type": 13, "id": "1QNeTeHCe1pdRCVb56tJpoiDN3MKCAakP3JSWn1zBvU", "fee": 1600000, "feeAssetId": null, "timestamp": 1695125144081, "version": 2, "chainId": 84, "sender": "3MsVsEgTUxTm6ETYkHGaqMhMhiY2Nb3yDN5", "senderPublicKey": "2LmNyaN5YAXdg9C5vsXcTLU66hsW2KUNPsN7KcHBYhUo", "proofs": [ "3pe4uqh753opb3Pw5H7iCxB15jQJrXuekd85NkWu73hub7iGCtxEG4LHQCFKuJ2dpxhFQnYwgfDchm1P4AsRbVrt" ], "script": "base64:BgIhCAISBAoCCAESAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIAgALVVNEQ0Fzc2V0SUQBIERHMcoh3/bynCbIVv74Z6l9nvez8AyJBUgJkDUU6U3/ABFDb2xsZWN0RmVlQWRkcmVzcwkApwgBASBSg9mgi9eQkjsz5eBARHIbc7Hg/F4fmB0sxZ6ySMfiIAYBaQEMUmVnaXN0ZXJQYWlyAgxFbnRlckFzc2V0SUQEZGF5cwQEcG10MQkBBXZhbHVlAQkAkQMCCAUBaQhwYXltZW50cwAABARwbXQyCQEFdmFsdWUBCQCRAwIIBQFpCHBheW1lbnRzAAEECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQFV0FWRVMJAQEhAQkBCWlzRGVmaW5lZAEIBQRwbXQyB2Fzc2V0SWQECWZldGNocGFpcgkAnQgCBQR0aGlzCQCsAgICCFBhaXJfVVZfBQxFbnRlckFzc2V0SUQEDWFzc2V0aW5mb3BtdDIJANkEAQUMRW50ZXJBc3NldElEBARpbmZvCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAOwH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ZWdlckVudHJ5AgkArAICAglUb3RhbF9MUF8FDEVudGVyQXNzZXRJRAUQTmV3TFBUb2tlbklzc3VlZAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCsAgIJAKwCAgILQmFsYW5jZV9vZl8FDEVudGVyQXNzZXRJRAIBXwkA2AQBBQtVU0RDQXNzZXRJRAUUTmV3VVNEQ0hvbGRpbmdJblBhaXIJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICCQCsAgICC0JhbGFuY2Vfb2ZfCQDYBAEFC1VTRENBc3NldElEAgFfBQxFbnRlckFzc2V0SUQFFU5ld0Fzc2V0SG9sZGluZ0luUGFpcgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFD1VzZXJMUFdvcnRoVVNEQwULVVNEQ0Fzc2V0SUQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBRBVc2VyTFBXb3J0aEFzc2V0CQDZBAEFDEVudGVyQXNzZXRJRAUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlefpJIqw=", "height": 2762247, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EXpwAcD8Lpzd36xHAmgjbiYmu7xX8S49WyYcpuwH46YS Next: HMuYqsQfg7QGBaBZshNxPRzoR6v4vfmPqKRh3dqWArxB Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let USDCAssetID = base58'5bXgvADuVoFdhtF5uKZAEiVdAo7ZCWw151L4yyf1PiES' | |
5 | + | ||
6 | + | let CollectFeeAddress = addressFromPublicKey(base58'6Z73KxcX3sugpiStpSRXxKxTmWqCaLVwFeM6kwyiKVDR') | |
7 | + | ||
8 | + | @Callable(i) | |
9 | + | func RegisterPair (EnterAssetID,days) = { | |
10 | + | let pmt1 = value(i.payments[0]) | |
11 | + | let pmt2 = value(i.payments[1]) | |
12 | + | let currentKey = toBase58String(i.caller.bytes) | |
13 | + | let WAVES = !(isDefined(pmt2.assetId)) | |
14 | + | let fetchpair = getString(this, ("Pair_UV_" + EnterAssetID)) | |
15 | + | let assetinfopmt2 = fromBase58String(EnterAssetID) | |
16 | + | let info = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
17 | + | if ((fetchpair == EnterAssetID)) | |
18 | + | then throw("Pair Already Exist in List.") | |
19 | + | else if ((size(i.payments) != 2)) | |
20 | + | then throw("Two attached assets expected as payment. Kindly Attach payment1 = WAVES Token & payment2 = Token you want to List.") | |
21 | + | else if (isDefined(pmt1.assetId)) | |
22 | + | then throw("Incorrect asset attached for Collateral, please attach WAVES only.") | |
23 | + | else if ((pmt1.amount != 1000000000)) | |
24 | + | then throw((((("You attached only " + toString(fraction(pmt1.amount, 1, 100000000))) + ".") + toString(fraction(pmt1.amount, 1, 10000000))) + " WAVES for Listing in payment[1], please attach 10 WAVES.")) | |
25 | + | else if ((pmt2.assetId != assetinfopmt2)) | |
26 | + | then throw("Input String & Attached AssetID in payment2 is not matching.") | |
27 | + | else if ((WAVES == true)) | |
28 | + | then throw("You Attached WAVES Asset ID for Listing, please attach Tokens You want to list in payment[2].") | |
29 | + | else [StringEntry(("Pair_UV_" + EnterAssetID), EnterAssetID), IntegerEntry(("Listing_Fee_" + EnterAssetID), pmt1.amount), ScriptTransfer(CollectFeeAddress, pmt1.amount, unit), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), 0), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), 0), IntegerEntry(("Total_of_Pair_Txns_" + EnterAssetID), 0), IntegerEntry(((("Total_Swap_Fee_Collected_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), 0), IntegerEntry(("Total_Swap_Fee_Collected_" + EnterAssetID), 0)] | |
30 | + | } | |
31 | + | ||
4 | 32 | ||
5 | 33 | ||
6 | 34 | @Callable(i) | |
7 | - | func RegisterPairForVoting (assetId) = { | |
8 | - | let readassetinfo = assetInfo(fromBase58String(assetId)) | |
35 | + | func IssueLPToken (EnterAssetID) = { | |
36 | + | let adminrights = valueOrErrorMessage(getString(this, "LP_Admin_Rights"), "LP Admin Rights are Not Included into Smart Contract. Deploy Admin Rights First.") | |
37 | + | let calleraddress = toBase58String(i.caller.bytes) | |
38 | + | let checkpairisavailableornot = valueOrErrorMessage(getString(this, ("Pair_UV_" + EnterAssetID)), "Asset not Found in Whitelisted Token") | |
39 | + | let info = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
40 | + | let name = info.name | |
41 | + | let decimals = info.decimals | |
42 | + | let FirstLPQty = (1 * pow(10, 0, fraction((decimals + 6), 1, 2), 0, 0, CEILING)) | |
43 | + | let LPissue = Issue((("LP-" + take(name, 8)) + "-USDC"), (((("LP-" + name) + "-USDC") + " is a Liquidity Provider Token Issued Against ") + EnterAssetID), FirstLPQty, fraction((decimals + 6), 1, 2), true) | |
44 | + | let LPid = calculateAssetId(LPissue) | |
45 | + | if ((adminrights != calleraddress)) | |
46 | + | then throw((("Your are not allowded to Issue LP Token. Only " + adminrights) + " can issue the LP Token.")) | |
47 | + | else if ((checkpairisavailableornot != EnterAssetID)) | |
48 | + | then throw("Pair is not available in List.") | |
49 | + | else [LPissue, StringEntry(("LP_" + EnterAssetID), toBase58String(LPid)), IntegerEntry(("Total_LP_" + EnterAssetID), FirstLPQty)] | |
50 | + | } | |
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | @Callable(i) | |
55 | + | func SwapAssetToUSDCPairEntry (EnterAssetID) = { | |
56 | + | let calleraddress = toBase58String(i.caller.bytes) | |
57 | + | let pmt = if ((size(i.payments) == 1)) | |
58 | + | then i.payments[0] | |
59 | + | else throw("Whitelisted Token is required as Attached payment[1].") | |
60 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
61 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
62 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
63 | + | let newbalanceofUSDC = fraction(CheckUSDCBalance, CheckAssetBalance, (CheckAssetBalance + pmt.amount)) | |
64 | + | let quantityofpriceasset = (CheckUSDCBalance - newbalanceofUSDC) | |
65 | + | let SwapFee = 3 | |
66 | + | let SwapFeetoreceive = ((quantityofpriceasset * SwapFee) / 1000) | |
67 | + | let userbalancetoreceive = ((quantityofpriceasset - SwapFeetoreceive) - SwapFeetoreceive) | |
68 | + | let SumupofAssetToUSDCSwapFee = match getInteger(this, ((("Total_Swap_Fee_Collected_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
69 | + | case a: Int => | |
70 | + | a | |
71 | + | case _ => | |
72 | + | 0 | |
73 | + | } | |
74 | + | let NewSumupofAssetToUSDCSwapFee = ((SumupofAssetToUSDCSwapFee + SwapFeetoreceive) + SwapFeetoreceive) | |
75 | + | let SumupAssetBalance = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
76 | + | case a: Int => | |
77 | + | a | |
78 | + | case _ => | |
79 | + | 0 | |
80 | + | } | |
81 | + | let NewSumupofAssetBalance = (CheckAssetBalance + pmt.amount) | |
82 | + | let SumupUSDCBalance = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
83 | + | case a: Int => | |
84 | + | a | |
85 | + | case _ => | |
86 | + | 0 | |
87 | + | } | |
88 | + | let NewSumupofUSDCBalance = ((CheckUSDCBalance - quantityofpriceasset) + SwapFeetoreceive) | |
89 | + | let TOPT = match getIntegerValue(this, ("Total_of_Pair_Txns_" + EnterAssetID)) { | |
90 | + | case a: Int => | |
91 | + | a | |
92 | + | case _ => | |
93 | + | 0 | |
94 | + | } | |
95 | + | let NewTPT = (TOPT + 1) | |
96 | + | if ((EnterAssetID == toBase58String(USDCAssetID))) | |
97 | + | then throw("Input can Never be a USDC AssetID. Enter Whitelisted AssetID in input & Attach Whitelisted Asset as an attachment Token in payment[1].") | |
98 | + | else if ((checkpairisavailableornot != EnterAssetID)) | |
99 | + | then throw("Pair is not available in Whitelisted Asset.") | |
100 | + | else if ((pmt.assetId == USDCAssetID)) | |
101 | + | then throw("You can't Attach USDC as an Attached Payment. Only Whitelisted Tokens are accepted.") | |
102 | + | else if ((pmt.assetId != fromBase58String(EnterAssetID))) | |
103 | + | then throw(("Incorrect asset attached, please attach or send " + EnterAssetID)) | |
104 | + | else if ((CheckUSDCBalance == 0)) | |
105 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
106 | + | else if ((CheckAssetBalance == 0)) | |
107 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
108 | + | else if ((100000 > quantityofpriceasset)) | |
109 | + | then throw((("Your Attached Asset Amount is very low. Attach More " + EnterAssetID) + " Tokens to Claim the minimum Amount of 0.1 dollar atleast.")) | |
110 | + | else if ((quantityofpriceasset > CheckUSDCBalance)) | |
111 | + | then throw((("Pool Only has a Liquidity of " + toString((CheckUSDCBalance / pow(10, 0, 6, 0, 0, CEILING)))) + " USDC. Add Liquidity into Pool.")) | |
112 | + | else [IntegerEntry(((("Total_Swap_Fee_Collected_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewSumupofAssetToUSDCSwapFee), IntegerEntry(("Total_of_Pair_Txns_" + EnterAssetID), NewTPT), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewSumupofAssetBalance), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewSumupofUSDCBalance), ScriptTransfer(i.caller, userbalancetoreceive, USDCAssetID), ScriptTransfer(CollectFeeAddress, SwapFeetoreceive, USDCAssetID)] | |
113 | + | } | |
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | @Callable(i) | |
118 | + | func SwapUSDCToAssetPairEntry (EnterAssetID) = { | |
119 | + | let calleraddress = toBase58String(i.caller.bytes) | |
120 | + | let pmt = if ((size(i.payments) == 1)) | |
121 | + | then i.payments[0] | |
122 | + | else throw((("Only " + toBase58String(USDCAssetID)) + " USDC Token is required as an Attached payment[1].")) | |
123 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
124 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
125 | + | let newbalanceofAsset = fraction(CheckUSDCBalance, CheckAssetBalance, (CheckUSDCBalance + pmt.amount)) | |
126 | + | let quantityofpriceasset = (CheckAssetBalance - newbalanceofAsset) | |
127 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
128 | + | let SwapFee = 3 | |
129 | + | let SwapFeetoreceive = ((quantityofpriceasset * SwapFee) / 1000) | |
130 | + | let userbalancetoreceive = ((quantityofpriceasset - SwapFeetoreceive) - SwapFeetoreceive) | |
131 | + | let SumupofUSDCToAssetSwapFee = match getInteger(this, ("Total_Swap_Fee_Collected_" + EnterAssetID)) { | |
132 | + | case a: Int => | |
133 | + | a | |
134 | + | case _ => | |
135 | + | 0 | |
136 | + | } | |
137 | + | let NewSumupofUSDCToAssetSwapFee = ((SumupofUSDCToAssetSwapFee + SwapFeetoreceive) + SwapFeetoreceive) | |
138 | + | let SumupAssetBalance = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
139 | + | case a: Int => | |
140 | + | a | |
141 | + | case _ => | |
142 | + | 0 | |
143 | + | } | |
144 | + | let NewSumupofAssetBalance = ((CheckAssetBalance - quantityofpriceasset) + SwapFeetoreceive) | |
145 | + | let SumupUSDCBalance = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
146 | + | case a: Int => | |
147 | + | a | |
148 | + | case _ => | |
149 | + | 0 | |
150 | + | } | |
151 | + | let NewSumupofUSDCBalance = (CheckUSDCBalance + pmt.amount) | |
152 | + | let TOPT = match getIntegerValue(this, ("Total_of_Pair_Txns_" + EnterAssetID)) { | |
153 | + | case a: Int => | |
154 | + | a | |
155 | + | case _ => | |
156 | + | 0 | |
157 | + | } | |
158 | + | let NewTPT = (TOPT + 1) | |
159 | + | if ((checkpairisavailableornot != EnterAssetID)) | |
160 | + | then throw("Pair is not available in Whitelisted Asset.") | |
161 | + | else if ((EnterAssetID == toBase58String(USDCAssetID))) | |
162 | + | then throw("Input can Never be a USDC AssetID. Enter Whitelisted AssetID in input & Attach USDC as an attachment Token in payment[1].") | |
163 | + | else if ((pmt.assetId != USDCAssetID)) | |
164 | + | then throw("You can Attach USDC as an Attached Payment[1] to Swap USDC To Required Token. Any other asset else than USDC will be rejected.") | |
165 | + | else if ((100000 > pmt.amount)) | |
166 | + | then throw("Your Attached USDC Amount is very low. Attach Atleast 0.1 USDC to Claim the minimum Tokens.") | |
167 | + | else if ((CheckUSDCBalance == 0)) | |
168 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
169 | + | else if ((CheckAssetBalance == 0)) | |
170 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
171 | + | else if ((quantityofpriceasset > CheckAssetBalance)) | |
172 | + | then throw((("Pool Only has a Liquidity of " + toString(CheckAssetBalance)) + " Tokens. Add Liquidity into Pool.")) | |
173 | + | else [IntegerEntry(("Total_Swap_Fee_Collected_" + EnterAssetID), NewSumupofUSDCToAssetSwapFee), IntegerEntry(("Total_of_Pair_Txns_" + EnterAssetID), NewTPT), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewSumupofAssetBalance), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewSumupofUSDCBalance), ScriptTransfer(i.caller, userbalancetoreceive, fromBase58String(EnterAssetID)), ScriptTransfer(CollectFeeAddress, SwapFeetoreceive, fromBase58String(EnterAssetID))] | |
174 | + | } | |
175 | + | ||
176 | + | ||
177 | + | ||
178 | + | @Callable(i) | |
179 | + | func AddLiquidity (EnterAssetID) = { | |
180 | + | let calleraddress = toBase58String(i.caller.bytes) | |
9 | 181 | let pmt1 = value(i.payments[0]) | |
10 | - | let currentKey = toBase58String(i.caller.bytes) | |
11 | - | let fetchpair = getString(this, ("Pair_UV_" + assetId)) | |
12 | - | let assetinfopmt2 = fromBase58String(assetId) | |
13 | - | if ((fetchpair == assetId)) | |
14 | - | then throw("Pair Already Exist in Voting List.") | |
15 | - | else [StringEntry(("Pair_UV_" + assetId), assetId)] | |
182 | + | let pmt2 = value(i.payments[1]) | |
183 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
184 | + | let ReissueassetId = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + EnterAssetID)), "LP Token is Missing or May be not Generated.")) | |
185 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
186 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
187 | + | let decimalsinfo = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
188 | + | let decimals = decimalsinfo.decimals | |
189 | + | let arg1 = CheckUSDCBalance | |
190 | + | let arg2 = CheckAssetBalance | |
191 | + | let args3 = pow((((arg1 * 1000000) / arg2) * pow(10, 0, decimals, 0, 0, CEILING)), 0, 1, 0, 0, CEILING) | |
192 | + | let bothassetsdecimals = (6 + decimals) | |
193 | + | let sharedecimals = (bothassetsdecimals / 2) | |
194 | + | let quantityofEnterAssetID = fraction(args3, pmt1.amount, pow(10, 0, bothassetsdecimals, 0, 0, CEILING)) | |
195 | + | let quantityofLPToken1 = pow((fraction(pmt1.amount, 1, pow(10, 0, decimals, 0, 0, CEILING)) * fraction(pmt2.amount, 1, pow(10, 0, 6, 0, 0, CEILING))), 0, 5, 1, sharedecimals, DOWN) | |
196 | + | let USDCHoldingInPair = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
197 | + | case a: Int => | |
198 | + | a | |
199 | + | case _ => | |
200 | + | 0 | |
201 | + | } | |
202 | + | let NewUSDCHoldingInPair = (USDCHoldingInPair + pmt2.amount) | |
203 | + | let AssetHoldingInPair = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
204 | + | case a: Int => | |
205 | + | a | |
206 | + | case _ => | |
207 | + | 0 | |
208 | + | } | |
209 | + | let NewAssetHoldingInPair = (AssetHoldingInPair + pmt1.amount) | |
210 | + | let LPTokenIssued = match getIntegerValue(this, ("Total_LP_" + EnterAssetID)) { | |
211 | + | case a: Int => | |
212 | + | a | |
213 | + | case _ => | |
214 | + | 0 | |
215 | + | } | |
216 | + | let NewLPTokenIssued = (LPTokenIssued + quantityofLPToken1) | |
217 | + | if ((checkpairisavailableornot != EnterAssetID)) | |
218 | + | then throw("Pair is not available in Whitelisted Asset.") | |
219 | + | else if ((EnterAssetID == toBase58String(USDCAssetID))) | |
220 | + | 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].") | |
221 | + | else if ((size(i.payments) != 2)) | |
222 | + | 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.") | |
223 | + | else if ((pmt1.assetId == USDCAssetID)) | |
224 | + | then throw("You Attached USDC asset in payment[1], please attach only whitelisted Token in payment[1] along with USDC in payment[2].") | |
225 | + | else if ((pmt1.assetId != fromBase58String(EnterAssetID))) | |
226 | + | then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.") | |
227 | + | else if ((pmt1.assetId != fromBase58String(EnterAssetID))) | |
228 | + | then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.") | |
229 | + | else if ((pmt2.assetId != USDCAssetID)) | |
230 | + | then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = USDC Token.") | |
231 | + | else if ((5000000 > pmt2.amount)) | |
232 | + | then throw("please attach atleast 5 USDC in payment[2] & Equivalent worth of Token in payment[1]") | |
233 | + | else if ((pmt2.amount != quantityofEnterAssetID)) | |
234 | + | then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(quantityofEnterAssetID)) + "] or ") + toString(fraction(quantityofEnterAssetID, 1, 1000000))) + ".") + takeRight(toString(quantityofEnterAssetID), 6)) + " USDC.")) | |
235 | + | else if ((1 > quantityofLPToken1)) | |
236 | + | then throw((("LP Token Outcome is going below " + toString(sharedecimals)) + " Decimals. Please Attach min. 1 LP token or 5 USDC Atleast.")) | |
237 | + | else [IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewUSDCHoldingInPair), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewAssetHoldingInPair), IntegerEntry(("Total_LP_" + EnterAssetID), NewLPTokenIssued), Reissue(ReissueassetId, quantityofLPToken1, true), ScriptTransfer(i.caller, quantityofLPToken1, ReissueassetId)] | |
238 | + | } | |
239 | + | ||
240 | + | ||
241 | + | ||
242 | + | @Callable(i) | |
243 | + | func RemoveLiquidity (EnterAssetID) = { | |
244 | + | let calleraddress = toBase58String(i.caller.bytes) | |
245 | + | let pmt = if ((size(i.payments) == 1)) | |
246 | + | then i.payments[0] | |
247 | + | else throw("No payment attached, Please Attach LP Token as payment[1].") | |
248 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
249 | + | let ReissueableassetId = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + EnterAssetID)), "LP Token is Missing or not Generated.")) | |
250 | + | let decimalsinfo = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
251 | + | let decimals = decimalsinfo.decimals | |
252 | + | let bothassetsdecimals = (6 + decimals) | |
253 | + | let sharedecimals = (bothassetsdecimals / 2) | |
254 | + | let CheckTotalLPAmount = getIntegerValue(this, ("Total_LP_" + EnterAssetID)) | |
255 | + | let UserLPPercentage = pow(fraction(pmt.amount, pow(10, 0, 8, 0, 0, CEILING), CheckTotalLPAmount), 6, 1, 0, 6, CEILING) | |
256 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
257 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
258 | + | let UserLPWorthUSDC = fraction(CheckUSDCBalance, UserLPPercentage, pow(10, 0, 8, 0, 0, CEILING)) | |
259 | + | let UserLPWorthAsset = fraction(CheckAssetBalance, UserLPPercentage, pow(10, 0, 8, 0, 0, CEILING)) | |
260 | + | let USDCHoldingInPair = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
261 | + | case a: Int => | |
262 | + | a | |
263 | + | case _ => | |
264 | + | 0 | |
265 | + | } | |
266 | + | let NewUSDCHoldingInPair = (USDCHoldingInPair - UserLPWorthUSDC) | |
267 | + | let AssetHoldingInPair = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
268 | + | case a: Int => | |
269 | + | a | |
270 | + | case _ => | |
271 | + | 0 | |
272 | + | } | |
273 | + | let NewAssetHoldingInPair = (AssetHoldingInPair - UserLPWorthAsset) | |
274 | + | let LPTokenIssued = match getIntegerValue(this, ("Total_LP_" + EnterAssetID)) { | |
275 | + | case a: Int => | |
276 | + | a | |
277 | + | case _ => | |
278 | + | 0 | |
279 | + | } | |
280 | + | let NewLPTokenIssued = (LPTokenIssued - pmt.amount) | |
281 | + | if ((checkpairisavailableornot != EnterAssetID)) | |
282 | + | then throw("Pair is not available in Whitelist.") | |
283 | + | else if ((fromBase58String(EnterAssetID) == USDCAssetID)) | |
284 | + | then throw("Don't choose USDC AssetID as Input, Only Whitelisted Asset as Input String & Attach LP Tokens as payment[1]") | |
285 | + | else if ((pmt.assetId != ReissueableassetId)) | |
286 | + | then throw("Wrong Asset is attached in payment[1] or LP Token Not Found or Missing.") | |
287 | + | else if ((1 > UserLPPercentage)) | |
288 | + | then throw("Your LP Token amount % is very low to convert.") | |
289 | + | else if ((1 > UserLPWorthUSDC)) | |
290 | + | then throw("Your LP Token conversion amount is very low to convert or less than 0.000001 USDC.") | |
291 | + | else if ((1 > UserLPWorthAsset)) | |
292 | + | then throw("Your LP Token conversion amount is very low to convert or less than fraction value of Token.") | |
293 | + | else [IntegerEntry("Withdraw_LP_Percentage", UserLPPercentage), Burn(ReissueableassetId, pmt.amount), IntegerEntry(("Total_LP_" + EnterAssetID), NewLPTokenIssued), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewUSDCHoldingInPair), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewAssetHoldingInPair), ScriptTransfer(i.caller, UserLPWorthUSDC, USDCAssetID), ScriptTransfer(i.caller, UserLPWorthAsset, fromBase58String(EnterAssetID))] | |
16 | 294 | } | |
17 | 295 | ||
18 | 296 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let USDCAssetID = base58'5bXgvADuVoFdhtF5uKZAEiVdAo7ZCWw151L4yyf1PiES' | |
5 | + | ||
6 | + | let CollectFeeAddress = addressFromPublicKey(base58'6Z73KxcX3sugpiStpSRXxKxTmWqCaLVwFeM6kwyiKVDR') | |
7 | + | ||
8 | + | @Callable(i) | |
9 | + | func RegisterPair (EnterAssetID,days) = { | |
10 | + | let pmt1 = value(i.payments[0]) | |
11 | + | let pmt2 = value(i.payments[1]) | |
12 | + | let currentKey = toBase58String(i.caller.bytes) | |
13 | + | let WAVES = !(isDefined(pmt2.assetId)) | |
14 | + | let fetchpair = getString(this, ("Pair_UV_" + EnterAssetID)) | |
15 | + | let assetinfopmt2 = fromBase58String(EnterAssetID) | |
16 | + | let info = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
17 | + | if ((fetchpair == EnterAssetID)) | |
18 | + | then throw("Pair Already Exist in List.") | |
19 | + | else if ((size(i.payments) != 2)) | |
20 | + | then throw("Two attached assets expected as payment. Kindly Attach payment1 = WAVES Token & payment2 = Token you want to List.") | |
21 | + | else if (isDefined(pmt1.assetId)) | |
22 | + | then throw("Incorrect asset attached for Collateral, please attach WAVES only.") | |
23 | + | else if ((pmt1.amount != 1000000000)) | |
24 | + | then throw((((("You attached only " + toString(fraction(pmt1.amount, 1, 100000000))) + ".") + toString(fraction(pmt1.amount, 1, 10000000))) + " WAVES for Listing in payment[1], please attach 10 WAVES.")) | |
25 | + | else if ((pmt2.assetId != assetinfopmt2)) | |
26 | + | then throw("Input String & Attached AssetID in payment2 is not matching.") | |
27 | + | else if ((WAVES == true)) | |
28 | + | then throw("You Attached WAVES Asset ID for Listing, please attach Tokens You want to list in payment[2].") | |
29 | + | else [StringEntry(("Pair_UV_" + EnterAssetID), EnterAssetID), IntegerEntry(("Listing_Fee_" + EnterAssetID), pmt1.amount), ScriptTransfer(CollectFeeAddress, pmt1.amount, unit), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), 0), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), 0), IntegerEntry(("Total_of_Pair_Txns_" + EnterAssetID), 0), IntegerEntry(((("Total_Swap_Fee_Collected_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), 0), IntegerEntry(("Total_Swap_Fee_Collected_" + EnterAssetID), 0)] | |
30 | + | } | |
31 | + | ||
4 | 32 | ||
5 | 33 | ||
6 | 34 | @Callable(i) | |
7 | - | func RegisterPairForVoting (assetId) = { | |
8 | - | let readassetinfo = assetInfo(fromBase58String(assetId)) | |
35 | + | func IssueLPToken (EnterAssetID) = { | |
36 | + | let adminrights = valueOrErrorMessage(getString(this, "LP_Admin_Rights"), "LP Admin Rights are Not Included into Smart Contract. Deploy Admin Rights First.") | |
37 | + | let calleraddress = toBase58String(i.caller.bytes) | |
38 | + | let checkpairisavailableornot = valueOrErrorMessage(getString(this, ("Pair_UV_" + EnterAssetID)), "Asset not Found in Whitelisted Token") | |
39 | + | let info = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
40 | + | let name = info.name | |
41 | + | let decimals = info.decimals | |
42 | + | let FirstLPQty = (1 * pow(10, 0, fraction((decimals + 6), 1, 2), 0, 0, CEILING)) | |
43 | + | let LPissue = Issue((("LP-" + take(name, 8)) + "-USDC"), (((("LP-" + name) + "-USDC") + " is a Liquidity Provider Token Issued Against ") + EnterAssetID), FirstLPQty, fraction((decimals + 6), 1, 2), true) | |
44 | + | let LPid = calculateAssetId(LPissue) | |
45 | + | if ((adminrights != calleraddress)) | |
46 | + | then throw((("Your are not allowded to Issue LP Token. Only " + adminrights) + " can issue the LP Token.")) | |
47 | + | else if ((checkpairisavailableornot != EnterAssetID)) | |
48 | + | then throw("Pair is not available in List.") | |
49 | + | else [LPissue, StringEntry(("LP_" + EnterAssetID), toBase58String(LPid)), IntegerEntry(("Total_LP_" + EnterAssetID), FirstLPQty)] | |
50 | + | } | |
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | @Callable(i) | |
55 | + | func SwapAssetToUSDCPairEntry (EnterAssetID) = { | |
56 | + | let calleraddress = toBase58String(i.caller.bytes) | |
57 | + | let pmt = if ((size(i.payments) == 1)) | |
58 | + | then i.payments[0] | |
59 | + | else throw("Whitelisted Token is required as Attached payment[1].") | |
60 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
61 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
62 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
63 | + | let newbalanceofUSDC = fraction(CheckUSDCBalance, CheckAssetBalance, (CheckAssetBalance + pmt.amount)) | |
64 | + | let quantityofpriceasset = (CheckUSDCBalance - newbalanceofUSDC) | |
65 | + | let SwapFee = 3 | |
66 | + | let SwapFeetoreceive = ((quantityofpriceasset * SwapFee) / 1000) | |
67 | + | let userbalancetoreceive = ((quantityofpriceasset - SwapFeetoreceive) - SwapFeetoreceive) | |
68 | + | let SumupofAssetToUSDCSwapFee = match getInteger(this, ((("Total_Swap_Fee_Collected_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
69 | + | case a: Int => | |
70 | + | a | |
71 | + | case _ => | |
72 | + | 0 | |
73 | + | } | |
74 | + | let NewSumupofAssetToUSDCSwapFee = ((SumupofAssetToUSDCSwapFee + SwapFeetoreceive) + SwapFeetoreceive) | |
75 | + | let SumupAssetBalance = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
76 | + | case a: Int => | |
77 | + | a | |
78 | + | case _ => | |
79 | + | 0 | |
80 | + | } | |
81 | + | let NewSumupofAssetBalance = (CheckAssetBalance + pmt.amount) | |
82 | + | let SumupUSDCBalance = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
83 | + | case a: Int => | |
84 | + | a | |
85 | + | case _ => | |
86 | + | 0 | |
87 | + | } | |
88 | + | let NewSumupofUSDCBalance = ((CheckUSDCBalance - quantityofpriceasset) + SwapFeetoreceive) | |
89 | + | let TOPT = match getIntegerValue(this, ("Total_of_Pair_Txns_" + EnterAssetID)) { | |
90 | + | case a: Int => | |
91 | + | a | |
92 | + | case _ => | |
93 | + | 0 | |
94 | + | } | |
95 | + | let NewTPT = (TOPT + 1) | |
96 | + | if ((EnterAssetID == toBase58String(USDCAssetID))) | |
97 | + | then throw("Input can Never be a USDC AssetID. Enter Whitelisted AssetID in input & Attach Whitelisted Asset as an attachment Token in payment[1].") | |
98 | + | else if ((checkpairisavailableornot != EnterAssetID)) | |
99 | + | then throw("Pair is not available in Whitelisted Asset.") | |
100 | + | else if ((pmt.assetId == USDCAssetID)) | |
101 | + | then throw("You can't Attach USDC as an Attached Payment. Only Whitelisted Tokens are accepted.") | |
102 | + | else if ((pmt.assetId != fromBase58String(EnterAssetID))) | |
103 | + | then throw(("Incorrect asset attached, please attach or send " + EnterAssetID)) | |
104 | + | else if ((CheckUSDCBalance == 0)) | |
105 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
106 | + | else if ((CheckAssetBalance == 0)) | |
107 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
108 | + | else if ((100000 > quantityofpriceasset)) | |
109 | + | then throw((("Your Attached Asset Amount is very low. Attach More " + EnterAssetID) + " Tokens to Claim the minimum Amount of 0.1 dollar atleast.")) | |
110 | + | else if ((quantityofpriceasset > CheckUSDCBalance)) | |
111 | + | then throw((("Pool Only has a Liquidity of " + toString((CheckUSDCBalance / pow(10, 0, 6, 0, 0, CEILING)))) + " USDC. Add Liquidity into Pool.")) | |
112 | + | else [IntegerEntry(((("Total_Swap_Fee_Collected_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewSumupofAssetToUSDCSwapFee), IntegerEntry(("Total_of_Pair_Txns_" + EnterAssetID), NewTPT), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewSumupofAssetBalance), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewSumupofUSDCBalance), ScriptTransfer(i.caller, userbalancetoreceive, USDCAssetID), ScriptTransfer(CollectFeeAddress, SwapFeetoreceive, USDCAssetID)] | |
113 | + | } | |
114 | + | ||
115 | + | ||
116 | + | ||
117 | + | @Callable(i) | |
118 | + | func SwapUSDCToAssetPairEntry (EnterAssetID) = { | |
119 | + | let calleraddress = toBase58String(i.caller.bytes) | |
120 | + | let pmt = if ((size(i.payments) == 1)) | |
121 | + | then i.payments[0] | |
122 | + | else throw((("Only " + toBase58String(USDCAssetID)) + " USDC Token is required as an Attached payment[1].")) | |
123 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
124 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
125 | + | let newbalanceofAsset = fraction(CheckUSDCBalance, CheckAssetBalance, (CheckUSDCBalance + pmt.amount)) | |
126 | + | let quantityofpriceasset = (CheckAssetBalance - newbalanceofAsset) | |
127 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
128 | + | let SwapFee = 3 | |
129 | + | let SwapFeetoreceive = ((quantityofpriceasset * SwapFee) / 1000) | |
130 | + | let userbalancetoreceive = ((quantityofpriceasset - SwapFeetoreceive) - SwapFeetoreceive) | |
131 | + | let SumupofUSDCToAssetSwapFee = match getInteger(this, ("Total_Swap_Fee_Collected_" + EnterAssetID)) { | |
132 | + | case a: Int => | |
133 | + | a | |
134 | + | case _ => | |
135 | + | 0 | |
136 | + | } | |
137 | + | let NewSumupofUSDCToAssetSwapFee = ((SumupofUSDCToAssetSwapFee + SwapFeetoreceive) + SwapFeetoreceive) | |
138 | + | let SumupAssetBalance = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
139 | + | case a: Int => | |
140 | + | a | |
141 | + | case _ => | |
142 | + | 0 | |
143 | + | } | |
144 | + | let NewSumupofAssetBalance = ((CheckAssetBalance - quantityofpriceasset) + SwapFeetoreceive) | |
145 | + | let SumupUSDCBalance = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
146 | + | case a: Int => | |
147 | + | a | |
148 | + | case _ => | |
149 | + | 0 | |
150 | + | } | |
151 | + | let NewSumupofUSDCBalance = (CheckUSDCBalance + pmt.amount) | |
152 | + | let TOPT = match getIntegerValue(this, ("Total_of_Pair_Txns_" + EnterAssetID)) { | |
153 | + | case a: Int => | |
154 | + | a | |
155 | + | case _ => | |
156 | + | 0 | |
157 | + | } | |
158 | + | let NewTPT = (TOPT + 1) | |
159 | + | if ((checkpairisavailableornot != EnterAssetID)) | |
160 | + | then throw("Pair is not available in Whitelisted Asset.") | |
161 | + | else if ((EnterAssetID == toBase58String(USDCAssetID))) | |
162 | + | then throw("Input can Never be a USDC AssetID. Enter Whitelisted AssetID in input & Attach USDC as an attachment Token in payment[1].") | |
163 | + | else if ((pmt.assetId != USDCAssetID)) | |
164 | + | then throw("You can Attach USDC as an Attached Payment[1] to Swap USDC To Required Token. Any other asset else than USDC will be rejected.") | |
165 | + | else if ((100000 > pmt.amount)) | |
166 | + | then throw("Your Attached USDC Amount is very low. Attach Atleast 0.1 USDC to Claim the minimum Tokens.") | |
167 | + | else if ((CheckUSDCBalance == 0)) | |
168 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
169 | + | else if ((CheckAssetBalance == 0)) | |
170 | + | then throw("Swap Pair Need to Add Liquidity first into Pool. Only After that Pair will be activated for Swapping.") | |
171 | + | else if ((quantityofpriceasset > CheckAssetBalance)) | |
172 | + | then throw((("Pool Only has a Liquidity of " + toString(CheckAssetBalance)) + " Tokens. Add Liquidity into Pool.")) | |
173 | + | else [IntegerEntry(("Total_Swap_Fee_Collected_" + EnterAssetID), NewSumupofUSDCToAssetSwapFee), IntegerEntry(("Total_of_Pair_Txns_" + EnterAssetID), NewTPT), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewSumupofAssetBalance), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewSumupofUSDCBalance), ScriptTransfer(i.caller, userbalancetoreceive, fromBase58String(EnterAssetID)), ScriptTransfer(CollectFeeAddress, SwapFeetoreceive, fromBase58String(EnterAssetID))] | |
174 | + | } | |
175 | + | ||
176 | + | ||
177 | + | ||
178 | + | @Callable(i) | |
179 | + | func AddLiquidity (EnterAssetID) = { | |
180 | + | let calleraddress = toBase58String(i.caller.bytes) | |
9 | 181 | let pmt1 = value(i.payments[0]) | |
10 | - | let currentKey = toBase58String(i.caller.bytes) | |
11 | - | let fetchpair = getString(this, ("Pair_UV_" + assetId)) | |
12 | - | let assetinfopmt2 = fromBase58String(assetId) | |
13 | - | if ((fetchpair == assetId)) | |
14 | - | then throw("Pair Already Exist in Voting List.") | |
15 | - | else [StringEntry(("Pair_UV_" + assetId), assetId)] | |
182 | + | let pmt2 = value(i.payments[1]) | |
183 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
184 | + | let ReissueassetId = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + EnterAssetID)), "LP Token is Missing or May be not Generated.")) | |
185 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
186 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
187 | + | let decimalsinfo = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
188 | + | let decimals = decimalsinfo.decimals | |
189 | + | let arg1 = CheckUSDCBalance | |
190 | + | let arg2 = CheckAssetBalance | |
191 | + | let args3 = pow((((arg1 * 1000000) / arg2) * pow(10, 0, decimals, 0, 0, CEILING)), 0, 1, 0, 0, CEILING) | |
192 | + | let bothassetsdecimals = (6 + decimals) | |
193 | + | let sharedecimals = (bothassetsdecimals / 2) | |
194 | + | let quantityofEnterAssetID = fraction(args3, pmt1.amount, pow(10, 0, bothassetsdecimals, 0, 0, CEILING)) | |
195 | + | let quantityofLPToken1 = pow((fraction(pmt1.amount, 1, pow(10, 0, decimals, 0, 0, CEILING)) * fraction(pmt2.amount, 1, pow(10, 0, 6, 0, 0, CEILING))), 0, 5, 1, sharedecimals, DOWN) | |
196 | + | let USDCHoldingInPair = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
197 | + | case a: Int => | |
198 | + | a | |
199 | + | case _ => | |
200 | + | 0 | |
201 | + | } | |
202 | + | let NewUSDCHoldingInPair = (USDCHoldingInPair + pmt2.amount) | |
203 | + | let AssetHoldingInPair = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
204 | + | case a: Int => | |
205 | + | a | |
206 | + | case _ => | |
207 | + | 0 | |
208 | + | } | |
209 | + | let NewAssetHoldingInPair = (AssetHoldingInPair + pmt1.amount) | |
210 | + | let LPTokenIssued = match getIntegerValue(this, ("Total_LP_" + EnterAssetID)) { | |
211 | + | case a: Int => | |
212 | + | a | |
213 | + | case _ => | |
214 | + | 0 | |
215 | + | } | |
216 | + | let NewLPTokenIssued = (LPTokenIssued + quantityofLPToken1) | |
217 | + | if ((checkpairisavailableornot != EnterAssetID)) | |
218 | + | then throw("Pair is not available in Whitelisted Asset.") | |
219 | + | else if ((EnterAssetID == toBase58String(USDCAssetID))) | |
220 | + | 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].") | |
221 | + | else if ((size(i.payments) != 2)) | |
222 | + | 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.") | |
223 | + | else if ((pmt1.assetId == USDCAssetID)) | |
224 | + | then throw("You Attached USDC asset in payment[1], please attach only whitelisted Token in payment[1] along with USDC in payment[2].") | |
225 | + | else if ((pmt1.assetId != fromBase58String(EnterAssetID))) | |
226 | + | then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.") | |
227 | + | else if ((pmt1.assetId != fromBase58String(EnterAssetID))) | |
228 | + | then throw("Incorrect asset attached for Liquidity in payment[1], please attach String Asset or Whitelisted Token only.") | |
229 | + | else if ((pmt2.assetId != USDCAssetID)) | |
230 | + | then throw("Wrong Asset Attached in payments[2], Please attach payment[1] = Liquidity Token & payment[2] = USDC Token.") | |
231 | + | else if ((5000000 > pmt2.amount)) | |
232 | + | then throw("please attach atleast 5 USDC in payment[2] & Equivalent worth of Token in payment[1]") | |
233 | + | else if ((pmt2.amount != quantityofEnterAssetID)) | |
234 | + | then throw((((((("Attached payment[2] qty is not matching as per attached payment[1].payment[2] must be as int [" + toString(quantityofEnterAssetID)) + "] or ") + toString(fraction(quantityofEnterAssetID, 1, 1000000))) + ".") + takeRight(toString(quantityofEnterAssetID), 6)) + " USDC.")) | |
235 | + | else if ((1 > quantityofLPToken1)) | |
236 | + | then throw((("LP Token Outcome is going below " + toString(sharedecimals)) + " Decimals. Please Attach min. 1 LP token or 5 USDC Atleast.")) | |
237 | + | else [IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewUSDCHoldingInPair), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewAssetHoldingInPair), IntegerEntry(("Total_LP_" + EnterAssetID), NewLPTokenIssued), Reissue(ReissueassetId, quantityofLPToken1, true), ScriptTransfer(i.caller, quantityofLPToken1, ReissueassetId)] | |
238 | + | } | |
239 | + | ||
240 | + | ||
241 | + | ||
242 | + | @Callable(i) | |
243 | + | func RemoveLiquidity (EnterAssetID) = { | |
244 | + | let calleraddress = toBase58String(i.caller.bytes) | |
245 | + | let pmt = if ((size(i.payments) == 1)) | |
246 | + | then i.payments[0] | |
247 | + | else throw("No payment attached, Please Attach LP Token as payment[1].") | |
248 | + | let checkpairisavailableornot = getString(this, ("Pair_UV_" + EnterAssetID)) | |
249 | + | let ReissueableassetId = fromBase58String(valueOrErrorMessage(getString(this, ("LP_" + EnterAssetID)), "LP Token is Missing or not Generated.")) | |
250 | + | let decimalsinfo = valueOrErrorMessage(assetInfo(fromBase58String(EnterAssetID)), (("Asset " + EnterAssetID) + " doesn't exist")) | |
251 | + | let decimals = decimalsinfo.decimals | |
252 | + | let bothassetsdecimals = (6 + decimals) | |
253 | + | let sharedecimals = (bothassetsdecimals / 2) | |
254 | + | let CheckTotalLPAmount = getIntegerValue(this, ("Total_LP_" + EnterAssetID)) | |
255 | + | let UserLPPercentage = pow(fraction(pmt.amount, pow(10, 0, 8, 0, 0, CEILING), CheckTotalLPAmount), 6, 1, 0, 6, CEILING) | |
256 | + | let CheckUSDCBalance = getIntegerValue(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) | |
257 | + | let CheckAssetBalance = getIntegerValue(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) | |
258 | + | let UserLPWorthUSDC = fraction(CheckUSDCBalance, UserLPPercentage, pow(10, 0, 8, 0, 0, CEILING)) | |
259 | + | let UserLPWorthAsset = fraction(CheckAssetBalance, UserLPPercentage, pow(10, 0, 8, 0, 0, CEILING)) | |
260 | + | let USDCHoldingInPair = match getInteger(this, ((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID))) { | |
261 | + | case a: Int => | |
262 | + | a | |
263 | + | case _ => | |
264 | + | 0 | |
265 | + | } | |
266 | + | let NewUSDCHoldingInPair = (USDCHoldingInPair - UserLPWorthUSDC) | |
267 | + | let AssetHoldingInPair = match getInteger(this, ((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID)) { | |
268 | + | case a: Int => | |
269 | + | a | |
270 | + | case _ => | |
271 | + | 0 | |
272 | + | } | |
273 | + | let NewAssetHoldingInPair = (AssetHoldingInPair - UserLPWorthAsset) | |
274 | + | let LPTokenIssued = match getIntegerValue(this, ("Total_LP_" + EnterAssetID)) { | |
275 | + | case a: Int => | |
276 | + | a | |
277 | + | case _ => | |
278 | + | 0 | |
279 | + | } | |
280 | + | let NewLPTokenIssued = (LPTokenIssued - pmt.amount) | |
281 | + | if ((checkpairisavailableornot != EnterAssetID)) | |
282 | + | then throw("Pair is not available in Whitelist.") | |
283 | + | else if ((fromBase58String(EnterAssetID) == USDCAssetID)) | |
284 | + | then throw("Don't choose USDC AssetID as Input, Only Whitelisted Asset as Input String & Attach LP Tokens as payment[1]") | |
285 | + | else if ((pmt.assetId != ReissueableassetId)) | |
286 | + | then throw("Wrong Asset is attached in payment[1] or LP Token Not Found or Missing.") | |
287 | + | else if ((1 > UserLPPercentage)) | |
288 | + | then throw("Your LP Token amount % is very low to convert.") | |
289 | + | else if ((1 > UserLPWorthUSDC)) | |
290 | + | then throw("Your LP Token conversion amount is very low to convert or less than 0.000001 USDC.") | |
291 | + | else if ((1 > UserLPWorthAsset)) | |
292 | + | then throw("Your LP Token conversion amount is very low to convert or less than fraction value of Token.") | |
293 | + | else [IntegerEntry("Withdraw_LP_Percentage", UserLPPercentage), Burn(ReissueableassetId, pmt.amount), IntegerEntry(("Total_LP_" + EnterAssetID), NewLPTokenIssued), IntegerEntry(((("Balance_of_" + EnterAssetID) + "_") + toBase58String(USDCAssetID)), NewUSDCHoldingInPair), IntegerEntry(((("Balance_of_" + toBase58String(USDCAssetID)) + "_") + EnterAssetID), NewAssetHoldingInPair), ScriptTransfer(i.caller, UserLPWorthUSDC, USDCAssetID), ScriptTransfer(i.caller, UserLPWorthAsset, fromBase58String(EnterAssetID))] | |
16 | 294 | } | |
17 | 295 | ||
18 | 296 | ||
19 | 297 | @Verifier(tx) | |
20 | 298 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
21 | 299 |
github/deemru/w8io/169f3d6 55.61 ms ◑