tx · 7gxj8wgP6CYiRKVdFzrJZnp3Lj8rs1ZDRmbrAQsqRGB5 3MytuyxG75kHY91sNzmHux9xCzUN8FHM4DG: -0.01200000 Waves 2024.09.21 13:02 [3293261] smart account 3MytuyxG75kHY91sNzmHux9xCzUN8FHM4DG > SELF 0.00000000 Waves
{ "type": 13, "id": "7gxj8wgP6CYiRKVdFzrJZnp3Lj8rs1ZDRmbrAQsqRGB5", "fee": 1200000, "feeAssetId": null, "timestamp": 1726913010845, "version": 2, "chainId": 84, "sender": "3MytuyxG75kHY91sNzmHux9xCzUN8FHM4DG", "senderPublicKey": "4JNWrRNexiT3ApCKPgynPrc9Z7JiEfeMgZHQHsAAdo3F", "proofs": [ "5ATC5m5s4wg2ZX7dNhZ268dEWMiiH8PGyrjT4acCUSkxkcJwx8BkA9N4CGrTtkzBZnuSAZUXfXYU4awUHifrTEjQ" ], "script": "base64:AAIFAAAAAAAAACkIAhIECgIICBIECgIECBIECgIICBIGCgQICAQIEgYKBAEICAgSAwoBCAAAABEBAAAACWdldFN0ckJ5SwAAAAEAAAADa2V5CQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQEAAAAJZ2V0SW50QnlLAAAAAQAAAANrZXkJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AAAAAAtiYWlfYXNzZXRpZAEAAAAgk+FyOHEEm2rommMfBCS3ZFOXLD68ZguDdK9ouySN4kIAAAAACmFkbWluX2FkZHIJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVRMt+97USOtxJNludqur6uEerVW/OLJLEAAAAAAD25vbl9jaXJjdWxhdGluZwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVOxqMNqLPdIMxcP9+gH3uQ9Up6mTAoNHuwAAAAAOZGFwcFJ1bm5pbmdLZXkCAAAAFGNvbmZfZGFwcF9pc19ydW5uaW5nAAAAABFtYWludGVuYW5jZU1TR0tleQIAAAAUY29uZl9tYWludGVuYW5jZV9tc2cAAAAAC2RhcHBSdW5uaW5nCQEAA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AAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5xtuoIg==", "height": 3293261, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 38ggDLJZL435p2AHATRqtF7V6Qb299oanFE47GWp8LPM Next: GJoveZp8Dpn5cQGbEYBtzjZX3NWMgXRLew251CY19oCZ Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | let STATUS_PENDING = "PENDING" | |
25 | 25 | ||
26 | 26 | let STATUS_PROCESSED = "PROCESSED" | |
27 | + | ||
28 | + | let STATUS_REJECTED = "REJECTED" | |
27 | 29 | ||
28 | 30 | let supported_recipients_network = split(valueOrElse(getStrByK("supported_recipients_network"), "bnb_base"), "_") | |
29 | 31 | ||
58 | 60 | ||
59 | 61 | @Callable(i) | |
60 | 62 | func appRunning (isLive,message) = { | |
61 | - | let $ | |
62 | - | let id = $ | |
63 | - | let caller = $ | |
64 | - | let date = $ | |
63 | + | let $t021512190 = idCallerDate(i) | |
64 | + | let id = $t021512190._1 | |
65 | + | let caller = $t021512190._2 | |
66 | + | let date = $t021512190._3 | |
65 | 67 | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
66 | 68 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
67 | 69 | else throw("You are not allowed to change this") | |
71 | 73 | ||
72 | 74 | @Callable(i) | |
73 | 75 | func deposit (recipient_address,recipient_network) = { | |
74 | - | let $ | |
75 | - | let amount = $ | |
76 | - | let asset = $ | |
76 | + | let $t025192558 = getPaymentData(i) | |
77 | + | let amount = $t025192558._1 | |
78 | + | let asset = $t025192558._2 | |
77 | 79 | if ((asset != bai_assetid)) | |
78 | 80 | then throw("Only BAI token accepted") | |
79 | 81 | else { | |
80 | - | let $ | |
81 | - | let id = $ | |
82 | - | let caller = $ | |
83 | - | let date = $ | |
82 | + | let $t026412680 = idCallerDate(i) | |
83 | + | let id = $t026412680._1 | |
84 | + | let caller = $t026412680._2 | |
85 | + | let date = $t026412680._3 | |
84 | 86 | if ((0 >= (amount - service_fee))) | |
85 | 87 | then throw("Cannot bridge non positive amount!") | |
86 | 88 | else if (!(containsElement(supported_recipients_network, recipient_network))) | |
92 | 94 | ||
93 | 95 | ||
94 | 96 | @Callable(i) | |
95 | - | func finalize (data_key_without_status,recipient_tx_txhash) = { | |
96 | - | let $ | |
97 | - | let id = $ | |
98 | - | let caller = $ | |
99 | - | let date = $ | |
97 | + | func finalize (data_key_without_status,recipient_tx_txhash,reject,msg) = { | |
98 | + | let $t032443283 = idCallerDate(i) | |
99 | + | let id = $t032443283._1 | |
100 | + | let caller = $t032443283._2 | |
101 | + | let date = $t032443283._3 | |
100 | 102 | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
101 | 103 | then { | |
102 | 104 | let data = valueOrElse(getStrByK(((data_key_without_status + "_") + STATUS_PENDING)), "") | |
110 | 112 | let deposit_height = valueOrElse(parseInt(split(data, "_")[4]), 0) | |
111 | 113 | if ((confirmations_required > (height - deposit_height))) | |
112 | 114 | then throw("Required confirmation not reached.") | |
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)] | |
115 | + | else if (reject) | |
116 | + | then [DeleteEntry(((data_key_without_status + "_") + STATUS_PENDING)), StringEntry(((data_key_without_status + "_") + STATUS_REJECTED), ((data + "_") + msg)), ScriptTransfer(Address(fromBase58String(split(data, "_")[0])), amount, bai_assetid)] | |
117 | + | 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 | 118 | } | |
115 | 119 | } | |
116 | 120 | } | |
123 | 127 | func withdraw (amount,recipient_address,sourceChain,sourceChainDepositTxId) = if ((valueOrElse(getIntByK(((((("WITHDRAW_" + sourceChainDepositTxId) + "_") + recipient_address) + "_") + sourceChain)), 0) != 0)) | |
124 | 128 | then throw("Withdraw already processed.") | |
125 | 129 | else { | |
126 | - | let $ | |
127 | - | let id = $ | |
128 | - | let caller = $ | |
129 | - | let date = $ | |
130 | + | let $t048714910 = idCallerDate(i) | |
131 | + | let id = $t048714910._1 | |
132 | + | let caller = $t048714910._2 | |
133 | + | let date = $t048714910._3 | |
130 | 134 | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
131 | 135 | then { | |
132 | 136 | let bai_balance_before = valueOrElse(assetBalance(this, bai_assetid), 0) | |
153 | 157 | ||
154 | 158 | @Callable(i) | |
155 | 159 | func deleteEntry (entry) = { | |
156 | - | let $ | |
157 | - | let id = $ | |
158 | - | let caller = $ | |
159 | - | let date = $ | |
160 | + | let $t056925731 = idCallerDate(i) | |
161 | + | let id = $t056925731._1 | |
162 | + | let caller = $t056925731._2 | |
163 | + | let date = $t056925731._3 | |
160 | 164 | if ((caller == toString(admin_addr))) | |
161 | 165 | then [DeleteEntry(entry)] | |
162 | 166 | 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 | 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 | + | ||
28 | + | let STATUS_REJECTED = "REJECTED" | |
27 | 29 | ||
28 | 30 | let supported_recipients_network = split(valueOrElse(getStrByK("supported_recipients_network"), "bnb_base"), "_") | |
29 | 31 | ||
30 | 32 | let confirmations_required = valueOrElse(getIntByK("confirmations_required"), 5) | |
31 | 33 | ||
32 | 34 | let service_fee = valueOrElse(getIntByK("service_fee"), 25000000) | |
33 | 35 | ||
34 | 36 | func getPaymentData (i) = if ((size(i.payments) == 0)) | |
35 | 37 | then throw("No payment attached") | |
36 | 38 | else { | |
37 | 39 | let payment = value(i.payments[0]) | |
38 | 40 | let amount = value(payment.amount) | |
39 | 41 | let asset = value(payment.assetId) | |
40 | 42 | $Tuple2(amount, asset) | |
41 | 43 | } | |
42 | 44 | ||
43 | 45 | ||
44 | 46 | func idCallerDate (i) = if (!(dappRunning)) | |
45 | 47 | then throw(maintenanceMSG) | |
46 | 48 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
47 | 49 | ||
48 | 50 | ||
49 | 51 | @Callable(invoke) | |
50 | 52 | func setConf (key,val) = { | |
51 | 53 | let caller = toString(invoke.caller) | |
52 | 54 | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
53 | 55 | then [StringEntry(key, val)] | |
54 | 56 | else throw("You are not allowed to change this") | |
55 | 57 | } | |
56 | 58 | ||
57 | 59 | ||
58 | 60 | ||
59 | 61 | @Callable(i) | |
60 | 62 | func appRunning (isLive,message) = { | |
61 | - | let $ | |
62 | - | let id = $ | |
63 | - | let caller = $ | |
64 | - | let date = $ | |
63 | + | let $t021512190 = idCallerDate(i) | |
64 | + | let id = $t021512190._1 | |
65 | + | let caller = $t021512190._2 | |
66 | + | let date = $t021512190._3 | |
65 | 67 | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
66 | 68 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
67 | 69 | else throw("You are not allowed to change this") | |
68 | 70 | } | |
69 | 71 | ||
70 | 72 | ||
71 | 73 | ||
72 | 74 | @Callable(i) | |
73 | 75 | func deposit (recipient_address,recipient_network) = { | |
74 | - | let $ | |
75 | - | let amount = $ | |
76 | - | let asset = $ | |
76 | + | let $t025192558 = getPaymentData(i) | |
77 | + | let amount = $t025192558._1 | |
78 | + | let asset = $t025192558._2 | |
77 | 79 | if ((asset != bai_assetid)) | |
78 | 80 | then throw("Only BAI token accepted") | |
79 | 81 | else { | |
80 | - | let $ | |
81 | - | let id = $ | |
82 | - | let caller = $ | |
83 | - | let date = $ | |
82 | + | let $t026412680 = idCallerDate(i) | |
83 | + | let id = $t026412680._1 | |
84 | + | let caller = $t026412680._2 | |
85 | + | let date = $t026412680._3 | |
84 | 86 | if ((0 >= (amount - service_fee))) | |
85 | 87 | then throw("Cannot bridge non positive amount!") | |
86 | 88 | else if (!(containsElement(supported_recipients_network, recipient_network))) | |
87 | 89 | then throw("Recipient network not supported") | |
88 | 90 | else [StringEntry(((((((((("DEPOSIT_" + id) + "_") + caller) + "_") + recipient_address) + "_") + recipient_network) + "_") + STATUS_PENDING), ((((((((caller + "_") + toString((amount - service_fee))) + "_") + recipient_address) + "_") + recipient_network) + "_") + toString(height)))] | |
89 | 91 | } | |
90 | 92 | } | |
91 | 93 | ||
92 | 94 | ||
93 | 95 | ||
94 | 96 | @Callable(i) | |
95 | - | func finalize (data_key_without_status,recipient_tx_txhash) = { | |
96 | - | let $ | |
97 | - | let id = $ | |
98 | - | let caller = $ | |
99 | - | let date = $ | |
97 | + | func finalize (data_key_without_status,recipient_tx_txhash,reject,msg) = { | |
98 | + | let $t032443283 = idCallerDate(i) | |
99 | + | let id = $t032443283._1 | |
100 | + | let caller = $t032443283._2 | |
101 | + | let date = $t032443283._3 | |
100 | 102 | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
101 | 103 | then { | |
102 | 104 | let data = valueOrElse(getStrByK(((data_key_without_status + "_") + STATUS_PENDING)), "") | |
103 | 105 | if ((data == "")) | |
104 | 106 | then throw("Request not found") | |
105 | 107 | else { | |
106 | 108 | let amount = valueOrElse(parseInt(split(data, "_")[1]), 0) | |
107 | 109 | if ((0 > amount)) | |
108 | 110 | then throw("Cannot transfer non positive amount") | |
109 | 111 | else { | |
110 | 112 | let deposit_height = valueOrElse(parseInt(split(data, "_")[4]), 0) | |
111 | 113 | if ((confirmations_required > (height - deposit_height))) | |
112 | 114 | then throw("Required confirmation not reached.") | |
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)] | |
115 | + | else if (reject) | |
116 | + | then [DeleteEntry(((data_key_without_status + "_") + STATUS_PENDING)), StringEntry(((data_key_without_status + "_") + STATUS_REJECTED), ((data + "_") + msg)), ScriptTransfer(Address(fromBase58String(split(data, "_")[0])), amount, bai_assetid)] | |
117 | + | 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 | 118 | } | |
115 | 119 | } | |
116 | 120 | } | |
117 | 121 | else throw("You are not allowed to change this") | |
118 | 122 | } | |
119 | 123 | ||
120 | 124 | ||
121 | 125 | ||
122 | 126 | @Callable(i) | |
123 | 127 | func withdraw (amount,recipient_address,sourceChain,sourceChainDepositTxId) = if ((valueOrElse(getIntByK(((((("WITHDRAW_" + sourceChainDepositTxId) + "_") + recipient_address) + "_") + sourceChain)), 0) != 0)) | |
124 | 128 | then throw("Withdraw already processed.") | |
125 | 129 | else { | |
126 | - | let $ | |
127 | - | let id = $ | |
128 | - | let caller = $ | |
129 | - | let date = $ | |
130 | + | let $t048714910 = idCallerDate(i) | |
131 | + | let id = $t048714910._1 | |
132 | + | let caller = $t048714910._2 | |
133 | + | let date = $t048714910._3 | |
130 | 134 | if (containsElement([toString(admin_addr), toString(this)], caller)) | |
131 | 135 | then { | |
132 | 136 | let bai_balance_before = valueOrElse(assetBalance(this, bai_assetid), 0) | |
133 | 137 | if ((bai_balance_before == bai_balance_before)) | |
134 | 138 | then { | |
135 | 139 | let swap = invoke(non_circulating, "withdraw", [amount], nil) | |
136 | 140 | if ((swap == swap)) | |
137 | 141 | then { | |
138 | 142 | let bai_balance_after = valueOrElse(assetBalance(this, bai_assetid), 0) | |
139 | 143 | if ((bai_balance_after == bai_balance_after)) | |
140 | 144 | then if (((bai_balance_after - bai_balance_before) == amount)) | |
141 | 145 | then [ScriptTransfer(Address(fromBase58String(recipient_address)), amount, bai_assetid), IntegerEntry(((((("WITHDRAW_" + sourceChainDepositTxId) + "_") + recipient_address) + "_") + sourceChain), amount)] | |
142 | 146 | else throw("Something went wrong during non circulating amount withdraw.") | |
143 | 147 | else throw("Strict value is not equal to itself.") | |
144 | 148 | } | |
145 | 149 | else throw("Strict value is not equal to itself.") | |
146 | 150 | } | |
147 | 151 | else throw("Strict value is not equal to itself.") | |
148 | 152 | } | |
149 | 153 | else throw("You are not allowed to change this") | |
150 | 154 | } | |
151 | 155 | ||
152 | 156 | ||
153 | 157 | ||
154 | 158 | @Callable(i) | |
155 | 159 | func deleteEntry (entry) = { | |
156 | - | let $ | |
157 | - | let id = $ | |
158 | - | let caller = $ | |
159 | - | let date = $ | |
160 | + | let $t056925731 = idCallerDate(i) | |
161 | + | let id = $t056925731._1 | |
162 | + | let caller = $t056925731._2 | |
163 | + | let date = $t056925731._3 | |
160 | 164 | if ((caller == toString(admin_addr))) | |
161 | 165 | then [DeleteEntry(entry)] | |
162 | 166 | else throw("no") | |
163 | 167 | } | |
164 | 168 | ||
165 | 169 | ||
166 | 170 | @Verifier(tx) | |
167 | 171 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
168 | 172 |
github/deemru/w8io/169f3d6 35.09 ms ◑