tx · ByD7qrJXoWbdBnC53XKptc7QbgTw1MpCb6xEipqquu2U 3MsNdm7ZAcUGdroTCNhcNNoP5Mki8BPmth3: -0.01000000 Waves 2023.11.28 10:20 [2862945] smart account 3MsNdm7ZAcUGdroTCNhcNNoP5Mki8BPmth3 > SELF 0.00000000 Waves
{ "type": 13, "id": "ByD7qrJXoWbdBnC53XKptc7QbgTw1MpCb6xEipqquu2U", "fee": 1000000, "feeAssetId": null, "timestamp": 1701156001965, "version": 2, "chainId": 84, "sender": "3MsNdm7ZAcUGdroTCNhcNNoP5Mki8BPmth3", "senderPublicKey": "5HjuMYPyr7sMjFBTkSU6U7rvf92cJQ6xF2HMKjcw973J", "proofs": [ "aXAdzMre9DejTfHY7fa1JwSm2sTuzXk7rTREBH9EzFjjEQU7e7Uv859EYjNffLfm32UpH6NLQsz4w6fMbkyWbL3" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgUKAwEICAAAAAwAAAAAFnBvb2xfbGlxdWlkaXR5X2FkZHJlc3MCAAAAIzNONHdCZ1l0V2dKVzJMVFJlZjJla1dRVHJFWENSZlhtR0xoAAAAABREYXBwX0FkZHJlc3NfcHViX2tleQEAAAAgyO2Y2obuVTVYYMc8lugqW2L1IjDFH+TsgVEJaOfOGnMAAAAAGHByb2R1Y3RfbGF1bmNoX3RpbWVzdGFtcAAAAAGKv2AWIAAAAAALQ3VycmVuY3lfSUQCAAAABVdBVkVTAAAAABRwcm9kdWN0X2xhdW5jaF9lcnJvcgIAAAAjUHJvZHVjdCBMYXVuY2ggVGltZXN0YW1wIGlzIHNldCBhdCAAAAAAEG5vX3BheW1lbnRfZXJyb3ICAAAAN05vIHBheW1lbnQgYXR0YWNoZWQsIFBsZWFzZSBBdHRhY2ggVG9rZW4gaW4gcGF5bWVudFsxXS4AAAAAEmNsb3NlZF9vcmFjbGVfZXJvcgIAAAAxT3JhY2xlIGlzIGNsb3NlZC4gV2FpdCBVbnRpbCBPcmFjbGUgaXMgVHVybmVkIE9uLgA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bXVtIGxpbWl0IG9mIAkAAaQAAAABBQAAABRtYXhpbXVtX3ZvdWNoZXJfc2l6ZQIAAAAMLzEwXjggV2F2ZXMuCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAAGVRvdGFsX1ZvdWNoZXJzX0lzc3VlZF9Ub18FAAAADFVzZXJfQWRkcmVzcwUAAAAZVG90YWxWb3VjaGVyc0lzc3VlZFRvVXNlcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAACBUb3RhbF9Wb3VjaGVyc19BbW91bnRfSXNzdWVkX1RvXwUAAAAMVXNlcl9BZGRyZXNzBQAAAB9Ub3RhbFZvdWNoZXJzQW1vdW50SXNzdWVkVG9Vc2VyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAALQ3VycmVuY3lfSUQCAAAAAV8FAAAADFVzZXJfQWRkcmVzcwUAAAAQVG90YWxVc2VyRGVwb3NpdAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAaQXZhaWxhYmxlX1ZvdWNoZXJzX0JhbGFuY2UFAAAAG3VwZGF0ZV9Ub3RhbFZvdWNoZXJzQmFsYW5jZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmciYUD", "height": 2862945, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8TY8oZGdgXuDPcuztrGvsRrgesDYJ18XVnpvuL57cocn Next: none Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | let maximum_order_size = 10000000000 | |
25 | 25 | ||
26 | 26 | let maximum_voucher_size = 100000000 | |
27 | + | ||
28 | + | @Callable(i) | |
29 | + | func Fill_Vouchers_Liquidity () = { | |
30 | + | let calleraddress = toBase58String(i.caller.bytes) | |
31 | + | let pmt = if ((size(i.payments) == 1)) | |
32 | + | then i.payments[0] | |
33 | + | else throw("No payment attached, Please Attach only Whitelisted Tokens in payment[1].") | |
34 | + | let PreviousVouchersBalance = match getInteger(this, "Available_Vouchers_Balance") { | |
35 | + | case a: Int => | |
36 | + | a | |
37 | + | case _ => | |
38 | + | 0 | |
39 | + | } | |
40 | + | let TotalVouchersBalance = (PreviousVouchersBalance + pmt.amount) | |
41 | + | let PreviousVouchersCounterID = match getInteger(this, "Vouchers_Counter_ID") { | |
42 | + | case a: Int => | |
43 | + | a | |
44 | + | case _ => | |
45 | + | 0 | |
46 | + | } | |
47 | + | let TotalVouchersCounterID = (PreviousVouchersCounterID + 1) | |
48 | + | if (isDefined(pmt.assetId)) | |
49 | + | then throw("Only WAVES is allowed to deposit at the moment") | |
50 | + | else [IntegerEntry("Available_Vouchers_Balance", TotalVouchersBalance), IntegerEntry((toString(TotalVouchersCounterID) + "_Voucher_Added_Amount"), pmt.amount), IntegerEntry("Vouchers_Counter_ID", TotalVouchersCounterID)] | |
51 | + | } | |
52 | + | ||
53 | + | ||
27 | 54 | ||
28 | 55 | @Callable(i) | |
29 | 56 | func Issue_Vouchers (Voucher_Amount,User_ID,User_Address) = { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let pool_liquidity_address = "3N4wBgYtWgJW2LTRef2ekWQTrEXCRfXmGLh" | |
5 | 5 | ||
6 | 6 | let Dapp_Address_pub_key = base58'EXLfxKmqhQPiProBaoPatTentUSZX5Dd8A8bYDcmfNwt' | |
7 | 7 | ||
8 | 8 | let product_launch_timestamp = 1695427860000 | |
9 | 9 | ||
10 | 10 | let Currency_ID = "WAVES" | |
11 | 11 | ||
12 | 12 | let product_launch_error = "Product Launch Timestamp is set at " | |
13 | 13 | ||
14 | 14 | let no_payment_error = "No payment attached, Please Attach Token in payment[1]." | |
15 | 15 | ||
16 | 16 | let closed_oracle_eror = "Oracle is closed. Wait Until Oracle is Turned On." | |
17 | 17 | ||
18 | 18 | let whitelist_address = addressFromPublicKey(Dapp_Address_pub_key) | |
19 | 19 | ||
20 | 20 | let network_fee = 900000 | |
21 | 21 | ||
22 | 22 | let minimum_order_size = 10000000 | |
23 | 23 | ||
24 | 24 | let maximum_order_size = 10000000000 | |
25 | 25 | ||
26 | 26 | let maximum_voucher_size = 100000000 | |
27 | + | ||
28 | + | @Callable(i) | |
29 | + | func Fill_Vouchers_Liquidity () = { | |
30 | + | let calleraddress = toBase58String(i.caller.bytes) | |
31 | + | let pmt = if ((size(i.payments) == 1)) | |
32 | + | then i.payments[0] | |
33 | + | else throw("No payment attached, Please Attach only Whitelisted Tokens in payment[1].") | |
34 | + | let PreviousVouchersBalance = match getInteger(this, "Available_Vouchers_Balance") { | |
35 | + | case a: Int => | |
36 | + | a | |
37 | + | case _ => | |
38 | + | 0 | |
39 | + | } | |
40 | + | let TotalVouchersBalance = (PreviousVouchersBalance + pmt.amount) | |
41 | + | let PreviousVouchersCounterID = match getInteger(this, "Vouchers_Counter_ID") { | |
42 | + | case a: Int => | |
43 | + | a | |
44 | + | case _ => | |
45 | + | 0 | |
46 | + | } | |
47 | + | let TotalVouchersCounterID = (PreviousVouchersCounterID + 1) | |
48 | + | if (isDefined(pmt.assetId)) | |
49 | + | then throw("Only WAVES is allowed to deposit at the moment") | |
50 | + | else [IntegerEntry("Available_Vouchers_Balance", TotalVouchersBalance), IntegerEntry((toString(TotalVouchersCounterID) + "_Voucher_Added_Amount"), pmt.amount), IntegerEntry("Vouchers_Counter_ID", TotalVouchersCounterID)] | |
51 | + | } | |
52 | + | ||
53 | + | ||
27 | 54 | ||
28 | 55 | @Callable(i) | |
29 | 56 | func Issue_Vouchers (Voucher_Amount,User_ID,User_Address) = { | |
30 | 57 | let read_TotalVouchersBalance = valueOrErrorMessage(getInteger(this, "Available_Vouchers_Balance"), "Available_Vouchers_Balance Entry is not Found. Initiate Fill_Vouchers_Liquidity Function first.") | |
31 | 58 | let update_TotalVouchersBalance = (read_TotalVouchersBalance - Voucher_Amount) | |
32 | 59 | let VouchersIssuedToUser = match getInteger(this, ("Total_Vouchers_Issued_To_" + User_Address)) { | |
33 | 60 | case a: Int => | |
34 | 61 | a | |
35 | 62 | case _ => | |
36 | 63 | 0 | |
37 | 64 | } | |
38 | 65 | let TotalVouchersIssuedToUser = (VouchersIssuedToUser + 1) | |
39 | 66 | let VouchersAmountIssuedToUser = match getInteger(this, ("Total_Vouchers_Amount_Issued_To_" + User_Address)) { | |
40 | 67 | case a: Int => | |
41 | 68 | a | |
42 | 69 | case _ => | |
43 | 70 | 0 | |
44 | 71 | } | |
45 | 72 | let TotalVouchersAmountIssuedToUser = (VouchersAmountIssuedToUser + Voucher_Amount) | |
46 | 73 | let PreviousUserDeposit = match getInteger(this, ((Currency_ID + "_") + User_Address)) { | |
47 | 74 | case a: Int => | |
48 | 75 | a | |
49 | 76 | case _ => | |
50 | 77 | 0 | |
51 | 78 | } | |
52 | 79 | let TotalUserDeposit = (PreviousUserDeposit + Voucher_Amount) | |
53 | 80 | if ((i.caller != addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx"))) | |
54 | 81 | then throw((("This Address is not Authorized. Only " + toString(addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx"))) + " is Authorized Address to Sign it.")) | |
55 | 82 | else if ((0 >= Voucher_Amount)) | |
56 | 83 | then throw("Voucher Balance can't be 0 or go in negative State. Increase the Voucher Amount.") | |
57 | 84 | else if ((0 >= update_TotalVouchersBalance)) | |
58 | 85 | then throw((("Updated Voucher Balance can't go in negative State of " + toString(update_TotalVouchersBalance)) + " /10^8 WAVES. Reduce the Voucher Amount.")) | |
59 | 86 | else if ((Voucher_Amount > maximum_voucher_size)) | |
60 | 87 | then throw((("Input Voucher Balance can't exceed the set maximum limit of " + toString(maximum_voucher_size)) + "/10^8 Waves.")) | |
61 | 88 | else [IntegerEntry(("Total_Vouchers_Issued_To_" + User_Address), TotalVouchersIssuedToUser), IntegerEntry(("Total_Vouchers_Amount_Issued_To_" + User_Address), TotalVouchersAmountIssuedToUser), IntegerEntry(((Currency_ID + "_") + User_Address), TotalUserDeposit), IntegerEntry("Available_Vouchers_Balance", update_TotalVouchersBalance)] | |
62 | 89 | } | |
63 | 90 | ||
64 | 91 | ||
65 | 92 | @Verifier(tx) | |
66 | 93 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
67 | 94 |
github/deemru/w8io/026f985 24.20 ms ◑