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