tx · DxBZe1CnTKFKE86xM3btgvdpcnnXkua1WySFoPZ3oASj

3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY:  -0.01600000 Waves

2022.06.18 03:02 [2101060] smart account 3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY > SELF 0.00000000 Waves

{ "type": 13, "id": "DxBZe1CnTKFKE86xM3btgvdpcnnXkua1WySFoPZ3oASj", "fee": 1600000, "feeAssetId": null, "timestamp": 1655510590360, "version": 2, "chainId": 84, "sender": "3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY", "senderPublicKey": "fFTt4dRQEMWmxs9cA5He1tph3gmQLAM4cnpj6eqkWPR", "proofs": [ "2pQqoYhYgPcJWPn87RDj2v3AK7E8GBxPB8HMGWD1mpvAt8czvWNrjuBdk1K3dUj8hxrkdi2n5wJV4xEMBR2J7YJw" ], "script": "base64:AAIFAAAAAAAAAEIIAhIKCggICAgICAQBARIDCgEEEgUKAwQEBBIDCgEBEgMKAQQSAwoBARIECgIEARIECgIICBIAEgMKAQESBAoCCAgAAAAgAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAA2FhMQIAAAAGcG9vbF9fAAAAAAJzYQIAAAAPU1RBS0lOR19BTU9VTlRfAAAAAAJsYQIAAAANTEVBU0VfQU1PVU5UXwAAAAACaXgCAAAAA0lEXwAAAAAHcmF0ZUZlZQIAAAATcGVyY2VudGFnZV9yYXRlX2ZlZQAAAAAOZGVwb3NpdF9oZWlnaHQCAAAAEkRlcG9zaXRfSGVpZ2h0X09mXwAAAAACRDgAAAAAAAX14QAAAAAAAkQ2AAAAAAAAD0JAAAAAAA9jb250cmFjdEFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQgFAAAABHRoaXMAAAAFYnl0ZXMAAAAADGV4Y2hhbmdlUmF0ZQAAAAAAAAAABQEAAAARZ2V0QWRkcmVzc0lmVmFsaWQAAAABAAAAB2FkZHJlc3MJAAQlAAAAAQkBAAA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YW1vdW50BAAAAA1uZXdhc3NldDJwb29sCQAAZAAAAAIFAAAACmFzc2V0MnBvb2wICQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABAAAABmFtb3VudAUAAAADbmlsBQAAAANuaWwJAAACAAAAAQIAAAARSW52YWxpZCBQb29sIEtleS4JAAACAAAAAQIAAAAZSW52YWxpZCBBc3NldDEgb3IgQXNzZXQyIQkAAAIAAAABAgAAACBBc3NldDEgY2Fubm90IGJlIGVxdWFsIHRvIEFzc2V0MgkAAAIAAAABAgAAAClsaXF1aWRpdHkgaXMgY3VycmVudGx5IHVuZGVyIG1haW50ZW5hbmNlLgkAAAIAAAABAgAAACRkQXBwIGlzIGN1cnJlbnRseSB1bmRlciBtYWludGVuYW5jZS4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmImiIK", "height": 2101060, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FsR1iZ5pZbsyxTFg64goC18kaYLdQPbmAoxqbdWZCfwW Next: 4SFvSn5rMHhPmBSB7LV1FDdgEAxM3MVkhN4Pp8SjbJ4U Diff:
OldNewDifferences
4040 let liquidityAc = "activate_liquidity"
4141
4242 let bcD = "block_distribuition"
43+
44+let typeBcd = "type_block_distribution"
4345
4446 let total_locked = "Total_Tokens_Locked_"
4547
8991 let keyPoolNgnnWaves = kp(NgnnAssetId, "WAVES")
9092 let keyPoolNgnnMainAsset = kp(NgnnAssetId, MainAssetId)
9193 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)]
94+[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(keyPoolNgnnWaves, 0), IntegerEntry(keyPoolNgnnMainAsset, 0), IntegerEntry(keyPoolMainWaves, 0), BooleanEntry(typeBcd, false)]
9395 }
9496 else throw("Only the Admin itself can invoke this function")
9597
127129 func blockDistribution (newValue) = if ((i.caller == this))
128130 then [IntegerEntry(bcD, newValue)]
129131 else throw("Only the Admin itself can invoke this function")
132+
133+
134+
135+@Callable(i)
136+func blockDistributionPools (mainAsset,newValue) = if ((i.caller == this))
137+ then [BooleanEntry(typeBcd, mainAsset), IntegerEntry(bcD, newValue)]
138+ else throw("Only the Admin itself can invoke this function")
139+
140+
141+
142+@Callable(i)
143+func lpAssetCreateForPairPool (asset1,asset2) = {
144+ let key = validPoolK(kp(asset1, asset2))
145+ if ((i.caller == this))
146+ then if (!((key == 0)))
147+ then {
148+ let assetLpCreate = Issue(((("LP_" + asset1) + "_") + asset2), ((("LP asset for pool liquidity in AxAi Swap pair " + asset1) + "_") + asset2), 1, 8, true)
149+ let idAssetLp = calculateAssetId(assetLpCreate)
150+ nil
151+ }
152+ else throw("Invalid Pool Key. Try inverting the assets")
153+ else throw("Only the Admin itself can invoke this function")
154+ }
130155
131156
132157
250275 let asset1pool = assetP(kp(Asset1, Asset2), Asset1)
251276 let asset2pool = assetP(kp(Asset1, Asset2), Asset2)
252277 let pBlock = IntegerEntry(pkey(Asset1, Asset2, currentKey), height)
253- let newCurrentAmount = currentAmount
254278 if (if ((asset1pool == 0))
255279 then true
256280 else (asset2pool == 0))
257- then nil
281+ then {
282+ let newcurrentAmountAsset1 = (currentAmountAsset1 + i.payments[0].amount)
283+ let newcurrentAmountAsset2 = (currentAmountAsset2 + i.payments[1].amount)
284+ let receiveLp = (i.payments[0].amount / i.payments[1].amount)
285+ let newcurrentAmount = (currentAmount + receiveLp)
286+ let newasset1pool = (asset1pool + i.payments[0].amount)
287+ let newasset2pool = (asset2pool + i.payments[1].amount)
288+ nil
289+ }
258290 else nil
259291 }
260292 else throw("Invalid Pool Key.")
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
88 let aa1 = "pool__"
99
1010 let sa = "STAKING_AMOUNT_"
1111
1212 let la = "LEASE_AMOUNT_"
1313
1414 let ix = "ID_"
1515
1616 let rateFee = "percentage_rate_fee"
1717
1818 let deposit_height = "Deposit_Height_Of_"
1919
2020 let D8 = 100000000
2121
2222 let D6 = 1000000
2323
2424 let contractAddress = Address(this.bytes)
2525
2626 let exchangeRate = 5
2727
2828 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse " + address) + " as address")))
2929
3030
3131 func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
3232
3333
3434 let ac = "activate"
3535
3636 let poolAc = "activate_pools"
3737
3838 let swapAc = "activate_swap"
3939
4040 let liquidityAc = "activate_liquidity"
4141
4242 let bcD = "block_distribuition"
43+
44+let typeBcd = "type_block_distribution"
4345
4446 let total_locked = "Total_Tokens_Locked_"
4547
4648 let usdn = "usdn_asset"
4749
4850 let usdt = "usdt_asset"
4951
5052 let usdc = "usdc_asset"
5153
5254 let ngnn = "ngnn_asset"
5355
5456 let aWaves = "accept_waves"
5557
5658 func kp (asset1,asset2) = (((aa1 + asset1) + "_") + asset2)
5759
5860
5961 func validPoolK (key) = valueOrElse(getInteger(this, key), 0)
6062
6163
6264 func kpAddress (address,key) = valueOrElse(getIntegerValue(this, ((key + "_") + address)), 0)
6365
6466
6567 func poolAA (address,key,asset) = valueOrElse(getIntegerValue(this, ((((key + "_") + address) + "_") + asset)), 0)
6668
6769
6870 func assetP (key,asset) = valueOrElse(getIntegerValue(this, ((key + "_") + asset)), 0)
6971
7072
7173 func pkey (Asset1,Asset2,address) = (((deposit_height + kp(Asset1, Asset2)) + "_") + address)
7274
7375
7476 @Callable(i)
7577 func constructor (MainAssetId,UsdnAssetId,UsdtAssetId,UsdcAssetId,NgnnAssetId,acceptWaves,percentageRate,blockDistribution) = if ((i.caller == this))
7678 then {
7779 let keyPoolUsdnUsdt = kp(UsdnAssetId, UsdtAssetId)
7880 let keyPoolUsdnUsdc = kp(UsdnAssetId, UsdcAssetId)
7981 let keyPoolUsdnNgnn = kp(UsdnAssetId, NgnnAssetId)
8082 let keyPoolUsdnWaves = kp(UsdnAssetId, "WAVES")
8183 let keyPoolUsdnMainAsset = kp(UsdnAssetId, MainAssetId)
8284 let keyPoolUsdcUsdt = kp(UsdcAssetId, UsdtAssetId)
8385 let keyPoolUsdcNgnn = kp(UsdcAssetId, NgnnAssetId)
8486 let keyPoolUsdcWaves = kp(UsdcAssetId, "WAVES")
8587 let keyPoolUsdcMainAsset = kp(UsdcAssetId, MainAssetId)
8688 let keyPoolUsdtNgnn = kp(UsdtAssetId, NgnnAssetId)
8789 let keyPoolUsdtWaves = kp(UsdtAssetId, "WAVES")
8890 let keyPoolUsdtMainAsset = kp(UsdtAssetId, MainAssetId)
8991 let keyPoolNgnnWaves = kp(NgnnAssetId, "WAVES")
9092 let keyPoolNgnnMainAsset = kp(NgnnAssetId, MainAssetId)
9193 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)]
94+[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(keyPoolNgnnWaves, 0), IntegerEntry(keyPoolNgnnMainAsset, 0), IntegerEntry(keyPoolMainWaves, 0), BooleanEntry(typeBcd, false)]
9395 }
9496 else throw("Only the Admin itself can invoke this function")
9597
9698
9799
98100 @Callable(i)
99101 func activate (v) = if ((i.caller == this))
100102 then [BooleanEntry(ac, v)]
101103 else throw("Only the Admin itself can invoke this function")
102104
103105
104106
105107 @Callable(i)
106108 func maintenance (pools,swap,stake) = if ((i.caller == this))
107109 then [BooleanEntry(poolAc, pools), BooleanEntry(swapAc, swap), BooleanEntry(liquidityAc, stake)]
108110 else throw("Only the Admin itself can invoke this function")
109111
110112
111113
112114 @Callable(i)
113115 func percentualRateFeeEdit (rate) = if ((i.caller == this))
114116 then [IntegerEntry(rateFee, rate)]
115117 else throw("Only the Admin itself can invoke this function")
116118
117119
118120
119121 @Callable(i)
120122 func acceptWaves (activate) = if ((i.caller == this))
121123 then [BooleanEntry(aWaves, activate)]
122124 else throw("Only the Admin itself can invoke this function")
123125
124126
125127
126128 @Callable(i)
127129 func blockDistribution (newValue) = if ((i.caller == this))
128130 then [IntegerEntry(bcD, newValue)]
129131 else throw("Only the Admin itself can invoke this function")
132+
133+
134+
135+@Callable(i)
136+func blockDistributionPools (mainAsset,newValue) = if ((i.caller == this))
137+ then [BooleanEntry(typeBcd, mainAsset), IntegerEntry(bcD, newValue)]
138+ else throw("Only the Admin itself can invoke this function")
139+
140+
141+
142+@Callable(i)
143+func lpAssetCreateForPairPool (asset1,asset2) = {
144+ let key = validPoolK(kp(asset1, asset2))
145+ if ((i.caller == this))
146+ then if (!((key == 0)))
147+ then {
148+ let assetLpCreate = Issue(((("LP_" + asset1) + "_") + asset2), ((("LP asset for pool liquidity in AxAi Swap pair " + asset1) + "_") + asset2), 1, 8, true)
149+ let idAssetLp = calculateAssetId(assetLpCreate)
150+ nil
151+ }
152+ else throw("Invalid Pool Key. Try inverting the assets")
153+ else throw("Only the Admin itself can invoke this function")
154+ }
130155
131156
132157
133158 @Callable(i)
134159 func deposit () = {
135160 let power = getBooleanValue(this, ac)
136161 let liquidityPower = getBooleanValue(this, liquidityAc)
137162 let acWaves = getBooleanValue(this, aWaves)
138163 let pmt = i.payments[0]
139164 let MainAsset = fromBase58String(getStringValue(this, main))
140165 if (power)
141166 then if (!(liquidityPower))
142167 then if ((pmt.assetId != MainAsset))
143168 then throw(("Invalid Asset! Kindly Deposit Only " + toBase58String(MainAsset)))
144169 else {
145170 let currentKey = toBase58String(i.caller.bytes)
146171 let currentAmount = match getInteger(this, currentKey) {
147172 case a: Int =>
148173 a
149174 case _ =>
150175 0
151176 }
152177 let newAmount = (currentAmount + pmt.amount)
153178 let useramount = IntegerEntry(currentKey, newAmount)
154179 let userdepositheight = IntegerEntry((deposit_height + currentKey), height)
155180 let previouslockbalance = match getInteger(this, "Total_Tokens_Locked:") {
156181 case a: Int =>
157182 a
158183 case _ =>
159184 0
160185 }
161186 let totaltoken = (previouslockbalance + pmt.amount)
162187 let TLV = IntegerEntry("Total_Tokens_Locked:", totaltoken)
163188 [useramount, userdepositheight, TLV]
164189 }
165190 else throw("liquidity is currently under maintenance.")
166191 else throw("dApp is currently under maintenance.")
167192 }
168193
169194
170195
171196 @Callable(i)
172197 func remove (amount) = {
173198 let power = getBooleanValue(this, ac)
174199 let liquidityPower = getBooleanValue(this, liquidityAc)
175200 let acWaves = getBooleanValue(this, aWaves)
176201 let pmt = i.payments[0]
177202 let MainAsset = fromBase58String(getStringValue(this, main))
178203 if (power)
179204 then if (!(liquidityPower))
180205 then {
181206 let currentKey = toBase58String(i.caller.bytes)
182207 let currentAmount = valueOrElse(getInteger(this, currentKey), 0)
183208 let swapheightkeyname = (deposit_height + currentKey)
184209 let previouslockbalance = getIntegerValue(this, "Total_Tokens_Locked:")
185210 let totaltoken = (previouslockbalance - amount)
186211 let diff = (height - getIntegerValue(this, swapheightkeyname))
187212 let bcd = getIntegerValue(this, bcD)
188213 let reward = ((diff * bcd) * D8)
189214 let feeCalc = (reward / (previouslockbalance / amount))
190215 if ((0 > amount))
191216 then throw("Can't withdraw negative AxAi amount")
192217 else {
193218 let newAmount = (currentAmount - amount)
194219 if ((0 > newAmount))
195220 then throw("Not enough AxAi balance")
196221 else [IntegerEntry(currentKey, newAmount), IntegerEntry("Total_Tokens_Locked:", totaltoken), ScriptTransfer(i.caller, amount, MainAsset), ScriptTransfer(i.caller, feeCalc, MainAsset)]
197222 }
198223 }
199224 else throw("liquidity is currently under maintenance.")
200225 else throw("dApp is currently under maintenance.")
201226 }
202227
203228
204229
205230 @Callable(i)
206231 func addLiquidity (Asset1,Asset2) = {
207232 let power = getBooleanValue(this, ac)
208233 let poolActivate = getBooleanValue(this, poolAc)
209234 let acWaves = getBooleanValue(this, aWaves)
210235 let key = validPoolK(kp(Asset1, Asset2))
211236 let asset1 = i.payments[0].assetId
212237 let asset2 = i.payments[1].assetId
213238 let USDN = toBytes(getStringValue(this, usdn))
214239 let USDC = toBytes(getStringValue(this, usdc))
215240 let USDT = toBytes(getStringValue(this, usdt))
216241 let NGNN = toBytes(getStringValue(this, ngnn))
217242 let MainAsset = fromBase58String(getStringValue(this, main))
218243 if (power)
219244 then if (!(poolActivate))
220245 then if (if (if (!((asset1 == asset2)))
221246 then (asset1 == fromBase58String(Asset1))
222247 else false)
223248 then (asset2 == fromBase58String(Asset2))
224249 else false)
225250 then if (if (if (if (if (if (if (if (if (if ((asset1 == USDN))
226251 then true
227252 else (asset1 == USDC))
228253 then true
229254 else (asset1 == USDT))
230255 then true
231256 else (asset1 == NGNN))
232257 then true
233258 else (asset1 == MainAsset))
234259 then true
235260 else (asset2 == USDN))
236261 then true
237262 else (asset2 == USDC))
238263 then true
239264 else (asset2 == USDT))
240265 then true
241266 else (asset2 == NGNN))
242267 then true
243268 else (asset2 == MainAsset))
244269 then if (!((key == 0)))
245270 then {
246271 let currentKey = toBase58String(i.caller.bytes)
247272 let currentAmount = kpAddress(currentKey, kp(Asset1, Asset2))
248273 let currentAmountAsset1 = poolAA(currentKey, kp(Asset1, Asset2), Asset1)
249274 let currentAmountAsset2 = poolAA(currentKey, kp(Asset1, Asset2), Asset2)
250275 let asset1pool = assetP(kp(Asset1, Asset2), Asset1)
251276 let asset2pool = assetP(kp(Asset1, Asset2), Asset2)
252277 let pBlock = IntegerEntry(pkey(Asset1, Asset2, currentKey), height)
253- let newCurrentAmount = currentAmount
254278 if (if ((asset1pool == 0))
255279 then true
256280 else (asset2pool == 0))
257- then nil
281+ then {
282+ let newcurrentAmountAsset1 = (currentAmountAsset1 + i.payments[0].amount)
283+ let newcurrentAmountAsset2 = (currentAmountAsset2 + i.payments[1].amount)
284+ let receiveLp = (i.payments[0].amount / i.payments[1].amount)
285+ let newcurrentAmount = (currentAmount + receiveLp)
286+ let newasset1pool = (asset1pool + i.payments[0].amount)
287+ let newasset2pool = (asset2pool + i.payments[1].amount)
288+ nil
289+ }
258290 else nil
259291 }
260292 else throw("Invalid Pool Key.")
261293 else throw("Invalid Asset1 or Asset2!")
262294 else throw("Asset1 cannot be equal to Asset2")
263295 else throw("liquidity is currently under maintenance.")
264296 else throw("dApp is currently under maintenance.")
265297 }
266298
267299
268300 @Verifier(tx)
269301 func verify () = match tx {
270302 case _ =>
271303 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
272304 }
273305

github/deemru/w8io/169f3d6 
58.87 ms