tx · 9Se83aPHtNhZmZxgFxnaaMLC7oTpseqo3KCKW12sLt7N

3Mx8raFsQfjh2JBeT8MN1Jv5sTvGkx5PDDS:  -0.01000000 Waves

2023.08.31 17:26 [2734969] smart account 3Mx8raFsQfjh2JBeT8MN1Jv5sTvGkx5PDDS > SELF 0.00000000 Waves

{ "type": 13, "id": "9Se83aPHtNhZmZxgFxnaaMLC7oTpseqo3KCKW12sLt7N", "fee": 1000000, "feeAssetId": null, "timestamp": 1693492047618, "version": 2, "chainId": 84, "sender": "3Mx8raFsQfjh2JBeT8MN1Jv5sTvGkx5PDDS", "senderPublicKey": "HmWR8GbhBF4LAodJ9xNgR7PpWF79RuCrhPWJWxqdB1KL", "proofs": [ "4tiCUdoPjGyQ562G48rGBCFRaZDf7zvdd6S33W4grZuvUJPxpYDVtAD4uWzLnScwhJAE5yJvBQ3W7SXcWpmBRZ7H" ], "script": "base64:AAIFAAAAAAAAAA4IAhIAEgMKAQESAwoBAQAAAAQAAAAAEWxwX2FkZHJlc3NfcHVia2V5AQAAACD5Ic6hH7prLmpePnu+NHOaX7/pUxioJAxXi6SfYaOBNwAAAAAgbWFzc3RyYW5zZmVyX3doaXRlbGlzdGVkX2FkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAEWxwX2FkZHJlc3NfcHVia2V5AAAAABRscF9kZXBvc2l0b3JfYWRkcmVzcwEAAAAg463XstSKNtaiPAMTm2AWTDVjxzAiveOx6Vx7CmnuvCMAAAAAFGxwX3doaXRlbGlzdF9hZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABRscF9kZXBvc2l0b3JfYWRkcmVzcwAAAAMAAAABaQEAAAAQQWRkUG9vbExpcXVpZGl0eQAAAAAEAAAADWNhbGxlcmFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAA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AAIAAAABAgAAAD5QbGFjZWQgV2l0aGRyYXcgQW1vdW50IFNpemUgaXMgbW9yZSB0aGFuIFRvdGFsIFBvb2wgTGlxdWlkaXR5LgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAUVG90YWxfUG9vbF9MaXF1aWRpdHkFAAAAFHVwZGF0ZWRfcG9vbF9iYWxhbmNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAABNMUF9XaXRoZHJhd19Db3VudGVyBQAAABZUb3RhbExQV2l0aGRyYXdDb3VudGVyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAABFUb3RhbF9MUF9XaXRoZHJhdwUAAAAPVG90YWxMUFdpdGhkcmF3CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAGkAAAAAQUAAAAWVG90YWxMUFdpdGhkcmF3Q291bnRlcgIAAAAMX0xQX1dpdGhkcmF3BQAAAA9Ub3RhbExQV2l0aGRyYXcFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAFT3JkZXIGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNFeGNoYW5nZVRyYW5zYWN0aW9uBgkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwBwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkre8G3", "height": 2734969, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F4zqxUGZ554ec6aZMQhghSuG9q1qRrUzqSdpXn1HdY13 Next: Cqr1NRm9yk7gzPsJfNcDekX6t1bSyvQ1e7tvybJSUweU Diff:
OldNewDifferences
6767 let TotalMassTransferSend = (PreviousMassTransferSend + PaidMassTransferAmount)
6868 if ((i.caller != masstransfer_whitelisted_address))
6969 then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it."))
70- else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount)]
70+ else if ((PaidMassTransferAmount > read_total_pool_liquidity))
71+ then throw("Placed Mass Transfer Amount Size is more than Total Pool Liquidity.")
72+ else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount)]
73+ }
74+
75+
76+
77+@Callable(i)
78+func WithdrawLPBalance (WithdrawAmount) = {
79+ let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.")
80+ let updated_pool_balance = (read_total_pool_liquidity - WithdrawAmount)
81+ let PreviousLPWithdrawCounter = match getInteger(this, "LP_Withdraw_Counter") {
82+ case a: Int =>
83+ a
84+ case _ =>
85+ 0
86+ }
87+ let TotalLPWithdrawCounter = (PreviousLPWithdrawCounter + 1)
88+ let PreviousLPWithdraw = match getInteger(this, "Total_LP_Withdraw") {
89+ case a: Int =>
90+ a
91+ case _ =>
92+ 0
93+ }
94+ let TotalLPWithdraw = (PreviousLPWithdraw + WithdrawAmount)
95+ if ((i.caller != lp_whitelist_address))
96+ then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it."))
97+ else if ((WithdrawAmount > read_total_pool_liquidity))
98+ then throw("Placed Withdraw Amount Size is more than Total Pool Liquidity.")
99+ else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("LP_Withdraw_Counter", TotalLPWithdrawCounter), IntegerEntry("Total_LP_Withdraw", TotalLPWithdraw), IntegerEntry((toString(TotalLPWithdrawCounter) + "_LP_Withdraw"), TotalLPWithdraw)]
71100 }
72101
73102
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let lp_address_pubkey = base58'HmWR8GbhBF4LAodJ9xNgR7PpWF79RuCrhPWJWxqdB1KL'
55
66 let masstransfer_whitelisted_address = addressFromPublicKey(lp_address_pubkey)
77
88 let lp_depositor_address = base58'GKmJ6BchUgQfwKp4mp5eX8Y9xLioYRm6e1gDfFgdAcCr'
99
1010 let lp_whitelist_address = addressFromPublicKey(lp_depositor_address)
1111
1212 @Callable(i)
1313 func AddPoolLiquidity () = {
1414 let calleraddress = toBase58String(i.caller.bytes)
1515 let pmt = if ((size(i.payments) == 1))
1616 then i.payments[0]
1717 else throw("No payment attached, Please Attach only Whitelisted Tokens in payment[1].")
1818 let PreviousFundsAddedToPoolbyCompany = match getInteger(this, "Total_LP_Added") {
1919 case a: Int =>
2020 a
2121 case _ =>
2222 0
2323 }
2424 let TotalFundsAddedToPoolbyCompany = (PreviousFundsAddedToPoolbyCompany + pmt.amount)
2525 let PreviousPoolLiquidity = match getInteger(this, "Total_Pool_Liquidity") {
2626 case a: Int =>
2727 a
2828 case _ =>
2929 0
3030 }
3131 let TotalPoolLiquidity = (PreviousPoolLiquidity + pmt.amount)
3232 let PreviousLPDepositCounter = match getInteger(this, "LP_Deposit_Counter") {
3333 case a: Int =>
3434 a
3535 case _ =>
3636 0
3737 }
3838 let TotalLPDepositCounter = (PreviousLPDepositCounter + 1)
3939 if ((i.caller != lp_whitelist_address))
4040 then throw((("This Address is not Authorized. Only " + toString(lp_whitelist_address)) + " is Authorized Address to Sign it."))
4141 else if (isDefined(pmt.assetId))
4242 then throw("Only WAVES is allowed to deposit at the moment")
4343 else [IntegerEntry("Total_Pool_Liquidity", TotalPoolLiquidity), IntegerEntry("LP_Deposit_Counter", TotalLPDepositCounter), IntegerEntry("Total_LP_Added", TotalFundsAddedToPoolbyCompany)]
4444 }
4545
4646
4747
4848 @Callable(i)
4949 func UpdateLPBalance (PaidMassTransferAmount) = {
5050 let read_account_balance = wavesBalance(this).regular
5151 let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.")
5252 let received_order_amount = (read_account_balance - read_total_pool_liquidity)
5353 let updated_pool_balance = ((read_total_pool_liquidity - PaidMassTransferAmount) + received_order_amount)
5454 let PreviousMassTransferCounter = match getInteger(this, "Mass_Transfer_Counter") {
5555 case a: Int =>
5656 a
5757 case _ =>
5858 0
5959 }
6060 let TotalMassTransferCounter = (PreviousMassTransferCounter + 1)
6161 let PreviousMassTransferSend = match getInteger(this, "Total_Mass_Transfer_Send") {
6262 case a: Int =>
6363 a
6464 case _ =>
6565 0
6666 }
6767 let TotalMassTransferSend = (PreviousMassTransferSend + PaidMassTransferAmount)
6868 if ((i.caller != masstransfer_whitelisted_address))
6969 then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it."))
70- else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount)]
70+ else if ((PaidMassTransferAmount > read_total_pool_liquidity))
71+ then throw("Placed Mass Transfer Amount Size is more than Total Pool Liquidity.")
72+ else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Mass_Transfer_Counter", TotalMassTransferCounter), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount)]
73+ }
74+
75+
76+
77+@Callable(i)
78+func WithdrawLPBalance (WithdrawAmount) = {
79+ let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.")
80+ let updated_pool_balance = (read_total_pool_liquidity - WithdrawAmount)
81+ let PreviousLPWithdrawCounter = match getInteger(this, "LP_Withdraw_Counter") {
82+ case a: Int =>
83+ a
84+ case _ =>
85+ 0
86+ }
87+ let TotalLPWithdrawCounter = (PreviousLPWithdrawCounter + 1)
88+ let PreviousLPWithdraw = match getInteger(this, "Total_LP_Withdraw") {
89+ case a: Int =>
90+ a
91+ case _ =>
92+ 0
93+ }
94+ let TotalLPWithdraw = (PreviousLPWithdraw + WithdrawAmount)
95+ if ((i.caller != lp_whitelist_address))
96+ then throw((("This Address is not Authorized. Only " + toString(masstransfer_whitelisted_address)) + " is Authorized Address to Sign it."))
97+ else if ((WithdrawAmount > read_total_pool_liquidity))
98+ then throw("Placed Withdraw Amount Size is more than Total Pool Liquidity.")
99+ else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("LP_Withdraw_Counter", TotalLPWithdrawCounter), IntegerEntry("Total_LP_Withdraw", TotalLPWithdraw), IntegerEntry((toString(TotalLPWithdrawCounter) + "_LP_Withdraw"), TotalLPWithdraw)]
71100 }
72101
73102
74103 @Verifier(tx)
75104 func verify () = match tx {
76105 case t: Order|ExchangeTransaction|TransferTransaction =>
77106 false
78107 case _ =>
79108 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
80109 }
81110

github/deemru/w8io/026f985 
26.24 ms