tx · CdR8auZXQXnYMwGAbRf5TZgdv75sot9i6DWd56wQYCtG

3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh:  -0.01500000 Waves

2024.10.01 19:06 [3308009] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves

{ "type": 13, "id": "CdR8auZXQXnYMwGAbRf5TZgdv75sot9i6DWd56wQYCtG", "fee": 1500000, "feeAssetId": null, "timestamp": 1727798805952, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "2GtSkV3PbDttwNHCZvMWnUGRdgzFCmWM3SJQFEac4KML8QPRoLAsZDRohohr2pp6eVsf4cPqNjC7FPdbtvhHHUJi" ], "script": "base64:BgIwCAISBAoCCAgSBAoCCAESAwoBBBIDCgEBEgASABIAEgASAwoBCBIDCgEIEgQKAggBMgADU0VQAgJfXwAFTVVMVDYAwIQ9AAVNVUxUNwCAreIEAAVNVUxUOACAwtcvABVVU0RUMkFDUkVTX01VTFRJUExJRVIACgAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC3VzZHRBc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwASCE2nqyCAM/TtG7yo7ui5O8yYLdC136B5ao1CP5qA//uQMJAAACAQFUBQckbWF0Y2gwASBVsdifcoeC7+XjW42sBatl3ppDoS8WuwXzGreHpfHFGAkAAgECDVVua25vd24gY2hhaW4AFmRlZmF1bHRSZXN0MkFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQRndZdGE4YmlFejMxenBlRmU1REpLOHdFNXRyU3BRVkY4AwkAAAIBAVQFByRtYXRjaDACIzNON1V1WWFyNjI2NFA1OEZCaFZXS1BRQWg0WXVhMmhnbmd2CQACAQINVW5r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mFjawEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgkBEUBleHRyTmF0aXZlKDEwNjIpAQUVb2xkU3Rha2luZ0NvbnRyYWN0U3RyCQACAQIRUGVybWlzc2lvbiBkZW5pZWQJARJzdGFrZUFjcmVzSW50ZXJuYWwCCAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAUEYWRkcgFpARpzaW11bGF0ZVN0YWtlQWNyZXNSRUFET05MWQIHYWRkcmVzcwZhbW91bnQECWFtb3VudEtleQkBF2tleUFjcmVzU3Rha2VkQW10QnlVc2VyAQUHYWRkcmVzcwQObmV3QWNyZXNBbW91bnQJAGQCCQELdmFsdWVPckVsc2UCCQCfCAEFCWFtb3VudEtleQAABQZhbW91bnQECG9sZFRvdGFsCQELdmFsdWVPckVsc2UCCQCfCAEFEmFjcmVzU3Rha2RUb3RhbEtleQAABAl1c2VyRnBLZXkJARVrZXlGYXJtaW5nUG93ZXJCeVVzZXIBBQdhZGRyZXNzBAVvbGRGcAkBC3ZhbHVlT3JFbHNlAgkAnwgBBQl1c2VyRnBLZXkAAAQFbmV3RnAJARZnZXRGYXJtaW5nUG93ZXJCeUFjcmVzAQUObmV3QWNyZXNBbW91bnQECm9sZFRvdGFsRnAJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUUdG90YWxGYXJtaW5nUG93ZXJLZXkAAAQKbmV3VG90YWxGcAkAZAIJAGUCBQpvbGRUb3RhbEZwBQVvbGRGcAUFbmV3RnAJAJQKAgUDbmlsCQDMCAIFBW9sZEZwCQDMCAIFBW5ld0ZwCQDMCAIFCm9sZFRvdGFsRnAJAMwIAgUKbmV3VG90YWxGcAUDbmlsABiT5JY=", "height": 3308009, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AATwCftzGi2MLdfy2M5sgNXtbYs6WUDfaLBUFJzBtUYN Next: H99cya7v6CCzaG2qqKHQzx7RbN2zk57C6wLgeZWR8n4f Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
6+let MULT6 = 1000000
7+
8+let MULT7 = 10000000
9+
610 let MULT8 = 100000000
711
8-let WLG2ACRES_DIVISOR = 200
12+let USDT2ACRES_MULTIPLIER = 10
913
1014 let chain = take(drop(this.bytes, 1), 1)
15+
16+let usdtAssetId = match chain {
17+ case _ =>
18+ if ((base58'2W' == $match0))
19+ then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
20+ else if ((base58'2T' == $match0))
21+ then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
22+ else throw("Unknown chain")
23+}
1124
1225 let defaultRest2AddressStr = match chain {
1326 case _ =>
3447
3548 let IdxCfgWlgDapp = 2
3649
50+let IdxCfgInvestFundDapp = 5
51+
3752 func keyRestCfg () = "%s__restConfig"
3853
3954
5469
5570 let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp)
5671
72+let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp)
73+
5774 let oldAcresContractKey = "oldAcresContract"
5875
5976 func keyBlocked () = "contractsBlocked"
6178
6279 func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
6380
64-
65-let wlgAssetIdKey = "wlg_assetId"
66-
67-let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
6881
6982 let acresIssuedAmountKey = "acresIssuedAmount"
7083
131144
132145 let M8_ = 100000000
133146
147+let wlgIssuedAmtKey = "wlg_issuedAmount"
148+
149+let zbIssuedAmtKey = "zbill_issuedAmount"
150+
134151 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
135152
136153
193210 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult)
194211 }
195212 else throw("Strict value is not equal to itself.")
213+ }
214+
215+
216+func getWlgPrice (usdtBalanceCorrection) = {
217+ let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet")
218+ let wlgUsd = assetBalance(wlgContract, usdtAssetId)
219+ let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection)
220+ let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0))
221+ let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal)
222+ fraction(totalFundsUsd, MULT8, issuedAmount)
196223 }
197224
198225
265292 else (value(pmt.assetId) != acresAssetId))
266293 then throw("ACRES payments only!")
267294 else {
268- let $t038353901 = stakeAcresInternal(amt, address)
269- let actions = $t038353901._1
270- let wlgClaimedAmount = $t038353901._2
295+ let $t045094575 = stakeAcresInternal(amt, address)
296+ let actions = $t045094575._1
297+ let wlgClaimedAmount = $t045094575._2
271298 $Tuple2((actions ++ prologActions), wlgClaimedAmount)
272299 }
273300 }
278305 @Callable(i)
279306 func buyAcres () = {
280307 let prologActions = prolog(i)
281- let address = toString(i.caller)
282308 if ((size(i.payments) != 1))
283309 then throw("exactly 1 payment must be attached")
284310 else {
285311 let pmt = i.payments[0]
286- let amt = pmt.amount
312+ let usdtAmount = pmt.amount
287313 if (if (!(isDefined(pmt.assetId)))
288314 then true
289- else (value(pmt.assetId) != wlgAssetId))
290- then throw("WLGOLD payments only!")
291- else if ((MULT8 > amt))
292- then throw((("Min payment should be " + fixedPoint(MULT8, 8)) + " WLGOLD"))
315+ else (value(pmt.assetId) != usdtAssetId))
316+ then throw("USDT payments only!")
317+ else if ((MULT6 > usdtAmount))
318+ then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT"))
293319 else {
294- let acresAmount = (amt / WLG2ACRES_DIVISOR)
320+ let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER)
321+ let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount))
295322 let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey))
296323 let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil)
297324 if ((req == req))
298325 then {
299- let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", nil, [AttachedPayment(wlgAssetId, amt)]))
326+ let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil))
300327 $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain)
301328 }
302329 else throw("Strict value is not equal to itself.")
330+ }
331+ }
332+ }
333+
334+
335+
336+@Callable(i)
337+func sellAcres () = {
338+ let prologActions = prolog(i)
339+ if ((size(i.payments) != 1))
340+ then throw("exactly 1 payment must be attached")
341+ else {
342+ let pmt = i.payments[0]
343+ let acresAmount = pmt.amount
344+ if (if (!(isDefined(pmt.assetId)))
345+ then true
346+ else (value(pmt.assetId) != acresAssetId))
347+ then throw("ACRES payments only!")
348+ else if ((MULT7 > acresAmount))
349+ then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES"))
350+ else {
351+ let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2)
352+ $Tuple2(([ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount)
303353 }
304354 }
305355 }
407457 else stakeAcresInternal(i.payments[0].amount, addr)
408458
409459
460+
461+@Callable(i)
462+func simulateStakeAcresREADONLY (address,amount) = {
463+ let amountKey = keyAcresStakedAmtByUser(address)
464+ let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amount)
465+ let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
466+ let userFpKey = keyFarmingPowerByUser(address)
467+ let oldFp = valueOrElse(getInteger(userFpKey), 0)
468+ let newFp = getFarmingPowerByAcres(newAcresAmount)
469+ let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
470+ let newTotalFp = ((oldTotalFp - oldFp) + newFp)
471+ $Tuple2(nil, [oldFp, newFp, oldTotalFp, newTotalFp])
472+ }
473+
474+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
6+let MULT6 = 1000000
7+
8+let MULT7 = 10000000
9+
610 let MULT8 = 100000000
711
8-let WLG2ACRES_DIVISOR = 200
12+let USDT2ACRES_MULTIPLIER = 10
913
1014 let chain = take(drop(this.bytes, 1), 1)
15+
16+let usdtAssetId = match chain {
17+ case _ =>
18+ if ((base58'2W' == $match0))
19+ then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
20+ else if ((base58'2T' == $match0))
21+ then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
22+ else throw("Unknown chain")
23+}
1124
1225 let defaultRest2AddressStr = match chain {
1326 case _ =>
1427 if ((base58'2W' == $match0))
1528 then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8"
1629 else if ((base58'2T' == $match0))
1730 then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv"
1831 else throw("Unknown chain")
1932 }
2033
2134 let oldStakingContractStr = match chain {
2235 case _ =>
2336 if ((base58'2W' == $match0))
2437 then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1"
2538 else if ((base58'2T' == $match0))
2639 then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm"
2740 else throw("Unknown chain")
2841 }
2942
3043 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
3144
3245
3346 let IdxCfgAcres2Dapp = 1
3447
3548 let IdxCfgWlgDapp = 2
3649
50+let IdxCfgInvestFundDapp = 5
51+
3752 func keyRestCfg () = "%s__restConfig"
3853
3954
4055 func keyRest2Address () = "%s__rest2Addr"
4156
4257
4358 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
4459
4560
4661 func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
4762
4863
4964 let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr))
5065
5166 let rest2Cfg = readRestCfgOrFail(rest2Contract)
5267
5368 let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp)
5469
5570 let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp)
5671
72+let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp)
73+
5774 let oldAcresContractKey = "oldAcresContract"
5875
5976 func keyBlocked () = "contractsBlocked"
6077
6178
6279 func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
6380
64-
65-let wlgAssetIdKey = "wlg_assetId"
66-
67-let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
6881
6982 let acresIssuedAmountKey = "acresIssuedAmount"
7083
7184 let acresAssetIdKey = "acresAssetId"
7285
7386 let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet")
7487
7588 func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr)
7689
7790
7891 func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr)
7992
8093
8194 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
8295
8396
8497 func asInt (v) = match v {
8598 case n: Int =>
8699 n
87100 case _ =>
88101 throw("fail to cast into Int")
89102 }
90103
91104
92105 func asTuple5Ints (val) = match val {
93106 case t: (Int, Int, Int, Int, Int) =>
94107 t
95108 case _ =>
96109 throw("fail to cast into (Int, Int, Int, Int, Int)")
97110 }
98111
99112
100113 func asTuple4Ints (val) = match val {
101114 case t: (Int, Int, Int, Int) =>
102115 t
103116 case _ =>
104117 throw("fail to cast into (Int, Int, Int, Int)")
105118 }
106119
107120
108121 func asTuple3Ints (val) = match val {
109122 case t: (Int, Int, Int) =>
110123 t
111124 case _ =>
112125 throw("fail to cast into (Int, Int, Int)")
113126 }
114127
115128
116129 func asTuple2Ints (val) = match val {
117130 case t: (Int, Int) =>
118131 t
119132 case _ =>
120133 throw("fail to cast into (Int, Int)")
121134 }
122135
123136
124137 func fixedPoint (val,decimals) = {
125138 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
126139 let lowPart = toString((val % tenPow))
127140 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
128141 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
129142 }
130143
131144
132145 let M8_ = 100000000
133146
147+let wlgIssuedAmtKey = "wlg_issuedAmount"
148+
149+let zbIssuedAmtKey = "zbill_issuedAmount"
150+
134151 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
135152
136153
137154 func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr)
138155
139156
140157 let acresStakdTotalKey = "acresStakedAmountTotal"
141158
142159 let totalFarmingPowerKey = "totalFarmingPower"
143160
144161 let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000]
145162
146163 func getLevelByAcres (acres) = {
147164 let acr = (acres / M8_)
148165 func checker (acc,item) = if ((item > acr))
149166 then acc
150167 else (acc + 1)
151168
152169 let idx = {
153170 let $l = levels
154171 let $s = size($l)
155172 let $acc0 = 0
156173 func $f0_1 ($a,$i) = if (($i >= $s))
157174 then $a
158175 else checker($a, $l[$i])
159176
160177 func $f0_2 ($a,$i) = if (($i >= $s))
161178 then $a
162179 else throw("List size exceeds 10")
163180
164181 $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)
165182 }
166183 (idx + 1)
167184 }
168185
169186
170187 func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4))
171188
172189
173190 func prolog (i) = if (if ((i.originCaller != rest2Contract))
174191 then valueOrElse(getBoolean(keyBlocked()), false)
175192 else false)
176193 then throw("Contracts are under maintenance")
177194 else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))]
178195
179196
180197 func stakeAcresInternal (amt,address) = {
181198 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
182199 if ((wlgResult == wlgResult))
183200 then {
184201 let now = lastBlock.timestamp
185202 let timeKey = keyAcresStakedTimeByUser(address)
186203 let amountKey = keyAcresStakedAmtByUser(address)
187204 let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amt)
188205 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
189206 let userFpKey = keyFarmingPowerByUser(address)
190207 let oldFp = valueOrElse(getInteger(userFpKey), 0)
191208 let newFp = getFarmingPowerByAcres(newAcresAmount)
192209 let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
193210 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult)
194211 }
195212 else throw("Strict value is not equal to itself.")
213+ }
214+
215+
216+func getWlgPrice (usdtBalanceCorrection) = {
217+ let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet")
218+ let wlgUsd = assetBalance(wlgContract, usdtAssetId)
219+ let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection)
220+ let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0))
221+ let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal)
222+ fraction(totalFundsUsd, MULT8, issuedAmount)
196223 }
197224
198225
199226 @Callable(i)
200227 func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this))
201228 then throw("Permission denied")
202229 else {
203230 let oldAcrContAddr = addressFromStringValue(oldAcrContract)
204231 [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)]
205232 }
206233
207234
208235
209236 @Callable(i)
210237 func saveInteger (key,amount) = if ((i.caller != this))
211238 then throw("saveInteger is not public method")
212239 else [IntegerEntry(key, amount)]
213240
214241
215242
216243 @Callable(i)
217244 func setBlocked (isBlocked) = if ((i.caller != this))
218245 then throw("permission denied")
219246 else [BooleanEntry(keyBlocked(), isBlocked)]
220247
221248
222249
223250 @Callable(i)
224251 func unstakeAcres (amount) = {
225252 let prologActions = prolog(i)
226253 if ((0 >= amount))
227254 then throw("Amount should be positive")
228255 else {
229256 let address = toString(i.caller)
230257 if ((size(i.payments) != 0))
231258 then throw("No payments required")
232259 else {
233260 let timeKey = keyAcresStakedTimeByUser(address)
234261 let amountKey = keyAcresStakedAmtByUser(address)
235262 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
236263 if ((amount > oldAcresAmount))
237264 then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8)))
238265 else {
239266 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
240267 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
241268 let newAcresAmount = (oldAcresAmount - amount)
242269 let userFpKey = keyFarmingPowerByUser(address)
243270 let oldFp = valueOrElse(getInteger(userFpKey), 0)
244271 let newFp = getFarmingPowerByAcres(newAcresAmount)
245272 let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
246273 $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)
247274 }
248275 }
249276 }
250277 }
251278
252279
253280
254281 @Callable(i)
255282 func stakeAcres () = {
256283 let prologActions = prolog(i)
257284 let address = toString(i.caller)
258285 if ((size(i.payments) != 1))
259286 then throw("exactly 1 payment must be attached")
260287 else {
261288 let pmt = i.payments[0]
262289 let amt = pmt.amount
263290 if (if (!(isDefined(pmt.assetId)))
264291 then true
265292 else (value(pmt.assetId) != acresAssetId))
266293 then throw("ACRES payments only!")
267294 else {
268- let $t038353901 = stakeAcresInternal(amt, address)
269- let actions = $t038353901._1
270- let wlgClaimedAmount = $t038353901._2
295+ let $t045094575 = stakeAcresInternal(amt, address)
296+ let actions = $t045094575._1
297+ let wlgClaimedAmount = $t045094575._2
271298 $Tuple2((actions ++ prologActions), wlgClaimedAmount)
272299 }
273300 }
274301 }
275302
276303
277304
278305 @Callable(i)
279306 func buyAcres () = {
280307 let prologActions = prolog(i)
281- let address = toString(i.caller)
282308 if ((size(i.payments) != 1))
283309 then throw("exactly 1 payment must be attached")
284310 else {
285311 let pmt = i.payments[0]
286- let amt = pmt.amount
312+ let usdtAmount = pmt.amount
287313 if (if (!(isDefined(pmt.assetId)))
288314 then true
289- else (value(pmt.assetId) != wlgAssetId))
290- then throw("WLGOLD payments only!")
291- else if ((MULT8 > amt))
292- then throw((("Min payment should be " + fixedPoint(MULT8, 8)) + " WLGOLD"))
315+ else (value(pmt.assetId) != usdtAssetId))
316+ then throw("USDT payments only!")
317+ else if ((MULT6 > usdtAmount))
318+ then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT"))
293319 else {
294- let acresAmount = (amt / WLG2ACRES_DIVISOR)
320+ let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER)
321+ let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount))
295322 let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey))
296323 let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil)
297324 if ((req == req))
298325 then {
299- let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", nil, [AttachedPayment(wlgAssetId, amt)]))
326+ let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil))
300327 $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain)
301328 }
302329 else throw("Strict value is not equal to itself.")
330+ }
331+ }
332+ }
333+
334+
335+
336+@Callable(i)
337+func sellAcres () = {
338+ let prologActions = prolog(i)
339+ if ((size(i.payments) != 1))
340+ then throw("exactly 1 payment must be attached")
341+ else {
342+ let pmt = i.payments[0]
343+ let acresAmount = pmt.amount
344+ if (if (!(isDefined(pmt.assetId)))
345+ then true
346+ else (value(pmt.assetId) != acresAssetId))
347+ then throw("ACRES payments only!")
348+ else if ((MULT7 > acresAmount))
349+ then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES"))
350+ else {
351+ let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2)
352+ $Tuple2(([ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount)
303353 }
304354 }
305355 }
306356
307357
308358
309359 @Callable(i)
310360 func convertOldStakes () = {
311361 let address = toString(i.caller)
312362 if ((size(i.payments) != 0))
313363 then throw("No payments required")
314364 else {
315365 let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey))
316366 let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0)
317367 let gotAcres0 = if ((amount > 0))
318368 then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil))
319369 else $Tuple2(0, 0)
320370 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
321371 let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address))
322372 let landsResult = if (isDefined(landsStr))
323373 then {
324374 let lands = split_51C(value(landsStr), "_")
325375 func oneLand (acc,landAssetId) = if ((landAssetId == ""))
326376 then throw("landAssetId is required")
327377 else {
328378 let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil))
329379 $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4))
330380 }
331381
332382 let rr = {
333383 let $l = lands
334384 let $s = size($l)
335385 let $acc0 = $Tuple4(0, 0, 0, 0)
336386 func $f0_1 ($a,$i) = if (($i >= $s))
337387 then $a
338388 else oneLand($a, $l[$i])
339389
340390 func $f0_2 ($a,$i) = if (($i >= $s))
341391 then $a
342392 else throw("List size exceeds 100")
343393
344394 $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)
345395 }
346396 let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil)
347397 if ((finalize == finalize))
348398 then {
349399 let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil)
350400 if ((req == req))
351401 then {
352402 let issue = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false)
353403 $Tuple5(rr._1, rr._2, rr._3, rr._4, [issue, ScriptTransfer(i.caller, 1, calculateAssetId(issue))])
354404 }
355405 else throw("Strict value is not equal to itself.")
356406 }
357407 else throw("Strict value is not equal to itself.")
358408 }
359409 else $Tuple5(0, 0, 0, 0, nil)
360410 let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "")
361411 let duckResult = if ((duckAssetId != ""))
362412 then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil))
363413 else $Tuple3(0, 0, 0)
364414 let x = stakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address)
365415 $Tuple2((landsResult._5 ++ x._1), x._2)
366416 }
367417 }
368418
369419
370420
371421 @Callable(i)
372422 func unstakeLandsREADONLY (address) = {
373423 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
374424 let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address))
375425 let landsResult = if (isDefined(landsStr))
376426 then {
377427 let lands = split_51C(value(landsStr), "_")
378428 func oneLand (acc,landAssetId) = if ((landAssetId == ""))
379429 then throw("landAssetId is required")
380430 else {
381431 let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil))
382432 $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4))
383433 }
384434
385435 let $l = lands
386436 let $s = size($l)
387437 let $acc0 = $Tuple4(0, 0, 0, 0)
388438 func $f0_1 ($a,$i) = if (($i >= $s))
389439 then $a
390440 else oneLand($a, $l[$i])
391441
392442 func $f0_2 ($a,$i) = if (($i >= $s))
393443 then $a
394444 else throw("List size exceeds 100")
395445
396446 $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)
397447 }
398448 else $Tuple4(0, 0, 0, 0)
399449 $Tuple2(nil, landsResult)
400450 }
401451
402452
403453
404454 @Callable(i)
405455 func stakeAcresCallback (addr) = if ((i.caller != addressFromStringValue(oldStakingContractStr)))
406456 then throw("Permission denied")
407457 else stakeAcresInternal(i.payments[0].amount, addr)
408458
409459
460+
461+@Callable(i)
462+func simulateStakeAcresREADONLY (address,amount) = {
463+ let amountKey = keyAcresStakedAmtByUser(address)
464+ let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amount)
465+ let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
466+ let userFpKey = keyFarmingPowerByUser(address)
467+ let oldFp = valueOrElse(getInteger(userFpKey), 0)
468+ let newFp = getFarmingPowerByAcres(newAcresAmount)
469+ let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
470+ let newTotalFp = ((oldTotalFp - oldFp) + newFp)
471+ $Tuple2(nil, [oldFp, newFp, oldTotalFp, newTotalFp])
472+ }
473+
474+

github/deemru/w8io/026f985 
74.89 ms