tx · 2AJLspzycKDjS6EbnuvyvEvynNH4gUfxSuDNWj8RyJxm 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh: -0.01500000 Waves 2024.10.06 04:50 [3314350] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves
{ "type": 13, "id": "2AJLspzycKDjS6EbnuvyvEvynNH4gUfxSuDNWj8RyJxm", "fee": 1500000, "feeAssetId": null, "timestamp": 1728179478952, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "4AEcHaykbegbQujJRRRnuGjyZKPQqxnjifNcNvxgiUsSwWWqnPFHvx2iSMHyvB9d16YJwev6i35fWP5AiMmvFRAR" ], "script": "base64:BgI6CAISBAoCCAgSBAoCCAESAwoBBBIDCgEBEgASABIDCgEBEgASAwoBARIAEgMKAQgSAwoBCBIECgIIATIAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDcAgK3iBAAFTVVMVDgAgMLXLwAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2R0QXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEghNp6sggDP07Ru8qO7ouTvMmC3Qtd+geWqNQj+agP/7kDCQAAAgEBVAUHJG1hdGNoMAEgVbHYn3KHgu/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABZkZWZhdWx0UmVzdDJBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUEZ3WXRhOGJpRXozMXpwZUZlNURKSzh3RTV0clNwUVZGOAMJAAACAQFUBQckbWF0Y2gwAiMzTjdVdVlhcjYyNjRQNThGQ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Vsc2UCCQCfCAEFEmFjcmVzU3Rha2RUb3RhbEtleQAABAl1c2VyRnBLZXkJARVrZXlGYXJtaW5nUG93ZXJCeVVzZXIBBQdhZGRyZXNzBAVvbGRGcAkBC3ZhbHVlT3JFbHNlAgkAnwgBBQl1c2VyRnBLZXkAAAQFbmV3RnAJARZnZXRGYXJtaW5nUG93ZXJCeUFjcmVzAQUObmV3QWNyZXNBbW91bnQECm9sZFRvdGFsRnAJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUUdG90YWxGYXJtaW5nUG93ZXJLZXkAAAQKbmV3VG90YWxGcAkAZAIJAGUCBQpvbGRUb3RhbEZwBQVvbGRGcAUFbmV3RnAJAJQKAgUDbmlsCQDMCAIFBW9sZEZwCQDMCAIFBW5ld0ZwCQDMCAIFCm9sZFRvdGFsRnAJAMwIAgUKbmV3VG90YWxGcAUDbmlsAN/aQ+c=", "height": 3314350, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H99cya7v6CCzaG2qqKHQzx7RbN2zk57C6wLgeZWR8n4f Next: GVi6WuHrgeKrY4qHr1Frevp3Z3jbVwSibLHicxWo4DHK Diff:
Old | New | Differences | |
---|---|---|---|
158 | 158 | ||
159 | 159 | let totalFarmingPowerKey = "totalFarmingPower" | |
160 | 160 | ||
161 | - | let | |
161 | + | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
162 | 162 | ||
163 | 163 | func getLevelByAcres (acres) = { | |
164 | - | let acr = (acres / M8_) | |
165 | - | func checker (acc,item) = if ((item > acr)) | |
164 | + | let acr = ((acres + 99999999) / M8_) | |
165 | + | func checker (acc,item) = if ((item >= acr)) | |
166 | 166 | then acc | |
167 | 167 | else (acc + 1) | |
168 | 168 | ||
169 | - | let idx = { | |
170 | - | let $l = levels | |
171 | - | let $s = size($l) | |
172 | - | let $acc0 = 0 | |
173 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
174 | - | then $a | |
175 | - | else checker($a, $l[$i]) | |
169 | + | let $l = levelAcres | |
170 | + | let $s = size($l) | |
171 | + | let $acc0 = 0 | |
172 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
173 | + | then $a | |
174 | + | else checker($a, $l[$i]) | |
176 | 175 | ||
177 | - | ||
178 | - | ||
179 | - | ||
176 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
177 | + | then $a | |
178 | + | else throw("List size exceeds 10") | |
180 | 179 | ||
181 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
182 | - | } | |
183 | - | (idx + 1) | |
180 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
184 | 181 | } | |
185 | 182 | ||
186 | 183 | ||
334 | 331 | ||
335 | 332 | ||
336 | 333 | @Callable(i) | |
334 | + | func buyAcresREADONLY (usdtAmount) = if ((MULT6 > usdtAmount)) | |
335 | + | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
336 | + | else { | |
337 | + | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
338 | + | let wlgToBurn = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
339 | + | $Tuple2(nil, [acresAmount, wlgToBurn]) | |
340 | + | } | |
341 | + | ||
342 | + | ||
343 | + | ||
344 | + | @Callable(i) | |
337 | 345 | func sellAcres () = { | |
338 | 346 | let prologActions = prolog(i) | |
339 | 347 | if ((size(i.payments) != 1)) | |
353 | 361 | } | |
354 | 362 | } | |
355 | 363 | } | |
364 | + | ||
365 | + | ||
366 | + | ||
367 | + | @Callable(i) | |
368 | + | func sellAcresREADONLY (acresAmount) = if ((MULT7 > acresAmount)) | |
369 | + | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
370 | + | else { | |
371 | + | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
372 | + | $Tuple2(nil, usdtAmount) | |
373 | + | } | |
356 | 374 | ||
357 | 375 | ||
358 | 376 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULT7 = 10000000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let USDT2ACRES_MULTIPLIER = 10 | |
13 | 13 | ||
14 | 14 | let chain = take(drop(this.bytes, 1), 1) | |
15 | 15 | ||
16 | 16 | let usdtAssetId = match chain { | |
17 | 17 | case _ => | |
18 | 18 | if ((base58'2W' == $match0)) | |
19 | 19 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
20 | 20 | else if ((base58'2T' == $match0)) | |
21 | 21 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
22 | 22 | else throw("Unknown chain") | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | let defaultRest2AddressStr = match chain { | |
26 | 26 | case _ => | |
27 | 27 | if ((base58'2W' == $match0)) | |
28 | 28 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
29 | 29 | else if ((base58'2T' == $match0)) | |
30 | 30 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
31 | 31 | else throw("Unknown chain") | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | let oldStakingContractStr = match chain { | |
35 | 35 | case _ => | |
36 | 36 | if ((base58'2W' == $match0)) | |
37 | 37 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
38 | 38 | else if ((base58'2T' == $match0)) | |
39 | 39 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
40 | 40 | else throw("Unknown chain") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | let IdxCfgAcres2Dapp = 1 | |
47 | 47 | ||
48 | 48 | let IdxCfgWlgDapp = 2 | |
49 | 49 | ||
50 | 50 | let IdxCfgInvestFundDapp = 5 | |
51 | 51 | ||
52 | 52 | func keyRestCfg () = "%s__restConfig" | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func keyRest2Address () = "%s__rest2Addr" | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
65 | 65 | ||
66 | 66 | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
67 | 67 | ||
68 | 68 | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
69 | 69 | ||
70 | 70 | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
71 | 71 | ||
72 | 72 | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
73 | 73 | ||
74 | 74 | let oldAcresContractKey = "oldAcresContract" | |
75 | 75 | ||
76 | 76 | func keyBlocked () = "contractsBlocked" | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | let acresIssuedAmountKey = "acresIssuedAmount" | |
83 | 83 | ||
84 | 84 | let acresAssetIdKey = "acresAssetId" | |
85 | 85 | ||
86 | 86 | let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet") | |
87 | 87 | ||
88 | 88 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func asInt (v) = match v { | |
98 | 98 | case n: Int => | |
99 | 99 | n | |
100 | 100 | case _ => | |
101 | 101 | throw("fail to cast into Int") | |
102 | 102 | } | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func asTuple5Ints (val) = match val { | |
106 | 106 | case t: (Int, Int, Int, Int, Int) => | |
107 | 107 | t | |
108 | 108 | case _ => | |
109 | 109 | throw("fail to cast into (Int, Int, Int, Int, Int)") | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func asTuple4Ints (val) = match val { | |
114 | 114 | case t: (Int, Int, Int, Int) => | |
115 | 115 | t | |
116 | 116 | case _ => | |
117 | 117 | throw("fail to cast into (Int, Int, Int, Int)") | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func asTuple3Ints (val) = match val { | |
122 | 122 | case t: (Int, Int, Int) => | |
123 | 123 | t | |
124 | 124 | case _ => | |
125 | 125 | throw("fail to cast into (Int, Int, Int)") | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func asTuple2Ints (val) = match val { | |
130 | 130 | case t: (Int, Int) => | |
131 | 131 | t | |
132 | 132 | case _ => | |
133 | 133 | throw("fail to cast into (Int, Int)") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func fixedPoint (val,decimals) = { | |
138 | 138 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
139 | 139 | let lowPart = toString((val % tenPow)) | |
140 | 140 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
141 | 141 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
142 | 142 | } | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | let M8_ = 100000000 | |
146 | 146 | ||
147 | 147 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
148 | 148 | ||
149 | 149 | let zbIssuedAmtKey = "zbill_issuedAmount" | |
150 | 150 | ||
151 | 151 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
158 | 158 | ||
159 | 159 | let totalFarmingPowerKey = "totalFarmingPower" | |
160 | 160 | ||
161 | - | let | |
161 | + | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
162 | 162 | ||
163 | 163 | func getLevelByAcres (acres) = { | |
164 | - | let acr = (acres / M8_) | |
165 | - | func checker (acc,item) = if ((item > acr)) | |
164 | + | let acr = ((acres + 99999999) / M8_) | |
165 | + | func checker (acc,item) = if ((item >= acr)) | |
166 | 166 | then acc | |
167 | 167 | else (acc + 1) | |
168 | 168 | ||
169 | - | let idx = { | |
170 | - | let $l = levels | |
171 | - | let $s = size($l) | |
172 | - | let $acc0 = 0 | |
173 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
174 | - | then $a | |
175 | - | else checker($a, $l[$i]) | |
169 | + | let $l = levelAcres | |
170 | + | let $s = size($l) | |
171 | + | let $acc0 = 0 | |
172 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
173 | + | then $a | |
174 | + | else checker($a, $l[$i]) | |
176 | 175 | ||
177 | - | ||
178 | - | ||
179 | - | ||
176 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
177 | + | then $a | |
178 | + | else throw("List size exceeds 10") | |
180 | 179 | ||
181 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
182 | - | } | |
183 | - | (idx + 1) | |
180 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
184 | 181 | } | |
185 | 182 | ||
186 | 183 | ||
187 | 184 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
188 | 185 | ||
189 | 186 | ||
190 | 187 | func prolog (i) = if (if ((i.originCaller != rest2Contract)) | |
191 | 188 | then valueOrElse(getBoolean(keyBlocked()), false) | |
192 | 189 | else false) | |
193 | 190 | then throw("Contracts are under maintenance") | |
194 | 191 | else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))] | |
195 | 192 | ||
196 | 193 | ||
197 | 194 | func stakeAcresInternal (amt,address) = { | |
198 | 195 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
199 | 196 | if ((wlgResult == wlgResult)) | |
200 | 197 | then { | |
201 | 198 | let now = lastBlock.timestamp | |
202 | 199 | let timeKey = keyAcresStakedTimeByUser(address) | |
203 | 200 | let amountKey = keyAcresStakedAmtByUser(address) | |
204 | 201 | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amt) | |
205 | 202 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
206 | 203 | let userFpKey = keyFarmingPowerByUser(address) | |
207 | 204 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
208 | 205 | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
209 | 206 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
210 | 207 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult) | |
211 | 208 | } | |
212 | 209 | else throw("Strict value is not equal to itself.") | |
213 | 210 | } | |
214 | 211 | ||
215 | 212 | ||
216 | 213 | func getWlgPrice (usdtBalanceCorrection) = { | |
217 | 214 | let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
218 | 215 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
219 | 216 | let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection) | |
220 | 217 | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
221 | 218 | let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal) | |
222 | 219 | fraction(totalFundsUsd, MULT8, issuedAmount) | |
223 | 220 | } | |
224 | 221 | ||
225 | 222 | ||
226 | 223 | @Callable(i) | |
227 | 224 | func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this)) | |
228 | 225 | then throw("Permission denied") | |
229 | 226 | else { | |
230 | 227 | let oldAcrContAddr = addressFromStringValue(oldAcrContract) | |
231 | 228 | [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)] | |
232 | 229 | } | |
233 | 230 | ||
234 | 231 | ||
235 | 232 | ||
236 | 233 | @Callable(i) | |
237 | 234 | func saveInteger (key,amount) = if ((i.caller != this)) | |
238 | 235 | then throw("saveInteger is not public method") | |
239 | 236 | else [IntegerEntry(key, amount)] | |
240 | 237 | ||
241 | 238 | ||
242 | 239 | ||
243 | 240 | @Callable(i) | |
244 | 241 | func setBlocked (isBlocked) = if ((i.caller != this)) | |
245 | 242 | then throw("permission denied") | |
246 | 243 | else [BooleanEntry(keyBlocked(), isBlocked)] | |
247 | 244 | ||
248 | 245 | ||
249 | 246 | ||
250 | 247 | @Callable(i) | |
251 | 248 | func unstakeAcres (amount) = { | |
252 | 249 | let prologActions = prolog(i) | |
253 | 250 | if ((0 >= amount)) | |
254 | 251 | then throw("Amount should be positive") | |
255 | 252 | else { | |
256 | 253 | let address = toString(i.caller) | |
257 | 254 | if ((size(i.payments) != 0)) | |
258 | 255 | then throw("No payments required") | |
259 | 256 | else { | |
260 | 257 | let timeKey = keyAcresStakedTimeByUser(address) | |
261 | 258 | let amountKey = keyAcresStakedAmtByUser(address) | |
262 | 259 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
263 | 260 | if ((amount > oldAcresAmount)) | |
264 | 261 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
265 | 262 | else { | |
266 | 263 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
267 | 264 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
268 | 265 | let newAcresAmount = (oldAcresAmount - amount) | |
269 | 266 | let userFpKey = keyFarmingPowerByUser(address) | |
270 | 267 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
271 | 268 | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
272 | 269 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
273 | 270 | $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult) | |
274 | 271 | } | |
275 | 272 | } | |
276 | 273 | } | |
277 | 274 | } | |
278 | 275 | ||
279 | 276 | ||
280 | 277 | ||
281 | 278 | @Callable(i) | |
282 | 279 | func stakeAcres () = { | |
283 | 280 | let prologActions = prolog(i) | |
284 | 281 | let address = toString(i.caller) | |
285 | 282 | if ((size(i.payments) != 1)) | |
286 | 283 | then throw("exactly 1 payment must be attached") | |
287 | 284 | else { | |
288 | 285 | let pmt = i.payments[0] | |
289 | 286 | let amt = pmt.amount | |
290 | 287 | if (if (!(isDefined(pmt.assetId))) | |
291 | 288 | then true | |
292 | 289 | else (value(pmt.assetId) != acresAssetId)) | |
293 | 290 | then throw("ACRES payments only!") | |
294 | 291 | else { | |
295 | 292 | let $t045094575 = stakeAcresInternal(amt, address) | |
296 | 293 | let actions = $t045094575._1 | |
297 | 294 | let wlgClaimedAmount = $t045094575._2 | |
298 | 295 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
299 | 296 | } | |
300 | 297 | } | |
301 | 298 | } | |
302 | 299 | ||
303 | 300 | ||
304 | 301 | ||
305 | 302 | @Callable(i) | |
306 | 303 | func buyAcres () = { | |
307 | 304 | let prologActions = prolog(i) | |
308 | 305 | if ((size(i.payments) != 1)) | |
309 | 306 | then throw("exactly 1 payment must be attached") | |
310 | 307 | else { | |
311 | 308 | let pmt = i.payments[0] | |
312 | 309 | let usdtAmount = pmt.amount | |
313 | 310 | if (if (!(isDefined(pmt.assetId))) | |
314 | 311 | then true | |
315 | 312 | else (value(pmt.assetId) != usdtAssetId)) | |
316 | 313 | then throw("USDT payments only!") | |
317 | 314 | else if ((MULT6 > usdtAmount)) | |
318 | 315 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
319 | 316 | else { | |
320 | 317 | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
321 | 318 | let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
322 | 319 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
323 | 320 | let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil) | |
324 | 321 | if ((req == req)) | |
325 | 322 | then { | |
326 | 323 | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil)) | |
327 | 324 | $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain) | |
328 | 325 | } | |
329 | 326 | else throw("Strict value is not equal to itself.") | |
330 | 327 | } | |
331 | 328 | } | |
332 | 329 | } | |
333 | 330 | ||
334 | 331 | ||
335 | 332 | ||
336 | 333 | @Callable(i) | |
334 | + | func buyAcresREADONLY (usdtAmount) = if ((MULT6 > usdtAmount)) | |
335 | + | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
336 | + | else { | |
337 | + | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
338 | + | let wlgToBurn = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
339 | + | $Tuple2(nil, [acresAmount, wlgToBurn]) | |
340 | + | } | |
341 | + | ||
342 | + | ||
343 | + | ||
344 | + | @Callable(i) | |
337 | 345 | func sellAcres () = { | |
338 | 346 | let prologActions = prolog(i) | |
339 | 347 | if ((size(i.payments) != 1)) | |
340 | 348 | then throw("exactly 1 payment must be attached") | |
341 | 349 | else { | |
342 | 350 | let pmt = i.payments[0] | |
343 | 351 | let acresAmount = pmt.amount | |
344 | 352 | if (if (!(isDefined(pmt.assetId))) | |
345 | 353 | then true | |
346 | 354 | else (value(pmt.assetId) != acresAssetId)) | |
347 | 355 | then throw("ACRES payments only!") | |
348 | 356 | else if ((MULT7 > acresAmount)) | |
349 | 357 | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
350 | 358 | else { | |
351 | 359 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
352 | 360 | $Tuple2(([ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount) | |
353 | 361 | } | |
354 | 362 | } | |
355 | 363 | } | |
364 | + | ||
365 | + | ||
366 | + | ||
367 | + | @Callable(i) | |
368 | + | func sellAcresREADONLY (acresAmount) = if ((MULT7 > acresAmount)) | |
369 | + | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
370 | + | else { | |
371 | + | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
372 | + | $Tuple2(nil, usdtAmount) | |
373 | + | } | |
356 | 374 | ||
357 | 375 | ||
358 | 376 | ||
359 | 377 | @Callable(i) | |
360 | 378 | func convertOldStakes () = { | |
361 | 379 | let address = toString(i.caller) | |
362 | 380 | if ((size(i.payments) != 0)) | |
363 | 381 | then throw("No payments required") | |
364 | 382 | else { | |
365 | 383 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
366 | 384 | let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0) | |
367 | 385 | let gotAcres0 = if ((amount > 0)) | |
368 | 386 | then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil)) | |
369 | 387 | else $Tuple2(0, 0) | |
370 | 388 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
371 | 389 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
372 | 390 | let landsResult = if (isDefined(landsStr)) | |
373 | 391 | then { | |
374 | 392 | let lands = split_51C(value(landsStr), "_") | |
375 | 393 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
376 | 394 | then throw("landAssetId is required") | |
377 | 395 | else { | |
378 | 396 | let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil)) | |
379 | 397 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
380 | 398 | } | |
381 | 399 | ||
382 | 400 | let rr = { | |
383 | 401 | let $l = lands | |
384 | 402 | let $s = size($l) | |
385 | 403 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
386 | 404 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
387 | 405 | then $a | |
388 | 406 | else oneLand($a, $l[$i]) | |
389 | 407 | ||
390 | 408 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
391 | 409 | then $a | |
392 | 410 | else throw("List size exceeds 100") | |
393 | 411 | ||
394 | 412 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 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) | |
395 | 413 | } | |
396 | 414 | let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil) | |
397 | 415 | if ((finalize == finalize)) | |
398 | 416 | then { | |
399 | 417 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
400 | 418 | if ((req == req)) | |
401 | 419 | then { | |
402 | 420 | let issue = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false) | |
403 | 421 | $Tuple5(rr._1, rr._2, rr._3, rr._4, [issue, ScriptTransfer(i.caller, 1, calculateAssetId(issue))]) | |
404 | 422 | } | |
405 | 423 | else throw("Strict value is not equal to itself.") | |
406 | 424 | } | |
407 | 425 | else throw("Strict value is not equal to itself.") | |
408 | 426 | } | |
409 | 427 | else $Tuple5(0, 0, 0, 0, nil) | |
410 | 428 | let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "") | |
411 | 429 | let duckResult = if ((duckAssetId != "")) | |
412 | 430 | then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil)) | |
413 | 431 | else $Tuple3(0, 0, 0) | |
414 | 432 | let x = stakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address) | |
415 | 433 | $Tuple2((landsResult._5 ++ x._1), x._2) | |
416 | 434 | } | |
417 | 435 | } | |
418 | 436 | ||
419 | 437 | ||
420 | 438 | ||
421 | 439 | @Callable(i) | |
422 | 440 | func unstakeLandsREADONLY (address) = { | |
423 | 441 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
424 | 442 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
425 | 443 | let landsResult = if (isDefined(landsStr)) | |
426 | 444 | then { | |
427 | 445 | let lands = split_51C(value(landsStr), "_") | |
428 | 446 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
429 | 447 | then throw("landAssetId is required") | |
430 | 448 | else { | |
431 | 449 | let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil)) | |
432 | 450 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
433 | 451 | } | |
434 | 452 | ||
435 | 453 | let $l = lands | |
436 | 454 | let $s = size($l) | |
437 | 455 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
438 | 456 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
439 | 457 | then $a | |
440 | 458 | else oneLand($a, $l[$i]) | |
441 | 459 | ||
442 | 460 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
443 | 461 | then $a | |
444 | 462 | else throw("List size exceeds 100") | |
445 | 463 | ||
446 | 464 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 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) | |
447 | 465 | } | |
448 | 466 | else $Tuple4(0, 0, 0, 0) | |
449 | 467 | $Tuple2(nil, landsResult) | |
450 | 468 | } | |
451 | 469 | ||
452 | 470 | ||
453 | 471 | ||
454 | 472 | @Callable(i) | |
455 | 473 | func stakeAcresCallback (addr) = if ((i.caller != addressFromStringValue(oldStakingContractStr))) | |
456 | 474 | then throw("Permission denied") | |
457 | 475 | else stakeAcresInternal(i.payments[0].amount, addr) | |
458 | 476 | ||
459 | 477 | ||
460 | 478 | ||
461 | 479 | @Callable(i) | |
462 | 480 | func simulateStakeAcresREADONLY (address,addedAmount) = { | |
463 | 481 | let amountKey = keyAcresStakedAmtByUser(address) | |
464 | 482 | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + addedAmount) | |
465 | 483 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
466 | 484 | let userFpKey = keyFarmingPowerByUser(address) | |
467 | 485 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
468 | 486 | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
469 | 487 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
470 | 488 | let newTotalFp = ((oldTotalFp - oldFp) + newFp) | |
471 | 489 | $Tuple2(nil, [oldFp, newFp, oldTotalFp, newTotalFp]) | |
472 | 490 | } | |
473 | 491 | ||
474 | 492 |
github/deemru/w8io/169f3d6 52.00 ms ◑