tx · 3k6jZHZrFD1dioi6GjqhmQeHP4svrf2WGeqbYA6W5SwW

3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH:  -0.03400000 Waves

2022.10.06 10:42 [2260170] smart account 3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH > SELF 0.00000000 Waves

{ "type": 13, "id": "3k6jZHZrFD1dioi6GjqhmQeHP4svrf2WGeqbYA6W5SwW", "fee": 3400000, "feeAssetId": null, "timestamp": 1665042153187, "version": 2, "chainId": 84, "sender": "3NCkVR5gTgfosVUNRTsUHc6kXdhh2V3betH", "senderPublicKey": "3mgJJUcUNFHYP2pNkbkfB2C8D4gSEKEGisFByu2i6xoM", "proofs": [ "3DRFW4U7DRUoJxz7FToyA2UqbLjCeTuCyM3MSaDfkHq36KD1iFbcFYQM9P33snUrJfP5sVyWFgobguefbPdkNKqh" ], "script": "base64:BgIiCAISBgoECAgICBIECgIICBIECgIIARIAEgMKAQgSAwoBCBsAB2tfZnVuZHMCB2tfZnVuZHMAD2tfdmlyZXNfYWRkcmVzcwIPa192aXJlc19hZGRyZXNzAA1rX3ZpcmVzX3ZhdWx0Ag1rX3ZpcmVzX3ZhdWx0ABZrX2Fzc2V0X2NsYWltZWRfcHJvZml0AhZrX2Fzc2V0X2NsYWltZWRfcHJvZml0ABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAE2tfaW5zdXJhbmNlX2FkZHJlc3MCE2tfaW5zdXJhbmNlX2FkZHJlc3MABWtfYW1tAgVrX2FtbQAPa19hZG1pbl9hZGRyZXNzAg9rX2FkbWluX2FkZHJlc3MAEmtfYWRtaW5fcHVibGljX2tleQISa19hZG1pbl9wdWJsaWNfa2V5AA1rX3F1b3RlX2Fzc2V0Ag1rX3F1b3RlX2Fzc2V0AA9rX3F1b3RlX3N0YWtpbmcCD2tfcXVvdGVfc3Rha2luZwARa19zdGFraW5nX2FkZHJlc3MCEWtfc3Rha2luZ19hZGRyZXNzAA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DWN1cnJlbnRBbW91bnQJAPwHBAkBCnZpcmVzVmF1bHQBBQhfYXNzZXRJZAIQZ2V0Q3VycmVudFRvdGFscwkAzAgCCQClCAEFBHRoaXMFA25pbAUDbmlsAwkAAAIFDWN1cnJlbnRBbW91bnQFDWN1cnJlbnRBbW91bnQEE2N1cnJlbnRBc3NldEJhbGFuY2UEByRtYXRjaDAFDWN1cnJlbnRBbW91bnQDCQABAgUHJG1hdGNoMAIUKEludCwgSW50LCBJbnQsIEludCkEAXQFByRtYXRjaDAIBQF0Al8zCQACAQIaSW52YWxpZCBjdXJyZW50QW1vdW50IHR5cGUEBnByb2ZpdAkAZQIFE2N1cnJlbnRBc3NldEJhbGFuY2UJAQliYWxhbmNlT2YBBQhfYXNzZXRJZAkAAgEJAKwCAgkArAICCQCsAgIJAKwCAgkApAMBCQEJYmFsYW5jZU9mAQUIX2Fzc2V0SWQCASwJAKQDAQUTY3VycmVudEFzc2V0QmFsYW5jZQIBLAkApAMBBQZwcm9maXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQEOYWRtaW5QdWJsaWNLZXkAGk/agQ==", "height": 2260170, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: B4bA9uX74UCSjD9ncDCNkXnUynwEX5MdnSxvExWypX1U Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let a = "k_funds"
5+
6+let b = "k_vires_address"
7+
8+let c = "k_vires_vault"
9+
10+let d = "k_asset_claimed_profit"
11+
12+let e = "k_coordinatorAddress"
13+
14+let f = "k_insurance_address"
15+
16+let g = "k_amm"
17+
18+let h = "k_admin_address"
19+
20+let i = "k_admin_public_key"
21+
22+let j = "k_quote_asset"
23+
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)
31+
32+
33+func q (r) = valueOrElse(getInteger(this, n(a, r)), 0)
34+
35+
36+func s () = valueOrErrorMessage(addressFromString(getStringValue(this, e)), "Coordinator not set")
37+
38+
39+func t () = valueOrErrorMessage(addressFromString(getStringValue(s(), f)), "Insurance not set")
40+
41+
42+func u (p) = valueOrElse(getBoolean(s(), n(g, p)), false)
43+
44+
45+func v () = valueOrElse(getBoolean(this, m), false)
46+
47+
48+func w () = addressFromString(getStringValue(s(), h))
49+
50+
51+func x () = fromBase58String(getStringValue(s(), i))
52+
53+
54+func y () = fromBase58String(getStringValue(s(), j))
55+
56+
57+func z () = valueOrErrorMessage(addressFromString(getStringValue(s(), l)), "Staking not set")
58+
59+
60+func A () = valueOrErrorMessage(addressFromString(getStringValue(this, b)), "Vires not set")
61+
62+
63+func B (r) = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, n(c, r)), ("No vault for token " + r))), ("Invalid address for token " + r))
64+
65+
66+func C (p) = if (if (u(p))
67+ then true
68+ else (p == toString(t())))
69+ then true
70+ else (p == toString(z()))
71+
72+
73+func D (r,E) = [IntegerEntry(n(a, r), E)]
74+
75+
76+@Callable(F)
77+func initialize (G,H,I,J) = if (v())
78+ then throw("Already initialized")
79+ else [StringEntry(e, G), StringEntry(b, H), StringEntry(n(c, I), J), BooleanEntry(m, true)]
80+
81+
82+
83+@Callable(F)
84+func addTokenVault (r,K) = if (if (!(v()))
85+ then true
86+ else (F.caller != w()))
87+ then throw("Invalid addTokenVault params")
88+ else [StringEntry(n(c, r), K)]
89+
90+
91+
92+@Callable(F)
93+func withdraw (r,L) = if (if (if (!(C(toString(F.caller))))
94+ then true
95+ else !(v()))
96+ then true
97+ else (L > q(r)))
98+ then throw(((("Invalid withdraw params " + toString(L)) + " > ") + toString(q(r))))
99+ else {
100+ let M = invoke(A(), "withdraw", [r, L], nil)
101+ if ((M == M))
102+ then {
103+ let N = (q(r) - L)
104+ (D(r, N) ++ [ScriptTransfer(F.caller, L, fromBase58String(r))])
105+ }
106+ else throw("Strict value is not equal to itself.")
107+ }
108+
109+
110+
111+@Callable(F)
112+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()))
116+ then true
117+ else !(v()))
118+ then true
119+ else if (!(C(toString(F.caller))))
120+ then (F.caller != w())
121+ else false)
122+ then throw("Invalid deposit params")
123+ 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))
127+ then {
128+ let N = (q(r) + L)
129+ D(r, N)
130+ }
131+ else throw("Strict value is not equal to itself.")
132+ }
133+ }
134+
135+
136+
137+@Callable(F)
138+func claimProfit (r) = if (if (if ((fromBase58String(r) != y()))
139+ then true
140+ else !(v()))
141+ then true
142+ else (F.caller != w()))
143+ then throw("Invalid claimProfit params")
144+ else {
145+ let Q = invoke(B(r), "getCurrentTotals", [toString(this)], nil)
146+ if ((Q == Q))
147+ then {
148+ let N = {
149+ let R = Q
150+ if ($isInstanceOf(R, "(Int, Int, Int, Int)"))
151+ then {
152+ let S = R
153+ S._3
154+ }
155+ else throw("Invalid currentAmount type")
156+ }
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))]
161+ else throw("Strict value is not equal to itself.")
162+ }
163+ else throw("Strict value is not equal to itself.")
164+ }
165+
166+
167+
168+@Callable(F)
169+func view_claimProfit (r) = if (if ((fromBase58String(r) != y()))
170+ then true
171+ else !(v()))
172+ then throw("Invalid view_claimProfit params")
173+ else {
174+ let Q = invoke(B(r), "getCurrentTotals", [toString(this)], nil)
175+ if ((Q == Q))
176+ then {
177+ let N = {
178+ let R = Q
179+ if ($isInstanceOf(R, "(Int, Int, Int, Int)"))
180+ then {
181+ let S = R
182+ S._3
183+ }
184+ else throw("Invalid currentAmount type")
185+ }
186+ let T = (N - q(r))
187+ throw(((((toString(q(r)) + ",") + toString(N)) + ",") + toString(T)))
188+ }
189+ else throw("Strict value is not equal to itself.")
190+ }
191+
192+
193+@Verifier(U)
194+func V () = sigVerify(U.bodyBytes, U.proofs[0], x())
195+

github/deemru/w8io/026f985 
188.37 ms