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/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABVkZWZhdWx0UmV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kZHJlc3MECWFtb3VudEtleQkBGmtleUFjcmVzU3Rha2VkQW1vdW50QnlVc2VyAQUHYWRkcmVzcwQLYWNyZXNBbW91bnQJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUJYW1vdW50S2V5AAAECXdsZ1Jlc3VsdAkA/AcEBQt3bGdDb250cmFjdAISb25TdGFrZVVuc3Rha2VMYW5kCQDMCAIFB2FkZHJlc3MFA25pbAUDbmlsBAxjbGFpbWVkQWNyZXMJAQ1jbGFpbUludGVybmFsAwUHYWRkcmVzcwULYWNyZXNBbW91bnQJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUHdGltZUtleQAACQCUCgIJAMwIAgkBDEludGVnZXJFbnRyeQIFB3RpbWVLZXkIBQlsYXN0QmxvY2sJdGltZXN0YW1wCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUMY2xhaW1lZEFjcmVzBQxhY3Jlc0Fzc2V0SWQFA25pbAkAlAoCBQxwcm9sb2dSZXN1bHQFCXdsZ1Jlc3VsdAAJQEJ5", "height": 2766949, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AABqeUNNJUiw19hcKfAaXujgohBWq8wBi9LTRd7hXkvw Next: HZDMMmvAm4YJE5LhT21TD9pFuyZEcQWgFRnbd88xsLws Diff:
Old | New | Differences | |
---|---|---|---|
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MILLION6 = 100000000000000 | |
5 | + | ||
6 | + | let DAYMILLIS = 86400000 | |
5 | 7 | ||
6 | 8 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
7 | 9 | ||
11 | 13 | let xpNewSLand = 5000000 | |
12 | 14 | ||
13 | 15 | let DAILYRESBYPIECE = 3456000 | |
14 | - | ||
15 | - | let DAYMILLIS = 86400000 | |
16 | 16 | ||
17 | 17 | let USDT2ACRES_MULTIPLIER = 10 | |
18 | 18 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MILLION6 = 100000000000000 | |
5 | + | ||
6 | + | let DAYMILLIS = 86400000 | |
5 | 7 | ||
6 | 8 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
7 | 9 | ||
8 | 10 | ||
9 | 11 | let acresStakedTotalKey = "acresStakedAmountTotal" | |
10 | 12 | ||
11 | 13 | let xpNewSLand = 5000000 | |
12 | 14 | ||
13 | 15 | let DAILYRESBYPIECE = 3456000 | |
14 | - | ||
15 | - | let DAYMILLIS = 86400000 | |
16 | 16 | ||
17 | 17 | let USDT2ACRES_MULTIPLIER = 10 | |
18 | 18 | ||
19 | 19 | let chain = take(drop(this.bytes, 1), 1) | |
20 | 20 | ||
21 | 21 | let usdtAssetId = match chain { | |
22 | 22 | case _ => | |
23 | 23 | if ((base58'2W' == $match0)) | |
24 | 24 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
25 | 25 | else if ((base58'2T' == $match0)) | |
26 | 26 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
27 | 27 | else throw("Unknown chain") | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | let defaultRestAddressStr = match chain { | |
31 | 31 | case _ => | |
32 | 32 | if ((base58'2W' == $match0)) | |
33 | 33 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
34 | 34 | else if ((base58'2T' == $match0)) | |
35 | 35 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
36 | 36 | else throw("Unknown chain") | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | let SEP = "__" | |
40 | 40 | ||
41 | 41 | let MULT6 = 1000000 | |
42 | 42 | ||
43 | 43 | let MULT8 = 100000000 | |
44 | 44 | ||
45 | 45 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | let IdxCfgStakingDapp = 1 | |
49 | 49 | ||
50 | 50 | let IdxCfgEconomyDapp = 2 | |
51 | 51 | ||
52 | 52 | let IdxCfgWlgDapp = 4 | |
53 | 53 | ||
54 | 54 | let IdxCfgAcresDapp = 8 | |
55 | 55 | ||
56 | 56 | func keyRestCfg () = "%s__restConfig" | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func keyRestAddress () = "%s__restAddr" | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
69 | 69 | ||
70 | 70 | let restCfg = readRestCfgOrFail(restContract) | |
71 | 71 | ||
72 | 72 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
73 | 73 | ||
74 | 74 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
75 | 75 | ||
76 | 76 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
77 | 77 | ||
78 | 78 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
79 | 79 | ||
80 | 80 | let acresIssuedAmountKey = "acresIssuedAmount" | |
81 | 81 | ||
82 | 82 | let acresAssetIdKey = "acresAssetId" | |
83 | 83 | ||
84 | 84 | let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet") | |
85 | 85 | ||
86 | 86 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | let IdxEffTotal = 0 | |
90 | 90 | ||
91 | 91 | func keyResProportions () = "resTypesProportions" | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + 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 getVotingPower (userAddrStrOrEmpty) = { | |
106 | 106 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
107 | 107 | func adder (acc,item) = (acc + parseIntValue(item)) | |
108 | 108 | ||
109 | 109 | let totalPower = { | |
110 | 110 | let $l = props | |
111 | 111 | let $s = size($l) | |
112 | 112 | let $acc0 = 0 | |
113 | 113 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
114 | 114 | then $a | |
115 | 115 | else adder($a, $l[$i]) | |
116 | 116 | ||
117 | 117 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
118 | 118 | then $a | |
119 | 119 | else throw("List size exceeds 6") | |
120 | 120 | ||
121 | 121 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
122 | 122 | } | |
123 | 123 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
124 | 124 | [totalPower, usersPower] | |
125 | 125 | } | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func fixedPoint (val,decimals) = { | |
129 | 129 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
130 | 130 | let lowPart = toString((val % tenPow)) | |
131 | 131 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
132 | 132 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func asTwoIntsTuple (val) = match val { | |
137 | 137 | case t2: (Int, Int) => | |
138 | 138 | t2 | |
139 | 139 | case _ => | |
140 | 140 | throw("fail to cast into (Int, Int)") | |
141 | 141 | } | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil)) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func claimInternal (addr,acresAmount,lastClaimTime) = { | |
148 | 148 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
149 | 149 | if ((0 > deltaTime)) | |
150 | 150 | then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
151 | 151 | else { | |
152 | 152 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
153 | 153 | let gotUsdt = asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1 | |
154 | 154 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
155 | 155 | } | |
156 | 156 | } | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | @Callable(i) | |
160 | 160 | func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this)) | |
161 | 161 | then throw("Permission denied") | |
162 | 162 | else if (isDefined(getBinary(acresAssetIdKey))) | |
163 | 163 | then throw("Already initialized") | |
164 | 164 | else { | |
165 | 165 | let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces) | |
166 | 166 | let issuedAmount = (MILLION6 - (nftAcres * MULT8)) | |
167 | 167 | let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0) | |
168 | 168 | let assetId = calculateAssetId(issue) | |
169 | 169 | [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)] | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(i) | |
175 | 175 | func stakeAcres () = { | |
176 | 176 | let prologResult = prolog() | |
177 | 177 | let address = toString(i.caller) | |
178 | 178 | if ((size(i.payments) != 1)) | |
179 | 179 | then throw("exactly 1 payment must be attached") | |
180 | 180 | else { | |
181 | 181 | let pmt = i.payments[0] | |
182 | 182 | let amt = pmt.amount | |
183 | 183 | if (if (!(isDefined(pmt.assetId))) | |
184 | 184 | then true | |
185 | 185 | else (value(pmt.assetId) != acresAssetId)) | |
186 | 186 | then throw("ACRES payments only!") | |
187 | 187 | else { | |
188 | 188 | let timeKey = keyAcresStakedTimeByUser(address) | |
189 | 189 | let amountKey = keyAcresStakedAmountByUser(address) | |
190 | 190 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
191 | 191 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
192 | 192 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
193 | 193 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
194 | 194 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount + amt)), IntegerEntry(acresStakedTotalKey, (oldTotal + amt)), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
195 | 195 | } | |
196 | 196 | } | |
197 | 197 | } | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | ||
201 | 201 | @Callable(i) | |
202 | 202 | func unstakeAcres (amount) = { | |
203 | 203 | let prologResult = prolog() | |
204 | 204 | let address = toString(i.caller) | |
205 | 205 | if ((size(i.payments) != 0)) | |
206 | 206 | then throw("No payments required") | |
207 | 207 | else { | |
208 | 208 | let timeKey = keyAcresStakedTimeByUser(address) | |
209 | 209 | let amountKey = keyAcresStakedAmountByUser(address) | |
210 | 210 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
211 | 211 | if ((amount > oldAcresAmount)) | |
212 | 212 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
213 | 213 | else { | |
214 | 214 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
215 | 215 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
216 | 216 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
217 | 217 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
218 | 218 | } | |
219 | 219 | } | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | ||
224 | 224 | @Callable(i) | |
225 | 225 | func buyAcres () = { | |
226 | 226 | let prologResult = prolog() | |
227 | 227 | let address = toString(i.caller) | |
228 | 228 | if ((size(i.payments) != 1)) | |
229 | 229 | then throw("exactly 1 payment must be attached") | |
230 | 230 | else { | |
231 | 231 | let pmt = i.payments[0] | |
232 | 232 | let amt = pmt.amount | |
233 | 233 | if (if (!(isDefined(pmt.assetId))) | |
234 | 234 | then true | |
235 | 235 | else (value(pmt.assetId) != usdtAssetId)) | |
236 | 236 | then throw("USDT payments only!") | |
237 | 237 | else if ((MULT6 > amt)) | |
238 | 238 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
239 | 239 | else { | |
240 | 240 | let acresAmount = (amt * USDT2ACRES_MULTIPLIER) | |
241 | 241 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil)) | |
242 | 242 | $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult)) | |
243 | 243 | } | |
244 | 244 | } | |
245 | 245 | } | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | ||
249 | 249 | @Callable(i) | |
250 | 250 | func burnAcres (amount) = if ((i.caller != stakingContract)) | |
251 | 251 | then throw("Permission denied") | |
252 | 252 | else $Tuple2([Burn(acresAssetId, amount)], amount) | |
253 | 253 | ||
254 | 254 | ||
255 | 255 | ||
256 | 256 | @Callable(i) | |
257 | 257 | func claimAcres () = { | |
258 | 258 | let prologResult = prolog() | |
259 | 259 | let address = toString(i.caller) | |
260 | 260 | if ((size(i.payments) != 0)) | |
261 | 261 | then throw("No payments required") | |
262 | 262 | else { | |
263 | 263 | let timeKey = keyAcresStakedTimeByUser(address) | |
264 | 264 | let amountKey = keyAcresStakedAmountByUser(address) | |
265 | 265 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
266 | 266 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
267 | 267 | let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0)) | |
268 | 268 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
269 | 269 | } | |
270 | 270 | } | |
271 | 271 | ||
272 | 272 |
github/deemru/w8io/026f985 34.62 ms ◑