tx · AsFSPZmAmm4NcNE7ArHk3wXgq5W9EEzkfYM3XVTAUHWG

3N1Sy1orAx7cA4DiXHsPc4qtpWoJcAh4zDc:  -0.01000000 Waves

2024.06.01 17:56 [3131773] smart account 3N1Sy1orAx7cA4DiXHsPc4qtpWoJcAh4zDc > SELF 0.00000000 Waves

{ "type": 13, "id": "AsFSPZmAmm4NcNE7ArHk3wXgq5W9EEzkfYM3XVTAUHWG", "fee": 1000000, "feeAssetId": null, "timestamp": 1717253773321, "version": 2, "chainId": 84, "sender": "3N1Sy1orAx7cA4DiXHsPc4qtpWoJcAh4zDc", "senderPublicKey": "49zi6CveYsNs7mCRBAxfBriVPMfCo9R4hXtDKcttRB6o", "proofs": [ "3Mkc3kHkEuJKrQNzWaVtWGsswp8nseZQJhgktKTuXwXGYpht6sDBV3CBT2BKSP9c2GTgdx4xgXBUnqtdAAe6B8fw" ], "script": "base64:AAIFAAAAAAAAABMIAhIECgIECBIDCgEIEgQKAggIAAAACwAAAAALYmFpX2Fzc2V0aWQBAAAAIJPhcjhxBJtq6JpjHwQkt2RTlyw+vGYLg3SvaLskjeJCAAAAAAphZG1pbl9hZGRyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUJLF+sAJh9V8XvAADJ9ItRG8u66/iRYjfAAAAAA5kYXBwUnVubmluZ0tleQIAAAAUY29uZl9kYXBwX2lzX3J1bm5pbmcAAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAABRjb25mX21haW50ZW5hbmNlX21zZwAAAAALZGFwcFJ1bm5pbmcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAEdGhpcwUAAAAOZGFwcFJ1bm5pbmdLZXkGAAAAAA5tYWludGVuYW5jZU1TRwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAABFtYWludGVuYW5jZU1TR0tleQIAAAAAAAAAAA5TVEFUVVNfUEVORElORwIAAAAHUEVORElORwAAAAAQU1RBVFVT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AAAAQUAAAABaQQAAAACaWQIBQAAAAskdDAxNzc3MTgxNgAAAAJfMQQAAAAGY2FsbGVyCAUAAAALJHQwMTc3NzE4MTYAAAACXzIEAAAABGRhdGUIBQAAAAskdDAxNzc3MTgxNgAAAAJfMwMJAQAAAA9jb250YWluc0VsZW1lbnQAAAACCQAETAAAAAIFAAAACmFkbWluX2FkZHIJAARMAAAAAgkABCUAAAABBQAAAAR0aGlzBQAAAANuaWwFAAAABmNhbGxlcgQAAAAEZGF0YQkBAAAACWdldFN0ckJ5SwAAAAEJAAEsAAAAAgkAASwAAAACBQAAAAR0eGlkAgAAAAFfBQAAAA5TVEFUVVNfUEVORElORwMJAAAAAAAAAgUAAAAEZGF0YQIAAAAACQAAAgAAAAECAAAAEVJlcXVlc3Qgbm90IGZvdW5kCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAR0eGlkAgAAAAFfBQAAABBTVEFUVVNfUFJPQ0VTU0VECQABLAAAAAIJAAEsAAAAAgUAAAAEZGF0YQIAAAABXwUAAAAKYm5iX3R4aGFzaAUAAAADbmlsCQAAAgAAAAECAAAAIllvdSBhcmUgbm90IGFsbG93ZWQgdG8gY2hhbmdlIHRoaXMAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVRg7kI=", "height": 3131773, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: CoXfRA2qzqmgrWaupjXWvJx6GXFauzeZkRQjG8FnjP6z Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 5 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let bai_assetid = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
5+
6+let admin_addr = Address(base58'3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp')
7+
8+let dappRunningKey = "conf_dapp_is_running"
9+
10+let maintenanceMSGKey = "conf_maintenance_msg"
11+
12+let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
13+
14+let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
15+
16+let STATUS_PENDING = "PENDING"
17+
18+let STATUS_PROCESSED = "PROCESSED"
19+
20+func getStrByK (key) = valueOrElse(getString(this, key), "")
21+
22+
23+func getPaymentData (i) = if ((size(i.payments) == 0))
24+ then throw("No payment attached")
25+ else {
26+ let payment = value(i.payments[0])
27+ let amount = value(payment.amount)
28+ let asset = value(payment.assetId)
29+ $Tuple2(amount, asset)
30+ }
31+
32+
33+func idCallerDate (i) = if (!(dappRunning))
34+ then throw(maintenanceMSG)
35+ else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
36+
37+
38+@Callable(i)
39+func appRunning (isLive,message) = {
40+ let $t011361175 = idCallerDate(i)
41+ let id = $t011361175._1
42+ let caller = $t011361175._2
43+ let date = $t011361175._3
44+ if (containsElement([admin_addr, toString(this)], caller))
45+ then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
46+ else throw("You are not allowed to change this")
47+ }
48+
49+
50+
51+@Callable(i)
52+func deposit (bnb_addres) = {
53+ let $t014611500 = getPaymentData(i)
54+ let amount = $t014611500._1
55+ let asset = $t014611500._2
56+ if ((asset != bai_assetid))
57+ then throw("Only BAI token accepted")
58+ else {
59+ let $t015821621 = idCallerDate(i)
60+ let id = $t015821621._1
61+ let caller = $t015821621._2
62+ let date = $t015821621._3
63+[StringEntry(((id + "_") + STATUS_PENDING), ((caller + "_") + toString(amount)))]
64+ }
65+ }
66+
67+
68+
69+@Callable(i)
70+func finalize (txid,bnb_txhash) = {
71+ let $t017771816 = idCallerDate(i)
72+ let id = $t017771816._1
73+ let caller = $t017771816._2
74+ let date = $t017771816._3
75+ if (containsElement([admin_addr, toString(this)], caller))
76+ then {
77+ let data = getStrByK(((txid + "_") + STATUS_PENDING))
78+ if ((data == ""))
79+ then throw("Request not found")
80+ else [StringEntry(((txid + "_") + STATUS_PROCESSED), ((data + "_") + bnb_txhash))]
81+ }
82+ else throw("You are not allowed to change this")
83+ }
84+
85+
86+@Verifier(tx)
87+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
88+

github/deemru/w8io/026f985 
47.84 ms