tx · CoXfRA2qzqmgrWaupjXWvJx6GXFauzeZkRQjG8FnjP6z 3N1Sy1orAx7cA4DiXHsPc4qtpWoJcAh4zDc: -0.01000000 Waves 2024.06.01 18:00 [3131779] smart account 3N1Sy1orAx7cA4DiXHsPc4qtpWoJcAh4zDc > SELF 0.00000000 Waves
{ "type": 13, "id": "CoXfRA2qzqmgrWaupjXWvJx6GXFauzeZkRQjG8FnjP6z", "fee": 1000000, "feeAssetId": null, "timestamp": 1717254065067, "version": 2, "chainId": 84, "sender": "3N1Sy1orAx7cA4DiXHsPc4qtpWoJcAh4zDc", "senderPublicKey": "49zi6CveYsNs7mCRBAxfBriVPMfCo9R4hXtDKcttRB6o", "proofs": [ "496vGsYFCe41BMDQ7WMDVJ6Dum5YUYCJijE1CkRzQ7pbq7EiZoh1ssS8LegH4W3oV8Di23x92C288EhtyRj2U29C" ], "script": "base64:AAIFAAAAAAAAABgIAhIECgIECBIDCgEIEgQKAggIEgMKAQgAAAALAAAAAAtiYWlfYXNzZXRpZAEAAAAgk+FyOHEEm2rommMfBCS3ZFOXLD68ZguDdK9ouySN4kIAAAAACmFkbWluX2FkZHIJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQksX6wAmH1Xxe8AAMn0i1Eby7rr+JFiN8AAAAADmRhcHBSdW5uaW5nS2V5AgAAABRjb25mX2RhcHBfaXNfcnVubmluZwAAAAARbWFpbnRlbmFuY2VNU0dLZXkCAAAAFGNvbmZfbWFpbnRlbmFuY2VfbXNnAAAAAAtkYXBwUnVubmluZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAR0aGlzBQAAAA5kYXBwUnVubmluZ0tleQYAAAAADm1haW50ZW5hbmNlTVNHCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAAAAAAAAADlNUQVRVU19QRU5ESU5HAgAAAAdQRU5ESU5HAAAAABBTVEFUVVNfUFJP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RlclB1YmxpY0tlebiFjXA=", "height": 3131779, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AsFSPZmAmm4NcNE7ArHk3wXgq5W9EEzkfYM3XVTAUHWG Next: 5DAYN4pZMVLEWKQoRS6pqffn8ojVUJy1dAjqdqp3k2RL Diff:
Old | New | Differences | |
---|---|---|---|
60 | 60 | let id = $t015821621._1 | |
61 | 61 | let caller = $t015821621._2 | |
62 | 62 | let date = $t015821621._3 | |
63 | - | [StringEntry(((id + "_") + STATUS_PENDING), ((caller + "_") + toString(amount)))] | |
63 | + | [StringEntry(((id + "_") + STATUS_PENDING), ((((caller + "_") + toString(amount)) + "_") + bnb_addres))] | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 | ||
68 | 68 | ||
69 | 69 | @Callable(i) | |
70 | 70 | func finalize (txid,bnb_txhash) = { | |
71 | - | let $ | |
72 | - | let id = $ | |
73 | - | let caller = $ | |
74 | - | let date = $ | |
71 | + | let $t017921831 = idCallerDate(i) | |
72 | + | let id = $t017921831._1 | |
73 | + | let caller = $t017921831._2 | |
74 | + | let date = $t017921831._3 | |
75 | 75 | if (containsElement([admin_addr, toString(this)], caller)) | |
76 | 76 | then { | |
77 | 77 | let data = getStrByK(((txid + "_") + STATUS_PENDING)) | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | + | ||
87 | + | @Callable(i) | |
88 | + | func deleteEntry (entry) = { | |
89 | + | let caller = i.caller | |
90 | + | if ((caller == admin_addr)) | |
91 | + | then [DeleteEntry(entry)] | |
92 | + | else throw("no") | |
93 | + | } | |
94 | + | ||
95 | + | ||
86 | 96 | @Verifier(tx) | |
87 | 97 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
88 | 98 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let bai_assetid = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1' | |
5 | 5 | ||
6 | 6 | let admin_addr = Address(base58'3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp') | |
7 | 7 | ||
8 | 8 | let dappRunningKey = "conf_dapp_is_running" | |
9 | 9 | ||
10 | 10 | let maintenanceMSGKey = "conf_maintenance_msg" | |
11 | 11 | ||
12 | 12 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
13 | 13 | ||
14 | 14 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
15 | 15 | ||
16 | 16 | let STATUS_PENDING = "PENDING" | |
17 | 17 | ||
18 | 18 | let STATUS_PROCESSED = "PROCESSED" | |
19 | 19 | ||
20 | 20 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getPaymentData (i) = if ((size(i.payments) == 0)) | |
24 | 24 | then throw("No payment attached") | |
25 | 25 | else { | |
26 | 26 | let payment = value(i.payments[0]) | |
27 | 27 | let amount = value(payment.amount) | |
28 | 28 | let asset = value(payment.assetId) | |
29 | 29 | $Tuple2(amount, asset) | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func idCallerDate (i) = if (!(dappRunning)) | |
34 | 34 | then throw(maintenanceMSG) | |
35 | 35 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(i) | |
39 | 39 | func appRunning (isLive,message) = { | |
40 | 40 | let $t011361175 = idCallerDate(i) | |
41 | 41 | let id = $t011361175._1 | |
42 | 42 | let caller = $t011361175._2 | |
43 | 43 | let date = $t011361175._3 | |
44 | 44 | if (containsElement([admin_addr, toString(this)], caller)) | |
45 | 45 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
46 | 46 | else throw("You are not allowed to change this") | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(i) | |
52 | 52 | func deposit (bnb_addres) = { | |
53 | 53 | let $t014611500 = getPaymentData(i) | |
54 | 54 | let amount = $t014611500._1 | |
55 | 55 | let asset = $t014611500._2 | |
56 | 56 | if ((asset != bai_assetid)) | |
57 | 57 | then throw("Only BAI token accepted") | |
58 | 58 | else { | |
59 | 59 | let $t015821621 = idCallerDate(i) | |
60 | 60 | let id = $t015821621._1 | |
61 | 61 | let caller = $t015821621._2 | |
62 | 62 | let date = $t015821621._3 | |
63 | - | [StringEntry(((id + "_") + STATUS_PENDING), ((caller + "_") + toString(amount)))] | |
63 | + | [StringEntry(((id + "_") + STATUS_PENDING), ((((caller + "_") + toString(amount)) + "_") + bnb_addres))] | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Callable(i) | |
70 | 70 | func finalize (txid,bnb_txhash) = { | |
71 | - | let $ | |
72 | - | let id = $ | |
73 | - | let caller = $ | |
74 | - | let date = $ | |
71 | + | let $t017921831 = idCallerDate(i) | |
72 | + | let id = $t017921831._1 | |
73 | + | let caller = $t017921831._2 | |
74 | + | let date = $t017921831._3 | |
75 | 75 | if (containsElement([admin_addr, toString(this)], caller)) | |
76 | 76 | then { | |
77 | 77 | let data = getStrByK(((txid + "_") + STATUS_PENDING)) | |
78 | 78 | if ((data == "")) | |
79 | 79 | then throw("Request not found") | |
80 | 80 | else [StringEntry(((txid + "_") + STATUS_PROCESSED), ((data + "_") + bnb_txhash))] | |
81 | 81 | } | |
82 | 82 | else throw("You are not allowed to change this") | |
83 | 83 | } | |
84 | 84 | ||
85 | 85 | ||
86 | + | ||
87 | + | @Callable(i) | |
88 | + | func deleteEntry (entry) = { | |
89 | + | let caller = i.caller | |
90 | + | if ((caller == admin_addr)) | |
91 | + | then [DeleteEntry(entry)] | |
92 | + | else throw("no") | |
93 | + | } | |
94 | + | ||
95 | + | ||
86 | 96 | @Verifier(tx) | |
87 | 97 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
88 | 98 |
github/deemru/w8io/026f985 28.95 ms ◑