tx · ALtUDyXosYHwARe1G5sRnpKYLVNDfYnUXRkQW9Ky5wH6 3MwLW8P5yh5T2xML9QqFuVxkVkm9RXqnzXh: -0.00800000 Waves 2022.11.30 20:59 [2340169] smart account 3MwLW8P5yh5T2xML9QqFuVxkVkm9RXqnzXh > SELF 0.00000000 Waves
{ "type": 13, "id": "ALtUDyXosYHwARe1G5sRnpKYLVNDfYnUXRkQW9Ky5wH6", "fee": 800000, "feeAssetId": null, "timestamp": 1669831201779, "version": 2, "chainId": 84, "sender": "3MwLW8P5yh5T2xML9QqFuVxkVkm9RXqnzXh", "senderPublicKey": "HscGVyJG5M3NMHWKfQbucCBsFLGPi8VmTxTAmcBbaWTa", "proofs": [ "5YnD4PU9JcKb4KJXbnBY6Ror1hxSLmkvkfqrXdipvjcWLgELAgDhqWcXKJTamu5XoQKpU3MPQpa9rA8dFWQZnvXa" ], "script": "base64:BgIOCAISAwoBCBIDCgEIEgASAAZTY2FsZTYAwIQ9AAZTY2FsZTgAgMLXLwAHU2NhbGUxNgkAaAIFBlNjYWxlOAUGU2NhbGU4AAp2YWxpZGF0b3JzCQDMCAICIzNOQW1xR2p4UkJSUG9SSFpVVXF2aGlOUzZheG5HcGluTEhDBQNuaWwAB2Fzc2V0SWQCLEhIbWFGUXBVb2J3S3h6ano0RUNhQlB0b0Y2OWt1akt3VTJjb3phVXpUc2d2AAtwdXp6bGVQb29scwkAzAgCAiMzTjZTdEpkZ21UZkFSc1JObjlYdDVyRFlFczNwcjRLR3kxdgUDbmlsAQpnZXRCYWxhbmNlAQdhc3NldElkBAckbWF0Y2gwBQdhc3NldElkAwkAAQIFByRtYXRjaDACBFVuaXQEAXgFByRtYXRjaDAICQDvBwEFBHRoaXMJYXZhaWxhYmxlCQDwBwIFBHRoaXMJAQV2YWx1ZQEFB2Fzc2V0SWQBCXRyeUdldEludAIHYWRkcmVzcwNrZXkEByRtYXRjaDAJAJoIAgUHYWRkcmVzcwUDa2V5AwkAAQIFByRtYXRjaDACA0ludAQ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Bvb2wBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5dzrfdw==", "height": 2340169, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G3MuSEZ7UCSPQw5t9jCEnG9uKotau9x64PZjbQtw6Po Next: 9R6erxBzUKkVB27ngEBAaafaT1pWM9JJMBou7jjts4fs Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | - | func p (q) = if ((q == "")) | |
61 | - | then 0 | |
62 | - | else { | |
63 | - | let r = assetBalance(Address(fromBase58String(q)), fromBase58String(e)) | |
64 | - | r | |
65 | - | } | |
60 | + | func p (q) = { | |
61 | + | let r = assetBalance(Address(fromBase58String(q)), fromBase58String(e)) | |
62 | + | r | |
63 | + | } | |
66 | 64 | ||
67 | 65 | ||
68 | 66 | func s () = { | |
120 | 118 | } | |
121 | 119 | ||
122 | 120 | ||
123 | - | func K (L,v) = { | |
124 | - | let M = fraction(v, b, y()) | |
125 | - | (F(M) ++ [IntegerEntry((L + "_staked"), (j(this, (L + "_staked")) + M))]) | |
121 | + | func K () = { | |
122 | + | let t = n(this, "currentPool") | |
123 | + | if ((t == "")) | |
124 | + | then throw(("Cannot find pool with id " + t)) | |
125 | + | else { | |
126 | + | let v = p(t) | |
127 | + | let L = u(t, v) | |
128 | + | if ((L == L)) | |
129 | + | then L | |
130 | + | else throw("Strict value is not equal to itself.") | |
131 | + | } | |
126 | 132 | } | |
127 | 133 | ||
128 | 134 | ||
129 | - | @Callable(N) | |
135 | + | func M (N,v) = { | |
136 | + | let O = fraction(v, b, y()) | |
137 | + | (F(O) ++ [IntegerEntry((N + "_staked"), (j(this, (N + "_staked")) + O))]) | |
138 | + | } | |
139 | + | ||
140 | + | ||
141 | + | @Callable(P) | |
142 | + | func init (q) = { | |
143 | + | let t = n(this, "currentPool") | |
144 | + | if ((indexOf(d, toString(P.caller)) == unit)) | |
145 | + | then throw("Access denied") | |
146 | + | else if ((t == "")) | |
147 | + | then [StringEntry("currentPool", q)] | |
148 | + | else nil | |
149 | + | } | |
150 | + | ||
151 | + | ||
152 | + | ||
153 | + | @Callable(P) | |
130 | 154 | func rebalance (q) = { | |
131 | 155 | let t = n(this, "currentPool") | |
132 | - | if ((indexOf(d, toString( | |
156 | + | if ((indexOf(d, toString(P.caller)) == unit)) | |
133 | 157 | then throw("Access denied") | |
134 | 158 | else if ((t == q)) | |
135 | 159 | then throw(("Already supplied to" + t)) | |
136 | 160 | else { | |
137 | - | let v = p(t) | |
138 | - | let O = if ((v > 0)) | |
139 | - | then u(t, v) | |
140 | - | else "" | |
141 | - | if ((O == O)) | |
161 | + | let x = K() | |
162 | + | if ((x == x)) | |
142 | 163 | then (H(q) ++ F(0)) | |
143 | 164 | else throw("Strict value is not equal to itself.") | |
144 | 165 | } | |
146 | 167 | ||
147 | 168 | ||
148 | 169 | ||
149 | - | @Callable( | |
170 | + | @Callable(P) | |
150 | 171 | func stake () = { | |
151 | - | let | |
152 | - | let v = | |
172 | + | let N = toString(P.caller) | |
173 | + | let v = P.payments[0].amount | |
153 | 174 | let t = n(this, "currentPool") | |
154 | 175 | if (if ((0 >= v)) | |
155 | 176 | then true | |
156 | - | else ( | |
177 | + | else (P.payments[0].assetId != fromBase58String(e))) | |
157 | 178 | then throw("invalid token attached") | |
158 | 179 | else if ((t == "")) | |
159 | 180 | then throw("Pool not initialized") | |
160 | - | else ( | |
181 | + | else (M(N, v) ++ H(t)) | |
161 | 182 | } | |
162 | 183 | ||
163 | 184 | ||
164 | - | @Verifier( | |
165 | - | func | |
185 | + | @Verifier(L) | |
186 | + | func Q () = sigVerify(L.bodyBytes, L.proofs[0], L.senderPublicKey) | |
166 | 187 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 1000000 | |
5 | 5 | ||
6 | 6 | let b = 100000000 | |
7 | 7 | ||
8 | 8 | let c = (b * b) | |
9 | 9 | ||
10 | 10 | let d = ["3NAmqGjxRBRPoRHZUUqvhiNS6axnGpinLHC"] | |
11 | 11 | ||
12 | 12 | let e = "HHmaFQpUobwKxzjz4ECaBPtoF69kujKwU2cozaUzTsgv" | |
13 | 13 | ||
14 | 14 | let f = ["3N6StJdgmTfARsRNn9Xt5rDYEs3pr4KGy1v"] | |
15 | 15 | ||
16 | 16 | func g (e) = { | |
17 | 17 | let h = e | |
18 | 18 | if ($isInstanceOf(h, "Unit")) | |
19 | 19 | then { | |
20 | 20 | let i = h | |
21 | 21 | wavesBalance(this).available | |
22 | 22 | } | |
23 | 23 | else assetBalance(this, value(e)) | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func j (k,l) = { | |
28 | 28 | let h = getInteger(k, l) | |
29 | 29 | if ($isInstanceOf(h, "Int")) | |
30 | 30 | then { | |
31 | 31 | let m = h | |
32 | 32 | m | |
33 | 33 | } | |
34 | 34 | else 0 | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func n (k,l) = { | |
39 | 39 | let h = getString(k, l) | |
40 | 40 | if ($isInstanceOf(h, "String")) | |
41 | 41 | then { | |
42 | 42 | let m = h | |
43 | 43 | m | |
44 | 44 | } | |
45 | 45 | else "" | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func o (e) = { | |
50 | 50 | let h = e | |
51 | 51 | if ($isInstanceOf(h, "ByteVector")) | |
52 | 52 | then { | |
53 | 53 | let m = h | |
54 | 54 | toBase58String(m) | |
55 | 55 | } | |
56 | 56 | else "WAVES" | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | - | func p (q) = if ((q == "")) | |
61 | - | then 0 | |
62 | - | else { | |
63 | - | let r = assetBalance(Address(fromBase58String(q)), fromBase58String(e)) | |
64 | - | r | |
65 | - | } | |
60 | + | func p (q) = { | |
61 | + | let r = assetBalance(Address(fromBase58String(q)), fromBase58String(e)) | |
62 | + | r | |
63 | + | } | |
66 | 64 | ||
67 | 65 | ||
68 | 66 | func s () = { | |
69 | 67 | let t = n(this, "currentPool") | |
70 | 68 | if ((t == "")) | |
71 | 69 | then throw(("Cannot find pool with id " + t)) | |
72 | 70 | else p(t) | |
73 | 71 | } | |
74 | 72 | ||
75 | 73 | ||
76 | 74 | func u (q,v) = { | |
77 | 75 | let w = Address(fromBase58String(q)) | |
78 | 76 | let x = if ((v > 0)) | |
79 | 77 | then invoke(w, "withdraw", [e, v], nil) | |
80 | 78 | else "" | |
81 | 79 | if ((x == x)) | |
82 | 80 | then x | |
83 | 81 | else throw("Strict value is not equal to itself.") | |
84 | 82 | } | |
85 | 83 | ||
86 | 84 | ||
87 | 85 | func y () = { | |
88 | 86 | let z = j(this, "global_lastCheckSRate") | |
89 | 87 | let A = j(this, "global_staked") | |
90 | 88 | let B = j(this, "global_lastCheckSRateHeight") | |
91 | 89 | let C = (height - B) | |
92 | 90 | let D = (s() - fraction(A, z, b)) | |
93 | 91 | if ((A == 0)) | |
94 | 92 | then b | |
95 | 93 | else { | |
96 | 94 | let E = (z + fraction((C * b), D, A)) | |
97 | 95 | if ((b > E)) | |
98 | 96 | then b | |
99 | 97 | else E | |
100 | 98 | } | |
101 | 99 | } | |
102 | 100 | ||
103 | 101 | ||
104 | 102 | func F (G) = { | |
105 | 103 | let A = j(this, "global_staked") | |
106 | 104 | let E = y() | |
107 | 105 | [IntegerEntry("global_staked", (A + G)), IntegerEntry("global_lastCheckSRate", E), IntegerEntry("global_lastCheckSRateHeight", height)] | |
108 | 106 | } | |
109 | 107 | ||
110 | 108 | ||
111 | 109 | func H (q) = if ((indexOf(f, q) == unit)) | |
112 | 110 | then throw(("Unknown poolId " + q)) | |
113 | 111 | else { | |
114 | 112 | let I = fromBase58String(e) | |
115 | 113 | let r = g(I) | |
116 | 114 | let J = invoke(Address(fromBase58String(q)), "supply", nil, [AttachedPayment(I, r)]) | |
117 | 115 | if ((J == J)) | |
118 | 116 | then [StringEntry("currentPool", q)] | |
119 | 117 | else throw("Strict value is not equal to itself.") | |
120 | 118 | } | |
121 | 119 | ||
122 | 120 | ||
123 | - | func K (L,v) = { | |
124 | - | let M = fraction(v, b, y()) | |
125 | - | (F(M) ++ [IntegerEntry((L + "_staked"), (j(this, (L + "_staked")) + M))]) | |
121 | + | func K () = { | |
122 | + | let t = n(this, "currentPool") | |
123 | + | if ((t == "")) | |
124 | + | then throw(("Cannot find pool with id " + t)) | |
125 | + | else { | |
126 | + | let v = p(t) | |
127 | + | let L = u(t, v) | |
128 | + | if ((L == L)) | |
129 | + | then L | |
130 | + | else throw("Strict value is not equal to itself.") | |
131 | + | } | |
126 | 132 | } | |
127 | 133 | ||
128 | 134 | ||
129 | - | @Callable(N) | |
135 | + | func M (N,v) = { | |
136 | + | let O = fraction(v, b, y()) | |
137 | + | (F(O) ++ [IntegerEntry((N + "_staked"), (j(this, (N + "_staked")) + O))]) | |
138 | + | } | |
139 | + | ||
140 | + | ||
141 | + | @Callable(P) | |
142 | + | func init (q) = { | |
143 | + | let t = n(this, "currentPool") | |
144 | + | if ((indexOf(d, toString(P.caller)) == unit)) | |
145 | + | then throw("Access denied") | |
146 | + | else if ((t == "")) | |
147 | + | then [StringEntry("currentPool", q)] | |
148 | + | else nil | |
149 | + | } | |
150 | + | ||
151 | + | ||
152 | + | ||
153 | + | @Callable(P) | |
130 | 154 | func rebalance (q) = { | |
131 | 155 | let t = n(this, "currentPool") | |
132 | - | if ((indexOf(d, toString( | |
156 | + | if ((indexOf(d, toString(P.caller)) == unit)) | |
133 | 157 | then throw("Access denied") | |
134 | 158 | else if ((t == q)) | |
135 | 159 | then throw(("Already supplied to" + t)) | |
136 | 160 | else { | |
137 | - | let v = p(t) | |
138 | - | let O = if ((v > 0)) | |
139 | - | then u(t, v) | |
140 | - | else "" | |
141 | - | if ((O == O)) | |
161 | + | let x = K() | |
162 | + | if ((x == x)) | |
142 | 163 | then (H(q) ++ F(0)) | |
143 | 164 | else throw("Strict value is not equal to itself.") | |
144 | 165 | } | |
145 | 166 | } | |
146 | 167 | ||
147 | 168 | ||
148 | 169 | ||
149 | - | @Callable( | |
170 | + | @Callable(P) | |
150 | 171 | func stake () = { | |
151 | - | let | |
152 | - | let v = | |
172 | + | let N = toString(P.caller) | |
173 | + | let v = P.payments[0].amount | |
153 | 174 | let t = n(this, "currentPool") | |
154 | 175 | if (if ((0 >= v)) | |
155 | 176 | then true | |
156 | - | else ( | |
177 | + | else (P.payments[0].assetId != fromBase58String(e))) | |
157 | 178 | then throw("invalid token attached") | |
158 | 179 | else if ((t == "")) | |
159 | 180 | then throw("Pool not initialized") | |
160 | - | else ( | |
181 | + | else (M(N, v) ++ H(t)) | |
161 | 182 | } | |
162 | 183 | ||
163 | 184 | ||
164 | - | @Verifier( | |
165 | - | func | |
185 | + | @Verifier(L) | |
186 | + | func Q () = sigVerify(L.bodyBytes, L.proofs[0], L.senderPublicKey) | |
166 | 187 |
github/deemru/w8io/169f3d6 44.32 ms ◑