tx · E2JN3F1oqYzoP5pTv4TtpwMPbvRbYFbCHmniF6ijiSig 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg: -0.01200000 Waves 2023.11.19 18:52 [2850466] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves
{ "type": 13, "id": "E2JN3F1oqYzoP5pTv4TtpwMPbvRbYFbCHmniF6ijiSig", "fee": 1200000, "feeAssetId": null, "timestamp": 1700409143157, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "2xMJZfoQMHuneZUxUsCPbEwvqRGwUTeyzPPcjfKbKNvB4FNTnoGw6YuMX3HrwJyHoz8k2c7kvXfM3BQE3ZzJWbCJ" ], "script": "base64:BgIsCAISBAoCCAESABIDCgEBEgASABIECgIIARIFCgMIAQESAwoBARIAEgMKAQguAAhNSUxMSU9ONgCAgOmDsd4WAAlEQVlNSUxMSVMAgLiZKQEaa2V5QWNyZXNTdGFrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNTdGFrZWRBbW91bnRCeVVzZXJfBQRhZGRyARprZXlBY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcgEEYWRkcgkArAICAhhhY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcl8FBGFkZHIBF2tleUFjcmVzTG9ja2VkRXRhQnlVc2VyAQRhZGRyCQCsAgICFWFjcmVzTG9ja2VkRXRhQnlVc2VyXwUEYWRkcgATYWNyZXNTdGFrZWRUb3RhbEtleQIWYWNyZXNTdGFrZWRBbW91bnRUb3RhbAAKeHBOZXdTTGFuZADAlrECAA9EQUlMWVJFU0JZUElFQ0UAgPjSAQAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c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| New | Differences | |
---|---|---|---|
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | + | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
151 | + | ||
150 | 152 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
151 | 153 | ||
152 | 154 | ||
202 | 204 | ||
203 | 205 | ||
204 | 206 | @Callable(i) | |
205 | - | func stakeAcres () = { | |
206 | - | let prologResult = prolog() | |
207 | - | if ((prologResult == prologResult)) | |
208 | - | then { | |
209 | - | let address = toString(i.caller) | |
210 | - | if ((size(i.payments) != 1)) | |
211 | - | then throw("exactly 1 payment must be attached") | |
212 | - | else { | |
213 | - | let pmt = i.payments[0] | |
214 | - | let amt = pmt.amount | |
215 | - | if (if (!(isDefined(pmt.assetId))) | |
216 | - | then true | |
217 | - | else (value(pmt.assetId) != acresAssetId)) | |
218 | - | then throw("ACRES payments only!") | |
219 | - | else { | |
220 | - | let timeKey = keyAcresStakedTimeByUser(address) | |
221 | - | let amountKey = keyAcresStakedAmountByUser(address) | |
222 | - | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
223 | - | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
224 | - | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
225 | - | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
226 | - | $Tuple2(((((if ((claimedAcres == 0)) | |
227 | - | then nil | |
228 | - | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
229 | - | } | |
230 | - | } | |
231 | - | } | |
232 | - | else throw("Strict value is not equal to itself.") | |
233 | - | } | |
207 | + | func stakeAcres () = if ((i.caller != this)) | |
208 | + | then throw("Temporarily disabled during promo action") | |
209 | + | else { | |
210 | + | let prologResult = prolog() | |
211 | + | if ((prologResult == prologResult)) | |
212 | + | then { | |
213 | + | let address = toString(i.caller) | |
214 | + | if ((size(i.payments) != 1)) | |
215 | + | then throw("exactly 1 payment must be attached") | |
216 | + | else { | |
217 | + | let pmt = i.payments[0] | |
218 | + | let amt = pmt.amount | |
219 | + | if (if (!(isDefined(pmt.assetId))) | |
220 | + | then true | |
221 | + | else (value(pmt.assetId) != acresAssetId)) | |
222 | + | then throw("ACRES payments only!") | |
223 | + | else { | |
224 | + | let timeKey = keyAcresStakedTimeByUser(address) | |
225 | + | let amountKey = keyAcresStakedAmountByUser(address) | |
226 | + | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
227 | + | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
228 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
229 | + | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
230 | + | $Tuple2(((((if ((claimedAcres == 0)) | |
231 | + | then nil | |
232 | + | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
233 | + | } | |
234 | + | } | |
235 | + | } | |
236 | + | else throw("Strict value is not equal to itself.") | |
237 | + | } | |
234 | 238 | ||
235 | 239 | ||
236 | 240 | ||
268 | 272 | } | |
269 | 273 | } | |
270 | 274 | } | |
275 | + | else throw("Strict value is not equal to itself.") | |
276 | + | } | |
277 | + | ||
278 | + | ||
279 | + | ||
280 | + | @Callable(i) | |
281 | + | func stakeAcresLocked () = { | |
282 | + | let prologResult = prolog() | |
283 | + | if ((prologResult == prologResult)) | |
284 | + | then { | |
285 | + | let address = toString(i.caller) | |
286 | + | if ((size(i.payments) != 1)) | |
287 | + | then throw("exactly 1 payment must be attached") | |
288 | + | else { | |
289 | + | let pmt = i.payments[0] | |
290 | + | let amt = pmt.amount | |
291 | + | if (if (!(isDefined(pmt.assetId))) | |
292 | + | then true | |
293 | + | else (value(pmt.assetId) != acresAssetId)) | |
294 | + | then throw("ACRES payments only!") | |
295 | + | else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt)) | |
296 | + | then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES")) | |
297 | + | else { | |
298 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
299 | + | if ((wlgResult == wlgResult)) | |
300 | + | then { | |
301 | + | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
302 | + | $Tuple2(nil, $Tuple3(prologResult, wlgResult, stakeResult)) | |
303 | + | } | |
304 | + | else throw("Strict value is not equal to itself.") | |
305 | + | } | |
306 | + | } | |
307 | + | } | |
271 | 308 | else throw("Strict value is not equal to itself.") | |
272 | 309 | } | |
273 | 310 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MILLION6 = 100000000000000 | |
5 | 5 | ||
6 | 6 | let DAYMILLIS = 86400000 | |
7 | 7 | ||
8 | 8 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func keyAcresLockedAmountByUser (addr) = ("acresLockedAmountByUser_" + addr) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func keyAcresLockedEtaByUser (addr) = ("acresLockedEtaByUser_" + addr) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | let acresStakedTotalKey = "acresStakedAmountTotal" | |
18 | 18 | ||
19 | 19 | let xpNewSLand = 5000000 | |
20 | 20 | ||
21 | 21 | let DAILYRESBYPIECE = 3456000 | |
22 | 22 | ||
23 | 23 | let USDT2ACRES_MULTIPLIER = 10 | |
24 | 24 | ||
25 | 25 | let chain = take(drop(this.bytes, 1), 1) | |
26 | 26 | ||
27 | 27 | let usdtAssetId = match chain { | |
28 | 28 | case _ => | |
29 | 29 | if ((base58'2W' == $match0)) | |
30 | 30 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
31 | 31 | else if ((base58'2T' == $match0)) | |
32 | 32 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
33 | 33 | else throw("Unknown chain") | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | let defaultRestAddressStr = match chain { | |
37 | 37 | case _ => | |
38 | 38 | if ((base58'2W' == $match0)) | |
39 | 39 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
40 | 40 | else if ((base58'2T' == $match0)) | |
41 | 41 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
42 | 42 | else throw("Unknown chain") | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | let SEP = "__" | |
46 | 46 | ||
47 | 47 | let MULT6 = 1000000 | |
48 | 48 | ||
49 | 49 | let MULT8 = 100000000 | |
50 | 50 | ||
51 | 51 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let IdxCfgStakingDapp = 1 | |
55 | 55 | ||
56 | 56 | let IdxCfgEconomyDapp = 2 | |
57 | 57 | ||
58 | 58 | let IdxCfgWlgDapp = 4 | |
59 | 59 | ||
60 | 60 | let IdxCfgAcresDapp = 8 | |
61 | 61 | ||
62 | 62 | func keyRestCfg () = "%s__restConfig" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keyRestAddress () = "%s__restAddr" | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
75 | 75 | ||
76 | 76 | let restCfg = readRestCfgOrFail(restContract) | |
77 | 77 | ||
78 | 78 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
79 | 79 | ||
80 | 80 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
81 | 81 | ||
82 | 82 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
83 | 83 | ||
84 | 84 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
85 | 85 | ||
86 | 86 | let acresIssuedAmountKey = "acresIssuedAmount" | |
87 | 87 | ||
88 | 88 | let acresAssetIdKey = "acresAssetId" | |
89 | 89 | ||
90 | 90 | let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet") | |
91 | 91 | ||
92 | 92 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | let IdxEffTotal = 0 | |
96 | 96 | ||
97 | 97 | func keyResProportions () = "resTypesProportions" | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func asInt (v) = match v { | |
104 | 104 | case n: Int => | |
105 | 105 | n | |
106 | 106 | case _ => | |
107 | 107 | throw("fail to cast into Int") | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func asTwoIntsTuple (val) = match val { | |
112 | 112 | case t2: (Int, Int) => | |
113 | 113 | t2 | |
114 | 114 | case _ => | |
115 | 115 | throw("fail to cast into (Int, Int)") | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getVotingPower (userAddrStrOrEmpty) = { | |
120 | 120 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
121 | 121 | func adder (acc,item) = (acc + parseIntValue(item)) | |
122 | 122 | ||
123 | 123 | let totalPower = { | |
124 | 124 | let $l = props | |
125 | 125 | let $s = size($l) | |
126 | 126 | let $acc0 = 0 | |
127 | 127 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
128 | 128 | then $a | |
129 | 129 | else adder($a, $l[$i]) | |
130 | 130 | ||
131 | 131 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
132 | 132 | then $a | |
133 | 133 | else throw("List size exceeds 6") | |
134 | 134 | ||
135 | 135 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
136 | 136 | } | |
137 | 137 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
138 | 138 | [totalPower, usersPower] | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func fixedPoint (val,decimals) = { | |
143 | 143 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
144 | 144 | let lowPart = toString((val % tenPow)) | |
145 | 145 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
146 | 146 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | + | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
151 | + | ||
150 | 152 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
151 | 153 | ||
152 | 154 | ||
153 | 155 | func claimAcresInternal (addr,acresAmount,lastClaimTime) = { | |
154 | 156 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
155 | 157 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
156 | 158 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
157 | 159 | let gotUsdt = max([0, canGetUsdt]) | |
158 | 160 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
159 | 161 | } | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | func claimInternal (addr,acresAmount,lastClaimTime) = { | |
163 | 165 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
164 | 166 | if ((0 > deltaTime)) | |
165 | 167 | then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
166 | 168 | else { | |
167 | 169 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
168 | 170 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
169 | 171 | let gotUsdt = if ((0 >= canGetUsdt)) | |
170 | 172 | then 0 | |
171 | 173 | else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1 | |
172 | 174 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
173 | 175 | } | |
174 | 176 | } | |
175 | 177 | ||
176 | 178 | ||
177 | 179 | func mergeLocked (oldAmount,oldETA,newAmount,newETA) = { | |
178 | 180 | let now = lastBlock.timestamp | |
179 | 181 | let dt1 = max([0, (oldETA - now)]) | |
180 | 182 | let dt2 = max([0, (newETA - now)]) | |
181 | 183 | let sum = (oldAmount + newAmount) | |
182 | 184 | let dt = if ((sum == 0)) | |
183 | 185 | then 0 | |
184 | 186 | else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum)) | |
185 | 187 | (now + dt) | |
186 | 188 | } | |
187 | 189 | ||
188 | 190 | ||
189 | 191 | @Callable(i) | |
190 | 192 | func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this)) | |
191 | 193 | then throw("Permission denied") | |
192 | 194 | else if (isDefined(getBinary(acresAssetIdKey))) | |
193 | 195 | then throw("Already initialized") | |
194 | 196 | else { | |
195 | 197 | let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces) | |
196 | 198 | let issuedAmount = (MILLION6 - (nftAcres * MULT8)) | |
197 | 199 | let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0) | |
198 | 200 | let assetId = calculateAssetId(issue) | |
199 | 201 | [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)] | |
200 | 202 | } | |
201 | 203 | ||
202 | 204 | ||
203 | 205 | ||
204 | 206 | @Callable(i) | |
205 | - | func stakeAcres () = { | |
206 | - | let prologResult = prolog() | |
207 | - | if ((prologResult == prologResult)) | |
208 | - | then { | |
209 | - | let address = toString(i.caller) | |
210 | - | if ((size(i.payments) != 1)) | |
211 | - | then throw("exactly 1 payment must be attached") | |
212 | - | else { | |
213 | - | let pmt = i.payments[0] | |
214 | - | let amt = pmt.amount | |
215 | - | if (if (!(isDefined(pmt.assetId))) | |
216 | - | then true | |
217 | - | else (value(pmt.assetId) != acresAssetId)) | |
218 | - | then throw("ACRES payments only!") | |
219 | - | else { | |
220 | - | let timeKey = keyAcresStakedTimeByUser(address) | |
221 | - | let amountKey = keyAcresStakedAmountByUser(address) | |
222 | - | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
223 | - | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
224 | - | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
225 | - | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
226 | - | $Tuple2(((((if ((claimedAcres == 0)) | |
227 | - | then nil | |
228 | - | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
229 | - | } | |
230 | - | } | |
231 | - | } | |
232 | - | else throw("Strict value is not equal to itself.") | |
233 | - | } | |
207 | + | func stakeAcres () = if ((i.caller != this)) | |
208 | + | then throw("Temporarily disabled during promo action") | |
209 | + | else { | |
210 | + | let prologResult = prolog() | |
211 | + | if ((prologResult == prologResult)) | |
212 | + | then { | |
213 | + | let address = toString(i.caller) | |
214 | + | if ((size(i.payments) != 1)) | |
215 | + | then throw("exactly 1 payment must be attached") | |
216 | + | else { | |
217 | + | let pmt = i.payments[0] | |
218 | + | let amt = pmt.amount | |
219 | + | if (if (!(isDefined(pmt.assetId))) | |
220 | + | then true | |
221 | + | else (value(pmt.assetId) != acresAssetId)) | |
222 | + | then throw("ACRES payments only!") | |
223 | + | else { | |
224 | + | let timeKey = keyAcresStakedTimeByUser(address) | |
225 | + | let amountKey = keyAcresStakedAmountByUser(address) | |
226 | + | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
227 | + | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
228 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
229 | + | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
230 | + | $Tuple2(((((if ((claimedAcres == 0)) | |
231 | + | then nil | |
232 | + | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
233 | + | } | |
234 | + | } | |
235 | + | } | |
236 | + | else throw("Strict value is not equal to itself.") | |
237 | + | } | |
234 | 238 | ||
235 | 239 | ||
236 | 240 | ||
237 | 241 | @Callable(i) | |
238 | 242 | func unstakeAcres (amount) = { | |
239 | 243 | let prologResult = prolog() | |
240 | 244 | if ((prologResult == prologResult)) | |
241 | 245 | then if ((0 >= amount)) | |
242 | 246 | then throw("Amount should be positive") | |
243 | 247 | else { | |
244 | 248 | let address = toString(i.caller) | |
245 | 249 | if ((size(i.payments) != 0)) | |
246 | 250 | then throw("No payments required") | |
247 | 251 | else { | |
248 | 252 | let timeKey = keyAcresStakedTimeByUser(address) | |
249 | 253 | let amountKey = keyAcresStakedAmountByUser(address) | |
250 | 254 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
251 | 255 | if ((amount > oldAcresAmount)) | |
252 | 256 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
253 | 257 | else { | |
254 | 258 | let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0) | |
255 | 259 | let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0) | |
256 | 260 | let now = lastBlock.timestamp | |
257 | 261 | let unstakableAmount = (oldAcresAmount - lockedAmount) | |
258 | 262 | if (if ((lockedETA > now)) | |
259 | 263 | then (amount > unstakableAmount) | |
260 | 264 | else false) | |
261 | 265 | then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA))) | |
262 | 266 | else { | |
263 | 267 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
264 | 268 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
265 | 269 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
266 | 270 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
267 | 271 | } | |
268 | 272 | } | |
269 | 273 | } | |
270 | 274 | } | |
275 | + | else throw("Strict value is not equal to itself.") | |
276 | + | } | |
277 | + | ||
278 | + | ||
279 | + | ||
280 | + | @Callable(i) | |
281 | + | func stakeAcresLocked () = { | |
282 | + | let prologResult = prolog() | |
283 | + | if ((prologResult == prologResult)) | |
284 | + | then { | |
285 | + | let address = toString(i.caller) | |
286 | + | if ((size(i.payments) != 1)) | |
287 | + | then throw("exactly 1 payment must be attached") | |
288 | + | else { | |
289 | + | let pmt = i.payments[0] | |
290 | + | let amt = pmt.amount | |
291 | + | if (if (!(isDefined(pmt.assetId))) | |
292 | + | then true | |
293 | + | else (value(pmt.assetId) != acresAssetId)) | |
294 | + | then throw("ACRES payments only!") | |
295 | + | else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt)) | |
296 | + | then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES")) | |
297 | + | else { | |
298 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
299 | + | if ((wlgResult == wlgResult)) | |
300 | + | then { | |
301 | + | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
302 | + | $Tuple2(nil, $Tuple3(prologResult, wlgResult, stakeResult)) | |
303 | + | } | |
304 | + | else throw("Strict value is not equal to itself.") | |
305 | + | } | |
306 | + | } | |
307 | + | } | |
271 | 308 | else throw("Strict value is not equal to itself.") | |
272 | 309 | } | |
273 | 310 | ||
274 | 311 | ||
275 | 312 | ||
276 | 313 | @Callable(i) | |
277 | 314 | func buyAcres () = { | |
278 | 315 | let prologResult = prolog() | |
279 | 316 | if ((prologResult == prologResult)) | |
280 | 317 | then { | |
281 | 318 | let address = toString(i.caller) | |
282 | 319 | if ((size(i.payments) != 1)) | |
283 | 320 | then throw("exactly 1 payment must be attached") | |
284 | 321 | else { | |
285 | 322 | let pmt = i.payments[0] | |
286 | 323 | let amt = pmt.amount | |
287 | 324 | if (if (!(isDefined(pmt.assetId))) | |
288 | 325 | then true | |
289 | 326 | else (value(pmt.assetId) != usdtAssetId)) | |
290 | 327 | then throw("USDT payments only!") | |
291 | 328 | else if ((MULT6 > amt)) | |
292 | 329 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
293 | 330 | else { | |
294 | 331 | let acresAmount = (amt * USDT2ACRES_MULTIPLIER) | |
295 | 332 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil)) | |
296 | 333 | $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult)) | |
297 | 334 | } | |
298 | 335 | } | |
299 | 336 | } | |
300 | 337 | else throw("Strict value is not equal to itself.") | |
301 | 338 | } | |
302 | 339 | ||
303 | 340 | ||
304 | 341 | ||
305 | 342 | @Callable(i) | |
306 | 343 | func sendAcres (addr,amount) = if ((i.caller != economyContract)) | |
307 | 344 | then throw("Permission denied") | |
308 | 345 | else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount) | |
309 | 346 | ||
310 | 347 | ||
311 | 348 | ||
312 | 349 | @Callable(i) | |
313 | 350 | func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this)) | |
314 | 351 | then (i.caller != restContract) | |
315 | 352 | else false) | |
316 | 353 | then throw("Permission denied") | |
317 | 354 | else { | |
318 | 355 | let now = lastBlock.timestamp | |
319 | 356 | let timeKey = keyAcresStakedTimeByUser(addr) | |
320 | 357 | let amountKey = keyAcresStakedAmountByUser(addr) | |
321 | 358 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
322 | 359 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
323 | 360 | let oldTime = valueOrElse(getInteger(timeKey), now) | |
324 | 361 | let etaKey = keyAcresLockedEtaByUser(addr) | |
325 | 362 | let lockedAmountKey = keyAcresLockedAmountByUser(addr) | |
326 | 363 | let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0) | |
327 | 364 | let oldLockedETA = valueOrElse(getInteger(etaKey), 0) | |
328 | 365 | let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS))) | |
329 | 366 | $Tuple2([IntegerEntry(timeKey, oldTime), IntegerEntry(amountKey, (oldAcresAmount + amount)), IntegerEntry(acresStakedTotalKey, (oldTotal + amount)), IntegerEntry(etaKey, mergedETA), IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))], amount) | |
330 | 367 | } | |
331 | 368 | ||
332 | 369 | ||
333 | 370 | ||
334 | 371 | @Callable(i) | |
335 | 372 | func burnAcres (amount) = if ((i.caller != stakingContract)) | |
336 | 373 | then throw("Permission denied") | |
337 | 374 | else { | |
338 | 375 | let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount) | |
339 | 376 | if ((0 > amountLeft)) | |
340 | 377 | then throw("Attempt to burn more ACRES, than exists") | |
341 | 378 | else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount) | |
342 | 379 | } | |
343 | 380 | ||
344 | 381 | ||
345 | 382 | ||
346 | 383 | @Callable(i) | |
347 | 384 | func claimAcres () = { | |
348 | 385 | let prologResult = prolog() | |
349 | 386 | if ((prologResult == prologResult)) | |
350 | 387 | then { | |
351 | 388 | let address = toString(i.caller) | |
352 | 389 | if ((size(i.payments) != 0)) | |
353 | 390 | then throw("No payments required") | |
354 | 391 | else { | |
355 | 392 | let timeKey = keyAcresStakedTimeByUser(address) | |
356 | 393 | let amountKey = keyAcresStakedAmountByUser(address) | |
357 | 394 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
358 | 395 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
359 | 396 | let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0)) | |
360 | 397 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
361 | 398 | } | |
362 | 399 | } | |
363 | 400 | else throw("Strict value is not equal to itself.") | |
364 | 401 | } | |
365 | 402 | ||
366 | 403 | ||
367 | 404 | ||
368 | 405 | @Callable(i) | |
369 | 406 | func claimAcresREADONLY (address) = { | |
370 | 407 | let timeKey = keyAcresStakedTimeByUser(address) | |
371 | 408 | let amountKey = keyAcresStakedAmountByUser(address) | |
372 | 409 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
373 | 410 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
374 | 411 | let claimedAcres = claimAcresInternal(address, acresAmount, lastTime) | |
375 | 412 | $Tuple2(nil, [claimedAcres, lastTime]) | |
376 | 413 | } | |
377 | 414 | ||
378 | 415 |
github/deemru/w8io/169f3d6 46.58 ms ◑