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