tx · FzMW8RBaeRjCPu83mJspDApgzkqLKMNzZbs8DxzudBFf 3Mx8raFsQfjh2JBeT8MN1Jv5sTvGkx5PDDS: -0.01500000 Waves 2023.08.26 22:47 [2728071] smart account 3Mx8raFsQfjh2JBeT8MN1Jv5sTvGkx5PDDS > SELF 0.00000000 Waves
{ "type": 13, "id": "FzMW8RBaeRjCPu83mJspDApgzkqLKMNzZbs8DxzudBFf", "fee": 1500000, "feeAssetId": null, "timestamp": 1693079250295, "version": 2, "chainId": 84, "sender": "3Mx8raFsQfjh2JBeT8MN1Jv5sTvGkx5PDDS", "senderPublicKey": "HmWR8GbhBF4LAodJ9xNgR7PpWF79RuCrhPWJWxqdB1KL", "proofs": [ "2tcA928S2PcG2o4YkVQiwAG9NKQNNmoT9nCYDgqadhLV6Ebm5w8tYBJhrCi4o6de6q6PMpKH4R53Vd8LHt6eRj1u" ], "script": "base64:AAIFAAAAAAAAAAkIAhIAEgMKAQEAAAACAAAAABFscF9hZGRyZXNzX3B1YmtleQEAAAAg+SHOoR+6ay5qXj57vjRzml+/6VMYqCQMV4ukn2GjgTcAAAAAEXdoaXRlbGlzdF9hZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABFscF9hZGRyZXNzX3B1YmtleQAAAAIAAAABaQEAAAAQQWRkUG9vbExpcXVpZGl0eQAAAAAEAAAADWNhbGxlcmFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAASU5vIHBheW1lbnQgYXR0YWNoZWQsIFBsZWFzZSBBdHRhY2ggb25seSBXaGl0ZWxpc3RlZCBUb2tlbnMgaW4gcGF5bWVudFsxXS4EAAAAIVByZXZpb3VzRnVuZHNBZGRlZFRvUG9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GlvbgQAAAABdAUAAAAHJG1hdGNoMAcJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V59OrKlQ==", "height": 2728071, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BSLZHBkG8bMkvTYjFYYgrin4VU8AWVeP3QuSBJsT3wtq Next: ENEhhdZUpyu5AVBNzMY9L3KbT1MWSJzgfiGRQTGWq88e Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let lp_address_pubkey = base58'HmWR8GbhBF4LAodJ9xNgR7PpWF79RuCrhPWJWxqdB1KL' | |
4 | 5 | ||
6 | + | let whitelist_address = addressFromPublicKey(lp_address_pubkey) | |
5 | 7 | ||
6 | 8 | @Callable(i) | |
7 | 9 | func AddPoolLiquidity () = { | |
15 | 17 | case _ => | |
16 | 18 | 0 | |
17 | 19 | } | |
18 | - | let | |
20 | + | let TotalFundsAddedToPoolbyCompany = (PreviousFundsAddedToPoolbyCompany + pmt.amount) | |
19 | 21 | let PreviousPoolLiquidity = match getInteger(this, "Total_Pool_Liquidity") { | |
20 | 22 | case a: Int => | |
21 | 23 | a | |
32 | 34 | let TotalLPDepositCounter = (PreviousLPDepositCounter + 1) | |
33 | 35 | if (isDefined(pmt.assetId)) | |
34 | 36 | then throw("Only WAVES is allowed to deposit at the moment") | |
35 | - | else [IntegerEntry("Total_Pool_Liquidity", TotalPoolLiquidity), IntegerEntry("LP_Deposit_Counter", TotalLPDepositCounter), IntegerEntry("Total_LP_Added", TotalFundsFundsAddedToPoolbyCompany)] | |
37 | + | else [IntegerEntry("Total_Pool_Liquidity", TotalPoolLiquidity), IntegerEntry("LP_Deposit_Counter", TotalLPDepositCounter), IntegerEntry("Total_LP_Added", TotalFundsAddedToPoolbyCompany)] | |
38 | + | } | |
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | @Callable(i) | |
43 | + | func UpdateLPBalance (PaidMassTransferAmount) = { | |
44 | + | let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.") | |
45 | + | let updated_pool_balance = (read_total_pool_liquidity - PaidMassTransferAmount) | |
46 | + | let PreviousMassTransferCounter = match getInteger(this, "Mass_Transfer_Counter") { | |
47 | + | case a: Int => | |
48 | + | a | |
49 | + | case _ => | |
50 | + | 0 | |
51 | + | } | |
52 | + | let TotalMassTransferCounter = (PreviousMassTransferCounter + 1) | |
53 | + | let PreviousMassTransferSend = match getInteger(this, "Total_Mass_Transfer_Send") { | |
54 | + | case a: Int => | |
55 | + | a | |
56 | + | case _ => | |
57 | + | 0 | |
58 | + | } | |
59 | + | let TotalMassTransferSend = (PreviousMassTransferSend + PaidMassTransferAmount) | |
60 | + | if ((i.caller != whitelist_address)) | |
61 | + | then throw((("This Address is not Authorized. Only " + toString(whitelist_address)) + " is Authorized Address to Sign it.")) | |
62 | + | else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount)] | |
36 | 63 | } | |
37 | 64 | ||
38 | 65 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let lp_address_pubkey = base58'HmWR8GbhBF4LAodJ9xNgR7PpWF79RuCrhPWJWxqdB1KL' | |
4 | 5 | ||
6 | + | let whitelist_address = addressFromPublicKey(lp_address_pubkey) | |
5 | 7 | ||
6 | 8 | @Callable(i) | |
7 | 9 | func AddPoolLiquidity () = { | |
8 | 10 | let calleraddress = toBase58String(i.caller.bytes) | |
9 | 11 | let pmt = if ((size(i.payments) == 1)) | |
10 | 12 | then i.payments[0] | |
11 | 13 | else throw("No payment attached, Please Attach only Whitelisted Tokens in payment[1].") | |
12 | 14 | let PreviousFundsAddedToPoolbyCompany = match getInteger(this, "Total_LP_Added") { | |
13 | 15 | case a: Int => | |
14 | 16 | a | |
15 | 17 | case _ => | |
16 | 18 | 0 | |
17 | 19 | } | |
18 | - | let | |
20 | + | let TotalFundsAddedToPoolbyCompany = (PreviousFundsAddedToPoolbyCompany + pmt.amount) | |
19 | 21 | let PreviousPoolLiquidity = match getInteger(this, "Total_Pool_Liquidity") { | |
20 | 22 | case a: Int => | |
21 | 23 | a | |
22 | 24 | case _ => | |
23 | 25 | 0 | |
24 | 26 | } | |
25 | 27 | let TotalPoolLiquidity = (PreviousPoolLiquidity + pmt.amount) | |
26 | 28 | let PreviousLPDepositCounter = match getInteger(this, "LP_Deposit_Counter") { | |
27 | 29 | case a: Int => | |
28 | 30 | a | |
29 | 31 | case _ => | |
30 | 32 | 0 | |
31 | 33 | } | |
32 | 34 | let TotalLPDepositCounter = (PreviousLPDepositCounter + 1) | |
33 | 35 | if (isDefined(pmt.assetId)) | |
34 | 36 | then throw("Only WAVES is allowed to deposit at the moment") | |
35 | - | else [IntegerEntry("Total_Pool_Liquidity", TotalPoolLiquidity), IntegerEntry("LP_Deposit_Counter", TotalLPDepositCounter), IntegerEntry("Total_LP_Added", TotalFundsFundsAddedToPoolbyCompany)] | |
37 | + | else [IntegerEntry("Total_Pool_Liquidity", TotalPoolLiquidity), IntegerEntry("LP_Deposit_Counter", TotalLPDepositCounter), IntegerEntry("Total_LP_Added", TotalFundsAddedToPoolbyCompany)] | |
38 | + | } | |
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | @Callable(i) | |
43 | + | func UpdateLPBalance (PaidMassTransferAmount) = { | |
44 | + | let read_total_pool_liquidity = valueOrErrorMessage(getInteger(this, "Total_Pool_Liquidity"), "No Initial Pool Liquidity was Found.") | |
45 | + | let updated_pool_balance = (read_total_pool_liquidity - PaidMassTransferAmount) | |
46 | + | let PreviousMassTransferCounter = match getInteger(this, "Mass_Transfer_Counter") { | |
47 | + | case a: Int => | |
48 | + | a | |
49 | + | case _ => | |
50 | + | 0 | |
51 | + | } | |
52 | + | let TotalMassTransferCounter = (PreviousMassTransferCounter + 1) | |
53 | + | let PreviousMassTransferSend = match getInteger(this, "Total_Mass_Transfer_Send") { | |
54 | + | case a: Int => | |
55 | + | a | |
56 | + | case _ => | |
57 | + | 0 | |
58 | + | } | |
59 | + | let TotalMassTransferSend = (PreviousMassTransferSend + PaidMassTransferAmount) | |
60 | + | if ((i.caller != whitelist_address)) | |
61 | + | then throw((("This Address is not Authorized. Only " + toString(whitelist_address)) + " is Authorized Address to Sign it.")) | |
62 | + | else [IntegerEntry("Total_Pool_Liquidity", updated_pool_balance), IntegerEntry("Total_Mass_Transfer_Send", TotalMassTransferSend), IntegerEntry((toString(TotalMassTransferCounter) + "_Mass_Transfer_Send"), PaidMassTransferAmount)] | |
36 | 63 | } | |
37 | 64 | ||
38 | 65 | ||
39 | 66 | @Verifier(tx) | |
40 | 67 | func verify () = match tx { | |
41 | 68 | case t: Order|ExchangeTransaction|TransferTransaction => | |
42 | 69 | false | |
43 | 70 | case _ => | |
44 | 71 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
45 | 72 | } | |
46 | 73 |
github/deemru/w8io/026f985 25.20 ms ◑