tx · CT38S7wUUk2m8hxerk8xRbP7aC5HfhfDSxKEaQMMsLPu

3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH:  -0.03700000 Waves

2023.03.03 23:06 [2474335] smart account 3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH > SELF 0.00000000 Waves

{ "type": 13, "id": "CT38S7wUUk2m8hxerk8xRbP7aC5HfhfDSxKEaQMMsLPu", "fee": 3700000, "feeAssetId": null, "timestamp": 1677874016522, "version": 2, "chainId": 84, "sender": "3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH", "senderPublicKey": "3mgJJUcUNFHYP2pNkbkfB2C8D4gSEKEGisFByu2i6xoM", "proofs": [ "3VzgDWxxG2GubqMjLNdFuyZ3NcDtMWEgVuMMAtzKaw4HeHkRyse5DqBJn57H2uctdYo9VFTqbCFGRBwT4PKQBgQ" ], "script": "base64:BgIqCAISBQoDCAgIEgASABIECgIICBIECgIIARIAEgMKAQgSAwoBCBIDCgEIFgAHa19mdW5kcwIHa19mdW5kcwAXa19hc3NldF9tYW5hZ2VyX2FkZHJlc3MCF2tfYXNzZXRfbWFuYWdlcl9hZGRyZXNzABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAEGtfb3JkZXJzX2FkZHJlc3MCEGtfb3JkZXJzX2FkZHJlc3MAD2tfdmF1bHRfYWRkcmVzcwIPa192YXVsdF9hZGRyZXNzAAVrX2FtbQIFa19hbW0AD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQACGtfcGF1c2VkAghrX3BhdXNlZAEOdG9Db21wb3NpdGVLZXkCBF9rZXkIX2FkZHJlc3MJAKwCAgkArAICBQRfa2V5AgFfBQhfYWRkcmVzcwEJYmFsYW5jZU9mAQhfYXNzZXRJZAkB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Status": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4qa9sF5Ct77GhVPnmvKGw1FueY37QqMAoFcgMEcdessd Next: yUBx7abeS1ib8eAcFauLQAwhagmUwdorVgsVpeu9nKL Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "k_funds"
55
6-let b = "k_vires_address"
6+let b = "k_asset_manager_address"
77
8-let c = "k_vires_vault"
8+let c = "k_coordinatorAddress"
99
10-let d = "k_asset_claimed_profit"
10+let d = "k_orders_address"
1111
12-let e = "k_coordinatorAddress"
12+let e = "k_vault_address"
1313
14-let f = "k_orders_address"
14+let f = "k_amm"
1515
16-let g = "k_vault_address"
16+let g = "k_admin_address"
1717
18-let h = "k_amm"
18+let h = "k_staking_address"
1919
20-let i = "k_admin_address"
20+let i = "k_initialized"
2121
22-let j = "k_quote_asset"
22+let j = "k_paused"
2323
24-let k = "k_quote_staking"
25-
26-let l = "k_staking_address"
27-
28-let m = "k_initialized"
29-
30-func n (o,p) = ((o + "_") + p)
24+func k (l,m) = ((l + "_") + m)
3125
3226
33-func q (r) = valueOrElse(getInteger(this, n(a, r)), 0)
27+func n (o) = valueOrElse(getInteger(this, k(a, o)), 0)
3428
3529
36-func s () = valueOrErrorMessage(addressFromString(getStringValue(this, e)), "Coordinator not set")
30+func p () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, c), "Coordinator not set Manager")), "Coordinator address invalid")
3731
3832
39-func t () = valueOrErrorMessage(addressFromString(getStringValue(s(), g)), "Vault not set")
33+func q () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(p(), e), "Vault address not set")), "Vault address invalid")
4034
4135
42-func u () = valueOrErrorMessage(addressFromString(getStringValue(s(), f)), "Orders not set")
36+func r () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(p(), d), "Orders address not set")), "Orders address invalid")
4337
4438
45-func v () = valueOrElse(getBoolean(this, m), false)
39+func s () = addressFromString(valueOrErrorMessage(getString(p(), g), "Admin address not set"))
4640
4741
48-func w () = addressFromString(getStringValue(s(), i))
42+func t () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(p(), h), "Staking address not set")), "Staking address invalid")
4943
5044
51-func x () = fromBase58String(getStringValue(s(), j))
45+func u () = valueOrElse(getBoolean(this, i), false)
5246
5347
54-func y () = valueOrErrorMessage(addressFromString(getStringValue(s(), l)), "Staking not set")
48+func v () = valueOrElse(getBoolean(this, j), false)
5549
5650
57-func z () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Vires not set")
51+func w (o) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k(b, o)), ("No asset manager for token " + o))), ("Invalid asset manager address for token " + o))
5852
5953
60-func A (r) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, n(c, r)), ("No vault for token " + r))), ("Invalid address for token " + r))
54+func x (m) = if (if ((m == toString(t())))
55+ then true
56+ else (m == toString(q())))
57+ then true
58+ else (m == toString(r()))
6159
6260
63-func B (p) = if (if ((p == toString(y())))
64- then true
65- else (p == toString(t())))
66- then true
67- else (p == toString(u()))
61+func y (o,z) = [IntegerEntry(k(a, o), z)]
6862
6963
70-func C (r,D) = [IntegerEntry(n(a, r), D)]
71-
72-
73-@Callable(E)
74-func initialize (F,G,H,I) = if (if (v())
64+@Callable(A)
65+func initialize (B,C,D) = if (if (u())
7566 then true
76- else (E.caller != this))
67+ else (A.caller != this))
7768 then throw("Unable to initialize")
78- else [StringEntry(e, toString(addressFromStringValue(F))), StringEntry(b, toString(addressFromStringValue(G))), StringEntry(n(c, H), toString(addressFromStringValue(I))), BooleanEntry(m, true)]
69+ else [StringEntry(c, toString(addressFromStringValue(B))), StringEntry(k(b, C), toString(addressFromStringValue(D))), BooleanEntry(i, true)]
7970
8071
8172
82-@Callable(E)
83-func addTokenVault (r,J) = if (if (!(v()))
84- then true
85- else (E.caller != w()))
86- then throw("Invalid addTokenVault params")
87- else [StringEntry(n(c, r), toString(addressFromStringValue(J)))]
73+@Callable(A)
74+func unpause () = if ((A.caller != s()))
75+ then throw("Invalid unpause params")
76+ else [BooleanEntry(j, false)]
8877
8978
9079
91-@Callable(E)
92-func withdraw (r,K) = if (if (if (!(B(toString(E.caller))))
80+@Callable(A)
81+func pause () = if ((A.caller != s()))
82+ then throw("Invalid pause params")
83+ else [BooleanEntry(j, true)]
84+
85+
86+
87+@Callable(A)
88+func addAssetManager (o,E) = if (if (if (!(u()))
9389 then true
94- else !(v()))
90+ else (A.caller != s()))
9591 then true
96- else (K > q(r)))
97- then throw(((("Invalid withdraw params (manager) " + toString(K)) + " > ") + toString(q(r))))
92+ else isDefined(getString(k(b, o))))
93+ then throw("Invalid addTokenVault params")
94+ else [StringEntry(k(b, o), toString(addressFromStringValue(E)))]
95+
96+
97+
98+@Callable(A)
99+func withdraw (o,F) = if (if (if (if (!(x(toString(A.caller))))
100+ then true
101+ else !(u()))
102+ then true
103+ else v())
104+ then true
105+ else (F > n(o)))
106+ then throw(((("Invalid withdraw params (manager) " + toString(F)) + " > ") + toString(n(o))))
98107 else {
99- let L = invoke(z(), "withdraw", [r, K], nil)
100- if ((L == L))
108+ let G = invoke(w(o), "withdraw", [o, F], nil)
109+ if ((G == G))
101110 then {
102- let M = (q(r) - K)
103- (C(r, M) ++ [ScriptTransfer(E.caller, K, fromBase58String(r))])
111+ let H = (n(o) - F)
112+ (y(o, H) ++ [ScriptTransfer(A.caller, F, fromBase58String(o))])
104113 }
105114 else throw("Strict value is not equal to itself.")
106115 }
107116
108117
109118
110-@Callable(E)
119+@Callable(A)
111120 func deposit () = {
112- let K = E.payments[0].amount
113- let r = toBase58String(valueOrErrorMessage(E.payments[0].assetId, "No assetId"))
114- if (if (if ((E.payments[0].assetId != x()))
121+ let F = A.payments[0].amount
122+ let o = toBase58String(valueOrErrorMessage(A.payments[0].assetId, "No assetId"))
123+ if (if (if (if (!(u()))
115124 then true
116- else !(v()))
125+ else if (!(x(toString(A.caller))))
126+ then (A.caller != s())
127+ else false)
117128 then true
118- else if (!(B(toString(E.caller))))
119- then (E.caller != w())
120- else false)
129+ else v())
130+ then true
131+ else (size(A.payments) != 1))
121132 then throw("Invalid deposit params (manager)")
122133 else {
123- let N = A(r)
124- let O = invoke(z(), "deposit", [toString(N), false], [AttachedPayment(E.payments[0].assetId, K)])
125- if ((O == O))
134+ let I = invoke(w(o), "deposit", nil, [AttachedPayment(A.payments[0].assetId, F)])
135+ if ((I == I))
126136 then {
127- let M = (q(r) + K)
128- C(r, M)
137+ let H = (n(o) + F)
138+ y(o, H)
129139 }
130140 else throw("Strict value is not equal to itself.")
131141 }
133143
134144
135145
136-@Callable(E)
137-func claimProfit (r) = if (if (if ((fromBase58String(r) != x()))
146+@Callable(A)
147+func claimProfit (o) = if (if (!(u()))
138148 then true
139- else !(v()))
140- then true
141- else (E.caller != t()))
142- then throw("Invalid claimProfit params")
149+ else (A.caller != q()))
150+ then throw("Invalid claimProfit params (manager)")
143151 else {
144- let P = invoke(A(r), "getCurrentTotals", [toString(this)], nil)
145- if ((P == P))
152+ let J = invoke(w(o), "claimProfit", [o], nil)
153+ if ((J == J))
146154 then {
147- let M = {
148- let Q = P
149- if ($isInstanceOf(Q, "(Int, Int, Int, Int)"))
155+ let K = {
156+ let L = J
157+ if ($isInstanceOf(L, "Int"))
150158 then {
151- let R = Q
152- R._3
159+ let M = L
160+ M
153161 }
154- else throw("Invalid currentAmount type")
162+ else throw("Invalid claimProfit result type")
155163 }
156- let S = (M - q(r))
157- let L = invoke(z(), "withdraw", [r, S], nil)
158- if ((L == L))
159- then $Tuple2([ScriptTransfer(E.caller, S, fromBase58String(r))], S)
160- else throw("Strict value is not equal to itself.")
164+ $Tuple2([ScriptTransfer(A.caller, K, fromBase58String(o))], K)
161165 }
162166 else throw("Strict value is not equal to itself.")
163167 }
164168
165169
166170
167-@Callable(E)
168-func view_claimProfit (r) = if (if ((fromBase58String(r) != x()))
169- then true
170- else !(v()))
171- then throw("Invalid view_claimProfit params")
171+@Callable(A)
172+func view_claimProfit (o) = if (!(u()))
173+ then throw("Invalid view_claimProfit params (manager)")
172174 else {
173- let P = invoke(A(r), "getCurrentTotals", [toString(this)], nil)
174- if ((P == P))
175+ let J = invoke(w(o), "claimProfit", [o], nil)
176+ if ((J == J))
175177 then {
176- let M = {
177- let Q = P
178- if ($isInstanceOf(Q, "(Int, Int, Int, Int)"))
178+ let K = {
179+ let L = J
180+ if ($isInstanceOf(L, "Int"))
179181 then {
180- let R = Q
181- R._3
182+ let M = L
183+ M
182184 }
183- else throw("Invalid currentAmount type")
185+ else throw("Invalid claimProfit result type")
184186 }
185- let S = (M - q(r))
186- throw(((((toString(q(r)) + ",") + toString(M)) + ",") + toString(S)))
187+ throw(((((toString(n(o)) + ",") + toString((n(o) + K))) + ",") + toString(K)))
187188 }
188189 else throw("Strict value is not equal to itself.")
189190 }
190191
191192
192-@Verifier(T)
193-func U () = {
194- let V = getString(this, e)
195- if (isDefined(V))
193+
194+@Callable(A)
195+func migrate (o) = {
196+ let F = n(o)
197+ if (if (if (!(u()))
198+ then true
199+ else (A.caller != s()))
200+ then true
201+ else !(v()))
202+ then throw("Invalid migrate params (manager)")
203+ else {
204+ let G = invoke(valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "k_vires_address"), "No legacy vires address")), "Invalid legacy vires address"), "withdraw", [o, F], nil)
205+ if ((G == G))
206+ then {
207+ let I = invoke(w(o), "deposit", nil, [AttachedPayment(fromBase58String(o), F)])
208+ if ((I == I))
209+ then [DeleteEntry("k_vires_address"), DeleteEntry("k_vires_vault")]
210+ else throw("Strict value is not equal to itself.")
211+ }
212+ else throw("Strict value is not equal to itself.")
213+ }
214+ }
215+
216+
217+@Verifier(N)
218+func O () = {
219+ let P = getString(this, c)
220+ if (isDefined(P))
196221 then {
197- let W = getString(addressFromStringValue(value(V)), i)
198- if (isDefined(W))
199- then valueOrElse(getBoolean(addressFromStringValue(value(W)), ((("status_" + toString(this)) + "_") + toBase58String(T.id))), false)
222+ let Q = getString(addressFromStringValue(value(P)), g)
223+ if (isDefined(Q))
224+ then valueOrElse(getBoolean(addressFromStringValue(value(Q)), ((("status_" + toString(this)) + "_") + toBase58String(N.id))), false)
200225 else throw("unable to verify: admin not set in coordinator")
201226 }
202- else sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
227+ else sigVerify(N.bodyBytes, N.proofs[0], N.senderPublicKey)
203228 }
204229
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "k_funds"
55
6-let b = "k_vires_address"
6+let b = "k_asset_manager_address"
77
8-let c = "k_vires_vault"
8+let c = "k_coordinatorAddress"
99
10-let d = "k_asset_claimed_profit"
10+let d = "k_orders_address"
1111
12-let e = "k_coordinatorAddress"
12+let e = "k_vault_address"
1313
14-let f = "k_orders_address"
14+let f = "k_amm"
1515
16-let g = "k_vault_address"
16+let g = "k_admin_address"
1717
18-let h = "k_amm"
18+let h = "k_staking_address"
1919
20-let i = "k_admin_address"
20+let i = "k_initialized"
2121
22-let j = "k_quote_asset"
22+let j = "k_paused"
2323
24-let k = "k_quote_staking"
25-
26-let l = "k_staking_address"
27-
28-let m = "k_initialized"
29-
30-func n (o,p) = ((o + "_") + p)
24+func k (l,m) = ((l + "_") + m)
3125
3226
33-func q (r) = valueOrElse(getInteger(this, n(a, r)), 0)
27+func n (o) = valueOrElse(getInteger(this, k(a, o)), 0)
3428
3529
36-func s () = valueOrErrorMessage(addressFromString(getStringValue(this, e)), "Coordinator not set")
30+func p () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, c), "Coordinator not set Manager")), "Coordinator address invalid")
3731
3832
39-func t () = valueOrErrorMessage(addressFromString(getStringValue(s(), g)), "Vault not set")
33+func q () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(p(), e), "Vault address not set")), "Vault address invalid")
4034
4135
42-func u () = valueOrErrorMessage(addressFromString(getStringValue(s(), f)), "Orders not set")
36+func r () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(p(), d), "Orders address not set")), "Orders address invalid")
4337
4438
45-func v () = valueOrElse(getBoolean(this, m), false)
39+func s () = addressFromString(valueOrErrorMessage(getString(p(), g), "Admin address not set"))
4640
4741
48-func w () = addressFromString(getStringValue(s(), i))
42+func t () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(p(), h), "Staking address not set")), "Staking address invalid")
4943
5044
51-func x () = fromBase58String(getStringValue(s(), j))
45+func u () = valueOrElse(getBoolean(this, i), false)
5246
5347
54-func y () = valueOrErrorMessage(addressFromString(getStringValue(s(), l)), "Staking not set")
48+func v () = valueOrElse(getBoolean(this, j), false)
5549
5650
57-func z () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Vires not set")
51+func w (o) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k(b, o)), ("No asset manager for token " + o))), ("Invalid asset manager address for token " + o))
5852
5953
60-func A (r) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, n(c, r)), ("No vault for token " + r))), ("Invalid address for token " + r))
54+func x (m) = if (if ((m == toString(t())))
55+ then true
56+ else (m == toString(q())))
57+ then true
58+ else (m == toString(r()))
6159
6260
63-func B (p) = if (if ((p == toString(y())))
64- then true
65- else (p == toString(t())))
66- then true
67- else (p == toString(u()))
61+func y (o,z) = [IntegerEntry(k(a, o), z)]
6862
6963
70-func C (r,D) = [IntegerEntry(n(a, r), D)]
71-
72-
73-@Callable(E)
74-func initialize (F,G,H,I) = if (if (v())
64+@Callable(A)
65+func initialize (B,C,D) = if (if (u())
7566 then true
76- else (E.caller != this))
67+ else (A.caller != this))
7768 then throw("Unable to initialize")
78- else [StringEntry(e, toString(addressFromStringValue(F))), StringEntry(b, toString(addressFromStringValue(G))), StringEntry(n(c, H), toString(addressFromStringValue(I))), BooleanEntry(m, true)]
69+ else [StringEntry(c, toString(addressFromStringValue(B))), StringEntry(k(b, C), toString(addressFromStringValue(D))), BooleanEntry(i, true)]
7970
8071
8172
82-@Callable(E)
83-func addTokenVault (r,J) = if (if (!(v()))
84- then true
85- else (E.caller != w()))
86- then throw("Invalid addTokenVault params")
87- else [StringEntry(n(c, r), toString(addressFromStringValue(J)))]
73+@Callable(A)
74+func unpause () = if ((A.caller != s()))
75+ then throw("Invalid unpause params")
76+ else [BooleanEntry(j, false)]
8877
8978
9079
91-@Callable(E)
92-func withdraw (r,K) = if (if (if (!(B(toString(E.caller))))
80+@Callable(A)
81+func pause () = if ((A.caller != s()))
82+ then throw("Invalid pause params")
83+ else [BooleanEntry(j, true)]
84+
85+
86+
87+@Callable(A)
88+func addAssetManager (o,E) = if (if (if (!(u()))
9389 then true
94- else !(v()))
90+ else (A.caller != s()))
9591 then true
96- else (K > q(r)))
97- then throw(((("Invalid withdraw params (manager) " + toString(K)) + " > ") + toString(q(r))))
92+ else isDefined(getString(k(b, o))))
93+ then throw("Invalid addTokenVault params")
94+ else [StringEntry(k(b, o), toString(addressFromStringValue(E)))]
95+
96+
97+
98+@Callable(A)
99+func withdraw (o,F) = if (if (if (if (!(x(toString(A.caller))))
100+ then true
101+ else !(u()))
102+ then true
103+ else v())
104+ then true
105+ else (F > n(o)))
106+ then throw(((("Invalid withdraw params (manager) " + toString(F)) + " > ") + toString(n(o))))
98107 else {
99- let L = invoke(z(), "withdraw", [r, K], nil)
100- if ((L == L))
108+ let G = invoke(w(o), "withdraw", [o, F], nil)
109+ if ((G == G))
101110 then {
102- let M = (q(r) - K)
103- (C(r, M) ++ [ScriptTransfer(E.caller, K, fromBase58String(r))])
111+ let H = (n(o) - F)
112+ (y(o, H) ++ [ScriptTransfer(A.caller, F, fromBase58String(o))])
104113 }
105114 else throw("Strict value is not equal to itself.")
106115 }
107116
108117
109118
110-@Callable(E)
119+@Callable(A)
111120 func deposit () = {
112- let K = E.payments[0].amount
113- let r = toBase58String(valueOrErrorMessage(E.payments[0].assetId, "No assetId"))
114- if (if (if ((E.payments[0].assetId != x()))
121+ let F = A.payments[0].amount
122+ let o = toBase58String(valueOrErrorMessage(A.payments[0].assetId, "No assetId"))
123+ if (if (if (if (!(u()))
115124 then true
116- else !(v()))
125+ else if (!(x(toString(A.caller))))
126+ then (A.caller != s())
127+ else false)
117128 then true
118- else if (!(B(toString(E.caller))))
119- then (E.caller != w())
120- else false)
129+ else v())
130+ then true
131+ else (size(A.payments) != 1))
121132 then throw("Invalid deposit params (manager)")
122133 else {
123- let N = A(r)
124- let O = invoke(z(), "deposit", [toString(N), false], [AttachedPayment(E.payments[0].assetId, K)])
125- if ((O == O))
134+ let I = invoke(w(o), "deposit", nil, [AttachedPayment(A.payments[0].assetId, F)])
135+ if ((I == I))
126136 then {
127- let M = (q(r) + K)
128- C(r, M)
137+ let H = (n(o) + F)
138+ y(o, H)
129139 }
130140 else throw("Strict value is not equal to itself.")
131141 }
132142 }
133143
134144
135145
136-@Callable(E)
137-func claimProfit (r) = if (if (if ((fromBase58String(r) != x()))
146+@Callable(A)
147+func claimProfit (o) = if (if (!(u()))
138148 then true
139- else !(v()))
140- then true
141- else (E.caller != t()))
142- then throw("Invalid claimProfit params")
149+ else (A.caller != q()))
150+ then throw("Invalid claimProfit params (manager)")
143151 else {
144- let P = invoke(A(r), "getCurrentTotals", [toString(this)], nil)
145- if ((P == P))
152+ let J = invoke(w(o), "claimProfit", [o], nil)
153+ if ((J == J))
146154 then {
147- let M = {
148- let Q = P
149- if ($isInstanceOf(Q, "(Int, Int, Int, Int)"))
155+ let K = {
156+ let L = J
157+ if ($isInstanceOf(L, "Int"))
150158 then {
151- let R = Q
152- R._3
159+ let M = L
160+ M
153161 }
154- else throw("Invalid currentAmount type")
162+ else throw("Invalid claimProfit result type")
155163 }
156- let S = (M - q(r))
157- let L = invoke(z(), "withdraw", [r, S], nil)
158- if ((L == L))
159- then $Tuple2([ScriptTransfer(E.caller, S, fromBase58String(r))], S)
160- else throw("Strict value is not equal to itself.")
164+ $Tuple2([ScriptTransfer(A.caller, K, fromBase58String(o))], K)
161165 }
162166 else throw("Strict value is not equal to itself.")
163167 }
164168
165169
166170
167-@Callable(E)
168-func view_claimProfit (r) = if (if ((fromBase58String(r) != x()))
169- then true
170- else !(v()))
171- then throw("Invalid view_claimProfit params")
171+@Callable(A)
172+func view_claimProfit (o) = if (!(u()))
173+ then throw("Invalid view_claimProfit params (manager)")
172174 else {
173- let P = invoke(A(r), "getCurrentTotals", [toString(this)], nil)
174- if ((P == P))
175+ let J = invoke(w(o), "claimProfit", [o], nil)
176+ if ((J == J))
175177 then {
176- let M = {
177- let Q = P
178- if ($isInstanceOf(Q, "(Int, Int, Int, Int)"))
178+ let K = {
179+ let L = J
180+ if ($isInstanceOf(L, "Int"))
179181 then {
180- let R = Q
181- R._3
182+ let M = L
183+ M
182184 }
183- else throw("Invalid currentAmount type")
185+ else throw("Invalid claimProfit result type")
184186 }
185- let S = (M - q(r))
186- throw(((((toString(q(r)) + ",") + toString(M)) + ",") + toString(S)))
187+ throw(((((toString(n(o)) + ",") + toString((n(o) + K))) + ",") + toString(K)))
187188 }
188189 else throw("Strict value is not equal to itself.")
189190 }
190191
191192
192-@Verifier(T)
193-func U () = {
194- let V = getString(this, e)
195- if (isDefined(V))
193+
194+@Callable(A)
195+func migrate (o) = {
196+ let F = n(o)
197+ if (if (if (!(u()))
198+ then true
199+ else (A.caller != s()))
200+ then true
201+ else !(v()))
202+ then throw("Invalid migrate params (manager)")
203+ else {
204+ let G = invoke(valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "k_vires_address"), "No legacy vires address")), "Invalid legacy vires address"), "withdraw", [o, F], nil)
205+ if ((G == G))
206+ then {
207+ let I = invoke(w(o), "deposit", nil, [AttachedPayment(fromBase58String(o), F)])
208+ if ((I == I))
209+ then [DeleteEntry("k_vires_address"), DeleteEntry("k_vires_vault")]
210+ else throw("Strict value is not equal to itself.")
211+ }
212+ else throw("Strict value is not equal to itself.")
213+ }
214+ }
215+
216+
217+@Verifier(N)
218+func O () = {
219+ let P = getString(this, c)
220+ if (isDefined(P))
196221 then {
197- let W = getString(addressFromStringValue(value(V)), i)
198- if (isDefined(W))
199- then valueOrElse(getBoolean(addressFromStringValue(value(W)), ((("status_" + toString(this)) + "_") + toBase58String(T.id))), false)
222+ let Q = getString(addressFromStringValue(value(P)), g)
223+ if (isDefined(Q))
224+ then valueOrElse(getBoolean(addressFromStringValue(value(Q)), ((("status_" + toString(this)) + "_") + toBase58String(N.id))), false)
200225 else throw("unable to verify: admin not set in coordinator")
201226 }
202- else sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
227+ else sigVerify(N.bodyBytes, N.proofs[0], N.senderPublicKey)
203228 }
204229

github/deemru/w8io/026f985 
79.04 ms