tx · 8TY8oZGdgXuDPcuztrGvsRrgesDYJ18XVnpvuL57cocn 3MsNdm7ZAcUGdroTCNhcNNoP5Mki8BPmth3: -0.01000000 Waves 2023.11.28 10:17 [2862941] smart account 3MsNdm7ZAcUGdroTCNhcNNoP5Mki8BPmth3 > SELF 0.00000000 Waves
{ "type": 13, "id": "8TY8oZGdgXuDPcuztrGvsRrgesDYJ18XVnpvuL57cocn", "fee": 1000000, "feeAssetId": null, "timestamp": 1701155850206, "version": 2, "chainId": 84, "sender": "3MsNdm7ZAcUGdroTCNhcNNoP5Mki8BPmth3", "senderPublicKey": "5HjuMYPyr7sMjFBTkSU6U7rvf92cJQ6xF2HMKjcw973J", "proofs": [ "5UK8tHeFQjNwaSZhLYtcbK8GC2heTGmvwuUjfaiw6B4h16dtKAWuFKPzC3wF2Jgcup1PhiDMjdLoGRaZsRzv86Sd" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMBCAgAAAAMAAAAABZwb29sX2xpcXVpZGl0eV9hZGRyZXNzAgAAACMzTjR3QmdZdFdnSlcyTFRSZWYyZWtXUVRyRVhDUmZYbUdMaAAAAAAURGFwcF9BZGRyZXNzX3B1Yl9rZXkBAAAAIMjtmNqG7lU1WGDHPJboKlti9SIwxR/k7IFRCWjnzhpzAAAAABhwcm9kdWN0X2xhdW5jaF90aW1lc3RhbXAAAAABir9gFiAAAAAAC0N1cnJlbmN5X0lEAgAAAAVXQVZFUwAAAAAUcHJvZHVjdF9sYXVuY2hfZXJyb3ICAAAAI1Byb2R1Y3QgTGF1bmNoIFRpbWVzdGFtcCBpcyBzZXQgYXQgAAAAABBub19wYXltZW50X2Vycm9yAgAAADdObyBwYXltZW50IGF0dGFjaGVkLCBQbGVhc2UgQXR0YWNoIFRva2VuIGluIHBheW1lbnRbMV0uAAAAABJjbG9zZWRfb3JhY2xlX2Vyb3ICAAAAMU9yYWNsZSBpcyBjbG9zZWQuIFdhaXQgVW50aWwgT3JhY2xlIGlzIFR1cm5lZCBPbi4A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91bnRJc3N1ZWRUb1VzZXIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAtDdXJyZW5jeV9JRAIAAAABXwUAAAAMVXNlcl9BZGRyZXNzBQAAABBUb3RhbFVzZXJEZXBvc2l0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAABpBdmFpbGFibGVfVm91Y2hlcnNfQmFsYW5jZQUAAAAbdXBkYXRlX1RvdGFsVm91Y2hlcnNCYWxhbmNlBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleXMEHzc=", "height": 2862941, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Daz26Pg7AcUhyPYNaNvFVQs85yjUqgmCroo9oe3Xuy3w Next: ByD7qrJXoWbdBnC53XKptc7QbgTw1MpCb6xEipqquu2U Diff:
Old | New | Differences | |
---|---|---|---|
50 | 50 | 0 | |
51 | 51 | } | |
52 | 52 | let TotalUserDeposit = (PreviousUserDeposit + Voucher_Amount) | |
53 | - | if ((0 >= Voucher_Amount)) | |
54 | - | then throw("Voucher Balance can't be 0 or go in negative State. Increase the Voucher Amount.") | |
55 | - | else if ((0 >= update_TotalVouchersBalance)) | |
56 | - | then throw((("Updated Voucher Balance can't go in negative State of " + toString(update_TotalVouchersBalance)) + " /10^8 WAVES. Reduce the Voucher Amount.")) | |
57 | - | else if ((Voucher_Amount > maximum_voucher_size)) | |
58 | - | then throw((("Input Voucher Balance can't exceed the set maximum limit of " + toString(maximum_voucher_size)) + "/10^8 Waves.")) | |
59 | - | 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)] | |
53 | + | if ((i.caller != addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx"))) | |
54 | + | then throw((("This Address is not Authorized. Only " + toString(addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx"))) + " is Authorized Address to Sign it.")) | |
55 | + | else if ((0 >= Voucher_Amount)) | |
56 | + | then throw("Voucher Balance can't be 0 or go in negative State. Increase the Voucher Amount.") | |
57 | + | else if ((0 >= update_TotalVouchersBalance)) | |
58 | + | then throw((("Updated Voucher Balance can't go in negative State of " + toString(update_TotalVouchersBalance)) + " /10^8 WAVES. Reduce the Voucher Amount.")) | |
59 | + | else if ((Voucher_Amount > maximum_voucher_size)) | |
60 | + | then throw((("Input Voucher Balance can't exceed the set maximum limit of " + toString(maximum_voucher_size)) + "/10^8 Waves.")) | |
61 | + | 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)] | |
60 | 62 | } | |
61 | 63 | ||
62 | 64 |
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 | 27 | ||
28 | 28 | @Callable(i) | |
29 | 29 | func Issue_Vouchers (Voucher_Amount,User_ID,User_Address) = { | |
30 | 30 | let read_TotalVouchersBalance = valueOrErrorMessage(getInteger(this, "Available_Vouchers_Balance"), "Available_Vouchers_Balance Entry is not Found. Initiate Fill_Vouchers_Liquidity Function first.") | |
31 | 31 | let update_TotalVouchersBalance = (read_TotalVouchersBalance - Voucher_Amount) | |
32 | 32 | let VouchersIssuedToUser = match getInteger(this, ("Total_Vouchers_Issued_To_" + User_Address)) { | |
33 | 33 | case a: Int => | |
34 | 34 | a | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | let TotalVouchersIssuedToUser = (VouchersIssuedToUser + 1) | |
39 | 39 | let VouchersAmountIssuedToUser = match getInteger(this, ("Total_Vouchers_Amount_Issued_To_" + User_Address)) { | |
40 | 40 | case a: Int => | |
41 | 41 | a | |
42 | 42 | case _ => | |
43 | 43 | 0 | |
44 | 44 | } | |
45 | 45 | let TotalVouchersAmountIssuedToUser = (VouchersAmountIssuedToUser + Voucher_Amount) | |
46 | 46 | let PreviousUserDeposit = match getInteger(this, ((Currency_ID + "_") + User_Address)) { | |
47 | 47 | case a: Int => | |
48 | 48 | a | |
49 | 49 | case _ => | |
50 | 50 | 0 | |
51 | 51 | } | |
52 | 52 | let TotalUserDeposit = (PreviousUserDeposit + Voucher_Amount) | |
53 | - | if ((0 >= Voucher_Amount)) | |
54 | - | then throw("Voucher Balance can't be 0 or go in negative State. Increase the Voucher Amount.") | |
55 | - | else if ((0 >= update_TotalVouchersBalance)) | |
56 | - | then throw((("Updated Voucher Balance can't go in negative State of " + toString(update_TotalVouchersBalance)) + " /10^8 WAVES. Reduce the Voucher Amount.")) | |
57 | - | else if ((Voucher_Amount > maximum_voucher_size)) | |
58 | - | then throw((("Input Voucher Balance can't exceed the set maximum limit of " + toString(maximum_voucher_size)) + "/10^8 Waves.")) | |
59 | - | 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)] | |
53 | + | if ((i.caller != addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx"))) | |
54 | + | then throw((("This Address is not Authorized. Only " + toString(addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx"))) + " is Authorized Address to Sign it.")) | |
55 | + | else if ((0 >= Voucher_Amount)) | |
56 | + | then throw("Voucher Balance can't be 0 or go in negative State. Increase the Voucher Amount.") | |
57 | + | else if ((0 >= update_TotalVouchersBalance)) | |
58 | + | then throw((("Updated Voucher Balance can't go in negative State of " + toString(update_TotalVouchersBalance)) + " /10^8 WAVES. Reduce the Voucher Amount.")) | |
59 | + | else if ((Voucher_Amount > maximum_voucher_size)) | |
60 | + | then throw((("Input Voucher Balance can't exceed the set maximum limit of " + toString(maximum_voucher_size)) + "/10^8 Waves.")) | |
61 | + | 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)] | |
60 | 62 | } | |
61 | 63 | ||
62 | 64 | ||
63 | 65 | @Verifier(tx) | |
64 | 66 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
65 | 67 |
github/deemru/w8io/026f985 25.92 ms ◑