tx · FsR1iZ5pZbsyxTFg64goC18kaYLdQPbmAoxqbdWZCfwW

3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY:  -0.01800000 Waves

2022.06.16 22:56 [2099376] smart account 3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY > SELF 0.00000000 Waves

{ "type": 13, "id": "FsR1iZ5pZbsyxTFg64goC18kaYLdQPbmAoxqbdWZCfwW", "fee": 1800000, "feeAssetId": null, "timestamp": 1655409365374, "version": 2, "chainId": 84, "sender": "3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY", "senderPublicKey": "fFTt4dRQEMWmxs9cA5He1tph3gmQLAM4cnpj6eqkWPR", "proofs": [ "2Xpos3LEXf9r96gyzbroNuoLjd9YYhdDKvAAkEMJDbDsugziQEJgJ9y7s31QGnHDdFPW3YaXCD65kEV5nbeBvUUK" ], "script": "base64:AAIFAAAAAAAAADYIAhIKCggICAgICAQBARIDCgEEEgUKAwQEBBIDCgEBEgMKAQQSAwoBARIAEgMKAQESBAoCCAgAAAAfAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAA2FhMQIAAAAGcG9vbF9fAAAAAAJzYQIAAAAPU1RBS0lOR19BTU9VTlRfAAAAAAJsYQIAAAANTEVBU0VfQU1PVU5UXwAAAAACaXgCAAAAA0lEXwAAAAAHcmF0ZUZlZQIAAAATcGVyY2VudGFnZV9yYXRlX2ZlZQAAAAAOZGVwb3NpdF9oZWlnaHQCAAAAEkRlcG9zaXRfSGVpZ2h0X09mXwAAAAACRDgAAAAAAAX14QAAAAAAAkQ2AAAAAAAAD0JAAAAAAA9jb250cmFjdEFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQgFAAAABHRoaXMAAAAFYnl0ZXMAAAAADGV4Y2hhbmdlUmF0ZQAAAAAAAAAABQEAAAARZ2V0QWRkcmVzc0lmVmFsaWQAAAABAAAAB2FkZHJlc3MJAAQlAAAAAQkBAAAAE3ZhbHVlT3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EFAAAABkFzc2V0MgUAAAAGQXNzZXQxBAAAAAphc3NldDJwb29sCQEAAAAGYXNzZXRQAAAAAgkBAAAAAmtwAAAAAgUAAAAGQXNzZXQxBQAAAAZBc3NldDIFAAAABkFzc2V0MgQAAAAGcEJsb2NrCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAABHBrZXkAAAADBQAAAAZBc3NldDEFAAAABkFzc2V0MgUAAAAKY3VycmVudEtleQUAAAAGaGVpZ2h0BAAAABBuZXdDdXJyZW50QW1vdW50BQAAAA1jdXJyZW50QW1vdW50AwMJAAAAAAAAAgUAAAAKYXNzZXQxcG9vbAAAAAAAAAAAAAYJAAAAAAAAAgUAAAAKYXNzZXQycG9vbAAAAAAAAAAAAAUAAAADbmlsBQAAAANuaWwJAAACAAAAAQIAAAARSW52YWxpZCBQb29sIEtleS4JAAACAAAAAQIAAAAZSW52YWxpZCBBc3NldDEgb3IgQXNzZXQyIQkAAAIAAAABAgAAACBBc3NldDEgY2Fubm90IGJlIGVxdWFsIHRvIEFzc2V0MgkAAAIAAAABAgAAAClsaXF1aWRpdHkgaXMgY3VycmVudGx5IHVuZGVyIG1haW50ZW5hbmNlLgkAAAIAAAABAgAAACRkQXBwIGlzIGN1cnJlbnRseSB1bmRlciBtYWludGVuYW5jZS4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlDfk2j", "height": 2099376, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Cy7ZrS3p7AGqfU3AGLLSLABV8QEvD1Mm4mKgv8eVEW7 Next: DxBZe1CnTKFKE86xM3btgvdpcnnXkua1WySFoPZ3oASj Diff:
OldNewDifferences
55
66 let l = "lp_asset_"
77
8-let a1 = "swap_asset1_"
9-
10-let st = "address_staker_"
11-
12-let sst = "address_pool_"
13-
14-let swp = "address_swap_"
15-
16-let a2 = "swap_asset2_"
17-
18-let aa1 = "pool_1_"
19-
20-let aa2 = "pool_2_"
21-
22-let st1 = "staker_address"
23-
24-let type = "type_"
8+let aa1 = "pool__"
259
2610 let sa = "STAKING_AMOUNT_"
2711
3014 let ix = "ID_"
3115
3216 let rateFee = "percentage_rate_fee"
17+
18+let deposit_height = "Deposit_Height_Of_"
3319
3420 let D8 = 100000000
3521
5541
5642 let bcD = "block_distribuition"
5743
44+let total_locked = "Total_Tokens_Locked_"
45+
5846 let usdn = "usdn_asset"
5947
6048 let usdt = "usdt_asset"
6553
6654 let aWaves = "accept_waves"
6755
56+func kp (asset1,asset2) = (((aa1 + asset1) + "_") + asset2)
57+
58+
59+func validPoolK (key) = valueOrElse(getInteger(this, key), 0)
60+
61+
62+func kpAddress (address,key) = valueOrElse(getIntegerValue(this, ((key + "_") + address)), 0)
63+
64+
65+func poolAA (address,key,asset) = valueOrElse(getIntegerValue(this, ((((key + "_") + address) + "_") + asset)), 0)
66+
67+
68+func assetP (key,asset) = valueOrElse(getIntegerValue(this, ((key + "_") + asset)), 0)
69+
70+
71+func pkey (Asset1,Asset2,address) = (((deposit_height + kp(Asset1, Asset2)) + "_") + address)
72+
73+
6874 @Callable(i)
6975 func constructor (MainAssetId,UsdnAssetId,UsdtAssetId,UsdcAssetId,NgnnAssetId,acceptWaves,percentageRate,blockDistribution) = if ((i.caller == this))
70- then [StringEntry(main, MainAssetId), StringEntry(usdn, UsdnAssetId), StringEntry(usdc, UsdcAssetId), StringEntry(usdt, UsdtAssetId), StringEntry(ngnn, NgnnAssetId), BooleanEntry(aWaves, acceptWaves), IntegerEntry(rateFee, percentageRate), BooleanEntry(ac, true), BooleanEntry(swapAc, false), BooleanEntry(poolAc, false), BooleanEntry(liquidityAc, false), IntegerEntry(bcD, blockDistribution)]
76+ then {
77+ let keyPoolUsdnUsdt = kp(UsdnAssetId, UsdtAssetId)
78+ let keyPoolUsdnUsdc = kp(UsdnAssetId, UsdcAssetId)
79+ let keyPoolUsdnNgnn = kp(UsdnAssetId, NgnnAssetId)
80+ let keyPoolUsdnWaves = kp(UsdnAssetId, "WAVES")
81+ let keyPoolUsdnMainAsset = kp(UsdnAssetId, MainAssetId)
82+ let keyPoolUsdcUsdt = kp(UsdcAssetId, UsdtAssetId)
83+ let keyPoolUsdcNgnn = kp(UsdcAssetId, NgnnAssetId)
84+ let keyPoolUsdcWaves = kp(UsdcAssetId, "WAVES")
85+ let keyPoolUsdcMainAsset = kp(UsdcAssetId, MainAssetId)
86+ let keyPoolUsdtNgnn = kp(UsdtAssetId, NgnnAssetId)
87+ let keyPoolUsdtWaves = kp(UsdtAssetId, "WAVES")
88+ let keyPoolUsdtMainAsset = kp(UsdtAssetId, MainAssetId)
89+ let keyPoolNgnnWaves = kp(NgnnAssetId, "WAVES")
90+ let keyPoolNgnnMainAsset = kp(NgnnAssetId, MainAssetId)
91+ let keyPoolMainWaves = kp(MainAssetId, "WAVES")
92+[StringEntry(main, MainAssetId), StringEntry(usdn, UsdnAssetId), StringEntry(usdc, UsdcAssetId), StringEntry(usdt, UsdtAssetId), StringEntry(ngnn, NgnnAssetId), BooleanEntry(aWaves, acceptWaves), IntegerEntry(rateFee, percentageRate), BooleanEntry(ac, true), BooleanEntry(swapAc, false), BooleanEntry(poolAc, false), BooleanEntry(liquidityAc, false), IntegerEntry(bcD, blockDistribution), IntegerEntry(keyPoolUsdnUsdt, 0), IntegerEntry(keyPoolUsdnWaves, 0), IntegerEntry(keyPoolUsdnUsdc, 0), IntegerEntry(keyPoolUsdnNgnn, 0), IntegerEntry(keyPoolUsdnMainAsset, 0), IntegerEntry(keyPoolUsdcUsdt, 0), IntegerEntry(keyPoolUsdcNgnn, 0), IntegerEntry(keyPoolUsdcWaves, 0), IntegerEntry(keyPoolUsdtMainAsset, 0), IntegerEntry(keyPoolUsdtNgnn, 0), IntegerEntry(keyPoolUsdtWaves, 0), IntegerEntry(keyPoolUsdtMainAsset, 0), IntegerEntry(keyPoolNgnnWaves, 0), IntegerEntry(keyPoolNgnnMainAsset, 0), IntegerEntry(keyPoolMainWaves, 0)]
93+ }
7194 else throw("Only the Admin itself can invoke this function")
7295
7396
128151 }
129152 let newAmount = (currentAmount + pmt.amount)
130153 let useramount = IntegerEntry(currentKey, newAmount)
131- let userdepositheight = IntegerEntry(("Deposit_Height_Of_" + currentKey), height)
154+ let userdepositheight = IntegerEntry((deposit_height + currentKey), height)
132155 let previouslockbalance = match getInteger(this, "Total_Tokens_Locked:") {
133156 case a: Int =>
134157 a
157180 then {
158181 let currentKey = toBase58String(i.caller.bytes)
159182 let currentAmount = valueOrElse(getInteger(this, currentKey), 0)
160- let swapheightkeyname = ("Deposit_Height_Of_" + currentKey)
183+ let swapheightkeyname = (deposit_height + currentKey)
161184 let previouslockbalance = getIntegerValue(this, "Total_Tokens_Locked:")
162185 let totaltoken = (previouslockbalance - amount)
163186 let diff = (height - getIntegerValue(this, swapheightkeyname))
178201 }
179202
180203
204+
205+@Callable(i)
206+func addLiquidity (Asset1,Asset2) = {
207+ let power = getBooleanValue(this, ac)
208+ let poolActivate = getBooleanValue(this, poolAc)
209+ let acWaves = getBooleanValue(this, aWaves)
210+ let key = validPoolK(kp(Asset1, Asset2))
211+ let asset1 = i.payments[0].assetId
212+ let asset2 = i.payments[1].assetId
213+ let USDN = toBytes(getStringValue(this, usdn))
214+ let USDC = toBytes(getStringValue(this, usdc))
215+ let USDT = toBytes(getStringValue(this, usdt))
216+ let NGNN = toBytes(getStringValue(this, ngnn))
217+ let MainAsset = fromBase58String(getStringValue(this, main))
218+ if (power)
219+ then if (!(poolActivate))
220+ then if (if (if (!((asset1 == asset2)))
221+ then (asset1 == fromBase58String(Asset1))
222+ else false)
223+ then (asset2 == fromBase58String(Asset2))
224+ else false)
225+ then if (if (if (if (if (if (if (if (if (if ((asset1 == USDN))
226+ then true
227+ else (asset1 == USDC))
228+ then true
229+ else (asset1 == USDT))
230+ then true
231+ else (asset1 == NGNN))
232+ then true
233+ else (asset1 == MainAsset))
234+ then true
235+ else (asset2 == USDN))
236+ then true
237+ else (asset2 == USDC))
238+ then true
239+ else (asset2 == USDT))
240+ then true
241+ else (asset2 == NGNN))
242+ then true
243+ else (asset2 == MainAsset))
244+ then if (!((key == 0)))
245+ then {
246+ let currentKey = toBase58String(i.caller.bytes)
247+ let currentAmount = kpAddress(currentKey, kp(Asset1, Asset2))
248+ let currentAmountAsset1 = poolAA(currentKey, kp(Asset1, Asset2), Asset1)
249+ let currentAmountAsset2 = poolAA(currentKey, kp(Asset1, Asset2), Asset2)
250+ let asset1pool = assetP(kp(Asset1, Asset2), Asset1)
251+ let asset2pool = assetP(kp(Asset1, Asset2), Asset2)
252+ let pBlock = IntegerEntry(pkey(Asset1, Asset2, currentKey), height)
253+ let newCurrentAmount = currentAmount
254+ if (if ((asset1pool == 0))
255+ then true
256+ else (asset2pool == 0))
257+ then nil
258+ else nil
259+ }
260+ else throw("Invalid Pool Key.")
261+ else throw("Invalid Asset1 or Asset2!")
262+ else throw("Asset1 cannot be equal to Asset2")
263+ else throw("liquidity is currently under maintenance.")
264+ else throw("dApp is currently under maintenance.")
265+ }
266+
267+
181268 @Verifier(tx)
182269 func verify () = match tx {
183270 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let main = "main_asset"
55
66 let l = "lp_asset_"
77
8-let a1 = "swap_asset1_"
9-
10-let st = "address_staker_"
11-
12-let sst = "address_pool_"
13-
14-let swp = "address_swap_"
15-
16-let a2 = "swap_asset2_"
17-
18-let aa1 = "pool_1_"
19-
20-let aa2 = "pool_2_"
21-
22-let st1 = "staker_address"
23-
24-let type = "type_"
8+let aa1 = "pool__"
259
2610 let sa = "STAKING_AMOUNT_"
2711
2812 let la = "LEASE_AMOUNT_"
2913
3014 let ix = "ID_"
3115
3216 let rateFee = "percentage_rate_fee"
17+
18+let deposit_height = "Deposit_Height_Of_"
3319
3420 let D8 = 100000000
3521
3622 let D6 = 1000000
3723
3824 let contractAddress = Address(this.bytes)
3925
4026 let exchangeRate = 5
4127
4228 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse " + address) + " as address")))
4329
4430
4531 func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
4632
4733
4834 let ac = "activate"
4935
5036 let poolAc = "activate_pools"
5137
5238 let swapAc = "activate_swap"
5339
5440 let liquidityAc = "activate_liquidity"
5541
5642 let bcD = "block_distribuition"
5743
44+let total_locked = "Total_Tokens_Locked_"
45+
5846 let usdn = "usdn_asset"
5947
6048 let usdt = "usdt_asset"
6149
6250 let usdc = "usdc_asset"
6351
6452 let ngnn = "ngnn_asset"
6553
6654 let aWaves = "accept_waves"
6755
56+func kp (asset1,asset2) = (((aa1 + asset1) + "_") + asset2)
57+
58+
59+func validPoolK (key) = valueOrElse(getInteger(this, key), 0)
60+
61+
62+func kpAddress (address,key) = valueOrElse(getIntegerValue(this, ((key + "_") + address)), 0)
63+
64+
65+func poolAA (address,key,asset) = valueOrElse(getIntegerValue(this, ((((key + "_") + address) + "_") + asset)), 0)
66+
67+
68+func assetP (key,asset) = valueOrElse(getIntegerValue(this, ((key + "_") + asset)), 0)
69+
70+
71+func pkey (Asset1,Asset2,address) = (((deposit_height + kp(Asset1, Asset2)) + "_") + address)
72+
73+
6874 @Callable(i)
6975 func constructor (MainAssetId,UsdnAssetId,UsdtAssetId,UsdcAssetId,NgnnAssetId,acceptWaves,percentageRate,blockDistribution) = if ((i.caller == this))
70- then [StringEntry(main, MainAssetId), StringEntry(usdn, UsdnAssetId), StringEntry(usdc, UsdcAssetId), StringEntry(usdt, UsdtAssetId), StringEntry(ngnn, NgnnAssetId), BooleanEntry(aWaves, acceptWaves), IntegerEntry(rateFee, percentageRate), BooleanEntry(ac, true), BooleanEntry(swapAc, false), BooleanEntry(poolAc, false), BooleanEntry(liquidityAc, false), IntegerEntry(bcD, blockDistribution)]
76+ then {
77+ let keyPoolUsdnUsdt = kp(UsdnAssetId, UsdtAssetId)
78+ let keyPoolUsdnUsdc = kp(UsdnAssetId, UsdcAssetId)
79+ let keyPoolUsdnNgnn = kp(UsdnAssetId, NgnnAssetId)
80+ let keyPoolUsdnWaves = kp(UsdnAssetId, "WAVES")
81+ let keyPoolUsdnMainAsset = kp(UsdnAssetId, MainAssetId)
82+ let keyPoolUsdcUsdt = kp(UsdcAssetId, UsdtAssetId)
83+ let keyPoolUsdcNgnn = kp(UsdcAssetId, NgnnAssetId)
84+ let keyPoolUsdcWaves = kp(UsdcAssetId, "WAVES")
85+ let keyPoolUsdcMainAsset = kp(UsdcAssetId, MainAssetId)
86+ let keyPoolUsdtNgnn = kp(UsdtAssetId, NgnnAssetId)
87+ let keyPoolUsdtWaves = kp(UsdtAssetId, "WAVES")
88+ let keyPoolUsdtMainAsset = kp(UsdtAssetId, MainAssetId)
89+ let keyPoolNgnnWaves = kp(NgnnAssetId, "WAVES")
90+ let keyPoolNgnnMainAsset = kp(NgnnAssetId, MainAssetId)
91+ let keyPoolMainWaves = kp(MainAssetId, "WAVES")
92+[StringEntry(main, MainAssetId), StringEntry(usdn, UsdnAssetId), StringEntry(usdc, UsdcAssetId), StringEntry(usdt, UsdtAssetId), StringEntry(ngnn, NgnnAssetId), BooleanEntry(aWaves, acceptWaves), IntegerEntry(rateFee, percentageRate), BooleanEntry(ac, true), BooleanEntry(swapAc, false), BooleanEntry(poolAc, false), BooleanEntry(liquidityAc, false), IntegerEntry(bcD, blockDistribution), IntegerEntry(keyPoolUsdnUsdt, 0), IntegerEntry(keyPoolUsdnWaves, 0), IntegerEntry(keyPoolUsdnUsdc, 0), IntegerEntry(keyPoolUsdnNgnn, 0), IntegerEntry(keyPoolUsdnMainAsset, 0), IntegerEntry(keyPoolUsdcUsdt, 0), IntegerEntry(keyPoolUsdcNgnn, 0), IntegerEntry(keyPoolUsdcWaves, 0), IntegerEntry(keyPoolUsdtMainAsset, 0), IntegerEntry(keyPoolUsdtNgnn, 0), IntegerEntry(keyPoolUsdtWaves, 0), IntegerEntry(keyPoolUsdtMainAsset, 0), IntegerEntry(keyPoolNgnnWaves, 0), IntegerEntry(keyPoolNgnnMainAsset, 0), IntegerEntry(keyPoolMainWaves, 0)]
93+ }
7194 else throw("Only the Admin itself can invoke this function")
7295
7396
7497
7598 @Callable(i)
7699 func activate (v) = if ((i.caller == this))
77100 then [BooleanEntry(ac, v)]
78101 else throw("Only the Admin itself can invoke this function")
79102
80103
81104
82105 @Callable(i)
83106 func maintenance (pools,swap,stake) = if ((i.caller == this))
84107 then [BooleanEntry(poolAc, pools), BooleanEntry(swapAc, swap), BooleanEntry(liquidityAc, stake)]
85108 else throw("Only the Admin itself can invoke this function")
86109
87110
88111
89112 @Callable(i)
90113 func percentualRateFeeEdit (rate) = if ((i.caller == this))
91114 then [IntegerEntry(rateFee, rate)]
92115 else throw("Only the Admin itself can invoke this function")
93116
94117
95118
96119 @Callable(i)
97120 func acceptWaves (activate) = if ((i.caller == this))
98121 then [BooleanEntry(aWaves, activate)]
99122 else throw("Only the Admin itself can invoke this function")
100123
101124
102125
103126 @Callable(i)
104127 func blockDistribution (newValue) = if ((i.caller == this))
105128 then [IntegerEntry(bcD, newValue)]
106129 else throw("Only the Admin itself can invoke this function")
107130
108131
109132
110133 @Callable(i)
111134 func deposit () = {
112135 let power = getBooleanValue(this, ac)
113136 let liquidityPower = getBooleanValue(this, liquidityAc)
114137 let acWaves = getBooleanValue(this, aWaves)
115138 let pmt = i.payments[0]
116139 let MainAsset = fromBase58String(getStringValue(this, main))
117140 if (power)
118141 then if (!(liquidityPower))
119142 then if ((pmt.assetId != MainAsset))
120143 then throw(("Invalid Asset! Kindly Deposit Only " + toBase58String(MainAsset)))
121144 else {
122145 let currentKey = toBase58String(i.caller.bytes)
123146 let currentAmount = match getInteger(this, currentKey) {
124147 case a: Int =>
125148 a
126149 case _ =>
127150 0
128151 }
129152 let newAmount = (currentAmount + pmt.amount)
130153 let useramount = IntegerEntry(currentKey, newAmount)
131- let userdepositheight = IntegerEntry(("Deposit_Height_Of_" + currentKey), height)
154+ let userdepositheight = IntegerEntry((deposit_height + currentKey), height)
132155 let previouslockbalance = match getInteger(this, "Total_Tokens_Locked:") {
133156 case a: Int =>
134157 a
135158 case _ =>
136159 0
137160 }
138161 let totaltoken = (previouslockbalance + pmt.amount)
139162 let TLV = IntegerEntry("Total_Tokens_Locked:", totaltoken)
140163 [useramount, userdepositheight, TLV]
141164 }
142165 else throw("liquidity is currently under maintenance.")
143166 else throw("dApp is currently under maintenance.")
144167 }
145168
146169
147170
148171 @Callable(i)
149172 func remove (amount) = {
150173 let power = getBooleanValue(this, ac)
151174 let liquidityPower = getBooleanValue(this, liquidityAc)
152175 let acWaves = getBooleanValue(this, aWaves)
153176 let pmt = i.payments[0]
154177 let MainAsset = fromBase58String(getStringValue(this, main))
155178 if (power)
156179 then if (!(liquidityPower))
157180 then {
158181 let currentKey = toBase58String(i.caller.bytes)
159182 let currentAmount = valueOrElse(getInteger(this, currentKey), 0)
160- let swapheightkeyname = ("Deposit_Height_Of_" + currentKey)
183+ let swapheightkeyname = (deposit_height + currentKey)
161184 let previouslockbalance = getIntegerValue(this, "Total_Tokens_Locked:")
162185 let totaltoken = (previouslockbalance - amount)
163186 let diff = (height - getIntegerValue(this, swapheightkeyname))
164187 let bcd = getIntegerValue(this, bcD)
165188 let reward = ((diff * bcd) * D8)
166189 let feeCalc = (reward / (previouslockbalance / amount))
167190 if ((0 > amount))
168191 then throw("Can't withdraw negative AxAi amount")
169192 else {
170193 let newAmount = (currentAmount - amount)
171194 if ((0 > newAmount))
172195 then throw("Not enough AxAi balance")
173196 else [IntegerEntry(currentKey, newAmount), IntegerEntry("Total_Tokens_Locked:", totaltoken), ScriptTransfer(i.caller, amount, MainAsset), ScriptTransfer(i.caller, feeCalc, MainAsset)]
174197 }
175198 }
176199 else throw("liquidity is currently under maintenance.")
177200 else throw("dApp is currently under maintenance.")
178201 }
179202
180203
204+
205+@Callable(i)
206+func addLiquidity (Asset1,Asset2) = {
207+ let power = getBooleanValue(this, ac)
208+ let poolActivate = getBooleanValue(this, poolAc)
209+ let acWaves = getBooleanValue(this, aWaves)
210+ let key = validPoolK(kp(Asset1, Asset2))
211+ let asset1 = i.payments[0].assetId
212+ let asset2 = i.payments[1].assetId
213+ let USDN = toBytes(getStringValue(this, usdn))
214+ let USDC = toBytes(getStringValue(this, usdc))
215+ let USDT = toBytes(getStringValue(this, usdt))
216+ let NGNN = toBytes(getStringValue(this, ngnn))
217+ let MainAsset = fromBase58String(getStringValue(this, main))
218+ if (power)
219+ then if (!(poolActivate))
220+ then if (if (if (!((asset1 == asset2)))
221+ then (asset1 == fromBase58String(Asset1))
222+ else false)
223+ then (asset2 == fromBase58String(Asset2))
224+ else false)
225+ then if (if (if (if (if (if (if (if (if (if ((asset1 == USDN))
226+ then true
227+ else (asset1 == USDC))
228+ then true
229+ else (asset1 == USDT))
230+ then true
231+ else (asset1 == NGNN))
232+ then true
233+ else (asset1 == MainAsset))
234+ then true
235+ else (asset2 == USDN))
236+ then true
237+ else (asset2 == USDC))
238+ then true
239+ else (asset2 == USDT))
240+ then true
241+ else (asset2 == NGNN))
242+ then true
243+ else (asset2 == MainAsset))
244+ then if (!((key == 0)))
245+ then {
246+ let currentKey = toBase58String(i.caller.bytes)
247+ let currentAmount = kpAddress(currentKey, kp(Asset1, Asset2))
248+ let currentAmountAsset1 = poolAA(currentKey, kp(Asset1, Asset2), Asset1)
249+ let currentAmountAsset2 = poolAA(currentKey, kp(Asset1, Asset2), Asset2)
250+ let asset1pool = assetP(kp(Asset1, Asset2), Asset1)
251+ let asset2pool = assetP(kp(Asset1, Asset2), Asset2)
252+ let pBlock = IntegerEntry(pkey(Asset1, Asset2, currentKey), height)
253+ let newCurrentAmount = currentAmount
254+ if (if ((asset1pool == 0))
255+ then true
256+ else (asset2pool == 0))
257+ then nil
258+ else nil
259+ }
260+ else throw("Invalid Pool Key.")
261+ else throw("Invalid Asset1 or Asset2!")
262+ else throw("Asset1 cannot be equal to Asset2")
263+ else throw("liquidity is currently under maintenance.")
264+ else throw("dApp is currently under maintenance.")
265+ }
266+
267+
181268 @Verifier(tx)
182269 func verify () = match tx {
183270 case _ =>
184271 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
185272 }
186273

github/deemru/w8io/169f3d6 
39.16 ms