tx · 9o6RQBmnKktY7PVY2spYEQLrsLeLGRdjUASy1UbziKmJ 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh: -0.00900000 Waves 2024.09.12 19:18 [3280652] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves
{ "type": 13, "id": "9o6RQBmnKktY7PVY2spYEQLrsLeLGRdjUASy1UbziKmJ", "fee": 900000, "feeAssetId": null, "timestamp": 1726157973369, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "2GM33hTtBJrveVWD2Grn6zzMuAiHR1zwdyKPqqvXAnsTGKHs4nLS31NFKqpjmo33yf7VBhU5W3ZUbNuobaxGTVsf" ], "script": "base64:BgIgCAISBAoCCAgSBAoCCAESAwoBBBIDCgEBEgASABIAEgAlAANTRVACAl9fAAVNVUxUOACAwtcvABRXTEcyQUNSRVNfTVVMVElQTElFUgDIAQAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAFmRlZmF1bHRSZXN0MkFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQRndZdGE4YmlFejMxenBlRmU1REpLOHdFNXRyU3BRVkY4AwkAAAIBAVQFByRtYXRjaDACIzNON1V1WWFyNjI2NFA1OEZCaFZXS1BRQWg0WXVhMmhnbmd2CQACAQINVW5rbm93biBjaGFpbgAVb2xkU3Rha2luZ0NvbnRyYWN0U3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUExuY1h0UzFVODNENmNRYkZEM0g4ckJIUExnenhTRktaMQMJAAACAQFUBQckbWF0Y2gwAiMzTkRDeUJHNXE4NUp1YVJpaWdVZUV0YWlueWpDUVQzWHBabQkAAgECDVVua25vd24gY2hhaW4BD2dldFN0cmluZ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29udmVydE9sZFN0YWtlc1JFQURPTkxZAAkAlAoCBQNuaWwAAABIaQNU", "height": 3280652, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 62zA3erjkHtszfmhDVFqw3m4MmgxT4B1gYLGR9nZd6w5 Next: EAb2VRaotmCe9EYZtDqibgkXBDWcTfkg1YMvoKaNfTo1 Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | - | let b = | |
6 | + | let b = 100000000 | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = 200 | |
9 | 9 | ||
10 | - | let d = { | |
11 | - | let e = c | |
12 | - | if ((base58'2W' == e)) | |
13 | - | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
14 | - | else if ((base58'2T' == e)) | |
15 | - | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
10 | + | let d = take(drop(this.bytes, 1), 1) | |
11 | + | ||
12 | + | let e = { | |
13 | + | let f = d | |
14 | + | if ((base58'2W' == f)) | |
15 | + | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
16 | + | else if ((base58'2T' == f)) | |
17 | + | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
16 | 18 | else throw("Unknown chain") | |
17 | 19 | } | |
18 | 20 | ||
19 | - | let | |
20 | - | let | |
21 | - | if ((base58'2W' == | |
22 | - | then " | |
23 | - | else if ((base58'2T' == | |
24 | - | then " | |
21 | + | let g = { | |
22 | + | let f = d | |
23 | + | if ((base58'2W' == f)) | |
24 | + | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
25 | + | else if ((base58'2T' == f)) | |
26 | + | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
25 | 27 | else throw("Unknown chain") | |
26 | 28 | } | |
27 | 29 | ||
28 | - | func | |
30 | + | func h (i,j) = valueOrErrorMessage(getString(i, j), makeString(["mandatory ", toString(i), ".", j, " is not defined"], "")) | |
29 | 31 | ||
30 | 32 | ||
31 | - | let | |
33 | + | let k = 1 | |
32 | 34 | ||
33 | - | let | |
35 | + | let l = 2 | |
34 | 36 | ||
35 | - | func | |
37 | + | func m () = "%s__restConfig" | |
36 | 38 | ||
37 | 39 | ||
38 | - | func | |
40 | + | func n () = "%s__rest2Addr" | |
39 | 41 | ||
40 | 42 | ||
41 | - | func | |
43 | + | func o (p) = split_4C(h(p, m()), a) | |
42 | 44 | ||
43 | 45 | ||
44 | - | func | |
46 | + | func q (r,s) = valueOrErrorMessage(addressFromString(r[s]), ("Rest cfg doesn't contain address at index " + toString(s))) | |
45 | 47 | ||
46 | 48 | ||
47 | - | let | |
49 | + | let t = addressFromStringValue(valueOrElse(getString(this, n()), e)) | |
48 | 50 | ||
49 | - | let | |
51 | + | let r = o(t) | |
50 | 52 | ||
51 | - | let | |
53 | + | let u = q(r, k) | |
52 | 54 | ||
53 | - | let | |
55 | + | let v = q(r, l) | |
54 | 56 | ||
55 | - | func v () = "contractsBlocked" | |
57 | + | let w = "oldAcresContract" | |
58 | + | ||
59 | + | func x () = "contractsBlocked" | |
56 | 60 | ||
57 | 61 | ||
58 | - | func | |
62 | + | func y (z) = ("lastTxIdByUser_" + z) | |
59 | 63 | ||
60 | 64 | ||
61 | - | let | |
65 | + | let A = "wlg_assetId" | |
62 | 66 | ||
63 | - | let | |
67 | + | let B = valueOrErrorMessage(getBinary(v, A), "WLGOLD is not issued yet") | |
64 | 68 | ||
65 | - | let | |
69 | + | let C = "acresIssuedAmount" | |
66 | 70 | ||
67 | - | func B (x) = ("acresStakedTimeByUser_" + x) | |
71 | + | let D = "acresAssetId" | |
72 | + | ||
73 | + | let E = valueOrErrorMessage(getBinary(u, D), "ACRES is not issued yet") | |
74 | + | ||
75 | + | func F (z) = ("acresStakedTimeByUser_" + z) | |
68 | 76 | ||
69 | 77 | ||
70 | - | func C (D,E) = { | |
71 | - | let F = pow(10, 0, E, 0, 0, DOWN) | |
72 | - | let G = toString((D % F)) | |
73 | - | let H = drop(toString(F), (1 + size(G))) | |
74 | - | (((toString((D / F)) + ".") + H) + G) | |
78 | + | func G (H) = ("stakedLandsByOwner_" + H) | |
79 | + | ||
80 | + | ||
81 | + | func I (H) = ("stakedDuckByOwner_" + H) | |
82 | + | ||
83 | + | ||
84 | + | func J (K) = { | |
85 | + | let f = K | |
86 | + | if ($isInstanceOf(f, "Int")) | |
87 | + | then { | |
88 | + | let L = f | |
89 | + | L | |
90 | + | } | |
91 | + | else throw("fail to cast into Int") | |
75 | 92 | } | |
76 | 93 | ||
77 | 94 | ||
78 | - | func I (x) = ("acresStakedAmountByUser_" + x) | |
79 | - | ||
80 | - | ||
81 | - | func J (x) = ("acresLockedAmountByUser_" + x) | |
82 | - | ||
83 | - | ||
84 | - | func K (x) = ("acresLockedEtaByUser_" + x) | |
85 | - | ||
86 | - | ||
87 | - | let L = "acresStakedAmountTotal" | |
88 | - | ||
89 | - | func M (N) = if (if ((N.originCaller != s)) | |
90 | - | then valueOrElse(getBoolean(v()), false) | |
91 | - | else false) | |
92 | - | then throw("Contracts are under maintenance") | |
93 | - | else [StringEntry(w(toString(N.originCaller)), toBase58String(N.transactionId))] | |
94 | - | ||
95 | - | ||
96 | - | func O (x,P,Q) = { | |
97 | - | let R = (lastBlock.timestamp - Q) | |
98 | - | 42 | |
95 | + | func M (N) = { | |
96 | + | let f = N | |
97 | + | if ($isInstanceOf(f, "(Int, Int, Int, Int, Int)")) | |
98 | + | then { | |
99 | + | let O = f | |
100 | + | O | |
101 | + | } | |
102 | + | else throw("fail to cast into (Int, Int, Int, Int, Int)") | |
99 | 103 | } | |
100 | 104 | ||
101 | 105 | ||
102 | - | func S (x,P,Q) = { | |
103 | - | let R = (lastBlock.timestamp - Q) | |
104 | - | if ((0 > R)) | |
105 | - | then throw(((("Saved timestamp is in future, saved = " + toString(Q)) + ", current = ") + toString(lastBlock.timestamp))) | |
106 | - | else 42 | |
106 | + | func P (N) = { | |
107 | + | let f = N | |
108 | + | if ($isInstanceOf(f, "(Int, Int, Int)")) | |
109 | + | then { | |
110 | + | let O = f | |
111 | + | O | |
112 | + | } | |
113 | + | else throw("fail to cast into (Int, Int, Int)") | |
107 | 114 | } | |
108 | 115 | ||
109 | 116 | ||
110 | - | @Callable(N) | |
111 | - | func constructorV1 (T,U) = if ((N.caller != this)) | |
112 | - | then throw("Permission denied") | |
113 | - | else { | |
114 | - | let V = addressFromStringValue(U) | |
115 | - | [IntegerEntry(y, getIntegerValue(V, y)), BinaryEntry(z, getBinaryValue(V, z)), StringEntry(m(), T)] | |
116 | - | } | |
117 | - | ||
118 | - | ||
119 | - | ||
120 | - | @Callable(N) | |
121 | - | func saveInteger (i,W) = if ((N.caller != this)) | |
122 | - | then throw("saveInteger is not public method") | |
123 | - | else [IntegerEntry(i, W)] | |
124 | - | ||
125 | - | ||
126 | - | ||
127 | - | @Callable(N) | |
128 | - | func setBlocked (X) = if ((N.caller != this)) | |
129 | - | then throw("permission denied") | |
130 | - | else [BooleanEntry(v(), X)] | |
131 | - | ||
132 | - | ||
133 | - | ||
134 | - | @Callable(N) | |
135 | - | func unstakeAcres (W) = { | |
136 | - | let Y = M(N) | |
137 | - | if ((Y == Y)) | |
138 | - | then if ((0 >= W)) | |
139 | - | then throw("Amount should be positive") | |
140 | - | else { | |
141 | - | let h = toString(N.caller) | |
142 | - | if ((size(N.payments) != 0)) | |
143 | - | then throw("No payments required") | |
144 | - | else { | |
145 | - | let Z = B(h) | |
146 | - | let aa = I(h) | |
147 | - | let ab = valueOrElse(getInteger(aa), 0) | |
148 | - | if ((W > ab)) | |
149 | - | then throw(((("You have only " + C(ab, 8)) + " ACRES staked, tried to unstake ") + C(W, 8))) | |
150 | - | else { | |
151 | - | let ac = valueOrElse(getInteger(J(h)), 0) | |
152 | - | let ad = valueOrElse(getInteger(K(h)), 0) | |
153 | - | let ae = lastBlock.timestamp | |
154 | - | let af = (ab - ac) | |
155 | - | if (if ((ad > ae)) | |
156 | - | then (W > af) | |
157 | - | else false) | |
158 | - | then throw(((("Only " + C(af, 8)) + " ACRES can be unstaked now, wait until ") + toString(ad))) | |
159 | - | else { | |
160 | - | let ag = valueOrElse(getInteger(L), 0) | |
161 | - | let ah = invoke(u, "onStakeUnstakeLand", [h], nil) | |
162 | - | let ai = S(h, ab, valueOrElse(getInteger(Z), 0)) | |
163 | - | $Tuple2([IntegerEntry(Z, lastBlock.timestamp), IntegerEntry(aa, (ab - W)), IntegerEntry(L, (ag - W)), ScriptTransfer(N.caller, (W + ai), A)], $Tuple2(Y, ah)) | |
164 | - | } | |
165 | - | } | |
166 | - | } | |
167 | - | } | |
168 | - | else throw("Strict value is not equal to itself.") | |
117 | + | func Q (N) = { | |
118 | + | let f = N | |
119 | + | if ($isInstanceOf(f, "(Int, Int)")) | |
120 | + | then { | |
121 | + | let O = f | |
122 | + | O._1 | |
123 | + | } | |
124 | + | else throw("fail to cast into (Int, Int)") | |
169 | 125 | } | |
170 | 126 | ||
171 | 127 | ||
128 | + | func R (N,S) = { | |
129 | + | let T = pow(10, 0, S, 0, 0, DOWN) | |
130 | + | let U = toString((N % T)) | |
131 | + | let V = drop(toString(T), (1 + size(U))) | |
132 | + | (((toString((N / T)) + ".") + V) + U) | |
133 | + | } | |
172 | 134 | ||
173 | - | @Callable(N) | |
174 | - | func stakeAcres () = { | |
175 | - | let Y = M(N) | |
176 | - | if ((Y == Y)) | |
135 | + | ||
136 | + | func W (z) = ("acresStakedAmountByUser_" + z) | |
137 | + | ||
138 | + | ||
139 | + | let X = "acresStakedAmountTotal" | |
140 | + | ||
141 | + | func Y (Z) = if (if ((Z.originCaller != t)) | |
142 | + | then valueOrElse(getBoolean(x()), false) | |
143 | + | else false) | |
144 | + | then throw("Contracts are under maintenance") | |
145 | + | else [StringEntry(y(toString(Z.originCaller)), toBase58String(Z.transactionId))] | |
146 | + | ||
147 | + | ||
148 | + | func aa (ab,i) = { | |
149 | + | let ac = invoke(v, "onStakeUnstakeLand", [i], nil) | |
150 | + | if ((ac == ac)) | |
177 | 151 | then { | |
178 | - | let h = toString(N.caller) | |
179 | - | if ((size(N.payments) != 1)) | |
180 | - | then throw("exactly 1 payment must be attached") | |
181 | - | else { | |
182 | - | let aj = N.payments[0] | |
183 | - | let ak = aj.amount | |
184 | - | if (if (!(isDefined(aj.assetId))) | |
185 | - | then true | |
186 | - | else (value(aj.assetId) != A)) | |
187 | - | then throw("ACRES payments only!") | |
188 | - | else { | |
189 | - | let ah = invoke(u, "onStakeUnstakeLand", [h], nil) | |
190 | - | if ((ah == ah)) | |
191 | - | then { | |
192 | - | let ae = lastBlock.timestamp | |
193 | - | let Z = B(h) | |
194 | - | let aa = I(h) | |
195 | - | let ab = valueOrElse(getInteger(aa), 0) | |
196 | - | let ag = valueOrElse(getInteger(L), 0) | |
197 | - | let ai = S(h, ab, valueOrElse(getInteger(Z), 0)) | |
198 | - | $Tuple2(((((if ((ai == 0)) | |
199 | - | then nil | |
200 | - | else [ScriptTransfer(N.caller, ai, A)]) :+ IntegerEntry(Z, lastBlock.timestamp)) :+ IntegerEntry(aa, (ab + ak))) :+ IntegerEntry(L, (ag + ak))), $Tuple2(Y, ah)) | |
201 | - | } | |
202 | - | else throw("Strict value is not equal to itself.") | |
203 | - | } | |
204 | - | } | |
152 | + | let ad = lastBlock.timestamp | |
153 | + | let ae = F(i) | |
154 | + | let af = W(i) | |
155 | + | let ag = valueOrElse(getInteger(af), 0) | |
156 | + | let ah = valueOrElse(getInteger(X), 0) | |
157 | + | $Tuple2([IntegerEntry(ae, lastBlock.timestamp), IntegerEntry(af, (ag + ab)), IntegerEntry(X, (ah + ab))], ac) | |
205 | 158 | } | |
206 | 159 | else throw("Strict value is not equal to itself.") | |
207 | 160 | } | |
208 | 161 | ||
209 | 162 | ||
163 | + | @Callable(Z) | |
164 | + | func constructorV1 (ai,aj) = if ((Z.caller != this)) | |
165 | + | then throw("Permission denied") | |
166 | + | else { | |
167 | + | let ak = addressFromStringValue(aj) | |
168 | + | [IntegerEntry(C, getIntegerValue(ak, C)), BinaryEntry(D, getBinaryValue(ak, D)), StringEntry(n(), ai), StringEntry(w, aj)] | |
169 | + | } | |
210 | 170 | ||
211 | - | @Callable(N) | |
212 | - | func buyAcres () = { | |
213 | - | let Y = M(N) | |
214 | - | if ((Y == Y)) | |
215 | - | then { | |
216 | - | let h = toString(N.caller) | |
217 | - | if ((size(N.payments) != 1)) | |
218 | - | then throw("exactly 1 payment must be attached") | |
171 | + | ||
172 | + | ||
173 | + | @Callable(Z) | |
174 | + | func saveInteger (j,al) = if ((Z.caller != this)) | |
175 | + | then throw("saveInteger is not public method") | |
176 | + | else [IntegerEntry(j, al)] | |
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | @Callable(Z) | |
181 | + | func setBlocked (am) = if ((Z.caller != this)) | |
182 | + | then throw("permission denied") | |
183 | + | else [BooleanEntry(x(), am)] | |
184 | + | ||
185 | + | ||
186 | + | ||
187 | + | @Callable(Z) | |
188 | + | func unstakeAcres (al) = { | |
189 | + | let an = Y(Z) | |
190 | + | if ((0 >= al)) | |
191 | + | then throw("Amount should be positive") | |
192 | + | else { | |
193 | + | let i = toString(Z.caller) | |
194 | + | if ((size(Z.payments) != 0)) | |
195 | + | then throw("No payments required") | |
219 | 196 | else { | |
220 | - | let aj = N.payments[0] | |
221 | - | let ak = aj.amount | |
222 | - | if (if (!(isDefined(aj.assetId))) | |
223 | - | then true | |
224 | - | else (value(aj.assetId) != d)) | |
225 | - | then throw("USDT payments only!") | |
226 | - | else if ((b > ak)) | |
227 | - | then throw((("Min payment should be " + C(b, 6)) + " USDT")) | |
228 | - | else $Tuple2(nil, Y) | |
197 | + | let ae = F(i) | |
198 | + | let af = W(i) | |
199 | + | let ag = valueOrElse(getInteger(af), 0) | |
200 | + | if ((al > ag)) | |
201 | + | then throw(((("You have only " + R(ag, 8)) + " ACRES staked, tried to unstake ") + R(al, 8))) | |
202 | + | else { | |
203 | + | let ah = valueOrElse(getInteger(X), 0) | |
204 | + | let ac = invoke(v, "onStakeUnstakeLand", [i], nil) | |
205 | + | $Tuple2(([IntegerEntry(ae, lastBlock.timestamp), IntegerEntry(af, (ag - al)), IntegerEntry(X, (ah - al)), ScriptTransfer(Z.caller, al, E)] ++ an), ac) | |
206 | + | } | |
229 | 207 | } | |
230 | 208 | } | |
231 | - | else throw("Strict value is not equal to itself.") | |
232 | 209 | } | |
233 | 210 | ||
234 | 211 | ||
235 | 212 | ||
236 | - | @Callable(N) | |
237 | - | func claimAcres () = { | |
238 | - | let Y = M(N) | |
239 | - | if ((Y == Y)) | |
240 | - | then { | |
241 | - | let h = toString(N.caller) | |
242 | - | if ((size(N.payments) != 0)) | |
243 | - | then throw("No payments required") | |
213 | + | @Callable(Z) | |
214 | + | func stakeAcres () = { | |
215 | + | let an = Y(Z) | |
216 | + | let i = toString(Z.caller) | |
217 | + | if ((size(Z.payments) != 1)) | |
218 | + | then throw("exactly 1 payment must be attached") | |
219 | + | else { | |
220 | + | let ao = Z.payments[0] | |
221 | + | let ab = ao.amount | |
222 | + | if (if (!(isDefined(ao.assetId))) | |
223 | + | then true | |
224 | + | else (value(ao.assetId) != E)) | |
225 | + | then throw("ACRES payments only!") | |
244 | 226 | else { | |
245 | - | let Z = B(h) | |
246 | - | let aa = I(h) | |
247 | - | let P = valueOrElse(getInteger(aa), 0) | |
248 | - | let ah = invoke(u, "onStakeUnstakeLand", [h], nil) | |
249 | - | let ai = S(h, P, valueOrElse(getInteger(Z), 0)) | |
250 | - | $Tuple2([IntegerEntry(Z, lastBlock.timestamp), ScriptTransfer(N.caller, ai, A)], $Tuple2(Y, ah)) | |
227 | + | let ap = aa(ab, i) | |
228 | + | let aq = ap._1 | |
229 | + | let ar = ap._2 | |
230 | + | $Tuple2((aq ++ an), ar) | |
251 | 231 | } | |
252 | 232 | } | |
253 | - | else throw("Strict value is not equal to itself.") | |
254 | 233 | } | |
255 | 234 | ||
256 | 235 | ||
257 | 236 | ||
258 | - | @Callable(N) | |
259 | - | func claimAcresREADONLY (h) = { | |
260 | - | let Z = B(h) | |
261 | - | let aa = I(h) | |
262 | - | let P = valueOrElse(getInteger(aa), 0) | |
263 | - | let al = valueOrElse(getInteger(Z), 0) | |
264 | - | let ai = O(h, P, al) | |
265 | - | $Tuple2(nil, [ai, al]) | |
237 | + | @Callable(Z) | |
238 | + | func buyAcres () = { | |
239 | + | let an = Y(Z) | |
240 | + | let i = toString(Z.caller) | |
241 | + | if ((size(Z.payments) != 1)) | |
242 | + | then throw("exactly 1 payment must be attached") | |
243 | + | else { | |
244 | + | let ao = Z.payments[0] | |
245 | + | let ab = ao.amount | |
246 | + | if (if (!(isDefined(ao.assetId))) | |
247 | + | then true | |
248 | + | else (value(ao.assetId) != B)) | |
249 | + | then throw("WLGOLD payments only!") | |
250 | + | else if ((b > ab)) | |
251 | + | then throw((("Min payment should be " + R(b, 8)) + " WLGOLD")) | |
252 | + | else { | |
253 | + | let as = (ab * c) | |
254 | + | let at = J(invoke(u, "burnWlgold", nil, [AttachedPayment(B, ab)])) | |
255 | + | $Tuple2(([ScriptTransfer(Z.caller, as, E)] ++ an), at) | |
256 | + | } | |
257 | + | } | |
266 | 258 | } | |
259 | + | ||
260 | + | ||
261 | + | ||
262 | + | @Callable(Z) | |
263 | + | func convertOldStakes () = { | |
264 | + | let i = toString(Z.caller) | |
265 | + | if ((size(Z.payments) != 0)) | |
266 | + | then throw("No payments required") | |
267 | + | else { | |
268 | + | let au = addressFromStringValue(getStringValue(w)) | |
269 | + | let al = valueOrElse(getInteger(au, W(i)), 0) | |
270 | + | let av = if ((al > 0)) | |
271 | + | then Q(invoke(au, "unstakeAcresCallback", [al, i], nil)) | |
272 | + | else 0 | |
273 | + | let aw = addressFromStringValue(g) | |
274 | + | let ax = getString(aw, G(i)) | |
275 | + | let ay = if (isDefined(ax)) | |
276 | + | then { | |
277 | + | let az = split_51C(value(ax), "_") | |
278 | + | func aA (aB,aC) = if ((aC == "")) | |
279 | + | then throw("landAssetId is required") | |
280 | + | else { | |
281 | + | let aD = M(invoke(aw, "unstakeLandCallback", [aC, i], nil)) | |
282 | + | $Tuple4((aB._1 + aD._1), (aB._2 + aD._2), (aB._3 + aD._3), (aB._4 + aD._4)) | |
283 | + | } | |
284 | + | ||
285 | + | let aE = { | |
286 | + | let aF = az | |
287 | + | let aG = size(aF) | |
288 | + | let aH = $Tuple4(0, 0, 0, 0) | |
289 | + | func aI (aJ,aK) = if ((aK >= aG)) | |
290 | + | then aJ | |
291 | + | else aA(aJ, aF[aK]) | |
292 | + | ||
293 | + | func aL (aJ,aK) = if ((aK >= aG)) | |
294 | + | then aJ | |
295 | + | else throw("List size exceeds 100") | |
296 | + | ||
297 | + | aL(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aH, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
298 | + | } | |
299 | + | let aM = invoke(aw, "unstakeLandsFinalizeCallback", [i], nil) | |
300 | + | if ((aM == aM)) | |
301 | + | then { | |
302 | + | let aN = invoke(au, "requestAcresCallback", [(((aE._1 + aE._2) + aE._3) + aE._4), i], nil) | |
303 | + | if ((aN == aN)) | |
304 | + | then { | |
305 | + | let aO = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false) | |
306 | + | $Tuple5(aE._1, aE._2, aE._3, aE._4, [aO, ScriptTransfer(Z.caller, 1, calculateAssetId(aO))]) | |
307 | + | } | |
308 | + | else throw("Strict value is not equal to itself.") | |
309 | + | } | |
310 | + | else throw("Strict value is not equal to itself.") | |
311 | + | } | |
312 | + | else $Tuple5(0, 0, 0, 0, nil) | |
313 | + | let aP = valueOrElse(getString(aw, I(i)), "") | |
314 | + | let aQ = if ((aP != "")) | |
315 | + | then P(invoke(aw, "unstakeDuckCallback", [aP, i], nil)) | |
316 | + | else $Tuple3(0, 0, 0) | |
317 | + | let aR = aa((((((((av + ay._1) + ay._2) + ay._3) + ay._4) + aQ._1) + aQ._2) + aQ._3), i) | |
318 | + | $Tuple2((ay._5 ++ aR._1), aR._2) | |
319 | + | } | |
320 | + | } | |
321 | + | ||
322 | + | ||
323 | + | ||
324 | + | @Callable(Z) | |
325 | + | func convertOldStakesREADONLY () = $Tuple2(nil, 0) | |
267 | 326 | ||
268 | 327 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | - | let b = | |
6 | + | let b = 100000000 | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = 200 | |
9 | 9 | ||
10 | - | let d = { | |
11 | - | let e = c | |
12 | - | if ((base58'2W' == e)) | |
13 | - | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
14 | - | else if ((base58'2T' == e)) | |
15 | - | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
10 | + | let d = take(drop(this.bytes, 1), 1) | |
11 | + | ||
12 | + | let e = { | |
13 | + | let f = d | |
14 | + | if ((base58'2W' == f)) | |
15 | + | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
16 | + | else if ((base58'2T' == f)) | |
17 | + | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
16 | 18 | else throw("Unknown chain") | |
17 | 19 | } | |
18 | 20 | ||
19 | - | let | |
20 | - | let | |
21 | - | if ((base58'2W' == | |
22 | - | then " | |
23 | - | else if ((base58'2T' == | |
24 | - | then " | |
21 | + | let g = { | |
22 | + | let f = d | |
23 | + | if ((base58'2W' == f)) | |
24 | + | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
25 | + | else if ((base58'2T' == f)) | |
26 | + | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
25 | 27 | else throw("Unknown chain") | |
26 | 28 | } | |
27 | 29 | ||
28 | - | func | |
30 | + | func h (i,j) = valueOrErrorMessage(getString(i, j), makeString(["mandatory ", toString(i), ".", j, " is not defined"], "")) | |
29 | 31 | ||
30 | 32 | ||
31 | - | let | |
33 | + | let k = 1 | |
32 | 34 | ||
33 | - | let | |
35 | + | let l = 2 | |
34 | 36 | ||
35 | - | func | |
37 | + | func m () = "%s__restConfig" | |
36 | 38 | ||
37 | 39 | ||
38 | - | func | |
40 | + | func n () = "%s__rest2Addr" | |
39 | 41 | ||
40 | 42 | ||
41 | - | func | |
43 | + | func o (p) = split_4C(h(p, m()), a) | |
42 | 44 | ||
43 | 45 | ||
44 | - | func | |
46 | + | func q (r,s) = valueOrErrorMessage(addressFromString(r[s]), ("Rest cfg doesn't contain address at index " + toString(s))) | |
45 | 47 | ||
46 | 48 | ||
47 | - | let | |
49 | + | let t = addressFromStringValue(valueOrElse(getString(this, n()), e)) | |
48 | 50 | ||
49 | - | let | |
51 | + | let r = o(t) | |
50 | 52 | ||
51 | - | let | |
53 | + | let u = q(r, k) | |
52 | 54 | ||
53 | - | let | |
55 | + | let v = q(r, l) | |
54 | 56 | ||
55 | - | func v () = "contractsBlocked" | |
57 | + | let w = "oldAcresContract" | |
58 | + | ||
59 | + | func x () = "contractsBlocked" | |
56 | 60 | ||
57 | 61 | ||
58 | - | func | |
62 | + | func y (z) = ("lastTxIdByUser_" + z) | |
59 | 63 | ||
60 | 64 | ||
61 | - | let | |
65 | + | let A = "wlg_assetId" | |
62 | 66 | ||
63 | - | let | |
67 | + | let B = valueOrErrorMessage(getBinary(v, A), "WLGOLD is not issued yet") | |
64 | 68 | ||
65 | - | let | |
69 | + | let C = "acresIssuedAmount" | |
66 | 70 | ||
67 | - | func B (x) = ("acresStakedTimeByUser_" + x) | |
71 | + | let D = "acresAssetId" | |
72 | + | ||
73 | + | let E = valueOrErrorMessage(getBinary(u, D), "ACRES is not issued yet") | |
74 | + | ||
75 | + | func F (z) = ("acresStakedTimeByUser_" + z) | |
68 | 76 | ||
69 | 77 | ||
70 | - | func C (D,E) = { | |
71 | - | let F = pow(10, 0, E, 0, 0, DOWN) | |
72 | - | let G = toString((D % F)) | |
73 | - | let H = drop(toString(F), (1 + size(G))) | |
74 | - | (((toString((D / F)) + ".") + H) + G) | |
78 | + | func G (H) = ("stakedLandsByOwner_" + H) | |
79 | + | ||
80 | + | ||
81 | + | func I (H) = ("stakedDuckByOwner_" + H) | |
82 | + | ||
83 | + | ||
84 | + | func J (K) = { | |
85 | + | let f = K | |
86 | + | if ($isInstanceOf(f, "Int")) | |
87 | + | then { | |
88 | + | let L = f | |
89 | + | L | |
90 | + | } | |
91 | + | else throw("fail to cast into Int") | |
75 | 92 | } | |
76 | 93 | ||
77 | 94 | ||
78 | - | func I (x) = ("acresStakedAmountByUser_" + x) | |
79 | - | ||
80 | - | ||
81 | - | func J (x) = ("acresLockedAmountByUser_" + x) | |
82 | - | ||
83 | - | ||
84 | - | func K (x) = ("acresLockedEtaByUser_" + x) | |
85 | - | ||
86 | - | ||
87 | - | let L = "acresStakedAmountTotal" | |
88 | - | ||
89 | - | func M (N) = if (if ((N.originCaller != s)) | |
90 | - | then valueOrElse(getBoolean(v()), false) | |
91 | - | else false) | |
92 | - | then throw("Contracts are under maintenance") | |
93 | - | else [StringEntry(w(toString(N.originCaller)), toBase58String(N.transactionId))] | |
94 | - | ||
95 | - | ||
96 | - | func O (x,P,Q) = { | |
97 | - | let R = (lastBlock.timestamp - Q) | |
98 | - | 42 | |
95 | + | func M (N) = { | |
96 | + | let f = N | |
97 | + | if ($isInstanceOf(f, "(Int, Int, Int, Int, Int)")) | |
98 | + | then { | |
99 | + | let O = f | |
100 | + | O | |
101 | + | } | |
102 | + | else throw("fail to cast into (Int, Int, Int, Int, Int)") | |
99 | 103 | } | |
100 | 104 | ||
101 | 105 | ||
102 | - | func S (x,P,Q) = { | |
103 | - | let R = (lastBlock.timestamp - Q) | |
104 | - | if ((0 > R)) | |
105 | - | then throw(((("Saved timestamp is in future, saved = " + toString(Q)) + ", current = ") + toString(lastBlock.timestamp))) | |
106 | - | else 42 | |
106 | + | func P (N) = { | |
107 | + | let f = N | |
108 | + | if ($isInstanceOf(f, "(Int, Int, Int)")) | |
109 | + | then { | |
110 | + | let O = f | |
111 | + | O | |
112 | + | } | |
113 | + | else throw("fail to cast into (Int, Int, Int)") | |
107 | 114 | } | |
108 | 115 | ||
109 | 116 | ||
110 | - | @Callable(N) | |
111 | - | func constructorV1 (T,U) = if ((N.caller != this)) | |
112 | - | then throw("Permission denied") | |
113 | - | else { | |
114 | - | let V = addressFromStringValue(U) | |
115 | - | [IntegerEntry(y, getIntegerValue(V, y)), BinaryEntry(z, getBinaryValue(V, z)), StringEntry(m(), T)] | |
116 | - | } | |
117 | - | ||
118 | - | ||
119 | - | ||
120 | - | @Callable(N) | |
121 | - | func saveInteger (i,W) = if ((N.caller != this)) | |
122 | - | then throw("saveInteger is not public method") | |
123 | - | else [IntegerEntry(i, W)] | |
124 | - | ||
125 | - | ||
126 | - | ||
127 | - | @Callable(N) | |
128 | - | func setBlocked (X) = if ((N.caller != this)) | |
129 | - | then throw("permission denied") | |
130 | - | else [BooleanEntry(v(), X)] | |
131 | - | ||
132 | - | ||
133 | - | ||
134 | - | @Callable(N) | |
135 | - | func unstakeAcres (W) = { | |
136 | - | let Y = M(N) | |
137 | - | if ((Y == Y)) | |
138 | - | then if ((0 >= W)) | |
139 | - | then throw("Amount should be positive") | |
140 | - | else { | |
141 | - | let h = toString(N.caller) | |
142 | - | if ((size(N.payments) != 0)) | |
143 | - | then throw("No payments required") | |
144 | - | else { | |
145 | - | let Z = B(h) | |
146 | - | let aa = I(h) | |
147 | - | let ab = valueOrElse(getInteger(aa), 0) | |
148 | - | if ((W > ab)) | |
149 | - | then throw(((("You have only " + C(ab, 8)) + " ACRES staked, tried to unstake ") + C(W, 8))) | |
150 | - | else { | |
151 | - | let ac = valueOrElse(getInteger(J(h)), 0) | |
152 | - | let ad = valueOrElse(getInteger(K(h)), 0) | |
153 | - | let ae = lastBlock.timestamp | |
154 | - | let af = (ab - ac) | |
155 | - | if (if ((ad > ae)) | |
156 | - | then (W > af) | |
157 | - | else false) | |
158 | - | then throw(((("Only " + C(af, 8)) + " ACRES can be unstaked now, wait until ") + toString(ad))) | |
159 | - | else { | |
160 | - | let ag = valueOrElse(getInteger(L), 0) | |
161 | - | let ah = invoke(u, "onStakeUnstakeLand", [h], nil) | |
162 | - | let ai = S(h, ab, valueOrElse(getInteger(Z), 0)) | |
163 | - | $Tuple2([IntegerEntry(Z, lastBlock.timestamp), IntegerEntry(aa, (ab - W)), IntegerEntry(L, (ag - W)), ScriptTransfer(N.caller, (W + ai), A)], $Tuple2(Y, ah)) | |
164 | - | } | |
165 | - | } | |
166 | - | } | |
167 | - | } | |
168 | - | else throw("Strict value is not equal to itself.") | |
117 | + | func Q (N) = { | |
118 | + | let f = N | |
119 | + | if ($isInstanceOf(f, "(Int, Int)")) | |
120 | + | then { | |
121 | + | let O = f | |
122 | + | O._1 | |
123 | + | } | |
124 | + | else throw("fail to cast into (Int, Int)") | |
169 | 125 | } | |
170 | 126 | ||
171 | 127 | ||
128 | + | func R (N,S) = { | |
129 | + | let T = pow(10, 0, S, 0, 0, DOWN) | |
130 | + | let U = toString((N % T)) | |
131 | + | let V = drop(toString(T), (1 + size(U))) | |
132 | + | (((toString((N / T)) + ".") + V) + U) | |
133 | + | } | |
172 | 134 | ||
173 | - | @Callable(N) | |
174 | - | func stakeAcres () = { | |
175 | - | let Y = M(N) | |
176 | - | if ((Y == Y)) | |
135 | + | ||
136 | + | func W (z) = ("acresStakedAmountByUser_" + z) | |
137 | + | ||
138 | + | ||
139 | + | let X = "acresStakedAmountTotal" | |
140 | + | ||
141 | + | func Y (Z) = if (if ((Z.originCaller != t)) | |
142 | + | then valueOrElse(getBoolean(x()), false) | |
143 | + | else false) | |
144 | + | then throw("Contracts are under maintenance") | |
145 | + | else [StringEntry(y(toString(Z.originCaller)), toBase58String(Z.transactionId))] | |
146 | + | ||
147 | + | ||
148 | + | func aa (ab,i) = { | |
149 | + | let ac = invoke(v, "onStakeUnstakeLand", [i], nil) | |
150 | + | if ((ac == ac)) | |
177 | 151 | then { | |
178 | - | let h = toString(N.caller) | |
179 | - | if ((size(N.payments) != 1)) | |
180 | - | then throw("exactly 1 payment must be attached") | |
181 | - | else { | |
182 | - | let aj = N.payments[0] | |
183 | - | let ak = aj.amount | |
184 | - | if (if (!(isDefined(aj.assetId))) | |
185 | - | then true | |
186 | - | else (value(aj.assetId) != A)) | |
187 | - | then throw("ACRES payments only!") | |
188 | - | else { | |
189 | - | let ah = invoke(u, "onStakeUnstakeLand", [h], nil) | |
190 | - | if ((ah == ah)) | |
191 | - | then { | |
192 | - | let ae = lastBlock.timestamp | |
193 | - | let Z = B(h) | |
194 | - | let aa = I(h) | |
195 | - | let ab = valueOrElse(getInteger(aa), 0) | |
196 | - | let ag = valueOrElse(getInteger(L), 0) | |
197 | - | let ai = S(h, ab, valueOrElse(getInteger(Z), 0)) | |
198 | - | $Tuple2(((((if ((ai == 0)) | |
199 | - | then nil | |
200 | - | else [ScriptTransfer(N.caller, ai, A)]) :+ IntegerEntry(Z, lastBlock.timestamp)) :+ IntegerEntry(aa, (ab + ak))) :+ IntegerEntry(L, (ag + ak))), $Tuple2(Y, ah)) | |
201 | - | } | |
202 | - | else throw("Strict value is not equal to itself.") | |
203 | - | } | |
204 | - | } | |
152 | + | let ad = lastBlock.timestamp | |
153 | + | let ae = F(i) | |
154 | + | let af = W(i) | |
155 | + | let ag = valueOrElse(getInteger(af), 0) | |
156 | + | let ah = valueOrElse(getInteger(X), 0) | |
157 | + | $Tuple2([IntegerEntry(ae, lastBlock.timestamp), IntegerEntry(af, (ag + ab)), IntegerEntry(X, (ah + ab))], ac) | |
205 | 158 | } | |
206 | 159 | else throw("Strict value is not equal to itself.") | |
207 | 160 | } | |
208 | 161 | ||
209 | 162 | ||
163 | + | @Callable(Z) | |
164 | + | func constructorV1 (ai,aj) = if ((Z.caller != this)) | |
165 | + | then throw("Permission denied") | |
166 | + | else { | |
167 | + | let ak = addressFromStringValue(aj) | |
168 | + | [IntegerEntry(C, getIntegerValue(ak, C)), BinaryEntry(D, getBinaryValue(ak, D)), StringEntry(n(), ai), StringEntry(w, aj)] | |
169 | + | } | |
210 | 170 | ||
211 | - | @Callable(N) | |
212 | - | func buyAcres () = { | |
213 | - | let Y = M(N) | |
214 | - | if ((Y == Y)) | |
215 | - | then { | |
216 | - | let h = toString(N.caller) | |
217 | - | if ((size(N.payments) != 1)) | |
218 | - | then throw("exactly 1 payment must be attached") | |
171 | + | ||
172 | + | ||
173 | + | @Callable(Z) | |
174 | + | func saveInteger (j,al) = if ((Z.caller != this)) | |
175 | + | then throw("saveInteger is not public method") | |
176 | + | else [IntegerEntry(j, al)] | |
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | @Callable(Z) | |
181 | + | func setBlocked (am) = if ((Z.caller != this)) | |
182 | + | then throw("permission denied") | |
183 | + | else [BooleanEntry(x(), am)] | |
184 | + | ||
185 | + | ||
186 | + | ||
187 | + | @Callable(Z) | |
188 | + | func unstakeAcres (al) = { | |
189 | + | let an = Y(Z) | |
190 | + | if ((0 >= al)) | |
191 | + | then throw("Amount should be positive") | |
192 | + | else { | |
193 | + | let i = toString(Z.caller) | |
194 | + | if ((size(Z.payments) != 0)) | |
195 | + | then throw("No payments required") | |
219 | 196 | else { | |
220 | - | let aj = N.payments[0] | |
221 | - | let ak = aj.amount | |
222 | - | if (if (!(isDefined(aj.assetId))) | |
223 | - | then true | |
224 | - | else (value(aj.assetId) != d)) | |
225 | - | then throw("USDT payments only!") | |
226 | - | else if ((b > ak)) | |
227 | - | then throw((("Min payment should be " + C(b, 6)) + " USDT")) | |
228 | - | else $Tuple2(nil, Y) | |
197 | + | let ae = F(i) | |
198 | + | let af = W(i) | |
199 | + | let ag = valueOrElse(getInteger(af), 0) | |
200 | + | if ((al > ag)) | |
201 | + | then throw(((("You have only " + R(ag, 8)) + " ACRES staked, tried to unstake ") + R(al, 8))) | |
202 | + | else { | |
203 | + | let ah = valueOrElse(getInteger(X), 0) | |
204 | + | let ac = invoke(v, "onStakeUnstakeLand", [i], nil) | |
205 | + | $Tuple2(([IntegerEntry(ae, lastBlock.timestamp), IntegerEntry(af, (ag - al)), IntegerEntry(X, (ah - al)), ScriptTransfer(Z.caller, al, E)] ++ an), ac) | |
206 | + | } | |
229 | 207 | } | |
230 | 208 | } | |
231 | - | else throw("Strict value is not equal to itself.") | |
232 | 209 | } | |
233 | 210 | ||
234 | 211 | ||
235 | 212 | ||
236 | - | @Callable(N) | |
237 | - | func claimAcres () = { | |
238 | - | let Y = M(N) | |
239 | - | if ((Y == Y)) | |
240 | - | then { | |
241 | - | let h = toString(N.caller) | |
242 | - | if ((size(N.payments) != 0)) | |
243 | - | then throw("No payments required") | |
213 | + | @Callable(Z) | |
214 | + | func stakeAcres () = { | |
215 | + | let an = Y(Z) | |
216 | + | let i = toString(Z.caller) | |
217 | + | if ((size(Z.payments) != 1)) | |
218 | + | then throw("exactly 1 payment must be attached") | |
219 | + | else { | |
220 | + | let ao = Z.payments[0] | |
221 | + | let ab = ao.amount | |
222 | + | if (if (!(isDefined(ao.assetId))) | |
223 | + | then true | |
224 | + | else (value(ao.assetId) != E)) | |
225 | + | then throw("ACRES payments only!") | |
244 | 226 | else { | |
245 | - | let Z = B(h) | |
246 | - | let aa = I(h) | |
247 | - | let P = valueOrElse(getInteger(aa), 0) | |
248 | - | let ah = invoke(u, "onStakeUnstakeLand", [h], nil) | |
249 | - | let ai = S(h, P, valueOrElse(getInteger(Z), 0)) | |
250 | - | $Tuple2([IntegerEntry(Z, lastBlock.timestamp), ScriptTransfer(N.caller, ai, A)], $Tuple2(Y, ah)) | |
227 | + | let ap = aa(ab, i) | |
228 | + | let aq = ap._1 | |
229 | + | let ar = ap._2 | |
230 | + | $Tuple2((aq ++ an), ar) | |
251 | 231 | } | |
252 | 232 | } | |
253 | - | else throw("Strict value is not equal to itself.") | |
254 | 233 | } | |
255 | 234 | ||
256 | 235 | ||
257 | 236 | ||
258 | - | @Callable(N) | |
259 | - | func claimAcresREADONLY (h) = { | |
260 | - | let Z = B(h) | |
261 | - | let aa = I(h) | |
262 | - | let P = valueOrElse(getInteger(aa), 0) | |
263 | - | let al = valueOrElse(getInteger(Z), 0) | |
264 | - | let ai = O(h, P, al) | |
265 | - | $Tuple2(nil, [ai, al]) | |
237 | + | @Callable(Z) | |
238 | + | func buyAcres () = { | |
239 | + | let an = Y(Z) | |
240 | + | let i = toString(Z.caller) | |
241 | + | if ((size(Z.payments) != 1)) | |
242 | + | then throw("exactly 1 payment must be attached") | |
243 | + | else { | |
244 | + | let ao = Z.payments[0] | |
245 | + | let ab = ao.amount | |
246 | + | if (if (!(isDefined(ao.assetId))) | |
247 | + | then true | |
248 | + | else (value(ao.assetId) != B)) | |
249 | + | then throw("WLGOLD payments only!") | |
250 | + | else if ((b > ab)) | |
251 | + | then throw((("Min payment should be " + R(b, 8)) + " WLGOLD")) | |
252 | + | else { | |
253 | + | let as = (ab * c) | |
254 | + | let at = J(invoke(u, "burnWlgold", nil, [AttachedPayment(B, ab)])) | |
255 | + | $Tuple2(([ScriptTransfer(Z.caller, as, E)] ++ an), at) | |
256 | + | } | |
257 | + | } | |
266 | 258 | } | |
259 | + | ||
260 | + | ||
261 | + | ||
262 | + | @Callable(Z) | |
263 | + | func convertOldStakes () = { | |
264 | + | let i = toString(Z.caller) | |
265 | + | if ((size(Z.payments) != 0)) | |
266 | + | then throw("No payments required") | |
267 | + | else { | |
268 | + | let au = addressFromStringValue(getStringValue(w)) | |
269 | + | let al = valueOrElse(getInteger(au, W(i)), 0) | |
270 | + | let av = if ((al > 0)) | |
271 | + | then Q(invoke(au, "unstakeAcresCallback", [al, i], nil)) | |
272 | + | else 0 | |
273 | + | let aw = addressFromStringValue(g) | |
274 | + | let ax = getString(aw, G(i)) | |
275 | + | let ay = if (isDefined(ax)) | |
276 | + | then { | |
277 | + | let az = split_51C(value(ax), "_") | |
278 | + | func aA (aB,aC) = if ((aC == "")) | |
279 | + | then throw("landAssetId is required") | |
280 | + | else { | |
281 | + | let aD = M(invoke(aw, "unstakeLandCallback", [aC, i], nil)) | |
282 | + | $Tuple4((aB._1 + aD._1), (aB._2 + aD._2), (aB._3 + aD._3), (aB._4 + aD._4)) | |
283 | + | } | |
284 | + | ||
285 | + | let aE = { | |
286 | + | let aF = az | |
287 | + | let aG = size(aF) | |
288 | + | let aH = $Tuple4(0, 0, 0, 0) | |
289 | + | func aI (aJ,aK) = if ((aK >= aG)) | |
290 | + | then aJ | |
291 | + | else aA(aJ, aF[aK]) | |
292 | + | ||
293 | + | func aL (aJ,aK) = if ((aK >= aG)) | |
294 | + | then aJ | |
295 | + | else throw("List size exceeds 100") | |
296 | + | ||
297 | + | aL(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aI(aH, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
298 | + | } | |
299 | + | let aM = invoke(aw, "unstakeLandsFinalizeCallback", [i], nil) | |
300 | + | if ((aM == aM)) | |
301 | + | then { | |
302 | + | let aN = invoke(au, "requestAcresCallback", [(((aE._1 + aE._2) + aE._3) + aE._4), i], nil) | |
303 | + | if ((aN == aN)) | |
304 | + | then { | |
305 | + | let aO = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false) | |
306 | + | $Tuple5(aE._1, aE._2, aE._3, aE._4, [aO, ScriptTransfer(Z.caller, 1, calculateAssetId(aO))]) | |
307 | + | } | |
308 | + | else throw("Strict value is not equal to itself.") | |
309 | + | } | |
310 | + | else throw("Strict value is not equal to itself.") | |
311 | + | } | |
312 | + | else $Tuple5(0, 0, 0, 0, nil) | |
313 | + | let aP = valueOrElse(getString(aw, I(i)), "") | |
314 | + | let aQ = if ((aP != "")) | |
315 | + | then P(invoke(aw, "unstakeDuckCallback", [aP, i], nil)) | |
316 | + | else $Tuple3(0, 0, 0) | |
317 | + | let aR = aa((((((((av + ay._1) + ay._2) + ay._3) + ay._4) + aQ._1) + aQ._2) + aQ._3), i) | |
318 | + | $Tuple2((ay._5 ++ aR._1), aR._2) | |
319 | + | } | |
320 | + | } | |
321 | + | ||
322 | + | ||
323 | + | ||
324 | + | @Callable(Z) | |
325 | + | func convertOldStakesREADONLY () = $Tuple2(nil, 0) | |
267 | 326 | ||
268 | 327 |
github/deemru/w8io/026f985 50.88 ms ◑