tx · Y3doXeR5u2zALiBoPsWi4BgY2HeAKnzswisL26VA49A 3MqqcLhm76wiWz5KLfLDST8MXPufuunLUMN: -0.01000000 Waves 2024.09.17 11:12 [3287412] smart account 3MqqcLhm76wiWz5KLfLDST8MXPufuunLUMN > SELF 0.00000000 Waves
{ "type": 13, "id": "Y3doXeR5u2zALiBoPsWi4BgY2HeAKnzswisL26VA49A", "fee": 1000000, "feeAssetId": null, "timestamp": 1726560734493, "version": 2, "chainId": 84, "sender": "3MqqcLhm76wiWz5KLfLDST8MXPufuunLUMN", "senderPublicKey": "7Ho7tSsDi1wFzsLjrEXbGRtsfps2kpEqLkQiDtJ1KbUf", "proofs": [ "3t97tLtwZMopooAyqckAEdV96MjLr3rJ9vVR9RPGGrkU8jC2EfmmX3BDbBVjJYMcuKwD1QFF95pEy4ETSiwztPFv" ], "script": "base64:AAIFAAAAAAAAAB8IAhIECgIICBIECgIECBIECgIICBIECgIICBIDCgEIAAAADwEAAAAJZ2V0U3RyQnlLAAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AgAAAAABAAAACWdldEludEJ5SwAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAAAAAALYmFpX2Fzc2V0aWQBAAAAIJPhcjhxBJtq6JpjHwQkt2RTlyw+vGYLg3SvaLskjeJCAAAAAAphZG1pbl9hZGRyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUTLfve1EjrcSTZbnarq+rhHq1VvziySxAAAAAAA9ub25fY2lyY3VsYXRpbmcJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVTsajDaiz3SDMXD/foB97kPVKepkwKDR7sAAAAADmRhcHBSdW5uaW5nS2V5AgAAABRjb25mX2RhcHBfaXNfcnVubmluZwAAAAARbWFpbnRlbmFuY2VNU0dLZXkCAAAAFGNvbmZfbWF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AAAAKYWRtaW5fYWRkcgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAVlbnRyeQUAAAADbmlsCQAAAgAAAAECAAAAAm5vAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmNHANw", "height": 3287412, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: HR3VJzg7N3QWFDbpsPgTB9Ee6AM5z28TBrBMjgaA7kW7 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
5 | + | ||
6 | + | ||
7 | + | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
8 | + | ||
9 | + | ||
10 | + | let bai_assetid = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1' | |
11 | + | ||
12 | + | let admin_addr = Address(base58'3MvujUZTtoANRzrKYKzx99Vtb9TUh6VPCDm') | |
13 | + | ||
14 | + | let non_circulating = Address(base58'3NBU8TThHH5YUSk26iGEGU1jHM7vSR3ZTPx') | |
15 | + | ||
16 | + | let dappRunningKey = "conf_dapp_is_running" | |
17 | + | ||
18 | + | let maintenanceMSGKey = "conf_maintenance_msg" | |
19 | + | ||
20 | + | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
21 | + | ||
22 | + | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
23 | + | ||
24 | + | let STATUS_PENDING = "PENDING" | |
25 | + | ||
26 | + | let STATUS_PROCESSED = "PROCESSED" | |
27 | + | ||
28 | + | let supported_recipients = split(valueOrElse(getStrByK("supported_recipients"), "bnb_base"), "_") | |
29 | + | ||
30 | + | let confirmations_required = valueOrElse(getIntByK("confirmations_required"), 5) | |
31 | + | ||
32 | + | func getPaymentData (i) = if ((size(i.payments) == 0)) | |
33 | + | then throw("No payment attached") | |
34 | + | else { | |
35 | + | let payment = value(i.payments[0]) | |
36 | + | let amount = value(payment.amount) | |
37 | + | let asset = value(payment.assetId) | |
38 | + | $Tuple2(amount, asset) | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func idCallerDate (i) = if (!(dappRunning)) | |
43 | + | then throw(maintenanceMSG) | |
44 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
45 | + | ||
46 | + | ||
47 | + | @Callable(invoke) | |
48 | + | func setConf (key,val) = { | |
49 | + | let caller = toString(invoke.caller) | |
50 | + | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
51 | + | then [StringEntry(key, val)] | |
52 | + | else throw("You are not allowed to change this") | |
53 | + | } | |
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | @Callable(i) | |
58 | + | func appRunning (isLive,message) = { | |
59 | + | let $t020012040 = idCallerDate(i) | |
60 | + | let id = $t020012040._1 | |
61 | + | let caller = $t020012040._2 | |
62 | + | let date = $t020012040._3 | |
63 | + | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
64 | + | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
65 | + | else throw("You are not allowed to change this") | |
66 | + | } | |
67 | + | ||
68 | + | ||
69 | + | ||
70 | + | @Callable(i) | |
71 | + | func deposit (recipient_address,recipient_network) = { | |
72 | + | let $t023692408 = getPaymentData(i) | |
73 | + | let amount = $t023692408._1 | |
74 | + | let asset = $t023692408._2 | |
75 | + | if ((asset != bai_assetid)) | |
76 | + | then throw("Only BAI token accepted") | |
77 | + | else { | |
78 | + | let $t024902529 = idCallerDate(i) | |
79 | + | let id = $t024902529._1 | |
80 | + | let caller = $t024902529._2 | |
81 | + | let date = $t024902529._3 | |
82 | + | if (!(containsElement(supported_recipients, recipient_network))) | |
83 | + | then throw("Recipient network not supported") | |
84 | + | else [StringEntry(((((((((id + "_") + caller) + "_") + recipient_address) + "_") + recipient_network) + "_") + STATUS_PENDING), ((((((((caller + "_") + toString(amount)) + "_") + recipient_address) + "_") + recipient_network) + "_") + toString(height)))] | |
85 | + | } | |
86 | + | } | |
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | @Callable(i) | |
91 | + | func finalize (data_key_without_status,recipient_tx_txhash) = { | |
92 | + | let $t029462985 = idCallerDate(i) | |
93 | + | let id = $t029462985._1 | |
94 | + | let caller = $t029462985._2 | |
95 | + | let date = $t029462985._3 | |
96 | + | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
97 | + | then { | |
98 | + | let data = getStrByK(((data_key_without_status + "_") + STATUS_PENDING)) | |
99 | + | if ((data == "")) | |
100 | + | then throw("Request not found") | |
101 | + | else { | |
102 | + | let amount = valueOrElse(parseInt(split(data, "_")[1]), 0) | |
103 | + | if ((0 > amount)) | |
104 | + | then throw("Cannot transfer non positive amount") | |
105 | + | else { | |
106 | + | let deposit_height = valueOrElse(parseInt(split(data, "_")[4]), 0) | |
107 | + | if ((confirmations_required > (height - deposit_height))) | |
108 | + | then throw("Required confirmation not reached.") | |
109 | + | else [DeleteEntry(((data_key_without_status + "_") + STATUS_PENDING)), StringEntry(((data_key_without_status + "_") + STATUS_PROCESSED), ((data + "_") + recipient_tx_txhash)), ScriptTransfer(non_circulating, amount, bai_assetid)] | |
110 | + | } | |
111 | + | } | |
112 | + | } | |
113 | + | else throw("You are not allowed to change this") | |
114 | + | } | |
115 | + | ||
116 | + | ||
117 | + | ||
118 | + | @Callable(i) | |
119 | + | func deleteEntry (entry) = { | |
120 | + | let $t038793918 = idCallerDate(i) | |
121 | + | let id = $t038793918._1 | |
122 | + | let caller = $t038793918._2 | |
123 | + | let date = $t038793918._3 | |
124 | + | if ((caller == toString(admin_addr))) | |
125 | + | then [DeleteEntry(entry)] | |
126 | + | else throw("no") | |
127 | + | } | |
128 | + | ||
129 | + | ||
130 | + | @Verifier(tx) | |
131 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
132 | + |
github/deemru/w8io/026f985 25.01 ms ◑