tx · 3RwkJJubCdpi2TwfMJ7Csn4TrgUY6UaRmqJo22G2F4hF

3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg:  -0.00800000 Waves

2023.09.22 21:28 [2766949] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves

{ "type": 13, "id": "3RwkJJubCdpi2TwfMJ7Csn4TrgUY6UaRmqJo22G2F4hF", "fee": 800000, "feeAssetId": null, "timestamp": 1695407322459, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "3L7LcJoRJGBp3EwLL5DfekeN5Uex3p1RDvX9XbXe5zW5s1cxCjFhTS4dx3Ngdb6m9bkjsiB5s3zP3bumNY7F2ArZ" ], "script": "base64:BgIYCAISBAoCCAESABIDCgEBEgASAwoBARIAKQAITUlMTElPTjYAgIDpg7HeFgAJREFZTUlMTElTAIC4mSkBGmtleUFjcmVzU3Rha2VkQW1vdW50QnlVc2VyAQRhZGRyCQCsAgICGGFjcmVzU3Rha2VkQW1vdW50QnlVc2VyXwUEYWRkcgATYWNyZXNTdGFrZWRUb3RhbEtleQIWYWNyZXNTdGFrZWRBbW91bnRUb3RhbAAKeHBOZXdTTGFuZADAlrECAA9EQUlMWVJFU0JZUElFQ0UAgPjSAQAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2R0QXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEghNp6sggDP07Ru8qO7ouTvMmC3Qtd+geWqNQj+agP/7kDCQAAAgEBVAUHJG1hdGNoMAEgVbHYn3KHgu/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABVkZWZhdWx0Um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FkZHJlc3MECWFtb3VudEtleQkBGmtleUFjcmVzU3Rha2VkQW1vdW50QnlVc2VyAQUHYWRkcmVzcwQLYWNyZXNBbW91bnQJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUJYW1vdW50S2V5AAAECXdsZ1Jlc3VsdAkA/AcEBQt3bGdDb250cmFjdAISb25TdGFrZVVuc3Rha2VMYW5kCQDMCAIFB2FkZHJlc3MFA25pbAUDbmlsBAxjbGFpbWVkQWNyZXMJAQ1jbGFpbUludGVybmFsAwUHYWRkcmVzcwULYWNyZXNBbW91bnQJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUHdGltZUtleQAACQCUCgIJAMwIAgkBDEludGVnZXJFbnRyeQIFB3RpbWVLZXkIBQlsYXN0QmxvY2sJdGltZXN0YW1wCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUMY2xhaW1lZEFjcmVzBQxhY3Jlc0Fzc2V0SWQFA25pbAkAlAoCBQxwcm9sb2dSZXN1bHQFCXdsZ1Jlc3VsdAAJQEJ5", "height": 2766949, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AABqeUNNJUiw19hcKfAaXujgohBWq8wBi9LTRd7hXkvw Next: HZDMMmvAm4YJE5LhT21TD9pFuyZEcQWgFRnbd88xsLws Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let MILLION6 = 100000000000000
5+
6+let DAYMILLIS = 86400000
57
68 func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr)
79
1113 let xpNewSLand = 5000000
1214
1315 let DAILYRESBYPIECE = 3456000
14-
15-let DAYMILLIS = 86400000
1616
1717 let USDT2ACRES_MULTIPLIER = 10
1818
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let MILLION6 = 100000000000000
5+
6+let DAYMILLIS = 86400000
57
68 func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr)
79
810
911 let acresStakedTotalKey = "acresStakedAmountTotal"
1012
1113 let xpNewSLand = 5000000
1214
1315 let DAILYRESBYPIECE = 3456000
14-
15-let DAYMILLIS = 86400000
1616
1717 let USDT2ACRES_MULTIPLIER = 10
1818
1919 let chain = take(drop(this.bytes, 1), 1)
2020
2121 let usdtAssetId = match chain {
2222 case _ =>
2323 if ((base58'2W' == $match0))
2424 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
2525 else if ((base58'2T' == $match0))
2626 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
2727 else throw("Unknown chain")
2828 }
2929
3030 let defaultRestAddressStr = match chain {
3131 case _ =>
3232 if ((base58'2W' == $match0))
3333 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
3434 else if ((base58'2T' == $match0))
3535 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
3636 else throw("Unknown chain")
3737 }
3838
3939 let SEP = "__"
4040
4141 let MULT6 = 1000000
4242
4343 let MULT8 = 100000000
4444
4545 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
4646
4747
4848 let IdxCfgStakingDapp = 1
4949
5050 let IdxCfgEconomyDapp = 2
5151
5252 let IdxCfgWlgDapp = 4
5353
5454 let IdxCfgAcresDapp = 8
5555
5656 func keyRestCfg () = "%s__restConfig"
5757
5858
5959 func keyRestAddress () = "%s__restAddr"
6060
6161
6262 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
6363
6464
6565 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
6666
6767
6868 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
6969
7070 let restCfg = readRestCfgOrFail(restContract)
7171
7272 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
7373
7474 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
7575
7676 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
7777
7878 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
7979
8080 let acresIssuedAmountKey = "acresIssuedAmount"
8181
8282 let acresAssetIdKey = "acresAssetId"
8383
8484 let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet")
8585
8686 func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr)
8787
8888
8989 let IdxEffTotal = 0
9090
9191 func keyResProportions () = "resTypesProportions"
9292
9393
9494 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
9595
9696
9797 func asInt (v) = match v {
9898 case n: Int =>
9999 n
100100 case _ =>
101101 throw("fail to cast into Int")
102102 }
103103
104104
105105 func getVotingPower (userAddrStrOrEmpty) = {
106106 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
107107 func adder (acc,item) = (acc + parseIntValue(item))
108108
109109 let totalPower = {
110110 let $l = props
111111 let $s = size($l)
112112 let $acc0 = 0
113113 func $f0_1 ($a,$i) = if (($i >= $s))
114114 then $a
115115 else adder($a, $l[$i])
116116
117117 func $f0_2 ($a,$i) = if (($i >= $s))
118118 then $a
119119 else throw("List size exceeds 6")
120120
121121 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
122122 }
123123 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
124124 [totalPower, usersPower]
125125 }
126126
127127
128128 func fixedPoint (val,decimals) = {
129129 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
130130 let lowPart = toString((val % tenPow))
131131 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
132132 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
133133 }
134134
135135
136136 func asTwoIntsTuple (val) = match val {
137137 case t2: (Int, Int) =>
138138 t2
139139 case _ =>
140140 throw("fail to cast into (Int, Int)")
141141 }
142142
143143
144144 func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil))
145145
146146
147147 func claimInternal (addr,acresAmount,lastClaimTime) = {
148148 let deltaTime = (lastBlock.timestamp - lastClaimTime)
149149 if ((0 > deltaTime))
150150 then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp)))
151151 else {
152152 let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8))
153153 let gotUsdt = asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1
154154 (gotUsdt * USDT2ACRES_MULTIPLIER)
155155 }
156156 }
157157
158158
159159 @Callable(i)
160160 func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this))
161161 then throw("Permission denied")
162162 else if (isDefined(getBinary(acresAssetIdKey)))
163163 then throw("Already initialized")
164164 else {
165165 let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces)
166166 let issuedAmount = (MILLION6 - (nftAcres * MULT8))
167167 let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0)
168168 let assetId = calculateAssetId(issue)
169169 [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)]
170170 }
171171
172172
173173
174174 @Callable(i)
175175 func stakeAcres () = {
176176 let prologResult = prolog()
177177 let address = toString(i.caller)
178178 if ((size(i.payments) != 1))
179179 then throw("exactly 1 payment must be attached")
180180 else {
181181 let pmt = i.payments[0]
182182 let amt = pmt.amount
183183 if (if (!(isDefined(pmt.assetId)))
184184 then true
185185 else (value(pmt.assetId) != acresAssetId))
186186 then throw("ACRES payments only!")
187187 else {
188188 let timeKey = keyAcresStakedTimeByUser(address)
189189 let amountKey = keyAcresStakedAmountByUser(address)
190190 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
191191 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
192192 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
193193 let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
194194 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount + amt)), IntegerEntry(acresStakedTotalKey, (oldTotal + amt)), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult))
195195 }
196196 }
197197 }
198198
199199
200200
201201 @Callable(i)
202202 func unstakeAcres (amount) = {
203203 let prologResult = prolog()
204204 let address = toString(i.caller)
205205 if ((size(i.payments) != 0))
206206 then throw("No payments required")
207207 else {
208208 let timeKey = keyAcresStakedTimeByUser(address)
209209 let amountKey = keyAcresStakedAmountByUser(address)
210210 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
211211 if ((amount > oldAcresAmount))
212212 then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8)))
213213 else {
214214 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
215215 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
216216 let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
217217 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult))
218218 }
219219 }
220220 }
221221
222222
223223
224224 @Callable(i)
225225 func buyAcres () = {
226226 let prologResult = prolog()
227227 let address = toString(i.caller)
228228 if ((size(i.payments) != 1))
229229 then throw("exactly 1 payment must be attached")
230230 else {
231231 let pmt = i.payments[0]
232232 let amt = pmt.amount
233233 if (if (!(isDefined(pmt.assetId)))
234234 then true
235235 else (value(pmt.assetId) != usdtAssetId))
236236 then throw("USDT payments only!")
237237 else if ((MULT6 > amt))
238238 then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT"))
239239 else {
240240 let acresAmount = (amt * USDT2ACRES_MULTIPLIER)
241241 let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil))
242242 $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult))
243243 }
244244 }
245245 }
246246
247247
248248
249249 @Callable(i)
250250 func burnAcres (amount) = if ((i.caller != stakingContract))
251251 then throw("Permission denied")
252252 else $Tuple2([Burn(acresAssetId, amount)], amount)
253253
254254
255255
256256 @Callable(i)
257257 func claimAcres () = {
258258 let prologResult = prolog()
259259 let address = toString(i.caller)
260260 if ((size(i.payments) != 0))
261261 then throw("No payments required")
262262 else {
263263 let timeKey = keyAcresStakedTimeByUser(address)
264264 let amountKey = keyAcresStakedAmountByUser(address)
265265 let acresAmount = valueOrElse(getInteger(amountKey), 0)
266266 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
267267 let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0))
268268 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult))
269269 }
270270 }
271271
272272

github/deemru/w8io/026f985 
34.62 ms