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