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/36Afe5D1SnqZMCg0e7AAAAAA5kYXBwUnVubmluZ0tleQIAAAAUY29uZl9kYXBwX2lzX3J1bm5pbmcAAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAABRjb25mX21haW50ZW5hbmNlX21zZwAAAAALZGFwcFJ1bm5pbmcJAQAAAAt2YWx1ZU9yR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pcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAiWW91IGFyZSBub3QgYWxsb3dlZCB0byBjaGFuZ2UgdGhpcwAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAAFZW50cnkEAAAACyR0MDU3NTI1NzkxCQEAAAAMaWRDYWxsZXJEYXRlAAAAAQUAAAABaQQAAAACaWQIBQAAAAskdDA1NzUyNTc5MQAAAAJfMQQAAAAGY2FsbGVyCAUAAAALJHQwNTc1MjU3OTEAAAACXzIEAAAABGRhdGUIBQAAAAskdDA1NzUyNTc5MQAAAAJfMwMJAAAAAAAAAgUAAAAGY2FsbGVyCQAEJQAAAAEFAAAACmFkbWluX2FkZHIJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAAAJubwAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5IurfLw==", "height": 3294426, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GJoveZp8Dpn5cQGbEYBtzjZX3NWMgXRLew251CY19oCZ Next: FV9ZBRKM1f7t38aPwWLyUXAPKpBy6VrQGuAXMiUYbQX5 Diff:
Old | New | Differences | |
---|---|---|---|
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(r) | |
97 | - | func finalize (I,J,K | |
98 | - | let | |
99 | - | let C = | |
100 | - | let y = | |
101 | - | let D = | |
97 | + | func finalize (I,J,K) = { | |
98 | + | let L = v(r) | |
99 | + | let C = L._1 | |
100 | + | let y = L._2 | |
101 | + | let D = L._3 | |
102 | 102 | if (containsElement([toString(e), toString(this)], y)) | |
103 | 103 | then { | |
104 | - | let | |
105 | - | if (( | |
104 | + | let M = valueOrElse(a(((I + "_") + k)), "") | |
105 | + | if ((M == "")) | |
106 | 106 | then throw("Request not found") | |
107 | 107 | else { | |
108 | - | let t = valueOrElse(parseInt(split( | |
108 | + | let t = valueOrElse(parseInt(split(M, "_")[1]), 0) | |
109 | 109 | if ((0 > t)) | |
110 | 110 | then throw("Cannot transfer non positive amount") | |
111 | - | else if ( | |
112 | - | then [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + m), (( | |
113 | - | else [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + l), | |
111 | + | else if (J) | |
112 | + | then [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + m), ((M + "_") + K)), ScriptTransfer(Address(fromBase58String(split(M, "_")[0])), t, d)] | |
113 | + | else [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + l), M), ScriptTransfer(f, t, d)] | |
114 | 114 | } | |
115 | 115 | } | |
116 | 116 | else throw("You are not allowed to change this") | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | @Callable(r) | |
122 | - | func withdraw (t,E,O | |
122 | + | func withdraw (t,E,N,O) = if ((valueOrElse(c(((((("WITHDRAW_" + O) + "_") + E) + "_") + N)), 0) != 0)) | |
123 | 123 | then throw("Withdraw already processed.") | |
124 | 124 | else { | |
125 | - | let | |
126 | - | let C = | |
127 | - | let y = | |
128 | - | let D = | |
125 | + | let P = v(r) | |
126 | + | let C = P._1 | |
127 | + | let y = P._2 | |
128 | + | let D = P._3 | |
129 | 129 | if (containsElement([toString(e), toString(this)], y)) | |
130 | 130 | then { | |
131 | - | let | |
132 | - | if (( | |
131 | + | let Q = valueOrElse(assetBalance(this, d), 0) | |
132 | + | if ((Q == Q)) | |
133 | 133 | then { | |
134 | - | let | |
135 | - | if (( | |
134 | + | let R = invoke(f, "withdraw", [t], nil) | |
135 | + | if ((R == R)) | |
136 | 136 | then { | |
137 | - | let | |
138 | - | if (( | |
139 | - | then if ((( | |
140 | - | then [ScriptTransfer(Address(fromBase58String(E)), t, d), IntegerEntry(((((("WITHDRAW_" + | |
137 | + | let S = valueOrElse(assetBalance(this, d), 0) | |
138 | + | if ((S == S)) | |
139 | + | then if (((S - Q) == t)) | |
140 | + | then [ScriptTransfer(Address(fromBase58String(E)), t, d), IntegerEntry(((((("WITHDRAW_" + O) + "_") + E) + "_") + N), t)] | |
141 | 141 | else throw("Something went wrong during non circulating amount withdraw.") | |
142 | 142 | else throw("Strict value is not equal to itself.") | |
143 | 143 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(r) | |
154 | - | func deleteEntry ( | |
155 | - | let | |
156 | - | let C = | |
157 | - | let y = | |
158 | - | let D = | |
154 | + | func deleteEntry (T) = { | |
155 | + | let U = v(r) | |
156 | + | let C = U._1 | |
157 | + | let y = U._2 | |
158 | + | let D = U._3 | |
159 | 159 | if ((y == toString(e))) | |
160 | - | then [DeleteEntry( | |
160 | + | then [DeleteEntry(T)] | |
161 | 161 | else throw("no") | |
162 | 162 | } | |
163 | 163 | ||
164 | 164 | ||
165 | - | @Verifier( | |
166 | - | func | |
165 | + | @Verifier(V) | |
166 | + | func W () = sigVerify(V.bodyBytes, V.proofs[0], V.senderPublicKey) | |
167 | 167 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = getString(this, b) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func c (b) = getInteger(this, b) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | let d = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1' | |
11 | 11 | ||
12 | 12 | let e = Address(base58'3MvujUZTtoANRzrKYKzx99Vtb9TUh6VPCDm') | |
13 | 13 | ||
14 | 14 | let f = Address(base58'3NBU8TThHH5YUSk26iGEGU1jHM7vSR3ZTPx') | |
15 | 15 | ||
16 | 16 | let g = "conf_dapp_is_running" | |
17 | 17 | ||
18 | 18 | let h = "conf_maintenance_msg" | |
19 | 19 | ||
20 | 20 | let i = valueOrElse(getBoolean(this, g), true) | |
21 | 21 | ||
22 | 22 | let j = valueOrElse(getString(this, h), "") | |
23 | 23 | ||
24 | 24 | let k = "PENDING" | |
25 | 25 | ||
26 | 26 | let l = "PROCESSED" | |
27 | 27 | ||
28 | 28 | let m = "REJECTED" | |
29 | 29 | ||
30 | 30 | let n = split(valueOrElse(a("supported_recipients_network"), "bnb_base"), "_") | |
31 | 31 | ||
32 | 32 | let o = valueOrElse(c("confirmations_required"), 5) | |
33 | 33 | ||
34 | 34 | let p = valueOrElse(c("service_fee"), 25000000) | |
35 | 35 | ||
36 | 36 | func q (r) = if ((size(r.payments) == 0)) | |
37 | 37 | then throw("No payment attached") | |
38 | 38 | else { | |
39 | 39 | let s = value(r.payments[0]) | |
40 | 40 | let t = value(s.amount) | |
41 | 41 | let u = value(s.assetId) | |
42 | 42 | $Tuple2(t, u) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func v (r) = if (!(i)) | |
47 | 47 | then throw(j) | |
48 | 48 | else $Tuple3(toBase58String(r.transactionId), toBase58String(r.caller.bytes), lastBlock.timestamp) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(w) | |
52 | 52 | func setConf (b,x) = { | |
53 | 53 | let y = toString(w.caller) | |
54 | 54 | if (containsElement([toString(e), toString(this)], y)) | |
55 | 55 | then [StringEntry(b, x)] | |
56 | 56 | else throw("You are not allowed to change this") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Callable(r) | |
62 | 62 | func appRunning (z,A) = { | |
63 | 63 | let B = v(r) | |
64 | 64 | let C = B._1 | |
65 | 65 | let y = B._2 | |
66 | 66 | let D = B._3 | |
67 | 67 | if (containsElement([toString(e), toString(this)], y)) | |
68 | 68 | then [BooleanEntry(g, z), StringEntry(h, A)] | |
69 | 69 | else throw("You are not allowed to change this") | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(r) | |
75 | 75 | func deposit (E,F) = { | |
76 | 76 | let G = q(r) | |
77 | 77 | let t = G._1 | |
78 | 78 | let u = G._2 | |
79 | 79 | if ((u != d)) | |
80 | 80 | then throw("Only BAI token accepted") | |
81 | 81 | else { | |
82 | 82 | let H = v(r) | |
83 | 83 | let C = H._1 | |
84 | 84 | let y = H._2 | |
85 | 85 | let D = H._3 | |
86 | 86 | if ((0 >= (t - p))) | |
87 | 87 | then throw("Cannot bridge non positive amount!") | |
88 | 88 | else if (!(containsElement(n, F))) | |
89 | 89 | then throw("Recipient network not supported") | |
90 | 90 | else [StringEntry(((((((((("DEPOSIT_" + C) + "_") + y) + "_") + E) + "_") + F) + "_") + k), ((((((((y + "_") + toString((t - p))) + "_") + E) + "_") + F) + "_") + toString(height)))] | |
91 | 91 | } | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(r) | |
97 | - | func finalize (I,J,K | |
98 | - | let | |
99 | - | let C = | |
100 | - | let y = | |
101 | - | let D = | |
97 | + | func finalize (I,J,K) = { | |
98 | + | let L = v(r) | |
99 | + | let C = L._1 | |
100 | + | let y = L._2 | |
101 | + | let D = L._3 | |
102 | 102 | if (containsElement([toString(e), toString(this)], y)) | |
103 | 103 | then { | |
104 | - | let | |
105 | - | if (( | |
104 | + | let M = valueOrElse(a(((I + "_") + k)), "") | |
105 | + | if ((M == "")) | |
106 | 106 | then throw("Request not found") | |
107 | 107 | else { | |
108 | - | let t = valueOrElse(parseInt(split( | |
108 | + | let t = valueOrElse(parseInt(split(M, "_")[1]), 0) | |
109 | 109 | if ((0 > t)) | |
110 | 110 | then throw("Cannot transfer non positive amount") | |
111 | - | else if ( | |
112 | - | then [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + m), (( | |
113 | - | else [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + l), | |
111 | + | else if (J) | |
112 | + | then [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + m), ((M + "_") + K)), ScriptTransfer(Address(fromBase58String(split(M, "_")[0])), t, d)] | |
113 | + | else [DeleteEntry(((I + "_") + k)), StringEntry(((I + "_") + l), M), ScriptTransfer(f, t, d)] | |
114 | 114 | } | |
115 | 115 | } | |
116 | 116 | else throw("You are not allowed to change this") | |
117 | 117 | } | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | ||
121 | 121 | @Callable(r) | |
122 | - | func withdraw (t,E,O | |
122 | + | func withdraw (t,E,N,O) = if ((valueOrElse(c(((((("WITHDRAW_" + O) + "_") + E) + "_") + N)), 0) != 0)) | |
123 | 123 | then throw("Withdraw already processed.") | |
124 | 124 | else { | |
125 | - | let | |
126 | - | let C = | |
127 | - | let y = | |
128 | - | let D = | |
125 | + | let P = v(r) | |
126 | + | let C = P._1 | |
127 | + | let y = P._2 | |
128 | + | let D = P._3 | |
129 | 129 | if (containsElement([toString(e), toString(this)], y)) | |
130 | 130 | then { | |
131 | - | let | |
132 | - | if (( | |
131 | + | let Q = valueOrElse(assetBalance(this, d), 0) | |
132 | + | if ((Q == Q)) | |
133 | 133 | then { | |
134 | - | let | |
135 | - | if (( | |
134 | + | let R = invoke(f, "withdraw", [t], nil) | |
135 | + | if ((R == R)) | |
136 | 136 | then { | |
137 | - | let | |
138 | - | if (( | |
139 | - | then if ((( | |
140 | - | then [ScriptTransfer(Address(fromBase58String(E)), t, d), IntegerEntry(((((("WITHDRAW_" + | |
137 | + | let S = valueOrElse(assetBalance(this, d), 0) | |
138 | + | if ((S == S)) | |
139 | + | then if (((S - Q) == t)) | |
140 | + | then [ScriptTransfer(Address(fromBase58String(E)), t, d), IntegerEntry(((((("WITHDRAW_" + O) + "_") + E) + "_") + N), t)] | |
141 | 141 | else throw("Something went wrong during non circulating amount withdraw.") | |
142 | 142 | else throw("Strict value is not equal to itself.") | |
143 | 143 | } | |
144 | 144 | else throw("Strict value is not equal to itself.") | |
145 | 145 | } | |
146 | 146 | else throw("Strict value is not equal to itself.") | |
147 | 147 | } | |
148 | 148 | else throw("You are not allowed to change this") | |
149 | 149 | } | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | @Callable(r) | |
154 | - | func deleteEntry ( | |
155 | - | let | |
156 | - | let C = | |
157 | - | let y = | |
158 | - | let D = | |
154 | + | func deleteEntry (T) = { | |
155 | + | let U = v(r) | |
156 | + | let C = U._1 | |
157 | + | let y = U._2 | |
158 | + | let D = U._3 | |
159 | 159 | if ((y == toString(e))) | |
160 | - | then [DeleteEntry( | |
160 | + | then [DeleteEntry(T)] | |
161 | 161 | else throw("no") | |
162 | 162 | } | |
163 | 163 | ||
164 | 164 | ||
165 | - | @Verifier( | |
166 | - | func | |
165 | + | @Verifier(V) | |
166 | + | func W () = sigVerify(V.bodyBytes, V.proofs[0], V.senderPublicKey) | |
167 | 167 |
github/deemru/w8io/026f985 58.18 ms ◑