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