tx · B4bA9uX74UCSjD9ncDCNkXnUynwEX5MdnSxvExWypX1U

3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH:  -0.03700000 Waves

2023.01.09 11:35 [2397170] smart account 3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH > SELF 0.00000000 Waves

{ "type": 13, "id": "B4bA9uX74UCSjD9ncDCNkXnUynwEX5MdnSxvExWypX1U", "fee": 3700000, "feeAssetId": null, "timestamp": 1673253318048, "version": 2, "chainId": 84, "sender": "3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH", "senderPublicKey": "3mgJJUcUNFHYP2pNkbkfB2C8D4gSEKEGisFByu2i6xoM", "proofs": [ "4U5X9TbHXp2wMJsPCib9roXwwTbTqVsvWzC6aMnkabtvX63vvTB3iT4nBkKrLxk5xUHxTXYPWsomJepL477j91kd" ], "script": "base64:BgIiCAISBgoECAgICBIECgIICBIECgIIARIAEgMKAQgSAwoBCB8AB2tfZnVuZHMCB2tfZnVuZHMAD2tfdmlyZXNfYWRkcmVzcwIPa192aXJlc19hZGRyZXNzAA1rX3ZpcmVzX3ZhdWx0Ag1rX3ZpcmVzX3ZhdWx0ABZrX2Fzc2V0X2NsYWltZWRfcHJvZml0AhZrX2Fzc2V0X2NsYWltZWRfcHJvZml0ABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAE2tfaW5zdXJhbmNlX2FkZHJlc3MCE2tfaW5zdXJhbmNlX2FkZHJlc3MAEGtfb3JkZXJzX2FkZHJlc3MCEGtfb3JkZXJzX2FkZHJlc3MAD2tfdmF1bHRfYWRkcmVzcwIPa192YXVsdF9hZGRyZXNzAAVrX2FtbQIFa19hbW0AD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAPa19xdW90ZV9zdGFra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90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQEOYWRtaW5QdWJsaWNLZXkA8GGP+g==", "height": 2397170, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3k6jZHZrFD1dioi6GjqhmQeHP4svrf2WGeqbYA6W5SwW Next: 4qa9sF5Ct77GhVPnmvKGw1FueY37QqMAoFcgMEcdessd Diff:
OldNewDifferences
1313
1414 let f = "k_insurance_address"
1515
16-let g = "k_amm"
16+let g = "k_orders_address"
1717
18-let h = "k_admin_address"
18+let h = "k_vault_address"
1919
20-let i = "k_admin_public_key"
20+let i = "k_amm"
2121
22-let j = "k_quote_asset"
22+let j = "k_admin_address"
2323
24-let k = "k_quote_staking"
24+let k = "k_admin_public_key"
2525
26-let l = "k_staking_address"
26+let l = "k_quote_asset"
2727
28-let m = "k_initialized"
28+let m = "k_quote_staking"
2929
30-func n (o,p) = ((o + "_") + p)
30+let n = "k_staking_address"
31+
32+let o = "k_initialized"
33+
34+func p (q,r) = ((q + "_") + r)
3135
3236
33-func q (r) = valueOrElse(getInteger(this, n(a, r)), 0)
37+func s (t) = valueOrElse(getInteger(this, p(a, t)), 0)
3438
3539
36-func s () = valueOrErrorMessage(addressFromString(getStringValue(this, e)), "Coordinator not set")
40+func u () = valueOrErrorMessage(addressFromString(getStringValue(this, e)), "Coordinator not set")
3741
3842
39-func t () = valueOrErrorMessage(addressFromString(getStringValue(s(), f)), "Insurance not set")
43+func v () = valueOrErrorMessage(addressFromString(getStringValue(u(), f)), "Insurance not set")
4044
4145
42-func u (p) = valueOrElse(getBoolean(s(), n(g, p)), false)
46+func w () = valueOrErrorMessage(addressFromString(getStringValue(u(), h)), "Vault not set")
4347
4448
45-func v () = valueOrElse(getBoolean(this, m), false)
49+func x () = valueOrErrorMessage(addressFromString(getStringValue(u(), g)), "Orders not set")
4650
4751
48-func w () = addressFromString(getStringValue(s(), h))
52+func y (r) = valueOrElse(getBoolean(u(), p(i, r)), false)
4953
5054
51-func x () = fromBase58String(getStringValue(s(), i))
55+func z () = valueOrElse(getBoolean(this, o), false)
5256
5357
54-func y () = fromBase58String(getStringValue(s(), j))
58+func A () = addressFromString(getStringValue(u(), j))
5559
5660
57-func z () = valueOrErrorMessage(addressFromString(getStringValue(s(), l)), "Staking not set")
61+func B () = fromBase58String(getStringValue(u(), k))
5862
5963
60-func A () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Vires not set")
64+func C () = fromBase58String(getStringValue(u(), l))
6165
6266
63-func B (r) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, n(c, r)), ("No vault for token " + r))), ("Invalid address for token " + r))
67+func D () = valueOrErrorMessage(addressFromString(getStringValue(u(), n)), "Staking not set")
6468
6569
66-func C (p) = if (if (u(p))
67- then true
68- else (p == toString(t())))
69- then true
70- else (p == toString(z()))
70+func E () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Vires not set")
7171
7272
73-func D (r,E) = [IntegerEntry(n(a, r), E)]
73+func F (t) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, p(c, t)), ("No vault for token " + t))), ("Invalid address for token " + t))
7474
7575
76-@Callable(F)
77-func initialize (G,H,I,J) = if (v())
76+func G (r) = if (if (if (if (y(r))
77+ then true
78+ else (r == toString(v())))
79+ then true
80+ else (r == toString(D())))
81+ then true
82+ else (r == toString(w())))
83+ then true
84+ else (r == toString(x()))
85+
86+
87+func H (t,I) = [IntegerEntry(p(a, t), I)]
88+
89+
90+@Callable(J)
91+func initialize (K,L,M,N) = if (z())
7892 then throw("Already initialized")
79- else [StringEntry(e, G), StringEntry(b, H), StringEntry(n(c, I), J), BooleanEntry(m, true)]
93+ else [StringEntry(e, K), StringEntry(b, L), StringEntry(p(c, M), N), BooleanEntry(o, true)]
8094
8195
8296
83-@Callable(F)
84-func addTokenVault (r,K) = if (if (!(v()))
97+@Callable(J)
98+func addTokenVault (t,O) = if (if (!(z()))
8599 then true
86- else (F.caller != w()))
100+ else (J.caller != A()))
87101 then throw("Invalid addTokenVault params")
88- else [StringEntry(n(c, r), K)]
102+ else [StringEntry(p(c, t), O)]
89103
90104
91105
92-@Callable(F)
93-func withdraw (r,L) = if (if (if (!(C(toString(F.caller))))
106+@Callable(J)
107+func withdraw (t,P) = if (if (if (!(G(toString(J.caller))))
94108 then true
95- else !(v()))
109+ else !(z()))
96110 then true
97- else (L > q(r)))
98- then throw(((("Invalid withdraw params " + toString(L)) + " > ") + toString(q(r))))
111+ else (P > s(t)))
112+ then throw(((("Invalid withdraw params (manager) " + toString(P)) + " > ") + toString(s(t))))
99113 else {
100- let M = invoke(A(), "withdraw", [r, L], nil)
101- if ((M == M))
114+ let Q = invoke(E(), "withdraw", [t, P], nil)
115+ if ((Q == Q))
102116 then {
103- let N = (q(r) - L)
104- (D(r, N) ++ [ScriptTransfer(F.caller, L, fromBase58String(r))])
117+ let R = (s(t) - P)
118+ (H(t, R) ++ [ScriptTransfer(J.caller, P, fromBase58String(t))])
105119 }
106120 else throw("Strict value is not equal to itself.")
107121 }
108122
109123
110124
111-@Callable(F)
125+@Callable(J)
112126 func deposit () = {
113- let L = F.payments[0].amount
114- let r = toBase58String(valueOrErrorMessage(F.payments[0].assetId, "No assetId"))
115- if (if (if ((F.payments[0].assetId != y()))
127+ let P = J.payments[0].amount
128+ let t = toBase58String(valueOrErrorMessage(J.payments[0].assetId, "No assetId"))
129+ if (if (if ((J.payments[0].assetId != C()))
116130 then true
117- else !(v()))
131+ else !(z()))
118132 then true
119- else if (!(C(toString(F.caller))))
120- then (F.caller != w())
133+ else if (!(G(toString(J.caller))))
134+ then (J.caller != A())
121135 else false)
122- then throw("Invalid deposit params")
136+ then throw("Invalid deposit params (manager)")
123137 else {
124- let O = B(r)
125- let P = invoke(A(), "deposit", [toString(O), false], [AttachedPayment(F.payments[0].assetId, L)])
126- if ((P == P))
138+ let S = F(t)
139+ let T = invoke(E(), "deposit", [toString(S), false], [AttachedPayment(J.payments[0].assetId, P)])
140+ if ((T == T))
127141 then {
128- let N = (q(r) + L)
129- D(r, N)
142+ let R = (s(t) + P)
143+ H(t, R)
130144 }
131145 else throw("Strict value is not equal to itself.")
132146 }
134148
135149
136150
137-@Callable(F)
138-func claimProfit (r) = if (if (if ((fromBase58String(r) != y()))
151+@Callable(J)
152+func claimProfit (t) = if (if (if ((fromBase58String(t) != C()))
139153 then true
140- else !(v()))
154+ else !(z()))
141155 then true
142- else (F.caller != w()))
156+ else (J.caller != A()))
143157 then throw("Invalid claimProfit params")
144158 else {
145- let Q = invoke(B(r), "getCurrentTotals", [toString(this)], nil)
146- if ((Q == Q))
159+ let U = invoke(F(t), "getCurrentTotals", [toString(this)], nil)
160+ if ((U == U))
147161 then {
148- let N = {
149- let R = Q
150- if ($isInstanceOf(R, "(Int, Int, Int, Int)"))
162+ let R = {
163+ let V = U
164+ if ($isInstanceOf(V, "(Int, Int, Int, Int)"))
151165 then {
152- let S = R
153- S._3
166+ let W = V
167+ W._3
154168 }
155169 else throw("Invalid currentAmount type")
156170 }
157- let T = (N - q(r))
158- let M = invoke(A(), "withdraw", [r, T], nil)
159- if ((M == M))
160- then [ScriptTransfer(F.caller, T, fromBase58String(r))]
171+ let X = (R - s(t))
172+ let Q = invoke(E(), "withdraw", [t, X], nil)
173+ if ((Q == Q))
174+ then [ScriptTransfer(J.caller, X, fromBase58String(t))]
161175 else throw("Strict value is not equal to itself.")
162176 }
163177 else throw("Strict value is not equal to itself.")
165179
166180
167181
168-@Callable(F)
169-func view_claimProfit (r) = if (if ((fromBase58String(r) != y()))
182+@Callable(J)
183+func view_claimProfit (t) = if (if ((fromBase58String(t) != C()))
170184 then true
171- else !(v()))
185+ else !(z()))
172186 then throw("Invalid view_claimProfit params")
173187 else {
174- let Q = invoke(B(r), "getCurrentTotals", [toString(this)], nil)
175- if ((Q == Q))
188+ let U = invoke(F(t), "getCurrentTotals", [toString(this)], nil)
189+ if ((U == U))
176190 then {
177- let N = {
178- let R = Q
179- if ($isInstanceOf(R, "(Int, Int, Int, Int)"))
191+ let R = {
192+ let V = U
193+ if ($isInstanceOf(V, "(Int, Int, Int, Int)"))
180194 then {
181- let S = R
182- S._3
195+ let W = V
196+ W._3
183197 }
184198 else throw("Invalid currentAmount type")
185199 }
186- let T = (N - q(r))
187- throw(((((toString(q(r)) + ",") + toString(N)) + ",") + toString(T)))
200+ let X = (R - s(t))
201+ throw(((((toString(s(t)) + ",") + toString(R)) + ",") + toString(X)))
188202 }
189203 else throw("Strict value is not equal to itself.")
190204 }
191205
192206
193-@Verifier(U)
194-func V () = sigVerify(U.bodyBytes, U.proofs[0], x())
207+@Verifier(Y)
208+func Z () = sigVerify(Y.bodyBytes, Y.proofs[0], B())
195209
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "k_funds"
55
66 let b = "k_vires_address"
77
88 let c = "k_vires_vault"
99
1010 let d = "k_asset_claimed_profit"
1111
1212 let e = "k_coordinatorAddress"
1313
1414 let f = "k_insurance_address"
1515
16-let g = "k_amm"
16+let g = "k_orders_address"
1717
18-let h = "k_admin_address"
18+let h = "k_vault_address"
1919
20-let i = "k_admin_public_key"
20+let i = "k_amm"
2121
22-let j = "k_quote_asset"
22+let j = "k_admin_address"
2323
24-let k = "k_quote_staking"
24+let k = "k_admin_public_key"
2525
26-let l = "k_staking_address"
26+let l = "k_quote_asset"
2727
28-let m = "k_initialized"
28+let m = "k_quote_staking"
2929
30-func n (o,p) = ((o + "_") + p)
30+let n = "k_staking_address"
31+
32+let o = "k_initialized"
33+
34+func p (q,r) = ((q + "_") + r)
3135
3236
33-func q (r) = valueOrElse(getInteger(this, n(a, r)), 0)
37+func s (t) = valueOrElse(getInteger(this, p(a, t)), 0)
3438
3539
36-func s () = valueOrErrorMessage(addressFromString(getStringValue(this, e)), "Coordinator not set")
40+func u () = valueOrErrorMessage(addressFromString(getStringValue(this, e)), "Coordinator not set")
3741
3842
39-func t () = valueOrErrorMessage(addressFromString(getStringValue(s(), f)), "Insurance not set")
43+func v () = valueOrErrorMessage(addressFromString(getStringValue(u(), f)), "Insurance not set")
4044
4145
42-func u (p) = valueOrElse(getBoolean(s(), n(g, p)), false)
46+func w () = valueOrErrorMessage(addressFromString(getStringValue(u(), h)), "Vault not set")
4347
4448
45-func v () = valueOrElse(getBoolean(this, m), false)
49+func x () = valueOrErrorMessage(addressFromString(getStringValue(u(), g)), "Orders not set")
4650
4751
48-func w () = addressFromString(getStringValue(s(), h))
52+func y (r) = valueOrElse(getBoolean(u(), p(i, r)), false)
4953
5054
51-func x () = fromBase58String(getStringValue(s(), i))
55+func z () = valueOrElse(getBoolean(this, o), false)
5256
5357
54-func y () = fromBase58String(getStringValue(s(), j))
58+func A () = addressFromString(getStringValue(u(), j))
5559
5660
57-func z () = valueOrErrorMessage(addressFromString(getStringValue(s(), l)), "Staking not set")
61+func B () = fromBase58String(getStringValue(u(), k))
5862
5963
60-func A () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Vires not set")
64+func C () = fromBase58String(getStringValue(u(), l))
6165
6266
63-func B (r) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, n(c, r)), ("No vault for token " + r))), ("Invalid address for token " + r))
67+func D () = valueOrErrorMessage(addressFromString(getStringValue(u(), n)), "Staking not set")
6468
6569
66-func C (p) = if (if (u(p))
67- then true
68- else (p == toString(t())))
69- then true
70- else (p == toString(z()))
70+func E () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Vires not set")
7171
7272
73-func D (r,E) = [IntegerEntry(n(a, r), E)]
73+func F (t) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, p(c, t)), ("No vault for token " + t))), ("Invalid address for token " + t))
7474
7575
76-@Callable(F)
77-func initialize (G,H,I,J) = if (v())
76+func G (r) = if (if (if (if (y(r))
77+ then true
78+ else (r == toString(v())))
79+ then true
80+ else (r == toString(D())))
81+ then true
82+ else (r == toString(w())))
83+ then true
84+ else (r == toString(x()))
85+
86+
87+func H (t,I) = [IntegerEntry(p(a, t), I)]
88+
89+
90+@Callable(J)
91+func initialize (K,L,M,N) = if (z())
7892 then throw("Already initialized")
79- else [StringEntry(e, G), StringEntry(b, H), StringEntry(n(c, I), J), BooleanEntry(m, true)]
93+ else [StringEntry(e, K), StringEntry(b, L), StringEntry(p(c, M), N), BooleanEntry(o, true)]
8094
8195
8296
83-@Callable(F)
84-func addTokenVault (r,K) = if (if (!(v()))
97+@Callable(J)
98+func addTokenVault (t,O) = if (if (!(z()))
8599 then true
86- else (F.caller != w()))
100+ else (J.caller != A()))
87101 then throw("Invalid addTokenVault params")
88- else [StringEntry(n(c, r), K)]
102+ else [StringEntry(p(c, t), O)]
89103
90104
91105
92-@Callable(F)
93-func withdraw (r,L) = if (if (if (!(C(toString(F.caller))))
106+@Callable(J)
107+func withdraw (t,P) = if (if (if (!(G(toString(J.caller))))
94108 then true
95- else !(v()))
109+ else !(z()))
96110 then true
97- else (L > q(r)))
98- then throw(((("Invalid withdraw params " + toString(L)) + " > ") + toString(q(r))))
111+ else (P > s(t)))
112+ then throw(((("Invalid withdraw params (manager) " + toString(P)) + " > ") + toString(s(t))))
99113 else {
100- let M = invoke(A(), "withdraw", [r, L], nil)
101- if ((M == M))
114+ let Q = invoke(E(), "withdraw", [t, P], nil)
115+ if ((Q == Q))
102116 then {
103- let N = (q(r) - L)
104- (D(r, N) ++ [ScriptTransfer(F.caller, L, fromBase58String(r))])
117+ let R = (s(t) - P)
118+ (H(t, R) ++ [ScriptTransfer(J.caller, P, fromBase58String(t))])
105119 }
106120 else throw("Strict value is not equal to itself.")
107121 }
108122
109123
110124
111-@Callable(F)
125+@Callable(J)
112126 func deposit () = {
113- let L = F.payments[0].amount
114- let r = toBase58String(valueOrErrorMessage(F.payments[0].assetId, "No assetId"))
115- if (if (if ((F.payments[0].assetId != y()))
127+ let P = J.payments[0].amount
128+ let t = toBase58String(valueOrErrorMessage(J.payments[0].assetId, "No assetId"))
129+ if (if (if ((J.payments[0].assetId != C()))
116130 then true
117- else !(v()))
131+ else !(z()))
118132 then true
119- else if (!(C(toString(F.caller))))
120- then (F.caller != w())
133+ else if (!(G(toString(J.caller))))
134+ then (J.caller != A())
121135 else false)
122- then throw("Invalid deposit params")
136+ then throw("Invalid deposit params (manager)")
123137 else {
124- let O = B(r)
125- let P = invoke(A(), "deposit", [toString(O), false], [AttachedPayment(F.payments[0].assetId, L)])
126- if ((P == P))
138+ let S = F(t)
139+ let T = invoke(E(), "deposit", [toString(S), false], [AttachedPayment(J.payments[0].assetId, P)])
140+ if ((T == T))
127141 then {
128- let N = (q(r) + L)
129- D(r, N)
142+ let R = (s(t) + P)
143+ H(t, R)
130144 }
131145 else throw("Strict value is not equal to itself.")
132146 }
133147 }
134148
135149
136150
137-@Callable(F)
138-func claimProfit (r) = if (if (if ((fromBase58String(r) != y()))
151+@Callable(J)
152+func claimProfit (t) = if (if (if ((fromBase58String(t) != C()))
139153 then true
140- else !(v()))
154+ else !(z()))
141155 then true
142- else (F.caller != w()))
156+ else (J.caller != A()))
143157 then throw("Invalid claimProfit params")
144158 else {
145- let Q = invoke(B(r), "getCurrentTotals", [toString(this)], nil)
146- if ((Q == Q))
159+ let U = invoke(F(t), "getCurrentTotals", [toString(this)], nil)
160+ if ((U == U))
147161 then {
148- let N = {
149- let R = Q
150- if ($isInstanceOf(R, "(Int, Int, Int, Int)"))
162+ let R = {
163+ let V = U
164+ if ($isInstanceOf(V, "(Int, Int, Int, Int)"))
151165 then {
152- let S = R
153- S._3
166+ let W = V
167+ W._3
154168 }
155169 else throw("Invalid currentAmount type")
156170 }
157- let T = (N - q(r))
158- let M = invoke(A(), "withdraw", [r, T], nil)
159- if ((M == M))
160- then [ScriptTransfer(F.caller, T, fromBase58String(r))]
171+ let X = (R - s(t))
172+ let Q = invoke(E(), "withdraw", [t, X], nil)
173+ if ((Q == Q))
174+ then [ScriptTransfer(J.caller, X, fromBase58String(t))]
161175 else throw("Strict value is not equal to itself.")
162176 }
163177 else throw("Strict value is not equal to itself.")
164178 }
165179
166180
167181
168-@Callable(F)
169-func view_claimProfit (r) = if (if ((fromBase58String(r) != y()))
182+@Callable(J)
183+func view_claimProfit (t) = if (if ((fromBase58String(t) != C()))
170184 then true
171- else !(v()))
185+ else !(z()))
172186 then throw("Invalid view_claimProfit params")
173187 else {
174- let Q = invoke(B(r), "getCurrentTotals", [toString(this)], nil)
175- if ((Q == Q))
188+ let U = invoke(F(t), "getCurrentTotals", [toString(this)], nil)
189+ if ((U == U))
176190 then {
177- let N = {
178- let R = Q
179- if ($isInstanceOf(R, "(Int, Int, Int, Int)"))
191+ let R = {
192+ let V = U
193+ if ($isInstanceOf(V, "(Int, Int, Int, Int)"))
180194 then {
181- let S = R
182- S._3
195+ let W = V
196+ W._3
183197 }
184198 else throw("Invalid currentAmount type")
185199 }
186- let T = (N - q(r))
187- throw(((((toString(q(r)) + ",") + toString(N)) + ",") + toString(T)))
200+ let X = (R - s(t))
201+ throw(((((toString(s(t)) + ",") + toString(R)) + ",") + toString(X)))
188202 }
189203 else throw("Strict value is not equal to itself.")
190204 }
191205
192206
193-@Verifier(U)
194-func V () = sigVerify(U.bodyBytes, U.proofs[0], x())
207+@Verifier(Y)
208+func Z () = sigVerify(Y.bodyBytes, Y.proofs[0], B())
195209

github/deemru/w8io/026f985 
63.10 ms