tx · 7Sn8aJWrWUwG7L5o8ps4qXkCqXcDXAsBujNT1dxt1J8j
3NADcxHXbecCheinqFbvhDjfzZhsMFZJUuH: -0.03700000 Waves
2022.12.12 16:42 [2357198] smart account 3NADcxHXbecCheinqFbvhDjfzZhsMFZJUuH > SELF 0.00000000 Waves
{
"type": 13,
"id": "7Sn8aJWrWUwG7L5o8ps4qXkCqXcDXAsBujNT1dxt1J8j",
"fee": 3700000,
"feeAssetId": null,
"timestamp": 1670852621373,
"version": 2,
"chainId": 84,
"sender": "3NADcxHXbecCheinqFbvhDjfzZhsMFZJUuH",
"senderPublicKey": "DKfzQgvVdTqPHgGbdZptWYA8G5xVfmSMAwL3UnhwQmdy",
"proofs": [
"3mJpkjgcqGtFyqYpcQN9RuNGB19hpP8k22dkDeTUjgjbmmziZb4N7fKgRdPPQixptSBbTpsZeEfzNvvHd7wi8j8d"
],
"script": "base64:BgIzCAISAwoBCBIAEgMKAQESABIDCgEEEgMKAQESAwoBARIDCgEBEgMKAQESAwoBCBIDCgEIQgANa190b3RhbFN1cHBseQINa190b3RhbFN1cHBseQAPa19sb2NrZWRCYWxhbmNlAg9rX2xvY2tlZEJhbGFuY2UAEGtfdkxvY2tlZEJhbGFuY2UCEGtfdkxvY2tlZEJhbGFuY2UADWtfZnJlZUJhbGFuY2UCDWtfZnJlZUJhbGFuY2UAFWtfZnJlZUJhbGFuY2VCb3Jyb3dlZAIVa19mcmVlQmFsYW5jZUJvcnJvd2VkAAZrX3JhdGUCBmtfcmF0ZQAJa19iYWxhbmNlAglrX2JhbGFuY2UADmtfYXZlcmFnZV9yYXRlAg5rX2F2ZXJhZ2VfcmF0ZQAQa193aXRoZHJhd19saW1pdAIQa193aXRoZHJhd19saW1pdAAUa19sYXN0X3dpdGhkcmF3X2RhdGUCFGtfbGFzdF93aXRoZHJhd19kYXRlABRrX3dpdGhkcmF3X2luX3BlcmlvZAIUa193aXRoZHJhd19pbl9wZXJpb2QADWtfaW5pdGlhbGl6ZWQCDWtf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Jhd0xpbWl0AQdfc3Rha2VyBBF3aXRoZHJhd0xpbWl0TGVmdAgJARRnZXRXaXRoZHJhd0xpbWl0TGVmdAEFB19zdGFrZXICXzIEC2xpbWl0SW5Vc2RuCQEQdXNkbkZyb21EZWNpbWFscwEJAQRtdWxkAgURd2l0aGRyYXdMaW1pdExlZnQJAQRyYXRlAAkAAgEJAKQDAQULbGltaXRJblVzZG4BAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACQEOYWRtaW5QdWJsaWNLZXkAw/0oEA==",
"height": 2357198,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CePWAsvbqcM4ypm1268t74p7MsF7Bo5GFNqxSfGUZCej
Next: AedhUzzEoxMx1HxeTKckrhCuTAEmKim9aXjm3pQM6qip
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "k_lockedBalance" |
---|
7 | 7 | | |
---|
8 | | - | let c = "k_freeBalance" |
---|
| 8 | + | let c = "k_vLockedBalance" |
---|
9 | 9 | | |
---|
10 | | - | let d = "k_rate" |
---|
| 10 | + | let d = "k_freeBalance" |
---|
11 | 11 | | |
---|
12 | | - | let e = "k_balance" |
---|
| 12 | + | let e = "k_freeBalanceBorrowed" |
---|
13 | 13 | | |
---|
14 | | - | let f = "k_average_rate" |
---|
| 14 | + | let f = "k_rate" |
---|
15 | 15 | | |
---|
16 | | - | let g = "k_withdraw_limit" |
---|
| 16 | + | let g = "k_balance" |
---|
17 | 17 | | |
---|
18 | | - | let h = "k_last_withdraw_date" |
---|
| 18 | + | let h = "k_average_rate" |
---|
19 | 19 | | |
---|
20 | | - | let i = "k_withdraw_in_period" |
---|
| 20 | + | let i = "k_withdraw_limit" |
---|
21 | 21 | | |
---|
22 | | - | let j = "k_initialized" |
---|
| 22 | + | let j = "k_last_withdraw_date" |
---|
23 | 23 | | |
---|
24 | | - | let k = "k_coordinatorAddress" |
---|
| 24 | + | let k = "k_withdraw_in_period" |
---|
25 | 25 | | |
---|
26 | | - | let l = "k_amm" |
---|
| 26 | + | let l = "k_initialized" |
---|
27 | 27 | | |
---|
28 | | - | let m = "k_quote_asset" |
---|
| 28 | + | let m = "k_coordinatorAddress" |
---|
29 | 29 | | |
---|
30 | | - | let n = "k_admin_public_key" |
---|
| 30 | + | let n = "k_amm" |
---|
31 | 31 | | |
---|
32 | | - | let o = "k_admin_address" |
---|
| 32 | + | let o = "k_quote_asset" |
---|
33 | 33 | | |
---|
34 | | - | let p = "k_manager_address" |
---|
| 34 | + | let p = "k_admin_public_key" |
---|
35 | 35 | | |
---|
36 | | - | func q (r,s) = ((r + "_") + s) |
---|
| 36 | + | let q = "k_admin_address" |
---|
| 37 | + | |
---|
| 38 | + | let r = "k_manager_address" |
---|
| 39 | + | |
---|
| 40 | + | let s = "k_collateral_address" |
---|
| 41 | + | |
---|
| 42 | + | func t (u,v) = ((u + "_") + v) |
---|
37 | 43 | | |
---|
38 | 44 | | |
---|
39 | | - | func t () = valueOrErrorMessage(addressFromString(getStringValue(this, k)), "Coordinator not set") |
---|
| 45 | + | func w () = valueOrErrorMessage(addressFromString(getStringValue(this, m)), "Coordinator not set") |
---|
40 | 46 | | |
---|
41 | 47 | | |
---|
42 | | - | func u (s) = valueOrElse(getBoolean(t(), q(l, s)), false) |
---|
| 48 | + | func x (v) = valueOrElse(getBoolean(w(), t(n, v)), false) |
---|
43 | 49 | | |
---|
44 | 50 | | |
---|
45 | | - | func v () = fromBase58String(getStringValue(t(), n)) |
---|
| 51 | + | func y () = fromBase58String(getStringValue(w(), p)) |
---|
46 | 52 | | |
---|
47 | 53 | | |
---|
48 | | - | func w () = addressFromString(valueOrErrorMessage(getString(t(), o), "Admin address not set")) |
---|
| 54 | + | func z () = addressFromString(valueOrErrorMessage(getString(w(), q), "Admin address not set")) |
---|
49 | 55 | | |
---|
50 | 56 | | |
---|
51 | | - | func x () = fromBase58String(getStringValue(t(), m)) |
---|
| 57 | + | func A () = fromBase58String(getStringValue(w(), o)) |
---|
52 | 58 | | |
---|
53 | 59 | | |
---|
54 | | - | func y () = valueOrErrorMessage(addressFromString(getStringValue(t(), p)), "Manager not set") |
---|
| 60 | + | func B () = valueOrErrorMessage(addressFromString(getStringValue(w(), r)), "Manager not set") |
---|
55 | 61 | | |
---|
56 | 62 | | |
---|
57 | | - | let z = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
58 | | - | |
---|
59 | | - | let A = ((60 * 60) * 24) |
---|
60 | | - | |
---|
61 | | - | let B = "" |
---|
62 | | - | |
---|
63 | | - | let C = 0 |
---|
64 | | - | |
---|
65 | | - | func D (E) = (E / 100) |
---|
| 63 | + | func C () = valueOrErrorMessage(addressFromString(getStringValue(w(), s)), "Collateral Manager not set") |
---|
66 | 64 | | |
---|
67 | 65 | | |
---|
68 | | - | func F (E) = (E * 100) |
---|
| 66 | + | let D = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
| 67 | + | |
---|
| 68 | + | let E = ((60 * 60) * 24) |
---|
| 69 | + | |
---|
| 70 | + | let F = "" |
---|
| 71 | + | |
---|
| 72 | + | let G = 0 |
---|
| 73 | + | |
---|
| 74 | + | func H (I) = (I / 100) |
---|
69 | 75 | | |
---|
70 | 76 | | |
---|
71 | | - | func G (H,I) = fraction(H, z, I, HALFEVEN) |
---|
| 77 | + | func J (I) = (I * 100) |
---|
72 | 78 | | |
---|
73 | 79 | | |
---|
74 | | - | func J (H,I) = fraction(H, I, z, HALFEVEN) |
---|
| 80 | + | func K (L,M) = fraction(L, D, M, HALFEVEN) |
---|
75 | 81 | | |
---|
76 | 82 | | |
---|
77 | | - | func K (H) = if ((H > 0)) |
---|
78 | | - | then H |
---|
79 | | - | else -(H) |
---|
| 83 | + | func N (L,M) = fraction(L, M, D, HALFEVEN) |
---|
80 | 84 | | |
---|
81 | 85 | | |
---|
82 | | - | func L (H,I) = if ((H > I)) |
---|
83 | | - | then I |
---|
84 | | - | else H |
---|
| 86 | + | func O (L) = if ((L > 0)) |
---|
| 87 | + | then L |
---|
| 88 | + | else -(L) |
---|
85 | 89 | | |
---|
86 | 90 | | |
---|
87 | | - | let M = (86400 * 1000) |
---|
88 | | - | |
---|
89 | | - | let N = G((1 * z), (4 * z)) |
---|
90 | | - | |
---|
91 | | - | func O (P) = valueOrErrorMessage(getInteger(this, P), ("no value for " + P)) |
---|
| 91 | + | func P (L,M) = if ((L > M)) |
---|
| 92 | + | then M |
---|
| 93 | + | else L |
---|
92 | 94 | | |
---|
93 | 95 | | |
---|
94 | | - | func Q (P) = valueOrElse(getInteger(this, P), 0) |
---|
| 96 | + | let Q = (86400 * 1000) |
---|
| 97 | + | |
---|
| 98 | + | let R = K((1 * D), (4 * D)) |
---|
| 99 | + | |
---|
| 100 | + | func S (T) = valueOrErrorMessage(getInteger(this, T), ("no value for " + T)) |
---|
95 | 101 | | |
---|
96 | 102 | | |
---|
97 | | - | func R (P) = valueOrElse(getInteger(this, P), z) |
---|
| 103 | + | func U (T) = valueOrElse(getInteger(this, T), 0) |
---|
98 | 104 | | |
---|
99 | 105 | | |
---|
100 | | - | func S () = Q(a) |
---|
| 106 | + | func V (T) = valueOrElse(getInteger(this, T), D) |
---|
101 | 107 | | |
---|
102 | 108 | | |
---|
103 | | - | func T () = R(d) |
---|
| 109 | + | func W () = U(a) |
---|
104 | 110 | | |
---|
105 | 111 | | |
---|
106 | | - | func U (V) = Q(q(e, V)) |
---|
| 112 | + | func X () = V(f) |
---|
107 | 113 | | |
---|
108 | 114 | | |
---|
109 | | - | func W (V) = Q(q(f, V)) |
---|
| 115 | + | func Y (Z) = U(t(g, Z)) |
---|
110 | 116 | | |
---|
111 | 117 | | |
---|
112 | | - | func X (V) = Q(q(g, V)) |
---|
| 118 | + | func aa (Z) = U(t(h, Z)) |
---|
113 | 119 | | |
---|
114 | 120 | | |
---|
115 | | - | func Y (V) = Q(q(i, V)) |
---|
| 121 | + | func ab (Z) = U(t(i, Z)) |
---|
116 | 122 | | |
---|
117 | 123 | | |
---|
118 | | - | func Z (V) = Q(q(h, V)) |
---|
| 124 | + | func ac (Z) = U(t(k, Z)) |
---|
119 | 125 | | |
---|
120 | 126 | | |
---|
121 | | - | func aa () = Q(c) |
---|
| 127 | + | func ad (Z) = U(t(j, Z)) |
---|
122 | 128 | | |
---|
123 | 129 | | |
---|
124 | | - | func ab () = Q(b) |
---|
| 130 | + | func ae () = U(d) |
---|
125 | 131 | | |
---|
126 | 132 | | |
---|
127 | | - | func ac () = valueOrElse(getBoolean(this, j), false) |
---|
| 133 | + | func af () = U(e) |
---|
128 | 134 | | |
---|
129 | 135 | | |
---|
130 | | - | func ad (V) = { |
---|
131 | | - | let ae = lastBlock.timestamp |
---|
132 | | - | let af = Z(V) |
---|
133 | | - | let ag = if (((ae - af) > M)) |
---|
134 | | - | then $Tuple2(ae, X(V)) |
---|
135 | | - | else $Tuple2(af, (X(V) - Y(V))) |
---|
136 | | - | let ah = ag._1 |
---|
137 | | - | let ai = ag._2 |
---|
138 | | - | $Tuple2(ah, ai) |
---|
| 136 | + | func ag () = U(b) |
---|
| 137 | + | |
---|
| 138 | + | |
---|
| 139 | + | func ah () = U(c) |
---|
| 140 | + | |
---|
| 141 | + | |
---|
| 142 | + | func ai () = valueOrElse(getBoolean(this, l), false) |
---|
| 143 | + | |
---|
| 144 | + | |
---|
| 145 | + | func aj (Z) = { |
---|
| 146 | + | let ak = lastBlock.timestamp |
---|
| 147 | + | let al = ad(Z) |
---|
| 148 | + | let am = if (((ak - al) > Q)) |
---|
| 149 | + | then $Tuple2(ak, ab(Z)) |
---|
| 150 | + | else $Tuple2(al, (ab(Z) - ac(Z))) |
---|
| 151 | + | let an = am._1 |
---|
| 152 | + | let ao = am._2 |
---|
| 153 | + | $Tuple2(an, ao) |
---|
139 | 154 | | } |
---|
140 | 155 | | |
---|
141 | 156 | | |
---|
142 | | - | func aj (ak,al) = [IntegerEntry(q(e, ak), (U(ak) + al))] |
---|
| 157 | + | func ap (aq) = { |
---|
| 158 | + | let ar = if ((W() > 0)) |
---|
| 159 | + | then K((ae() + aq), W()) |
---|
| 160 | + | else D |
---|
| 161 | + | ar |
---|
| 162 | + | } |
---|
143 | 163 | | |
---|
144 | 164 | | |
---|
145 | | - | func am (ak,an) = [IntegerEntry(q(g, ak), an)] |
---|
| 165 | + | func as (at,au) = [IntegerEntry(t(g, at), (Y(at) + au))] |
---|
146 | 166 | | |
---|
147 | 167 | | |
---|
148 | | - | func ao (ak,an) = [IntegerEntry(q(f, ak), an)] |
---|
| 168 | + | func av (at,aw) = [IntegerEntry(t(i, at), aw)] |
---|
149 | 169 | | |
---|
150 | 170 | | |
---|
151 | | - | func ap (al) = [IntegerEntry(c, (aa() + al))] |
---|
| 171 | + | func ax (at,aw) = [IntegerEntry(t(h, at), aw)] |
---|
152 | 172 | | |
---|
153 | 173 | | |
---|
154 | | - | func aq (al) = [IntegerEntry(b, (ab() + al))] |
---|
| 174 | + | func ay (au) = [IntegerEntry(d, (ae() + au))] |
---|
155 | 175 | | |
---|
156 | 176 | | |
---|
157 | | - | func ar (al) = [IntegerEntry(a, (S() + al))] |
---|
| 177 | + | func az (au) = { |
---|
| 178 | + | let aA = af() |
---|
| 179 | + | if (((aA + au) >= 0)) |
---|
| 180 | + | then [IntegerEntry(e, (aA + au))] |
---|
| 181 | + | else throw(((("Vault: can not update borrowed free balance. Balance: " + toString(aA)) + " change: ") + toString(au))) |
---|
| 182 | + | } |
---|
158 | 183 | | |
---|
159 | 184 | | |
---|
160 | | - | func as (an) = [IntegerEntry(d, an)] |
---|
| 185 | + | func aB (au) = { |
---|
| 186 | + | let aC = ag() |
---|
| 187 | + | if (((aC + au) >= 0)) |
---|
| 188 | + | then [IntegerEntry(b, (aC + au))] |
---|
| 189 | + | else throw(((("Vault: can not update locked balance. Balance: " + toString(aC)) + " change: ") + toString(au))) |
---|
| 190 | + | } |
---|
161 | 191 | | |
---|
162 | 192 | | |
---|
163 | | - | func at (ak,au,av) = [IntegerEntry(q(h, ak), au), IntegerEntry(q(i, ak), av)] |
---|
| 193 | + | func aD (au) = { |
---|
| 194 | + | let aC = ah() |
---|
| 195 | + | if (((aC + au) >= 0)) |
---|
| 196 | + | then [IntegerEntry(c, (aC + au))] |
---|
| 197 | + | else throw(((("Vault: can not update v-locked balance. Balance: " + toString(aC)) + " change: ") + toString(au))) |
---|
| 198 | + | } |
---|
164 | 199 | | |
---|
165 | 200 | | |
---|
166 | | - | @Callable(aw) |
---|
167 | | - | func initialize (ax) = if (ac()) |
---|
| 201 | + | func aE (au) = [IntegerEntry(a, (W() + au))] |
---|
| 202 | + | |
---|
| 203 | + | |
---|
| 204 | + | func aF (aw) = [IntegerEntry(f, aw)] |
---|
| 205 | + | |
---|
| 206 | + | |
---|
| 207 | + | func aG (at,aH,aI) = [IntegerEntry(t(j, at), aH), IntegerEntry(t(k, at), aI)] |
---|
| 208 | + | |
---|
| 209 | + | |
---|
| 210 | + | @Callable(aJ) |
---|
| 211 | + | func initialize (aK) = if (ai()) |
---|
168 | 212 | | then throw("Already initialized") |
---|
169 | | - | else [StringEntry(k, ax), BooleanEntry(j, true)] |
---|
| 213 | + | else [StringEntry(m, aK), BooleanEntry(l, true)] |
---|
170 | 214 | | |
---|
171 | 215 | | |
---|
172 | 216 | | |
---|
173 | | - | @Callable(aw) |
---|
| 217 | + | @Callable(aJ) |
---|
174 | 218 | | func stake () = { |
---|
175 | | - | let V = toString(aw.caller) |
---|
176 | | - | let E = F(aw.payments[0].amount) |
---|
177 | | - | if (if ((aw.payments[0].assetId != x())) |
---|
| 219 | + | let Z = toString(aJ.caller) |
---|
| 220 | + | let I = J(aJ.payments[0].amount) |
---|
| 221 | + | if (if ((aJ.payments[0].assetId != A())) |
---|
178 | 222 | | then true |
---|
179 | | - | else !(ac())) |
---|
| 223 | + | else !(ai())) |
---|
180 | 224 | | then throw("Invalid call to stake") |
---|
181 | 225 | | else { |
---|
182 | | - | let ay = T() |
---|
183 | | - | let az = W(V) |
---|
184 | | - | let aA = G(E, ay) |
---|
185 | | - | let aB = G((J(aA, ay) + J(U(V), az)), (ay + az)) |
---|
186 | | - | let aC = (aA + U(V)) |
---|
187 | | - | let aD = J(aC, N) |
---|
188 | | - | let aE = invoke(y(), "deposit", nil, [AttachedPayment(x(), D(E))]) |
---|
189 | | - | if ((aE == aE)) |
---|
190 | | - | then ((((ap(E) ++ aj(V, aA)) ++ ao(V, aB)) ++ am(V, aD)) ++ ar(aA)) |
---|
| 226 | + | let aL = X() |
---|
| 227 | + | let aM = aa(Z) |
---|
| 228 | + | let aN = K(I, aL) |
---|
| 229 | + | let aO = K((N(aN, aL) + N(Y(Z), aM)), (aL + aM)) |
---|
| 230 | + | let aP = (aN + Y(Z)) |
---|
| 231 | + | let aQ = N(aP, R) |
---|
| 232 | + | let aR = invoke(B(), "deposit", nil, [AttachedPayment(A(), H(I))]) |
---|
| 233 | + | if ((aR == aR)) |
---|
| 234 | + | then ((((ay(I) ++ as(Z, aN)) ++ ax(Z, aO)) ++ av(Z, aQ)) ++ aE(aN)) |
---|
191 | 235 | | else throw("Strict value is not equal to itself.") |
---|
192 | 236 | | } |
---|
193 | 237 | | } |
---|
194 | 238 | | |
---|
195 | 239 | | |
---|
196 | 240 | | |
---|
197 | | - | @Callable(aw) |
---|
198 | | - | func unStake (E) = { |
---|
199 | | - | let V = toString(aw.caller) |
---|
200 | | - | let aF = F(E) |
---|
201 | | - | if (if ((aw.payments != nil)) |
---|
| 241 | + | @Callable(aJ) |
---|
| 242 | + | func unStake (I) = { |
---|
| 243 | + | let Z = toString(aJ.caller) |
---|
| 244 | + | let aS = J(I) |
---|
| 245 | + | if (if ((aJ.payments != nil)) |
---|
202 | 246 | | then true |
---|
203 | | - | else !(ac())) |
---|
| 247 | + | else !(ai())) |
---|
204 | 248 | | then throw("Invalid call to unStake") |
---|
205 | 249 | | else { |
---|
206 | | - | let aG = ad(V) |
---|
207 | | - | let ah = aG._1 |
---|
208 | | - | let ai = aG._2 |
---|
209 | | - | let aA = G(aF, T()) |
---|
210 | | - | if ((aA > ai)) |
---|
| 250 | + | let aT = aj(Z) |
---|
| 251 | + | let an = aT._1 |
---|
| 252 | + | let ao = aT._2 |
---|
| 253 | + | let aN = K(aS, X()) |
---|
| 254 | + | if ((aN > ao)) |
---|
211 | 255 | | then throw("Invalid call to unStake: withdraw over limit") |
---|
212 | 256 | | else { |
---|
213 | | - | let aH = (Y(V) + aA) |
---|
214 | | - | if ((aF > aa())) |
---|
| 257 | + | let aU = (ac(Z) + aN) |
---|
| 258 | + | if ((aS > ae())) |
---|
215 | 259 | | then throw("Invalid call to unStake: balance too low") |
---|
216 | 260 | | else { |
---|
217 | | - | let aI = invoke(y(), "withdraw", [toBase58String(x()), D(aF)], nil) |
---|
218 | | - | if ((aI == aI)) |
---|
219 | | - | then ((((ap(-(aF)) ++ aj(V, -(aA))) ++ ar(-(aA))) ++ at(V, ah, aH)) ++ [ScriptTransfer(aw.caller, D(aF), x())]) |
---|
| 261 | + | let aV = invoke(B(), "withdraw", [toBase58String(A()), H(aS)], nil) |
---|
| 262 | + | if ((aV == aV)) |
---|
| 263 | + | then ((((ay(-(aS)) ++ as(Z, -(aN))) ++ aE(-(aN))) ++ aG(Z, an, aU)) ++ [ScriptTransfer(aJ.caller, H(aS), A())]) |
---|
220 | 264 | | else throw("Strict value is not equal to itself.") |
---|
221 | 265 | | } |
---|
222 | 266 | | } |
---|
|
225 | 269 | | |
---|
226 | 270 | | |
---|
227 | 271 | | |
---|
228 | | - | @Callable(aw) |
---|
| 272 | + | @Callable(aJ) |
---|
229 | 273 | | func addFree () = { |
---|
230 | | - | let E = F(aw.payments[0].amount) |
---|
231 | | - | if (if (if ((aw.payments[0].assetId != x())) |
---|
| 274 | + | let I = J(aJ.payments[0].amount) |
---|
| 275 | + | if (if (if ((aJ.payments[0].assetId != A())) |
---|
232 | 276 | | then true |
---|
233 | | - | else !(ac())) |
---|
| 277 | + | else !(ai())) |
---|
234 | 278 | | then true |
---|
235 | | - | else !(if (u(toString(aw.caller))) |
---|
| 279 | + | else !(if (x(toString(aJ.caller))) |
---|
236 | 280 | | then true |
---|
237 | | - | else (aw.caller == w()))) |
---|
| 281 | + | else (aJ.caller == z()))) |
---|
238 | 282 | | then throw("Invalid addFree params") |
---|
239 | 283 | | else { |
---|
240 | | - | let aJ = if ((S() > 0)) |
---|
241 | | - | then G((aa() + E), S()) |
---|
242 | | - | else z |
---|
243 | | - | let aI = invoke(y(), "deposit", nil, [AttachedPayment(x(), D(E))]) |
---|
244 | | - | if ((aI == aI)) |
---|
245 | | - | then (ap(E) ++ as(aJ)) |
---|
| 284 | + | let ar = if ((W() > 0)) |
---|
| 285 | + | then K((ae() + I), W()) |
---|
| 286 | + | else D |
---|
| 287 | + | let aV = invoke(B(), "deposit", nil, [AttachedPayment(A(), H(I))]) |
---|
| 288 | + | if ((aV == aV)) |
---|
| 289 | + | then (ay(I) ++ aF(ar)) |
---|
246 | 290 | | else throw("Strict value is not equal to itself.") |
---|
247 | 291 | | } |
---|
248 | 292 | | } |
---|
249 | 293 | | |
---|
250 | 294 | | |
---|
251 | 295 | | |
---|
252 | | - | @Callable(aw) |
---|
253 | | - | func addLocked () = { |
---|
254 | | - | let E = F(aw.payments[0].amount) |
---|
255 | | - | if (if (if ((aw.payments[0].assetId != x())) |
---|
| 296 | + | @Callable(aJ) |
---|
| 297 | + | func addLocked (aW) = { |
---|
| 298 | + | let I = J(aJ.payments[0].amount) |
---|
| 299 | + | if (if (if ((aJ.payments[0].assetId != A())) |
---|
256 | 300 | | then true |
---|
257 | | - | else !(ac())) |
---|
| 301 | + | else !(ai())) |
---|
258 | 302 | | then true |
---|
259 | | - | else !(if (u(toString(aw.caller))) |
---|
| 303 | + | else !(if (if (x(toString(aJ.caller))) |
---|
260 | 304 | | then true |
---|
261 | | - | else (aw.caller == w()))) |
---|
| 305 | + | else (aJ.caller == C())) |
---|
| 306 | + | then true |
---|
| 307 | + | else (aJ.caller == z()))) |
---|
262 | 308 | | then throw("Invalid addLocked params") |
---|
263 | 309 | | else { |
---|
264 | | - | let aI = invoke(y(), "deposit", nil, [AttachedPayment(x(), D(E))]) |
---|
265 | | - | if ((aI == aI)) |
---|
266 | | - | then aq(E) |
---|
| 310 | + | let aV = invoke(B(), "deposit", nil, [AttachedPayment(A(), H(I))]) |
---|
| 311 | + | if ((aV == aV)) |
---|
| 312 | + | then { |
---|
| 313 | + | let aX = af() |
---|
| 314 | + | ((if (if (aW) |
---|
| 315 | + | then (aX > 0) |
---|
| 316 | + | else false) |
---|
| 317 | + | then az(-(P(aX, I))) |
---|
| 318 | + | else nil) ++ aB(I)) |
---|
| 319 | + | } |
---|
267 | 320 | | else throw("Strict value is not equal to itself.") |
---|
268 | 321 | | } |
---|
269 | 322 | | } |
---|
270 | 323 | | |
---|
271 | 324 | | |
---|
272 | 325 | | |
---|
273 | | - | @Callable(aw) |
---|
274 | | - | func exchangeFreeAndLocked (E) = if (if (!(ac())) |
---|
| 326 | + | @Callable(aJ) |
---|
| 327 | + | func addLockedV (aY) = { |
---|
| 328 | + | let I = J(aY) |
---|
| 329 | + | if (if (!(ai())) |
---|
| 330 | + | then true |
---|
| 331 | + | else !(if ((aJ.caller == C())) |
---|
| 332 | + | then true |
---|
| 333 | + | else (aJ.caller == z()))) |
---|
| 334 | + | then throw("Invalid addLockedV params") |
---|
| 335 | + | else (aB(I) ++ aD(I)) |
---|
| 336 | + | } |
---|
| 337 | + | |
---|
| 338 | + | |
---|
| 339 | + | |
---|
| 340 | + | @Callable(aJ) |
---|
| 341 | + | func exchangeFreeAndLocked (I) = if (if (!(ai())) |
---|
275 | 342 | | then true |
---|
276 | | - | else !(if (u(toString(aw.caller))) |
---|
| 343 | + | else !(if (x(toString(aJ.caller))) |
---|
277 | 344 | | then true |
---|
278 | | - | else (aw.caller == w()))) |
---|
| 345 | + | else (aJ.caller == z()))) |
---|
279 | 346 | | then throw("Invalid exchangeFreeAndLocked params") |
---|
280 | 347 | | else { |
---|
281 | | - | let aF = F(E) |
---|
282 | | - | let aJ = if ((S() > 0)) |
---|
283 | | - | then G((aa() - aF), S()) |
---|
284 | | - | else z |
---|
285 | | - | ((aq(aF) ++ ap(-(aF))) ++ as(aJ)) |
---|
| 348 | + | let aS = J(I) |
---|
| 349 | + | let aA = af() |
---|
| 350 | + | let aZ = if (if ((aS > 0)) |
---|
| 351 | + | then (aA > 0) |
---|
| 352 | + | else false) |
---|
| 353 | + | then $Tuple2(-(aS), -(P(aS, aA))) |
---|
| 354 | + | else $Tuple2(-(aS), 0) |
---|
| 355 | + | let ba = aZ._1 |
---|
| 356 | + | let bb = aZ._2 |
---|
| 357 | + | let ar = ap(ba) |
---|
| 358 | + | (((aB(aS) ++ ay(ba)) ++ az(bb)) ++ aF(ar)) |
---|
286 | 359 | | } |
---|
287 | 360 | | |
---|
288 | 361 | | |
---|
289 | 362 | | |
---|
290 | | - | @Callable(aw) |
---|
291 | | - | func withdrawLocked (E) = if (if (if (!(ac())) |
---|
| 363 | + | @Callable(aJ) |
---|
| 364 | + | func withdrawLocked (I) = if (if (if (!(ai())) |
---|
292 | 365 | | then true |
---|
293 | | - | else (0 >= E)) |
---|
| 366 | + | else (0 >= I)) |
---|
294 | 367 | | then true |
---|
295 | | - | else !(u(toString(aw.caller)))) |
---|
| 368 | + | else !(x(toString(aJ.caller)))) |
---|
296 | 369 | | then throw("Invalid withdrawLocked params") |
---|
297 | 370 | | else { |
---|
298 | | - | let aF = F(E) |
---|
299 | | - | let aI = invoke(y(), "withdraw", [toBase58String(x()), D(aF)], nil) |
---|
300 | | - | if ((aI == aI)) |
---|
301 | | - | then (aq(-(aF)) ++ [ScriptTransfer(aw.caller, D(aF), x())]) |
---|
| 371 | + | let aS = J(I) |
---|
| 372 | + | let aV = invoke(B(), "withdraw", [toBase58String(A()), H(aS)], nil) |
---|
| 373 | + | if ((aV == aV)) |
---|
| 374 | + | then { |
---|
| 375 | + | let bc = ag() |
---|
| 376 | + | let bd = if ((aS > bc)) |
---|
| 377 | + | then $Tuple2(bc, (aS - bc)) |
---|
| 378 | + | else $Tuple2(aS, 0) |
---|
| 379 | + | let be = bd._1 |
---|
| 380 | + | let bf = bd._2 |
---|
| 381 | + | let bg = ah() |
---|
| 382 | + | let bh = (bc - bg) |
---|
| 383 | + | let bi = if ((be > bh)) |
---|
| 384 | + | then $Tuple2(bh, (be - bh)) |
---|
| 385 | + | else $Tuple2(be, 0) |
---|
| 386 | + | let bj = bi._1 |
---|
| 387 | + | let bk = bi._2 |
---|
| 388 | + | ((((if ((bk > 0)) |
---|
| 389 | + | then az(bk) |
---|
| 390 | + | else nil) ++ (if ((bf > 0)) |
---|
| 391 | + | then { |
---|
| 392 | + | let ar = ap(-(bf)) |
---|
| 393 | + | (ay(-(bf)) ++ aF(ar)) |
---|
| 394 | + | } |
---|
| 395 | + | else nil)) ++ aB(-(be))) ++ [ScriptTransfer(aJ.caller, H(aS), A())]) |
---|
| 396 | + | } |
---|
302 | 397 | | else throw("Strict value is not equal to itself.") |
---|
303 | 398 | | } |
---|
304 | 399 | | |
---|
305 | 400 | | |
---|
306 | 401 | | |
---|
307 | | - | @Callable(aw) |
---|
308 | | - | func view_reward (V) = { |
---|
309 | | - | let aK = U(V) |
---|
310 | | - | let aL = J(W(V), aK) |
---|
311 | | - | let aM = J(T(), aK) |
---|
312 | | - | let aN = (aM - aL) |
---|
313 | | - | throw(toString(aN)) |
---|
| 402 | + | @Callable(aJ) |
---|
| 403 | + | func withdrawLockedV (aY) = if (if (if (!(ai())) |
---|
| 404 | + | then true |
---|
| 405 | + | else (0 >= aY)) |
---|
| 406 | + | then true |
---|
| 407 | + | else !((aJ.caller == C()))) |
---|
| 408 | + | then throw("Invalid withdrawLockedV params") |
---|
| 409 | + | else { |
---|
| 410 | + | let aS = J(aY) |
---|
| 411 | + | let bc = ag() |
---|
| 412 | + | let bl = if ((aS > bc)) |
---|
| 413 | + | then $Tuple2(bc, (aS - bc)) |
---|
| 414 | + | else $Tuple2(aS, 0) |
---|
| 415 | + | let be = bl._1 |
---|
| 416 | + | let bf = bl._2 |
---|
| 417 | + | (((if ((bf > 0)) |
---|
| 418 | + | then { |
---|
| 419 | + | let ar = ap(-(bf)) |
---|
| 420 | + | (ay(-(bf)) ++ aF(ar)) |
---|
| 421 | + | } |
---|
| 422 | + | else nil) ++ aB(-(be))) ++ aD(-(aS))) |
---|
| 423 | + | } |
---|
| 424 | + | |
---|
| 425 | + | |
---|
| 426 | + | |
---|
| 427 | + | @Callable(aJ) |
---|
| 428 | + | func view_reward (Z) = { |
---|
| 429 | + | let aC = Y(Z) |
---|
| 430 | + | let bm = N(aa(Z), aC) |
---|
| 431 | + | let bn = N(X(), aC) |
---|
| 432 | + | let bo = (bn - bm) |
---|
| 433 | + | throw(toString(bo)) |
---|
314 | 434 | | } |
---|
315 | 435 | | |
---|
316 | 436 | | |
---|
317 | 437 | | |
---|
318 | | - | @Callable(aw) |
---|
319 | | - | func view_withdrawLimit (V) = { |
---|
320 | | - | let ai = ad(V)._2 |
---|
321 | | - | let aO = D(J(ai, T())) |
---|
322 | | - | throw(toString(aO)) |
---|
| 438 | + | @Callable(aJ) |
---|
| 439 | + | func view_withdrawLimit (Z) = { |
---|
| 440 | + | let ao = aj(Z)._2 |
---|
| 441 | + | let bp = H(N(ao, X())) |
---|
| 442 | + | throw(toString(bp)) |
---|
323 | 443 | | } |
---|
324 | 444 | | |
---|
325 | 445 | | |
---|
326 | | - | @Verifier(aP) |
---|
327 | | - | func aQ () = sigVerify(aP.bodyBytes, aP.proofs[0], v()) |
---|
| 446 | + | @Verifier(bq) |
---|
| 447 | + | func br () = sigVerify(bq.bodyBytes, bq.proofs[0], y()) |
---|
328 | 448 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "k_totalSupply" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "k_lockedBalance" |
---|
7 | 7 | | |
---|
8 | | - | let c = "k_freeBalance" |
---|
| 8 | + | let c = "k_vLockedBalance" |
---|
9 | 9 | | |
---|
10 | | - | let d = "k_rate" |
---|
| 10 | + | let d = "k_freeBalance" |
---|
11 | 11 | | |
---|
12 | | - | let e = "k_balance" |
---|
| 12 | + | let e = "k_freeBalanceBorrowed" |
---|
13 | 13 | | |
---|
14 | | - | let f = "k_average_rate" |
---|
| 14 | + | let f = "k_rate" |
---|
15 | 15 | | |
---|
16 | | - | let g = "k_withdraw_limit" |
---|
| 16 | + | let g = "k_balance" |
---|
17 | 17 | | |
---|
18 | | - | let h = "k_last_withdraw_date" |
---|
| 18 | + | let h = "k_average_rate" |
---|
19 | 19 | | |
---|
20 | | - | let i = "k_withdraw_in_period" |
---|
| 20 | + | let i = "k_withdraw_limit" |
---|
21 | 21 | | |
---|
22 | | - | let j = "k_initialized" |
---|
| 22 | + | let j = "k_last_withdraw_date" |
---|
23 | 23 | | |
---|
24 | | - | let k = "k_coordinatorAddress" |
---|
| 24 | + | let k = "k_withdraw_in_period" |
---|
25 | 25 | | |
---|
26 | | - | let l = "k_amm" |
---|
| 26 | + | let l = "k_initialized" |
---|
27 | 27 | | |
---|
28 | | - | let m = "k_quote_asset" |
---|
| 28 | + | let m = "k_coordinatorAddress" |
---|
29 | 29 | | |
---|
30 | | - | let n = "k_admin_public_key" |
---|
| 30 | + | let n = "k_amm" |
---|
31 | 31 | | |
---|
32 | | - | let o = "k_admin_address" |
---|
| 32 | + | let o = "k_quote_asset" |
---|
33 | 33 | | |
---|
34 | | - | let p = "k_manager_address" |
---|
| 34 | + | let p = "k_admin_public_key" |
---|
35 | 35 | | |
---|
36 | | - | func q (r,s) = ((r + "_") + s) |
---|
| 36 | + | let q = "k_admin_address" |
---|
| 37 | + | |
---|
| 38 | + | let r = "k_manager_address" |
---|
| 39 | + | |
---|
| 40 | + | let s = "k_collateral_address" |
---|
| 41 | + | |
---|
| 42 | + | func t (u,v) = ((u + "_") + v) |
---|
37 | 43 | | |
---|
38 | 44 | | |
---|
39 | | - | func t () = valueOrErrorMessage(addressFromString(getStringValue(this, k)), "Coordinator not set") |
---|
| 45 | + | func w () = valueOrErrorMessage(addressFromString(getStringValue(this, m)), "Coordinator not set") |
---|
40 | 46 | | |
---|
41 | 47 | | |
---|
42 | | - | func u (s) = valueOrElse(getBoolean(t(), q(l, s)), false) |
---|
| 48 | + | func x (v) = valueOrElse(getBoolean(w(), t(n, v)), false) |
---|
43 | 49 | | |
---|
44 | 50 | | |
---|
45 | | - | func v () = fromBase58String(getStringValue(t(), n)) |
---|
| 51 | + | func y () = fromBase58String(getStringValue(w(), p)) |
---|
46 | 52 | | |
---|
47 | 53 | | |
---|
48 | | - | func w () = addressFromString(valueOrErrorMessage(getString(t(), o), "Admin address not set")) |
---|
| 54 | + | func z () = addressFromString(valueOrErrorMessage(getString(w(), q), "Admin address not set")) |
---|
49 | 55 | | |
---|
50 | 56 | | |
---|
51 | | - | func x () = fromBase58String(getStringValue(t(), m)) |
---|
| 57 | + | func A () = fromBase58String(getStringValue(w(), o)) |
---|
52 | 58 | | |
---|
53 | 59 | | |
---|
54 | | - | func y () = valueOrErrorMessage(addressFromString(getStringValue(t(), p)), "Manager not set") |
---|
| 60 | + | func B () = valueOrErrorMessage(addressFromString(getStringValue(w(), r)), "Manager not set") |
---|
55 | 61 | | |
---|
56 | 62 | | |
---|
57 | | - | let z = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
58 | | - | |
---|
59 | | - | let A = ((60 * 60) * 24) |
---|
60 | | - | |
---|
61 | | - | let B = "" |
---|
62 | | - | |
---|
63 | | - | let C = 0 |
---|
64 | | - | |
---|
65 | | - | func D (E) = (E / 100) |
---|
| 63 | + | func C () = valueOrErrorMessage(addressFromString(getStringValue(w(), s)), "Collateral Manager not set") |
---|
66 | 64 | | |
---|
67 | 65 | | |
---|
68 | | - | func F (E) = (E * 100) |
---|
| 66 | + | let D = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10)) |
---|
| 67 | + | |
---|
| 68 | + | let E = ((60 * 60) * 24) |
---|
| 69 | + | |
---|
| 70 | + | let F = "" |
---|
| 71 | + | |
---|
| 72 | + | let G = 0 |
---|
| 73 | + | |
---|
| 74 | + | func H (I) = (I / 100) |
---|
69 | 75 | | |
---|
70 | 76 | | |
---|
71 | | - | func G (H,I) = fraction(H, z, I, HALFEVEN) |
---|
| 77 | + | func J (I) = (I * 100) |
---|
72 | 78 | | |
---|
73 | 79 | | |
---|
74 | | - | func J (H,I) = fraction(H, I, z, HALFEVEN) |
---|
| 80 | + | func K (L,M) = fraction(L, D, M, HALFEVEN) |
---|
75 | 81 | | |
---|
76 | 82 | | |
---|
77 | | - | func K (H) = if ((H > 0)) |
---|
78 | | - | then H |
---|
79 | | - | else -(H) |
---|
| 83 | + | func N (L,M) = fraction(L, M, D, HALFEVEN) |
---|
80 | 84 | | |
---|
81 | 85 | | |
---|
82 | | - | func L (H,I) = if ((H > I)) |
---|
83 | | - | then I |
---|
84 | | - | else H |
---|
| 86 | + | func O (L) = if ((L > 0)) |
---|
| 87 | + | then L |
---|
| 88 | + | else -(L) |
---|
85 | 89 | | |
---|
86 | 90 | | |
---|
87 | | - | let M = (86400 * 1000) |
---|
88 | | - | |
---|
89 | | - | let N = G((1 * z), (4 * z)) |
---|
90 | | - | |
---|
91 | | - | func O (P) = valueOrErrorMessage(getInteger(this, P), ("no value for " + P)) |
---|
| 91 | + | func P (L,M) = if ((L > M)) |
---|
| 92 | + | then M |
---|
| 93 | + | else L |
---|
92 | 94 | | |
---|
93 | 95 | | |
---|
94 | | - | func Q (P) = valueOrElse(getInteger(this, P), 0) |
---|
| 96 | + | let Q = (86400 * 1000) |
---|
| 97 | + | |
---|
| 98 | + | let R = K((1 * D), (4 * D)) |
---|
| 99 | + | |
---|
| 100 | + | func S (T) = valueOrErrorMessage(getInteger(this, T), ("no value for " + T)) |
---|
95 | 101 | | |
---|
96 | 102 | | |
---|
97 | | - | func R (P) = valueOrElse(getInteger(this, P), z) |
---|
| 103 | + | func U (T) = valueOrElse(getInteger(this, T), 0) |
---|
98 | 104 | | |
---|
99 | 105 | | |
---|
100 | | - | func S () = Q(a) |
---|
| 106 | + | func V (T) = valueOrElse(getInteger(this, T), D) |
---|
101 | 107 | | |
---|
102 | 108 | | |
---|
103 | | - | func T () = R(d) |
---|
| 109 | + | func W () = U(a) |
---|
104 | 110 | | |
---|
105 | 111 | | |
---|
106 | | - | func U (V) = Q(q(e, V)) |
---|
| 112 | + | func X () = V(f) |
---|
107 | 113 | | |
---|
108 | 114 | | |
---|
109 | | - | func W (V) = Q(q(f, V)) |
---|
| 115 | + | func Y (Z) = U(t(g, Z)) |
---|
110 | 116 | | |
---|
111 | 117 | | |
---|
112 | | - | func X (V) = Q(q(g, V)) |
---|
| 118 | + | func aa (Z) = U(t(h, Z)) |
---|
113 | 119 | | |
---|
114 | 120 | | |
---|
115 | | - | func Y (V) = Q(q(i, V)) |
---|
| 121 | + | func ab (Z) = U(t(i, Z)) |
---|
116 | 122 | | |
---|
117 | 123 | | |
---|
118 | | - | func Z (V) = Q(q(h, V)) |
---|
| 124 | + | func ac (Z) = U(t(k, Z)) |
---|
119 | 125 | | |
---|
120 | 126 | | |
---|
121 | | - | func aa () = Q(c) |
---|
| 127 | + | func ad (Z) = U(t(j, Z)) |
---|
122 | 128 | | |
---|
123 | 129 | | |
---|
124 | | - | func ab () = Q(b) |
---|
| 130 | + | func ae () = U(d) |
---|
125 | 131 | | |
---|
126 | 132 | | |
---|
127 | | - | func ac () = valueOrElse(getBoolean(this, j), false) |
---|
| 133 | + | func af () = U(e) |
---|
128 | 134 | | |
---|
129 | 135 | | |
---|
130 | | - | func ad (V) = { |
---|
131 | | - | let ae = lastBlock.timestamp |
---|
132 | | - | let af = Z(V) |
---|
133 | | - | let ag = if (((ae - af) > M)) |
---|
134 | | - | then $Tuple2(ae, X(V)) |
---|
135 | | - | else $Tuple2(af, (X(V) - Y(V))) |
---|
136 | | - | let ah = ag._1 |
---|
137 | | - | let ai = ag._2 |
---|
138 | | - | $Tuple2(ah, ai) |
---|
| 136 | + | func ag () = U(b) |
---|
| 137 | + | |
---|
| 138 | + | |
---|
| 139 | + | func ah () = U(c) |
---|
| 140 | + | |
---|
| 141 | + | |
---|
| 142 | + | func ai () = valueOrElse(getBoolean(this, l), false) |
---|
| 143 | + | |
---|
| 144 | + | |
---|
| 145 | + | func aj (Z) = { |
---|
| 146 | + | let ak = lastBlock.timestamp |
---|
| 147 | + | let al = ad(Z) |
---|
| 148 | + | let am = if (((ak - al) > Q)) |
---|
| 149 | + | then $Tuple2(ak, ab(Z)) |
---|
| 150 | + | else $Tuple2(al, (ab(Z) - ac(Z))) |
---|
| 151 | + | let an = am._1 |
---|
| 152 | + | let ao = am._2 |
---|
| 153 | + | $Tuple2(an, ao) |
---|
139 | 154 | | } |
---|
140 | 155 | | |
---|
141 | 156 | | |
---|
142 | | - | func aj (ak,al) = [IntegerEntry(q(e, ak), (U(ak) + al))] |
---|
| 157 | + | func ap (aq) = { |
---|
| 158 | + | let ar = if ((W() > 0)) |
---|
| 159 | + | then K((ae() + aq), W()) |
---|
| 160 | + | else D |
---|
| 161 | + | ar |
---|
| 162 | + | } |
---|
143 | 163 | | |
---|
144 | 164 | | |
---|
145 | | - | func am (ak,an) = [IntegerEntry(q(g, ak), an)] |
---|
| 165 | + | func as (at,au) = [IntegerEntry(t(g, at), (Y(at) + au))] |
---|
146 | 166 | | |
---|
147 | 167 | | |
---|
148 | | - | func ao (ak,an) = [IntegerEntry(q(f, ak), an)] |
---|
| 168 | + | func av (at,aw) = [IntegerEntry(t(i, at), aw)] |
---|
149 | 169 | | |
---|
150 | 170 | | |
---|
151 | | - | func ap (al) = [IntegerEntry(c, (aa() + al))] |
---|
| 171 | + | func ax (at,aw) = [IntegerEntry(t(h, at), aw)] |
---|
152 | 172 | | |
---|
153 | 173 | | |
---|
154 | | - | func aq (al) = [IntegerEntry(b, (ab() + al))] |
---|
| 174 | + | func ay (au) = [IntegerEntry(d, (ae() + au))] |
---|
155 | 175 | | |
---|
156 | 176 | | |
---|
157 | | - | func ar (al) = [IntegerEntry(a, (S() + al))] |
---|
| 177 | + | func az (au) = { |
---|
| 178 | + | let aA = af() |
---|
| 179 | + | if (((aA + au) >= 0)) |
---|
| 180 | + | then [IntegerEntry(e, (aA + au))] |
---|
| 181 | + | else throw(((("Vault: can not update borrowed free balance. Balance: " + toString(aA)) + " change: ") + toString(au))) |
---|
| 182 | + | } |
---|
158 | 183 | | |
---|
159 | 184 | | |
---|
160 | | - | func as (an) = [IntegerEntry(d, an)] |
---|
| 185 | + | func aB (au) = { |
---|
| 186 | + | let aC = ag() |
---|
| 187 | + | if (((aC + au) >= 0)) |
---|
| 188 | + | then [IntegerEntry(b, (aC + au))] |
---|
| 189 | + | else throw(((("Vault: can not update locked balance. Balance: " + toString(aC)) + " change: ") + toString(au))) |
---|
| 190 | + | } |
---|
161 | 191 | | |
---|
162 | 192 | | |
---|
163 | | - | func at (ak,au,av) = [IntegerEntry(q(h, ak), au), IntegerEntry(q(i, ak), av)] |
---|
| 193 | + | func aD (au) = { |
---|
| 194 | + | let aC = ah() |
---|
| 195 | + | if (((aC + au) >= 0)) |
---|
| 196 | + | then [IntegerEntry(c, (aC + au))] |
---|
| 197 | + | else throw(((("Vault: can not update v-locked balance. Balance: " + toString(aC)) + " change: ") + toString(au))) |
---|
| 198 | + | } |
---|
164 | 199 | | |
---|
165 | 200 | | |
---|
166 | | - | @Callable(aw) |
---|
167 | | - | func initialize (ax) = if (ac()) |
---|
| 201 | + | func aE (au) = [IntegerEntry(a, (W() + au))] |
---|
| 202 | + | |
---|
| 203 | + | |
---|
| 204 | + | func aF (aw) = [IntegerEntry(f, aw)] |
---|
| 205 | + | |
---|
| 206 | + | |
---|
| 207 | + | func aG (at,aH,aI) = [IntegerEntry(t(j, at), aH), IntegerEntry(t(k, at), aI)] |
---|
| 208 | + | |
---|
| 209 | + | |
---|
| 210 | + | @Callable(aJ) |
---|
| 211 | + | func initialize (aK) = if (ai()) |
---|
168 | 212 | | then throw("Already initialized") |
---|
169 | | - | else [StringEntry(k, ax), BooleanEntry(j, true)] |
---|
| 213 | + | else [StringEntry(m, aK), BooleanEntry(l, true)] |
---|
170 | 214 | | |
---|
171 | 215 | | |
---|
172 | 216 | | |
---|
173 | | - | @Callable(aw) |
---|
| 217 | + | @Callable(aJ) |
---|
174 | 218 | | func stake () = { |
---|
175 | | - | let V = toString(aw.caller) |
---|
176 | | - | let E = F(aw.payments[0].amount) |
---|
177 | | - | if (if ((aw.payments[0].assetId != x())) |
---|
| 219 | + | let Z = toString(aJ.caller) |
---|
| 220 | + | let I = J(aJ.payments[0].amount) |
---|
| 221 | + | if (if ((aJ.payments[0].assetId != A())) |
---|
178 | 222 | | then true |
---|
179 | | - | else !(ac())) |
---|
| 223 | + | else !(ai())) |
---|
180 | 224 | | then throw("Invalid call to stake") |
---|
181 | 225 | | else { |
---|
182 | | - | let ay = T() |
---|
183 | | - | let az = W(V) |
---|
184 | | - | let aA = G(E, ay) |
---|
185 | | - | let aB = G((J(aA, ay) + J(U(V), az)), (ay + az)) |
---|
186 | | - | let aC = (aA + U(V)) |
---|
187 | | - | let aD = J(aC, N) |
---|
188 | | - | let aE = invoke(y(), "deposit", nil, [AttachedPayment(x(), D(E))]) |
---|
189 | | - | if ((aE == aE)) |
---|
190 | | - | then ((((ap(E) ++ aj(V, aA)) ++ ao(V, aB)) ++ am(V, aD)) ++ ar(aA)) |
---|
| 226 | + | let aL = X() |
---|
| 227 | + | let aM = aa(Z) |
---|
| 228 | + | let aN = K(I, aL) |
---|
| 229 | + | let aO = K((N(aN, aL) + N(Y(Z), aM)), (aL + aM)) |
---|
| 230 | + | let aP = (aN + Y(Z)) |
---|
| 231 | + | let aQ = N(aP, R) |
---|
| 232 | + | let aR = invoke(B(), "deposit", nil, [AttachedPayment(A(), H(I))]) |
---|
| 233 | + | if ((aR == aR)) |
---|
| 234 | + | then ((((ay(I) ++ as(Z, aN)) ++ ax(Z, aO)) ++ av(Z, aQ)) ++ aE(aN)) |
---|
191 | 235 | | else throw("Strict value is not equal to itself.") |
---|
192 | 236 | | } |
---|
193 | 237 | | } |
---|
194 | 238 | | |
---|
195 | 239 | | |
---|
196 | 240 | | |
---|
197 | | - | @Callable(aw) |
---|
198 | | - | func unStake (E) = { |
---|
199 | | - | let V = toString(aw.caller) |
---|
200 | | - | let aF = F(E) |
---|
201 | | - | if (if ((aw.payments != nil)) |
---|
| 241 | + | @Callable(aJ) |
---|
| 242 | + | func unStake (I) = { |
---|
| 243 | + | let Z = toString(aJ.caller) |
---|
| 244 | + | let aS = J(I) |
---|
| 245 | + | if (if ((aJ.payments != nil)) |
---|
202 | 246 | | then true |
---|
203 | | - | else !(ac())) |
---|
| 247 | + | else !(ai())) |
---|
204 | 248 | | then throw("Invalid call to unStake") |
---|
205 | 249 | | else { |
---|
206 | | - | let aG = ad(V) |
---|
207 | | - | let ah = aG._1 |
---|
208 | | - | let ai = aG._2 |
---|
209 | | - | let aA = G(aF, T()) |
---|
210 | | - | if ((aA > ai)) |
---|
| 250 | + | let aT = aj(Z) |
---|
| 251 | + | let an = aT._1 |
---|
| 252 | + | let ao = aT._2 |
---|
| 253 | + | let aN = K(aS, X()) |
---|
| 254 | + | if ((aN > ao)) |
---|
211 | 255 | | then throw("Invalid call to unStake: withdraw over limit") |
---|
212 | 256 | | else { |
---|
213 | | - | let aH = (Y(V) + aA) |
---|
214 | | - | if ((aF > aa())) |
---|
| 257 | + | let aU = (ac(Z) + aN) |
---|
| 258 | + | if ((aS > ae())) |
---|
215 | 259 | | then throw("Invalid call to unStake: balance too low") |
---|
216 | 260 | | else { |
---|
217 | | - | let aI = invoke(y(), "withdraw", [toBase58String(x()), D(aF)], nil) |
---|
218 | | - | if ((aI == aI)) |
---|
219 | | - | then ((((ap(-(aF)) ++ aj(V, -(aA))) ++ ar(-(aA))) ++ at(V, ah, aH)) ++ [ScriptTransfer(aw.caller, D(aF), x())]) |
---|
| 261 | + | let aV = invoke(B(), "withdraw", [toBase58String(A()), H(aS)], nil) |
---|
| 262 | + | if ((aV == aV)) |
---|
| 263 | + | then ((((ay(-(aS)) ++ as(Z, -(aN))) ++ aE(-(aN))) ++ aG(Z, an, aU)) ++ [ScriptTransfer(aJ.caller, H(aS), A())]) |
---|
220 | 264 | | else throw("Strict value is not equal to itself.") |
---|
221 | 265 | | } |
---|
222 | 266 | | } |
---|
223 | 267 | | } |
---|
224 | 268 | | } |
---|
225 | 269 | | |
---|
226 | 270 | | |
---|
227 | 271 | | |
---|
228 | | - | @Callable(aw) |
---|
| 272 | + | @Callable(aJ) |
---|
229 | 273 | | func addFree () = { |
---|
230 | | - | let E = F(aw.payments[0].amount) |
---|
231 | | - | if (if (if ((aw.payments[0].assetId != x())) |
---|
| 274 | + | let I = J(aJ.payments[0].amount) |
---|
| 275 | + | if (if (if ((aJ.payments[0].assetId != A())) |
---|
232 | 276 | | then true |
---|
233 | | - | else !(ac())) |
---|
| 277 | + | else !(ai())) |
---|
234 | 278 | | then true |
---|
235 | | - | else !(if (u(toString(aw.caller))) |
---|
| 279 | + | else !(if (x(toString(aJ.caller))) |
---|
236 | 280 | | then true |
---|
237 | | - | else (aw.caller == w()))) |
---|
| 281 | + | else (aJ.caller == z()))) |
---|
238 | 282 | | then throw("Invalid addFree params") |
---|
239 | 283 | | else { |
---|
240 | | - | let aJ = if ((S() > 0)) |
---|
241 | | - | then G((aa() + E), S()) |
---|
242 | | - | else z |
---|
243 | | - | let aI = invoke(y(), "deposit", nil, [AttachedPayment(x(), D(E))]) |
---|
244 | | - | if ((aI == aI)) |
---|
245 | | - | then (ap(E) ++ as(aJ)) |
---|
| 284 | + | let ar = if ((W() > 0)) |
---|
| 285 | + | then K((ae() + I), W()) |
---|
| 286 | + | else D |
---|
| 287 | + | let aV = invoke(B(), "deposit", nil, [AttachedPayment(A(), H(I))]) |
---|
| 288 | + | if ((aV == aV)) |
---|
| 289 | + | then (ay(I) ++ aF(ar)) |
---|
246 | 290 | | else throw("Strict value is not equal to itself.") |
---|
247 | 291 | | } |
---|
248 | 292 | | } |
---|
249 | 293 | | |
---|
250 | 294 | | |
---|
251 | 295 | | |
---|
252 | | - | @Callable(aw) |
---|
253 | | - | func addLocked () = { |
---|
254 | | - | let E = F(aw.payments[0].amount) |
---|
255 | | - | if (if (if ((aw.payments[0].assetId != x())) |
---|
| 296 | + | @Callable(aJ) |
---|
| 297 | + | func addLocked (aW) = { |
---|
| 298 | + | let I = J(aJ.payments[0].amount) |
---|
| 299 | + | if (if (if ((aJ.payments[0].assetId != A())) |
---|
256 | 300 | | then true |
---|
257 | | - | else !(ac())) |
---|
| 301 | + | else !(ai())) |
---|
258 | 302 | | then true |
---|
259 | | - | else !(if (u(toString(aw.caller))) |
---|
| 303 | + | else !(if (if (x(toString(aJ.caller))) |
---|
260 | 304 | | then true |
---|
261 | | - | else (aw.caller == w()))) |
---|
| 305 | + | else (aJ.caller == C())) |
---|
| 306 | + | then true |
---|
| 307 | + | else (aJ.caller == z()))) |
---|
262 | 308 | | then throw("Invalid addLocked params") |
---|
263 | 309 | | else { |
---|
264 | | - | let aI = invoke(y(), "deposit", nil, [AttachedPayment(x(), D(E))]) |
---|
265 | | - | if ((aI == aI)) |
---|
266 | | - | then aq(E) |
---|
| 310 | + | let aV = invoke(B(), "deposit", nil, [AttachedPayment(A(), H(I))]) |
---|
| 311 | + | if ((aV == aV)) |
---|
| 312 | + | then { |
---|
| 313 | + | let aX = af() |
---|
| 314 | + | ((if (if (aW) |
---|
| 315 | + | then (aX > 0) |
---|
| 316 | + | else false) |
---|
| 317 | + | then az(-(P(aX, I))) |
---|
| 318 | + | else nil) ++ aB(I)) |
---|
| 319 | + | } |
---|
267 | 320 | | else throw("Strict value is not equal to itself.") |
---|
268 | 321 | | } |
---|
269 | 322 | | } |
---|
270 | 323 | | |
---|
271 | 324 | | |
---|
272 | 325 | | |
---|
273 | | - | @Callable(aw) |
---|
274 | | - | func exchangeFreeAndLocked (E) = if (if (!(ac())) |
---|
| 326 | + | @Callable(aJ) |
---|
| 327 | + | func addLockedV (aY) = { |
---|
| 328 | + | let I = J(aY) |
---|
| 329 | + | if (if (!(ai())) |
---|
| 330 | + | then true |
---|
| 331 | + | else !(if ((aJ.caller == C())) |
---|
| 332 | + | then true |
---|
| 333 | + | else (aJ.caller == z()))) |
---|
| 334 | + | then throw("Invalid addLockedV params") |
---|
| 335 | + | else (aB(I) ++ aD(I)) |
---|
| 336 | + | } |
---|
| 337 | + | |
---|
| 338 | + | |
---|
| 339 | + | |
---|
| 340 | + | @Callable(aJ) |
---|
| 341 | + | func exchangeFreeAndLocked (I) = if (if (!(ai())) |
---|
275 | 342 | | then true |
---|
276 | | - | else !(if (u(toString(aw.caller))) |
---|
| 343 | + | else !(if (x(toString(aJ.caller))) |
---|
277 | 344 | | then true |
---|
278 | | - | else (aw.caller == w()))) |
---|
| 345 | + | else (aJ.caller == z()))) |
---|
279 | 346 | | then throw("Invalid exchangeFreeAndLocked params") |
---|
280 | 347 | | else { |
---|
281 | | - | let aF = F(E) |
---|
282 | | - | let aJ = if ((S() > 0)) |
---|
283 | | - | then G((aa() - aF), S()) |
---|
284 | | - | else z |
---|
285 | | - | ((aq(aF) ++ ap(-(aF))) ++ as(aJ)) |
---|
| 348 | + | let aS = J(I) |
---|
| 349 | + | let aA = af() |
---|
| 350 | + | let aZ = if (if ((aS > 0)) |
---|
| 351 | + | then (aA > 0) |
---|
| 352 | + | else false) |
---|
| 353 | + | then $Tuple2(-(aS), -(P(aS, aA))) |
---|
| 354 | + | else $Tuple2(-(aS), 0) |
---|
| 355 | + | let ba = aZ._1 |
---|
| 356 | + | let bb = aZ._2 |
---|
| 357 | + | let ar = ap(ba) |
---|
| 358 | + | (((aB(aS) ++ ay(ba)) ++ az(bb)) ++ aF(ar)) |
---|
286 | 359 | | } |
---|
287 | 360 | | |
---|
288 | 361 | | |
---|
289 | 362 | | |
---|
290 | | - | @Callable(aw) |
---|
291 | | - | func withdrawLocked (E) = if (if (if (!(ac())) |
---|
| 363 | + | @Callable(aJ) |
---|
| 364 | + | func withdrawLocked (I) = if (if (if (!(ai())) |
---|
292 | 365 | | then true |
---|
293 | | - | else (0 >= E)) |
---|
| 366 | + | else (0 >= I)) |
---|
294 | 367 | | then true |
---|
295 | | - | else !(u(toString(aw.caller)))) |
---|
| 368 | + | else !(x(toString(aJ.caller)))) |
---|
296 | 369 | | then throw("Invalid withdrawLocked params") |
---|
297 | 370 | | else { |
---|
298 | | - | let aF = F(E) |
---|
299 | | - | let aI = invoke(y(), "withdraw", [toBase58String(x()), D(aF)], nil) |
---|
300 | | - | if ((aI == aI)) |
---|
301 | | - | then (aq(-(aF)) ++ [ScriptTransfer(aw.caller, D(aF), x())]) |
---|
| 371 | + | let aS = J(I) |
---|
| 372 | + | let aV = invoke(B(), "withdraw", [toBase58String(A()), H(aS)], nil) |
---|
| 373 | + | if ((aV == aV)) |
---|
| 374 | + | then { |
---|
| 375 | + | let bc = ag() |
---|
| 376 | + | let bd = if ((aS > bc)) |
---|
| 377 | + | then $Tuple2(bc, (aS - bc)) |
---|
| 378 | + | else $Tuple2(aS, 0) |
---|
| 379 | + | let be = bd._1 |
---|
| 380 | + | let bf = bd._2 |
---|
| 381 | + | let bg = ah() |
---|
| 382 | + | let bh = (bc - bg) |
---|
| 383 | + | let bi = if ((be > bh)) |
---|
| 384 | + | then $Tuple2(bh, (be - bh)) |
---|
| 385 | + | else $Tuple2(be, 0) |
---|
| 386 | + | let bj = bi._1 |
---|
| 387 | + | let bk = bi._2 |
---|
| 388 | + | ((((if ((bk > 0)) |
---|
| 389 | + | then az(bk) |
---|
| 390 | + | else nil) ++ (if ((bf > 0)) |
---|
| 391 | + | then { |
---|
| 392 | + | let ar = ap(-(bf)) |
---|
| 393 | + | (ay(-(bf)) ++ aF(ar)) |
---|
| 394 | + | } |
---|
| 395 | + | else nil)) ++ aB(-(be))) ++ [ScriptTransfer(aJ.caller, H(aS), A())]) |
---|
| 396 | + | } |
---|
302 | 397 | | else throw("Strict value is not equal to itself.") |
---|
303 | 398 | | } |
---|
304 | 399 | | |
---|
305 | 400 | | |
---|
306 | 401 | | |
---|
307 | | - | @Callable(aw) |
---|
308 | | - | func view_reward (V) = { |
---|
309 | | - | let aK = U(V) |
---|
310 | | - | let aL = J(W(V), aK) |
---|
311 | | - | let aM = J(T(), aK) |
---|
312 | | - | let aN = (aM - aL) |
---|
313 | | - | throw(toString(aN)) |
---|
| 402 | + | @Callable(aJ) |
---|
| 403 | + | func withdrawLockedV (aY) = if (if (if (!(ai())) |
---|
| 404 | + | then true |
---|
| 405 | + | else (0 >= aY)) |
---|
| 406 | + | then true |
---|
| 407 | + | else !((aJ.caller == C()))) |
---|
| 408 | + | then throw("Invalid withdrawLockedV params") |
---|
| 409 | + | else { |
---|
| 410 | + | let aS = J(aY) |
---|
| 411 | + | let bc = ag() |
---|
| 412 | + | let bl = if ((aS > bc)) |
---|
| 413 | + | then $Tuple2(bc, (aS - bc)) |
---|
| 414 | + | else $Tuple2(aS, 0) |
---|
| 415 | + | let be = bl._1 |
---|
| 416 | + | let bf = bl._2 |
---|
| 417 | + | (((if ((bf > 0)) |
---|
| 418 | + | then { |
---|
| 419 | + | let ar = ap(-(bf)) |
---|
| 420 | + | (ay(-(bf)) ++ aF(ar)) |
---|
| 421 | + | } |
---|
| 422 | + | else nil) ++ aB(-(be))) ++ aD(-(aS))) |
---|
| 423 | + | } |
---|
| 424 | + | |
---|
| 425 | + | |
---|
| 426 | + | |
---|
| 427 | + | @Callable(aJ) |
---|
| 428 | + | func view_reward (Z) = { |
---|
| 429 | + | let aC = Y(Z) |
---|
| 430 | + | let bm = N(aa(Z), aC) |
---|
| 431 | + | let bn = N(X(), aC) |
---|
| 432 | + | let bo = (bn - bm) |
---|
| 433 | + | throw(toString(bo)) |
---|
314 | 434 | | } |
---|
315 | 435 | | |
---|
316 | 436 | | |
---|
317 | 437 | | |
---|
318 | | - | @Callable(aw) |
---|
319 | | - | func view_withdrawLimit (V) = { |
---|
320 | | - | let ai = ad(V)._2 |
---|
321 | | - | let aO = D(J(ai, T())) |
---|
322 | | - | throw(toString(aO)) |
---|
| 438 | + | @Callable(aJ) |
---|
| 439 | + | func view_withdrawLimit (Z) = { |
---|
| 440 | + | let ao = aj(Z)._2 |
---|
| 441 | + | let bp = H(N(ao, X())) |
---|
| 442 | + | throw(toString(bp)) |
---|
323 | 443 | | } |
---|
324 | 444 | | |
---|
325 | 445 | | |
---|
326 | | - | @Verifier(aP) |
---|
327 | | - | func aQ () = sigVerify(aP.bodyBytes, aP.proofs[0], v()) |
---|
| 446 | + | @Verifier(bq) |
---|
| 447 | + | func br () = sigVerify(bq.bodyBytes, bq.proofs[0], y()) |
---|
328 | 448 | | |
---|