tx · 6uzvbZbnnQZsZtWCWKEfzUVLYaZyJF2AEyPTbWHQdd6Y 3MsaYMAGjgngDLDfCRz2zM1PFkWsEWrqQKo: -0.01400000 Waves 2021.12.03 01:23 [1817253] smart account 3MsaYMAGjgngDLDfCRz2zM1PFkWsEWrqQKo > SELF 0.00000000 Waves
{ "type": 13, "id": "6uzvbZbnnQZsZtWCWKEfzUVLYaZyJF2AEyPTbWHQdd6Y", "fee": 1400000, "feeAssetId": null, "timestamp": 1638483806980, "version": 1, "sender": "3MsaYMAGjgngDLDfCRz2zM1PFkWsEWrqQKo", "senderPublicKey": "2TjQMiex51XzQHmuRKxZLYE7L1GHvUdc5xD6qGwWqsnB", "proofs": [ "S7bqfRVPvoLi7ndvoMyrk4FvyeobdufbSxnNxbLoUhBCNB3eDUXSyGsh7Td7nUr7XZkCiRqn6sNHNGA2pgM2Ddp" ], "script": "base64:AAIFAAAAAAAAABAIAhIAEgMKAQESAwoBARIAAAAAGAAAAAAGb3JhY2xlCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU+1HL0ASlajd9LXjglRa/LZYurUe0gyHKAAAAAAdiYWxhbmNlCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAGb3JhY2xlAgAAAA9iYWxhbmNlX2FkZHJlc3MCAAAAGUVtcHR5IGtleSBiYWxhbmNlX2FkZHJlc3MAAAAAEVNXT1Bnb3Zlcm5hbmNlQWRyCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAGb3JhY2xlAgAAAA9zd29wX2dvdmVybmFuY2UCAAAAGUVtcHR5IGtleSBzd29wX2dvdmVybmFuY2UAAAAABFNXT1AJAAJZAAAAAQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAABm9yYWNsZQIAAA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wAAAAIFAAAABmFkbWluMQkAAlgAAAABCAUAAAACdHgAAAACaWQHAAAAAAAAAAABAAAAAAAAAAAABAAAAAxhZG1pbjJTaWduZWQDCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABmFkbWluMgkAAlgAAAABCAUAAAACdHgAAAACaWQHAAAAAAAAAAABAAAAAAAAAAAABAAAAAxhZG1pbjNTaWduZWQDCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABmFkbWluMwkAAlgAAAABCAUAAAACdHgAAAACaWQHAAAAAAAAAAABAAAAAAAAAAAABAAAAAxhZG1pbjRTaWduZWQDCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABmFkbWluNAkAAlgAAAABCAUAAAACdHgAAAACaWQHAAAAAAAAAAABAAAAAAAAAAAABAAAAAxhZG1pbjVTaWduZWQDCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGwAAAAIFAAAABmFkbWluNQkAAlgAAAABCAUAAAACdHgAAAACaWQHAAAAAAAAAAABAAAAAAAAAAAACQAAZwAAAAIJAABkAAAAAgkAAGQAAAACCQAAZAAAAAIJAABkAAAAAgUAAAAMYWRtaW4xU2lnbmVkBQAAAAxhZG1pbjJTaWduZWQFAAAADGFkbWluM1NpZ25lZAUAAAAMYWRtaW40U2lnbmVkBQAAAAxhZG1pbjVTaWduZWQAAAAAAAAAAAPH9XqX", "chainId": 84, "height": 1817253, "applicationStatus": "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'3NCpwNNAC2S7fnPp8hHaKiHtuLFEMTKxTWR') | |
5 | + | ||
6 | + | let b = addressFromStringValue(valueOrErrorMessage(getString(a, "balance_address"), "Empty key balance_address")) | |
7 | + | ||
8 | + | let c = addressFromStringValue(valueOrErrorMessage(getString(a, "swop_governance"), "Empty key swop_governance")) | |
9 | + | ||
10 | + | let d = fromBase58String(valueOrErrorMessage(getString(a, "SWOP"), "Empty key SWOP")) | |
11 | + | ||
12 | + | let e = split(valueOrElse(getString(a, "consumers"), "Empty key consumer"), ",") | |
13 | + | ||
14 | + | let f = addressFromStringValue(valueOrElse(getString(a, "admin_1"), "Empty key admin_1")) | |
15 | + | ||
16 | + | let g = addressFromStringValue(valueOrElse(getString(a, "admin_2"), "Empty key admin_2")) | |
17 | + | ||
18 | + | let h = addressFromStringValue(valueOrElse(getString(a, "admin_3"), "Empty key admin_3")) | |
19 | + | ||
20 | + | let i = addressFromStringValue(valueOrElse(getString(a, "admin_4"), "Empty key admin_4")) | |
21 | + | ||
22 | + | let j = addressFromStringValue(valueOrElse(getString(a, "admin_5"), "Empty key admin_5")) | |
23 | + | ||
24 | + | let k = valueOrErrorMessage(getBoolean(a, "is_protocol_active"), "Empty key is_protocol_active") | |
25 | + | ||
26 | + | let l = "is_dapp_active" | |
27 | + | ||
28 | + | let m = "owner" | |
29 | + | ||
30 | + | let n = valueOrErrorMessage(getBoolean(this, l), "Empty key is_dapp_active") | |
31 | + | ||
32 | + | let o = valueOrErrorMessage(getString(this, m), "Empty keyAutomateOwner") | |
33 | + | ||
34 | + | let p = addressFromString(o) | |
35 | + | ||
36 | + | let q = "last_interest" | |
37 | + | ||
38 | + | let r = "_SWOP_amount" | |
39 | + | ||
40 | + | let s = "_last_interest" | |
41 | + | ||
42 | + | let t = 100000000 | |
43 | + | ||
44 | + | func u () = { | |
45 | + | let v = valueOrElse(getInteger(c, q), 0) | |
46 | + | v | |
47 | + | } | |
48 | + | ||
49 | + | ||
50 | + | func w (x) = valueOrElse(getInteger(c, (toString(x) + r)), 0) | |
51 | + | ||
52 | + | ||
53 | + | func y (x,v) = { | |
54 | + | let z = w(x) | |
55 | + | let A = getInteger(c, (toString(x) + s)) | |
56 | + | let B = { | |
57 | + | let C = A | |
58 | + | if ($isInstanceOf(C, "Int")) | |
59 | + | then { | |
60 | + | let A = C | |
61 | + | A | |
62 | + | } | |
63 | + | else v | |
64 | + | } | |
65 | + | $Tuple2(B, z) | |
66 | + | } | |
67 | + | ||
68 | + | ||
69 | + | func D (E) = { | |
70 | + | let v = u() | |
71 | + | let F = y(E, v) | |
72 | + | let A = F._1 | |
73 | + | let G = F._2 | |
74 | + | let H = fraction(G, (v - A), t) | |
75 | + | let I = v | |
76 | + | $Tuple2(I, H) | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | @Callable(J) | |
81 | + | func governanceLockSWOP () = if (!(if (k) | |
82 | + | then n | |
83 | + | else false)) | |
84 | + | then throw("Protol stopped by admin") | |
85 | + | else { | |
86 | + | let K = $Tuple2(J.payments[0].amount, J.payments[0].assetId) | |
87 | + | let L = K._1 | |
88 | + | let M = K._2 | |
89 | + | if ((M != d)) | |
90 | + | then throw("Only SWOP payment available in governanceLockSWOP()") | |
91 | + | else { | |
92 | + | let N = invoke(c, "lockSWOP", nil, [AttachedPayment(d, L)]) | |
93 | + | if ((N == N)) | |
94 | + | then nil | |
95 | + | else throw("Strict value is not equal to itself.") | |
96 | + | } | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | @Callable(J) | |
102 | + | func governanceClaimAndStake (O) = if (!(if (k) | |
103 | + | then n | |
104 | + | else false)) | |
105 | + | then throw("Protol stopped by admin") | |
106 | + | else if (if ((J.caller != p)) | |
107 | + | then !(containsElement(e, toBase58String(J.caller.bytes))) | |
108 | + | else false) | |
109 | + | then throw("Only owner or admin can call this function") | |
110 | + | else { | |
111 | + | let H = D(this)._2 | |
112 | + | if ((O > H)) | |
113 | + | then throw("Amount to claim is less than minSWOPreward") | |
114 | + | else { | |
115 | + | let P = if ((J.caller == p)) | |
116 | + | then false | |
117 | + | else true | |
118 | + | let N = invoke(c, "claimAndStakeSWOP", nil, nil) | |
119 | + | if ((N == N)) | |
120 | + | then { | |
121 | + | let Q = invoke(b, "extractFee", [P], nil) | |
122 | + | if ((Q == Q)) | |
123 | + | then nil | |
124 | + | else throw("Strict value is not equal to itself.") | |
125 | + | } | |
126 | + | else throw("Strict value is not equal to itself.") | |
127 | + | } | |
128 | + | } | |
129 | + | ||
130 | + | ||
131 | + | ||
132 | + | @Callable(J) | |
133 | + | func governanceWithdraw (R) = if (!(if (k) | |
134 | + | then n | |
135 | + | else false)) | |
136 | + | then throw("Protol stopped by admin") | |
137 | + | else if ((J.caller != p)) | |
138 | + | then throw("Only owner can call this function") | |
139 | + | else { | |
140 | + | let N = invoke(c, "withdrawSWOP", [R], nil) | |
141 | + | if ((N == N)) | |
142 | + | then [ScriptTransfer(J.caller, R, d)] | |
143 | + | else throw("Strict value is not equal to itself.") | |
144 | + | } | |
145 | + | ||
146 | + | ||
147 | + | ||
148 | + | @Callable(J) | |
149 | + | func shutdownDapp () = if (!(if (k) | |
150 | + | then n | |
151 | + | else false)) | |
152 | + | then throw("Protol stopped by admin") | |
153 | + | else if (if (!(containsElement([f, g, h, i, j, p], J.caller))) | |
154 | + | then !(containsElement(e, toBase58String(J.caller.bytes))) | |
155 | + | else false) | |
156 | + | then throw("Only admin can call this function") | |
157 | + | else [BooleanEntry("is_dapp_active", false)] | |
158 | + | ||
159 | + | ||
160 | + | @Verifier(S) | |
161 | + | func T () = { | |
162 | + | let U = if (valueOrElse(getBoolean(f, toBase58String(S.id)), false)) | |
163 | + | then 1 | |
164 | + | else 0 | |
165 | + | let V = if (valueOrElse(getBoolean(g, toBase58String(S.id)), false)) | |
166 | + | then 1 | |
167 | + | else 0 | |
168 | + | let W = if (valueOrElse(getBoolean(h, toBase58String(S.id)), false)) | |
169 | + | then 1 | |
170 | + | else 0 | |
171 | + | let X = if (valueOrElse(getBoolean(i, toBase58String(S.id)), false)) | |
172 | + | then 1 | |
173 | + | else 0 | |
174 | + | let Y = if (valueOrElse(getBoolean(j, toBase58String(S.id)), false)) | |
175 | + | then 1 | |
176 | + | else 0 | |
177 | + | (((((U + V) + W) + X) + Y) >= 3) | |
178 | + | } | |
179 | + |
github/deemru/w8io/169f3d6 20.80 ms ◑