tx · AHx1LcCw3ijTb2EjK9A8JNDJYLmwF2HfG6iE2eu98f8N

3MytuyxG75kHY91sNzmHux9xCzUN8FHM4DG:  -0.01100000 Waves

2024.09.22 08:08 [3294426] smart account 3MytuyxG75kHY91sNzmHux9xCzUN8FHM4DG > SELF 0.00000000 Waves

{ "type": 13, "id": "AHx1LcCw3ijTb2EjK9A8JNDJYLmwF2HfG6iE2eu98f8N", "fee": 1100000, "feeAssetId": null, "timestamp": 1726981725880, "version": 2, "chainId": 84, "sender": "3MytuyxG75kHY91sNzmHux9xCzUN8FHM4DG", "senderPublicKey": "4JNWrRNexiT3ApCKPgynPrc9Z7JiEfeMgZHQHsAAdo3F", "proofs": [ "31LkegdHRggZGSUi4bmzfGj8hiw8YuFShM26vbMnT8yu7bhfN3xmFhKtKyRxiTwXcoan6iaSQmnS69fp5phbC6FD" ], "script": "base64:AAIFAAAAAAAAACgIAhIECgIICBIECgIECBIECgIICBIFCgMIBAgSBgoEAQgICBIDCgEIAAAAEQEAAAAJZ2V0U3RyQnlLAAAAAQAAAANrZXkJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AQAAAAlnZXRJbnRCeUsAAAABAAAAA2tleQkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkAAAAAC2JhaV9hc3NldGlkAQAAACCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgAAAAAKYWRtaW5fYWRkcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVEy373tRI63Ek2W52q6vq4R6tVb84sksQAAAAAAPbm9uX2NpcmN1bGF0aW5nCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU7Gow2os90gzFw/36Afe5D1SnqZMCg0e7AAAAAA5kYXBwUnVubmluZ0tleQIAAAAUY29uZl9kYXBwX2lzX3J1bm5pbmcAAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAABRjb25mX21haW50ZW5hbmNlX21zZwAAAAALZGFwcFJ1bm5pbmcJAQAAAAt2YWx1ZU9y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BpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAiWW91IGFyZSBub3QgYWxsb3dlZCB0byBjaGFuZ2UgdGhpcwAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAAFZW50cnkEAAAACyR0MDU3NTI1NzkxCQEAAAAMaWRDYWxsZXJEYXRlAAAAAQUAAAABaQQAAAACaWQIBQAAAAskdDA1NzUyNTc5MQAAAAJfMQQAAAAGY2FsbGVyCAUAAAALJHQwNTc1MjU3OTEAAAACXzIEAAAABGRhdGUIBQAAAAskdDA1NzUyNTc5MQAAAAJfMwMJAAAAAAAAAgUAAAAGY2FsbGVyCQAEJQAAAAEFAAAACmFkbWluX2FkZHIJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAAAJubwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5IurfLw==", "height": 3294426, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GJoveZp8Dpn5cQGbEYBtzjZX3NWMgXRLew251CY19oCZ Next: FV9ZBRKM1f7t38aPwWLyUXAPKpBy6VrQGuAXMiUYbQX5 Diff:
OldNewDifferences
9494
9595
9696 @Callable(i)
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
97+func finalize (data_key_without_status,reject,msg) = {
98+ let $t032153254 = idCallerDate(i)
99+ let id = $t032153254._1
100+ let caller = $t032153254._2
101+ let date = $t032153254._3
102102 if (containsElement([toString(admin_addr), toString(this)], caller))
103103 then {
104104 let data = valueOrElse(getStrByK(((data_key_without_status + "_") + STATUS_PENDING)), "")
110110 then throw("Cannot transfer non positive amount")
111111 else if (reject)
112112 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)]
113+ else [DeleteEntry(((data_key_without_status + "_") + STATUS_PENDING)), StringEntry(((data_key_without_status + "_") + STATUS_PROCESSED), data), ScriptTransfer(non_circulating, amount, bai_assetid)]
114114 }
115115 }
116116 else throw("You are not allowed to change this")
122122 func withdraw (amount,recipient_address,sourceChain,sourceChainDepositTxId) = if ((valueOrElse(getIntByK(((((("WITHDRAW_" + sourceChainDepositTxId) + "_") + recipient_address) + "_") + sourceChain)), 0) != 0))
123123 then throw("Withdraw already processed.")
124124 else {
125- let $t048734912 = idCallerDate(i)
126- let id = $t048734912._1
127- let caller = $t048734912._2
128- let date = $t048734912._3
125+ let $t048204859 = idCallerDate(i)
126+ let id = $t048204859._1
127+ let caller = $t048204859._2
128+ let date = $t048204859._3
129129 if (containsElement([toString(admin_addr), toString(this)], caller))
130130 then {
131131 let bai_balance_before = valueOrElse(assetBalance(this, bai_assetid), 0)
152152
153153 @Callable(i)
154154 func deleteEntry (entry) = {
155- let $t056945733 = idCallerDate(i)
156- let id = $t056945733._1
157- let caller = $t056945733._2
158- let date = $t056945733._3
155+ let $t057525791 = idCallerDate(i)
156+ let id = $t057525791._1
157+ let caller = $t057525791._2
158+ let date = $t057525791._3
159159 if ((caller == toString(admin_addr)))
160160 then [DeleteEntry(entry)]
161161 else throw("no")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStrByK (key) = getString(this, key)
55
66
77 func getIntByK (key) = getInteger(this, key)
88
99
1010 let bai_assetid = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
1111
1212 let admin_addr = Address(base58'3MvujUZTtoANRzrKYKzx99Vtb9TUh6VPCDm')
1313
1414 let non_circulating = Address(base58'3NBU8TThHH5YUSk26iGEGU1jHM7vSR3ZTPx')
1515
1616 let dappRunningKey = "conf_dapp_is_running"
1717
1818 let maintenanceMSGKey = "conf_maintenance_msg"
1919
2020 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
2121
2222 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
2323
2424 let STATUS_PENDING = "PENDING"
2525
2626 let STATUS_PROCESSED = "PROCESSED"
2727
2828 let STATUS_REJECTED = "REJECTED"
2929
3030 let supported_recipients_network = split(valueOrElse(getStrByK("supported_recipients_network"), "bnb_base"), "_")
3131
3232 let confirmations_required = valueOrElse(getIntByK("confirmations_required"), 5)
3333
3434 let service_fee = valueOrElse(getIntByK("service_fee"), 25000000)
3535
3636 func getPaymentData (i) = if ((size(i.payments) == 0))
3737 then throw("No payment attached")
3838 else {
3939 let payment = value(i.payments[0])
4040 let amount = value(payment.amount)
4141 let asset = value(payment.assetId)
4242 $Tuple2(amount, asset)
4343 }
4444
4545
4646 func idCallerDate (i) = if (!(dappRunning))
4747 then throw(maintenanceMSG)
4848 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
4949
5050
5151 @Callable(invoke)
5252 func setConf (key,val) = {
5353 let caller = toString(invoke.caller)
5454 if (containsElement([toString(admin_addr), toString(this)], caller))
5555 then [StringEntry(key, val)]
5656 else throw("You are not allowed to change this")
5757 }
5858
5959
6060
6161 @Callable(i)
6262 func appRunning (isLive,message) = {
6363 let $t021512190 = idCallerDate(i)
6464 let id = $t021512190._1
6565 let caller = $t021512190._2
6666 let date = $t021512190._3
6767 if (containsElement([toString(admin_addr), toString(this)], caller))
6868 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
6969 else throw("You are not allowed to change this")
7070 }
7171
7272
7373
7474 @Callable(i)
7575 func deposit (recipient_address,recipient_network) = {
7676 let $t025192558 = getPaymentData(i)
7777 let amount = $t025192558._1
7878 let asset = $t025192558._2
7979 if ((asset != bai_assetid))
8080 then throw("Only BAI token accepted")
8181 else {
8282 let $t026412680 = idCallerDate(i)
8383 let id = $t026412680._1
8484 let caller = $t026412680._2
8585 let date = $t026412680._3
8686 if ((0 >= (amount - service_fee)))
8787 then throw("Cannot bridge non positive amount!")
8888 else if (!(containsElement(supported_recipients_network, recipient_network)))
8989 then throw("Recipient network not supported")
9090 else [StringEntry(((((((((("DEPOSIT_" + id) + "_") + caller) + "_") + recipient_address) + "_") + recipient_network) + "_") + STATUS_PENDING), ((((((((caller + "_") + toString((amount - service_fee))) + "_") + recipient_address) + "_") + recipient_network) + "_") + toString(height)))]
9191 }
9292 }
9393
9494
9595
9696 @Callable(i)
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
97+func finalize (data_key_without_status,reject,msg) = {
98+ let $t032153254 = idCallerDate(i)
99+ let id = $t032153254._1
100+ let caller = $t032153254._2
101+ let date = $t032153254._3
102102 if (containsElement([toString(admin_addr), toString(this)], caller))
103103 then {
104104 let data = valueOrElse(getStrByK(((data_key_without_status + "_") + STATUS_PENDING)), "")
105105 if ((data == ""))
106106 then throw("Request not found")
107107 else {
108108 let amount = valueOrElse(parseInt(split(data, "_")[1]), 0)
109109 if ((0 > amount))
110110 then throw("Cannot transfer non positive amount")
111111 else if (reject)
112112 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)]
113+ else [DeleteEntry(((data_key_without_status + "_") + STATUS_PENDING)), StringEntry(((data_key_without_status + "_") + STATUS_PROCESSED), data), ScriptTransfer(non_circulating, amount, bai_assetid)]
114114 }
115115 }
116116 else throw("You are not allowed to change this")
117117 }
118118
119119
120120
121121 @Callable(i)
122122 func withdraw (amount,recipient_address,sourceChain,sourceChainDepositTxId) = if ((valueOrElse(getIntByK(((((("WITHDRAW_" + sourceChainDepositTxId) + "_") + recipient_address) + "_") + sourceChain)), 0) != 0))
123123 then throw("Withdraw already processed.")
124124 else {
125- let $t048734912 = idCallerDate(i)
126- let id = $t048734912._1
127- let caller = $t048734912._2
128- let date = $t048734912._3
125+ let $t048204859 = idCallerDate(i)
126+ let id = $t048204859._1
127+ let caller = $t048204859._2
128+ let date = $t048204859._3
129129 if (containsElement([toString(admin_addr), toString(this)], caller))
130130 then {
131131 let bai_balance_before = valueOrElse(assetBalance(this, bai_assetid), 0)
132132 if ((bai_balance_before == bai_balance_before))
133133 then {
134134 let swap = invoke(non_circulating, "withdraw", [amount], nil)
135135 if ((swap == swap))
136136 then {
137137 let bai_balance_after = valueOrElse(assetBalance(this, bai_assetid), 0)
138138 if ((bai_balance_after == bai_balance_after))
139139 then if (((bai_balance_after - bai_balance_before) == amount))
140140 then [ScriptTransfer(Address(fromBase58String(recipient_address)), amount, bai_assetid), IntegerEntry(((((("WITHDRAW_" + sourceChainDepositTxId) + "_") + recipient_address) + "_") + sourceChain), amount)]
141141 else throw("Something went wrong during non circulating amount withdraw.")
142142 else throw("Strict value is not equal to itself.")
143143 }
144144 else throw("Strict value is not equal to itself.")
145145 }
146146 else throw("Strict value is not equal to itself.")
147147 }
148148 else throw("You are not allowed to change this")
149149 }
150150
151151
152152
153153 @Callable(i)
154154 func deleteEntry (entry) = {
155- let $t056945733 = idCallerDate(i)
156- let id = $t056945733._1
157- let caller = $t056945733._2
158- let date = $t056945733._3
155+ let $t057525791 = idCallerDate(i)
156+ let id = $t057525791._1
157+ let caller = $t057525791._2
158+ let date = $t057525791._3
159159 if ((caller == toString(admin_addr)))
160160 then [DeleteEntry(entry)]
161161 else throw("no")
162162 }
163163
164164
165165 @Verifier(tx)
166166 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
167167

github/deemru/w8io/026f985 
31.54 ms