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