tx · 4fAxfGsTrmHf3QVnJzpBb49fHcZgburxkKBwbURaW93R 3Mqsp3PyjvwEYS7jXAQ73cP9uKzUKcpSRzg: -0.01400000 Waves 2021.10.31 12:20 [1770295] smart account 3Mqsp3PyjvwEYS7jXAQ73cP9uKzUKcpSRzg > SELF 0.00000000 Waves
{ "type": 13, "id": "4fAxfGsTrmHf3QVnJzpBb49fHcZgburxkKBwbURaW93R", "fee": 1400000, "feeAssetId": null, "timestamp": 1635672037260, "version": 1, "sender": "3Mqsp3PyjvwEYS7jXAQ73cP9uKzUKcpSRzg", "senderPublicKey": "AnaW2CiNfKM994en7tfMEztV7t5wraWM19fkKyNL1m8s", "proofs": [ "5GjKAbzog9iY5emiAVP1AbzDCk6yqQpbBUPSPoFThLajuHDZPcYbh716MCQoVPV1gaFsBN9BQ7RQWPqjiS5QrToc" ], "script": "base64:AAIFAAAAAAAAACEIAhIAEgQKAggEEgQKAggEEgMKAQgSAwoBARIDCgEIEgAAAAATAAAAAAZvcmFjbGUJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVSpHA/3It5Iym1Df/6r/XdrKhz2wqVE56sAAAAAEVNXT1Bnb3Zlcm5hbmNlQWRyCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAGb3JhY2xlAgAAAA9zd29wX2dvdmVybmFuY2UCAAAAGUVtcHR5IGtleSBzd29wX2dvdmVybmFuY2UAAAAADVdhdmVzVXNkblBvb2wJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAZvcmFjbGUCAAAAD1dBVkVTX1VTRE5fcG9vbAIAAAAhRW1wdHkga2V5IFNXT1BfZ292ZXJuYW5jZV9hZGRyZXNzAAAAAAljb25zdW1lcnMJAAS1AAAAAgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAZvcm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atus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = Address(base58'3N5LFb9VKspdbYuEQ6XFzmmYuVSrou1CgcA') | |
5 | + | ||
6 | + | let b = addressFromStringValue(valueOrErrorMessage(getString(a, "swop_governance"), "Empty key swop_governance")) | |
7 | + | ||
8 | + | let c = value(addressFromString(valueOrElse(getString(a, "WAVES_USDN_pool"), "Empty key SWOP_governance_address"))) | |
9 | + | ||
10 | + | let d = split(valueOrElse(getString(a, "consumers"), "Empty key consumer"), ",") | |
11 | + | ||
12 | + | let e = addressFromStringValue(valueOrElse(getString(a, "admin_1"), "Empty key admin_1")) | |
13 | + | ||
14 | + | let f = addressFromStringValue(valueOrElse(getString(a, "admin_2"), "Empty key admin_2")) | |
15 | + | ||
16 | + | let g = addressFromStringValue(valueOrElse(getString(a, "admin_3"), "Empty key admin_3")) | |
17 | + | ||
18 | + | let h = valueOrErrorMessage(getInteger(a, "protocol_fee_in_usdn"), "Empty protocol_fee_in_usdn") | |
19 | + | ||
20 | + | let i = valueOrErrorMessage(getBoolean(a, "is_protocol_active"), "Empty key is_protocol_active") | |
21 | + | ||
22 | + | let j = "_balance" | |
23 | + | ||
24 | + | let k = "fee_in_usdn" | |
25 | + | ||
26 | + | let l = "is_dapp_active" | |
27 | + | ||
28 | + | let m = "overall_balance" | |
29 | + | ||
30 | + | let n = valueOrErrorMessage(getBoolean(this, l), "Empty key is_dapp_active") | |
31 | + | ||
32 | + | let o = valueOrErrorMessage(getInteger(this, m), "Empty key overall_balance") | |
33 | + | ||
34 | + | let p = 500000 | |
35 | + | ||
36 | + | func q (r) = { | |
37 | + | let s = { | |
38 | + | let t = getInteger(this, (r + j)) | |
39 | + | if ($isInstanceOf(t, "Int")) | |
40 | + | then { | |
41 | + | let u = t | |
42 | + | u | |
43 | + | } | |
44 | + | else if ($isInstanceOf(t, "Unit")) | |
45 | + | then { | |
46 | + | let v = t | |
47 | + | 0 | |
48 | + | } | |
49 | + | else throw("Match error") | |
50 | + | } | |
51 | + | s | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | func w () = { | |
56 | + | let x = valueOrErrorMessage(getInteger(c, "B_asset_balance"), "Empty B_asset_balance") | |
57 | + | let y = valueOrErrorMessage(getInteger(c, "A_asset_balance"), "Empty A_asset_balance") | |
58 | + | let z = fraction(h, y, x) | |
59 | + | (z + p) | |
60 | + | } | |
61 | + | ||
62 | + | ||
63 | + | func A (B) = { | |
64 | + | let C = if (valueOrElse(getBoolean(e, "txStr"), false)) | |
65 | + | then 1 | |
66 | + | else 0 | |
67 | + | let D = if (valueOrElse(getBoolean(f, "txStr"), false)) | |
68 | + | then 1 | |
69 | + | else 0 | |
70 | + | let E = if (valueOrElse(getBoolean(g, "txStr"), false)) | |
71 | + | then 1 | |
72 | + | else 0 | |
73 | + | (((C + D) + E) >= 2) | |
74 | + | } | |
75 | + | ||
76 | + | ||
77 | + | @Callable(F) | |
78 | + | func init () = if (if (isDefined(getString(this, "is_dapp_active"))) | |
79 | + | then true | |
80 | + | else isDefined(getInteger(this, "overall_balance"))) | |
81 | + | then throw("Already initialized") | |
82 | + | else [IntegerEntry("overall_balance", 0), BooleanEntry("is_dapp_active", true)] | |
83 | + | ||
84 | + | ||
85 | + | ||
86 | + | @Callable(F) | |
87 | + | func updateAutomateStatus (G,H) = if (!(if (i) | |
88 | + | then n | |
89 | + | else false)) | |
90 | + | then throw("Protol stopped by admin") | |
91 | + | else if (!(containsElement(d, toBase58String(F.caller.bytes)))) | |
92 | + | then throw("Only admin can call this function") | |
93 | + | else [BooleanEntry(G, H)] | |
94 | + | ||
95 | + | ||
96 | + | ||
97 | + | @Callable(F) | |
98 | + | func extractFee (I,J) = if (!(if (i) | |
99 | + | then n | |
100 | + | else false)) | |
101 | + | then throw("Protol stopped by admin") | |
102 | + | else { | |
103 | + | let K = valueOrErrorMessage(getBoolean(this, toString(F.caller)), ("Empty key i.caller: " + toString(F.caller))) | |
104 | + | if (!(K)) | |
105 | + | then throw("This automate is inactive") | |
106 | + | else { | |
107 | + | let L = if (J) | |
108 | + | then w() | |
109 | + | else 0 | |
110 | + | let s = valueOrErrorMessage(getInteger(this, (I + j)), (("Empty key user + keyBalance: " + I) + j)) | |
111 | + | let M = (s - L) | |
112 | + | let N = (o - L) | |
113 | + | if ((0 > M)) | |
114 | + | then throw(((("Insufficient new balance:" + toString(M)) + " for user ") + I)) | |
115 | + | else [IntegerEntry((I + j), M), IntegerEntry(m, N)] | |
116 | + | } | |
117 | + | } | |
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | @Callable(F) | |
122 | + | func replenishBalance (O) = if (!(if (i) | |
123 | + | then n | |
124 | + | else false)) | |
125 | + | then throw("Protol stopped by admin") | |
126 | + | else { | |
127 | + | let P = valueOrErrorMessage(addressFromString(O), "Argument must be base58 string") | |
128 | + | let Q = $Tuple2(F.payments[0].amount, F.payments[0].assetId) | |
129 | + | let R = Q._1 | |
130 | + | let S = Q._2 | |
131 | + | if ((S != unit)) | |
132 | + | then throw("Only WAVES available for replenishment") | |
133 | + | else { | |
134 | + | let T = q(O) | |
135 | + | let M = (T + R) | |
136 | + | let N = (o + R) | |
137 | + | [IntegerEntry((toBase58String(P.bytes) + j), M), IntegerEntry(m, N)] | |
138 | + | } | |
139 | + | } | |
140 | + | ||
141 | + | ||
142 | + | ||
143 | + | @Callable(F) | |
144 | + | func withdraw (U) = if (!(if (i) | |
145 | + | then n | |
146 | + | else false)) | |
147 | + | then throw("Protol stopped by admin") | |
148 | + | else { | |
149 | + | let V = toString(F.caller) | |
150 | + | let W = q(V) | |
151 | + | let X = (W - U) | |
152 | + | let N = (o - U) | |
153 | + | if ((U > W)) | |
154 | + | then throw("withdrawAmt > callerBalance") | |
155 | + | else [IntegerEntry((V + j), X), IntegerEntry(m, N), ScriptTransfer(F.caller, U, unit)] | |
156 | + | } | |
157 | + | ||
158 | + | ||
159 | + | ||
160 | + | @Callable(F) | |
161 | + | func incomeProtocolWithdraw (Y) = if (!(if (i) | |
162 | + | then n | |
163 | + | else false)) | |
164 | + | then throw("Protol stopped by admin") | |
165 | + | else if (!(A(toBase58String(F.transactionId)))) | |
166 | + | then throw("Transaction id not approved by admins") | |
167 | + | else { | |
168 | + | let Z = (wavesBalance(this).available - o) | |
169 | + | if ((0 >= Z)) | |
170 | + | then throw("income <= 0 ") | |
171 | + | else [ScriptTransfer(addressFromStringValue(Y), Z, unit)] | |
172 | + | } | |
173 | + | ||
174 | + | ||
175 | + | ||
176 | + | @Callable(F) | |
177 | + | func shutdownDapp () = if (!(n)) | |
178 | + | then throw("Protol stopped by admin") | |
179 | + | else if (if (!(containsElement([e, f, g], F.caller))) | |
180 | + | then !(containsElement(d, toBase58String(F.caller.bytes))) | |
181 | + | else false) | |
182 | + | then throw("Only admin can call this function") | |
183 | + | else [BooleanEntry("is_dapp_active", false)] | |
184 | + | ||
185 | + | ||
186 | + | @Verifier(aa) | |
187 | + | func ab () = if (!(A(toBase58String(aa.id)))) | |
188 | + | then throw("Transaction id not approved by admins") | |
189 | + | else true | |
190 | + |
github/deemru/w8io/169f3d6 17.70 ms ◑