tx · 2n2gtzArNCdz5Pn4BPkboGYxJrgS8P8AnTgXsHm5STcw

3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY:  -0.01000000 Waves

2022.06.16 01:40 [2098100] smart account 3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY > SELF 0.00000000 Waves

{ "type": 13, "id": "2n2gtzArNCdz5Pn4BPkboGYxJrgS8P8AnTgXsHm5STcw", "fee": 1000000, "feeAssetId": null, "timestamp": 1655332908623, "version": 2, "chainId": 84, "sender": "3N6LXAerq2VVAPds14fKmB72f1Whmem7pxY", "senderPublicKey": "fFTt4dRQEMWmxs9cA5He1tph3gmQLAM4cnpj6eqkWPR", "proofs": [ "4oat4gRm7LHcjyqpbXE9x8Z4XJc5GgxefACHmJJ5CHKKz995rzDqxji2AWzUvXHuSyVu1wvrcLE16fGTx3GxNJxP" ], "script": "base64:AAIFAAAAAAAAADAIAhIKCggICAgICAQBARIDCgEEEgUKAwQEBBIDCgEBEgMKAQQSAwoBARIAEgMKAQEAAAAfAAAAAARtYWluAgAAAAptYWluX2Fzc2V0AAAAAAFsAgAAAAlscF9hc3NldF8AAAAAAmExAgAAAAxzd2FwX2Fzc2V0MV8AAAAAAnN0AgAAAA9hZGRyZXNzX3N0YWtlcl8AAAAAA3NzdAIAAAANYWRkcmVzc19wb29sXwAAAAADc3dwAgAAAA1hZGRyZXNzX3N3YXBfAAAAAAJhMgIAAAAMc3dhcF9hc3NldDJfAAAAAANhYTECAAAAB3Bvb2xfMV8AAAAAA2FhMgIAAAAHcG9vbF8yXwAAAAADc3QxAgAAAA5zdGFrZXJfYWRkcmVzcwAAAAAEdHlwZQIAAAAFdHlwZV8AAAAAAnNhAgAAAA9TVEFLSU5HX0FNT1VOVF8AAAAAAmxhAgAAAA1MRUFTRV9BTU9VTlRfAAAAAAJpeAIAAAADSURfAAAAAAdyYXRlRmVlAgAAABNwZXJjZW50YWdlX3JhdGVfZmVlAAAAAAJEOAAAAAAABfXhAAAAAAACRDYAAAAAAAA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AAAAAAAAAAAUAAAAGYW1vdW50CQAAAgAAAAECAAAAI0Nhbid0IHdpdGhkcmF3IG5lZ2F0aXZlIEF4QWkgYW1vdW50BAAAAAluZXdBbW91bnQJAABlAAAAAgUAAAANY3VycmVudEFtb3VudAUAAAAGYW1vdW50AwkAAGYAAAACAAAAAAAAAAAABQAAAAluZXdBbW91bnQJAAACAAAAAQIAAAAXTm90IGVub3VnaCBBeEFpIGJhbGFuY2UJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAUVG90YWxfVG9rZW5zX0xvY2tlZDoFAAAACnRvdGFsdG9rZW4JAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAACU1haW5Bc3NldAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIJAABoAAAAAgkAAGkAAAACCQAAaAAAAAIFAAAABGRpZmYFAAAAA2JjZAUAAAATcHJldmlvdXNsb2NrYmFsYW5jZQUAAAANY3VycmVudEFtb3VudAUAAAAJTWFpbkFzc2V0BQAAAANuaWwJAAACAAAAAQIAAAApbGlxdWlkaXR5IGlzIGN1cnJlbnRseSB1bmRlciBtYWludGVuYW5jZS4JAAACAAAAAQIAAAAkZEFwcCBpcyBjdXJyZW50bHkgdW5kZXIgbWFpbnRlbmFuY2UuAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5//CPGQ==", "height": 2098100, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 41exwtqWT7YAmEyhUFR2wK39mmxoZ1dgWHEAe1U4Bwe5 Next: 7EZgRp8vChy8RmbX69jFNbHcTcpdaELBsxxKw2VP7fMC Diff:
OldNewDifferences
102102
103103 @Callable(i)
104104 func blockDistribution (newValue) = if ((i.caller == this))
105- then [BooleanEntry(bcD, newValue)]
105+ then [IntegerEntry(bcD, newValue)]
106106 else throw("Only the Admin itself can invoke this function")
107107
108108
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 a1 = "swap_asset1_"
99
1010 let st = "address_staker_"
1111
1212 let sst = "address_pool_"
1313
1414 let swp = "address_swap_"
1515
1616 let a2 = "swap_asset2_"
1717
1818 let aa1 = "pool_1_"
1919
2020 let aa2 = "pool_2_"
2121
2222 let st1 = "staker_address"
2323
2424 let type = "type_"
2525
2626 let sa = "STAKING_AMOUNT_"
2727
2828 let la = "LEASE_AMOUNT_"
2929
3030 let ix = "ID_"
3131
3232 let rateFee = "percentage_rate_fee"
3333
3434 let D8 = 100000000
3535
3636 let D6 = 1000000
3737
3838 let contractAddress = Address(this.bytes)
3939
4040 let exchangeRate = 5
4141
4242 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse " + address) + " as address")))
4343
4444
4545 func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
4646
4747
4848 let ac = "activate"
4949
5050 let poolAc = "activate_pools"
5151
5252 let swapAc = "activate_swap"
5353
5454 let liquidityAc = "activate_liquidity"
5555
5656 let bcD = "block_distribuition"
5757
5858 let usdn = "usdn_asset"
5959
6060 let usdt = "usdt_asset"
6161
6262 let usdc = "usdc_asset"
6363
6464 let ngnn = "ngnn_asset"
6565
6666 let aWaves = "accept_waves"
6767
6868 @Callable(i)
6969 func constructor (MainAssetId,UsdnAssetId,UsdtAssetId,UsdcAssetId,NgnnAssetId,acceptWaves,percentageRate,blockDistribution) = if ((i.caller == this))
7070 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)]
7171 else throw("Only the Admin itself can invoke this function")
7272
7373
7474
7575 @Callable(i)
7676 func activate (v) = if ((i.caller == this))
7777 then [BooleanEntry(ac, v)]
7878 else throw("Only the Admin itself can invoke this function")
7979
8080
8181
8282 @Callable(i)
8383 func maintenance (pools,swap,stake) = if ((i.caller == this))
8484 then [BooleanEntry(poolAc, pools), BooleanEntry(swapAc, swap), BooleanEntry(liquidityAc, stake)]
8585 else throw("Only the Admin itself can invoke this function")
8686
8787
8888
8989 @Callable(i)
9090 func percentualRateFeeEdit (rate) = if ((i.caller == this))
9191 then [IntegerEntry(rateFee, rate)]
9292 else throw("Only the Admin itself can invoke this function")
9393
9494
9595
9696 @Callable(i)
9797 func acceptWaves (activate) = if ((i.caller == this))
9898 then [BooleanEntry(aWaves, activate)]
9999 else throw("Only the Admin itself can invoke this function")
100100
101101
102102
103103 @Callable(i)
104104 func blockDistribution (newValue) = if ((i.caller == this))
105- then [BooleanEntry(bcD, newValue)]
105+ then [IntegerEntry(bcD, newValue)]
106106 else throw("Only the Admin itself can invoke this function")
107107
108108
109109
110110 @Callable(i)
111111 func deposit () = {
112112 let power = getBooleanValue(this, ac)
113113 let liquidityPower = getBooleanValue(this, liquidityAc)
114114 let acWaves = getBooleanValue(this, aWaves)
115115 let pmt = i.payments[0]
116116 let MainAsset = fromBase58String(getStringValue(this, main))
117117 if (power)
118118 then if (!(liquidityPower))
119119 then if ((pmt.assetId != MainAsset))
120120 then throw(("Invalid Asset! Kindly Deposit Only " + toBase58String(MainAsset)))
121121 else {
122122 let currentKey = toBase58String(i.caller.bytes)
123123 let currentAmount = match getInteger(this, currentKey) {
124124 case a: Int =>
125125 a
126126 case _ =>
127127 0
128128 }
129129 let newAmount = (currentAmount + pmt.amount)
130130 let useramount = IntegerEntry(currentKey, newAmount)
131131 let userdepositheight = IntegerEntry(("Deposit_Height_Of_" + currentKey), height)
132132 let previouslockbalance = match getInteger(this, "Total_Tokens_Locked:") {
133133 case a: Int =>
134134 a
135135 case _ =>
136136 0
137137 }
138138 let totaltoken = (previouslockbalance + pmt.amount)
139139 let TLV = IntegerEntry("Total_Tokens_Locked:", totaltoken)
140140 [useramount, userdepositheight, TLV]
141141 }
142142 else throw("liquidity is currently under maintenance.")
143143 else throw("dApp is currently under maintenance.")
144144 }
145145
146146
147147
148148 @Callable(i)
149149 func remove (amount) = {
150150 let power = getBooleanValue(this, ac)
151151 let liquidityPower = getBooleanValue(this, liquidityAc)
152152 let acWaves = getBooleanValue(this, aWaves)
153153 let pmt = i.payments[0]
154154 let MainAsset = fromBase58String(getStringValue(this, main))
155155 if (power)
156156 then if (!(liquidityPower))
157157 then {
158158 let currentKey = toBase58String(i.caller.bytes)
159159 let currentAmount = valueOrElse(getInteger(this, currentKey), 0)
160160 let swapheightkeyname = ("Deposit_Height_Of_" + currentKey)
161161 let previouslockbalance = getIntegerValue(this, "Total_Tokens_Locked:")
162162 let totaltoken = (previouslockbalance - amount)
163163 let diff = (height - getIntegerValue(this, swapheightkeyname))
164164 let bcd = getIntegerValue(this, bcD)
165165 if ((0 > amount))
166166 then throw("Can't withdraw negative AxAi amount")
167167 else {
168168 let newAmount = (currentAmount - amount)
169169 if ((0 > newAmount))
170170 then throw("Not enough AxAi balance")
171171 else [IntegerEntry(currentKey, newAmount), IntegerEntry("Total_Tokens_Locked:", totaltoken), ScriptTransfer(i.caller, amount, MainAsset), ScriptTransfer(i.caller, (((diff * bcd) / previouslockbalance) * currentAmount), MainAsset)]
172172 }
173173 }
174174 else throw("liquidity is currently under maintenance.")
175175 else throw("dApp is currently under maintenance.")
176176 }
177177
178178
179179 @Verifier(tx)
180180 func verify () = match tx {
181181 case _ =>
182182 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
183183 }
184184

github/deemru/w8io/026f985 
41.76 ms