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+TsgVEJaOfOGnMAAAAAGHByb2R1Y3RfbGF1bmNoX3RpbWVzdGFtcAAAAAGKv2AWIAAAAAALQ3VycmVuY3lfSUQCAAAABVdBVkVTAAAAABRwcm9kdWN0X2xhdW5jaF9lcnJvcgIAAAAjUHJvZHVjdCBMYXVuY2ggVGltZXN0YW1wIGlzIHNldCBhdCAAAAAAEG5vX3BheW1lbnRfZXJyb3ICAAAAN05vIHBheW1lbnQgYXR0YWNoZWQsIFBsZWFzZSBBdHRhY2ggVG9rZW4gaW4gcGF5bWVudFsxXS4AAAAAEmNsb3NlZF9vcmFjbGVfZXJvcgIAAAAxT3JhY2xlIGlzIGNsb3NlZC4gV2FpdCBVbnRpbCBPcmFjbGUgaXMgVHVybmVkIE9uLg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pbXVtIGxpbWl0IG9mIAkAAaQAAAABBQAAABRtYXhpbXVtX3ZvdWNoZXJfc2l6ZQIAAAAMLzEwXjggV2F2ZXMuCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAAGVRvdGFsX1ZvdWNoZXJzX0lzc3VlZF9Ub18FAAAADFVzZXJfQWRkcmVzcwUAAAAZVG90YWxWb3VjaGVyc0lzc3VlZFRvVXNlcgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAACBUb3RhbF9Wb3VjaGVyc19BbW91bnRfSXNzdWVkX1RvXwUAAAAMVXNlcl9BZGRyZXNzBQAAAB9Ub3RhbFZvdWNoZXJzQW1vdW50SXNzdWVkVG9Vc2VyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAALQ3VycmVuY3lfSUQCAAAAAV8FAAAADFVzZXJfQWRkcmVzcwUAAAAQVG90YWxVc2VyRGVwb3NpdAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAaQXZhaWxhYmxlX1ZvdWNoZXJzX0JhbGFuY2UFAAAAG3VwZGF0ZV9Ub3RhbFZvdWNoZXJzQmFsYW5jZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmciYUD", "height": 2862945, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8TY8oZGdgXuDPcuztrGvsRrgesDYJ18XVnpvuL57cocn Next: none Diff:
OldNewDifferences
2424 let maximum_order_size = 10000000000
2525
2626 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+
2754
2855 @Callable(i)
2956 func Issue_Vouchers (Voucher_Amount,User_ID,User_Address) = {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let pool_liquidity_address = "3N4wBgYtWgJW2LTRef2ekWQTrEXCRfXmGLh"
55
66 let Dapp_Address_pub_key = base58'EXLfxKmqhQPiProBaoPatTentUSZX5Dd8A8bYDcmfNwt'
77
88 let product_launch_timestamp = 1695427860000
99
1010 let Currency_ID = "WAVES"
1111
1212 let product_launch_error = "Product Launch Timestamp is set at "
1313
1414 let no_payment_error = "No payment attached, Please Attach Token in payment[1]."
1515
1616 let closed_oracle_eror = "Oracle is closed. Wait Until Oracle is Turned On."
1717
1818 let whitelist_address = addressFromPublicKey(Dapp_Address_pub_key)
1919
2020 let network_fee = 900000
2121
2222 let minimum_order_size = 10000000
2323
2424 let maximum_order_size = 10000000000
2525
2626 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+
2754
2855 @Callable(i)
2956 func Issue_Vouchers (Voucher_Amount,User_ID,User_Address) = {
3057 let read_TotalVouchersBalance = valueOrErrorMessage(getInteger(this, "Available_Vouchers_Balance"), "Available_Vouchers_Balance Entry is not Found. Initiate Fill_Vouchers_Liquidity Function first.")
3158 let update_TotalVouchersBalance = (read_TotalVouchersBalance - Voucher_Amount)
3259 let VouchersIssuedToUser = match getInteger(this, ("Total_Vouchers_Issued_To_" + User_Address)) {
3360 case a: Int =>
3461 a
3562 case _ =>
3663 0
3764 }
3865 let TotalVouchersIssuedToUser = (VouchersIssuedToUser + 1)
3966 let VouchersAmountIssuedToUser = match getInteger(this, ("Total_Vouchers_Amount_Issued_To_" + User_Address)) {
4067 case a: Int =>
4168 a
4269 case _ =>
4370 0
4471 }
4572 let TotalVouchersAmountIssuedToUser = (VouchersAmountIssuedToUser + Voucher_Amount)
4673 let PreviousUserDeposit = match getInteger(this, ((Currency_ID + "_") + User_Address)) {
4774 case a: Int =>
4875 a
4976 case _ =>
5077 0
5178 }
5279 let TotalUserDeposit = (PreviousUserDeposit + Voucher_Amount)
5380 if ((i.caller != addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx")))
5481 then throw((("This Address is not Authorized. Only " + toString(addressFromStringValue("3MpLNn2CtrAbh2iWgX9zR26TSNxaLqtB1hx"))) + " is Authorized Address to Sign it."))
5582 else if ((0 >= Voucher_Amount))
5683 then throw("Voucher Balance can't be 0 or go in negative State. Increase the Voucher Amount.")
5784 else if ((0 >= update_TotalVouchersBalance))
5885 then throw((("Updated Voucher Balance can't go in negative State of " + toString(update_TotalVouchersBalance)) + " /10^8 WAVES. Reduce the Voucher Amount."))
5986 else if ((Voucher_Amount > maximum_voucher_size))
6087 then throw((("Input Voucher Balance can't exceed the set maximum limit of " + toString(maximum_voucher_size)) + "/10^8 Waves."))
6188 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)]
6289 }
6390
6491
6592 @Verifier(tx)
6693 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6794

github/deemru/w8io/026f985 
24.20 ms