tx · saPCz8KMCdFA8tCvrVz2kYXpfczrQGyDqfv32EjvQwv 3My8YSkcnfWVLQEUAV2gjz9Vz3W5j9hV6A4: -1.20000000 Waves 2022.11.15 18:46 [2318433] smart account 3My8YSkcnfWVLQEUAV2gjz9Vz3W5j9hV6A4 > SELF 0.00000000 Waves
{ "type": 13, "id": "saPCz8KMCdFA8tCvrVz2kYXpfczrQGyDqfv32EjvQwv", "fee": 120000000, "feeAssetId": null, "timestamp": 1668527202841, "version": 2, "chainId": 84, "sender": "3My8YSkcnfWVLQEUAV2gjz9Vz3W5j9hV6A4", "senderPublicKey": "FiTTSqfEHKmA1in7cLjr8RkP1TEG5vmNRPNb6pqniGoE", "proofs": [ "4JWGesSMoSHvLPvsvRMdKwHK9pSrViC7vULqg2a7EwSsUXeAdRQMm35C6gMz2ZAJ3epvb94yrbk6x7hFEzctwpdA" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEIEgASABIAAAAAMwAAAAAJUFJFQ0lTSU9OAA3gtrOnZAAAAAAAAAhEVVJBVElPTgkAAGgAAAACCQAAaAAAAAIAAAAAAAAAADwAAAAAAAAAADwAAAAAAAAAABgAAAAACERFQ0lNQUxTAAAAAAAF9eEAAAAAABJrX2xhc3RDb21wb3VuZFRpbWUCAAAAEmtfbGFzdENvbXBvdW5kVGltZQAAAAAOa19wZXJpb2RGaW5pc2gCAAAADmtfcGVyaW9kRmluaXNoAAAAAAprX2xhc3RSYXRlAgAAAAprX2xhc3RSYXRlAAAAAAxrX2dyb3d0aFJhdGUCAAAADGtfZ3Jvd3RoUmF0ZQAAAAAJa19iYWxhbmNlAgAAAAlrX2JhbGFuY2UAAAAACWtfbGVhc2VJZAIAAAAJa19sZWFzZUlkAAAAAA1rX2luaXRpYWxpemVkAgAAAA1rX2luaXRpYWxpemVkAAAAABBrX2FkbWluUHVibGljS2V5AgAAABBrX2FkbWluUHVibGljS2V5AAAAAA5rX2FkbWluQWRkcmVzcwIAAAAOa19hZG1pbkFkZHJlc3M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NLZXkCVDxd", "height": 2318433, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6vso2nsZvvmUrKDBsnkeEJHxzoh7BPEudsw6vR9vB9A4 Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PRECISION = 1000000000000000000 | |
5 | 5 | ||
6 | 6 | let DURATION = ((60 * 60) * 24) | |
7 | 7 | ||
8 | 8 | let DECIMALS = 100000000 | |
9 | 9 | ||
10 | 10 | let k_lastCompoundTime = "k_lastCompoundTime" | |
11 | 11 | ||
12 | 12 | let k_periodFinish = "k_periodFinish" | |
13 | 13 | ||
14 | 14 | let k_lastRate = "k_lastRate" | |
15 | 15 | ||
16 | 16 | let k_growthRate = "k_growthRate" | |
17 | 17 | ||
18 | 18 | let k_balance = "k_balance" | |
19 | 19 | ||
20 | 20 | let k_leaseId = "k_leaseId" | |
21 | 21 | ||
22 | 22 | let k_initialized = "k_initialized" | |
23 | 23 | ||
24 | 24 | let k_adminPublicKey = "k_adminPublicKey" | |
25 | 25 | ||
26 | 26 | let k_adminAddress = "k_adminAddress" | |
27 | 27 | ||
28 | 28 | let k_minerAddress = "k_minerAddress" | |
29 | 29 | ||
30 | 30 | let k_sWavesAsset = "k_sWavesAssetId" | |
31 | 31 | ||
32 | 32 | func divd (_x,_y) = fraction(_x, DECIMALS, _y, HALFEVEN) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func muld (_x,_y) = fraction(_x, _y, DECIMALS, HALFEVEN) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func divp (_x,_y) = fraction(_x, PRECISION, _y, HALFEVEN) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func mulp (_x,_y) = fraction(_x, _y, PRECISION, HALFEVEN) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func abs (_x) = if ((_x > 0)) | |
45 | 45 | then _x | |
46 | 46 | else -(_x) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func minv (_x,_y) = if ((_x > _y)) | |
50 | 50 | then _y | |
51 | 51 | else _x | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func adminAddress () = addressFromString(getStringValue(this, k_adminAddress)) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func adminPublicKey () = fromBase58String(getStringValue(this, k_adminPublicKey)) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(this, k_minerAddress)), "Invalid miner address is not set") | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func sWavesAsset () = fromBase58String(getStringValue(this, k_sWavesAsset)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("No value for " + k)) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func int0 (k) = valueOrElse(getInteger(this, k), 0) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func lastCompoundTime () = int0(k_lastCompoundTime) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func growthRate () = int0(k_growthRate) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func balance () = int0(k_balance) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func lastRate () = int(k_lastRate) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func periodFinish () = int0(k_periodFinish) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func adminPublicKeyOrUnit () = match getString(this, k_adminPublicKey) { | |
94 | 94 | case s: String => | |
95 | 95 | fromBase58String(s) | |
96 | 96 | case _: Unit => | |
97 | 97 | unit | |
98 | 98 | case _ => | |
99 | 99 | throw("Match error") | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func mustAdmin (i) = { | |
104 | 104 | let pd = throw("permission denied") | |
105 | 105 | match adminPublicKeyOrUnit() { | |
106 | 106 | case pk: ByteVector => | |
107 | 107 | if ((i.callerPublicKey == pk)) | |
108 | 108 | then true | |
109 | 109 | else pd | |
110 | 110 | case _: Unit => | |
111 | 111 | if ((i.caller == this)) | |
112 | 112 | then true | |
113 | 113 | else pd | |
114 | 114 | case _ => | |
115 | 115 | throw("Match error") | |
116 | 116 | } | |
117 | 117 | } | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func currentTimestampSec () = (lastBlock.timestamp / 1000) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func dt () = minv(currentTimestampSec(), periodFinish()) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func cancelLease () = match getBinary(k_leaseId) { | |
127 | 127 | case id: ByteVector => | |
128 | 128 | [LeaseCancel(id), DeleteEntry(k_leaseId)] | |
129 | 129 | case _: Unit => | |
130 | 130 | nil | |
131 | 131 | case _ => | |
132 | 132 | throw("Match error") | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func updateBalance (_amount) = [IntegerEntry(k_balance, _amount)] | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func updateTime (_lastCompoundTime,_periodFinish) = [IntegerEntry(k_lastCompoundTime, _lastCompoundTime), IntegerEntry(k_periodFinish, _periodFinish)] | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func updateRate (_rate,_growthRate) = [IntegerEntry(k_lastRate, _rate), IntegerEntry(k_growthRate, _growthRate)] | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func updateLease (_amount) = if ((_amount > 0)) | |
146 | 146 | then { | |
147 | 147 | let newLease = Lease(minerAddress(), _amount) | |
148 | 148 | let newLeaseId = calculateLeaseId(newLease) | |
149 | 149 | [newLease, BinaryEntry(k_leaseId, newLeaseId)] | |
150 | 150 | } | |
151 | 151 | else nil | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func lease (_amount) = if ((_amount == 0)) | |
155 | 155 | then nil | |
156 | 156 | else { | |
157 | 157 | let newAmount = (balance() + _amount) | |
158 | 158 | ((cancelLease() ++ updateLease(newAmount)) ++ updateBalance(newAmount)) | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func issueSWaves (_amount) = [Reissue(sWavesAsset(), _amount, true)] | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func burnSWaves (_amount) = [Burn(sWavesAsset(), _amount)] | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func sendSWaves (_recipient,_amount) = [ScriptTransfer(_recipient, _amount, sWavesAsset())] | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func sendWaves (_recipient,_amount) = [ScriptTransfer(_recipient, _amount, unit)] | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func sWavesQuantity () = match assetInfo(sWavesAsset()) { | |
175 | 175 | case asset: Asset => | |
176 | 176 | asset.quantity | |
177 | 177 | case _ => | |
178 | 178 | throw("Can't find asset") | |
179 | 179 | } | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func getExcessWaves () = wavesBalance(minerAddress()).regular | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func withdraw () = { | |
186 | 186 | let result = invoke(minerAddress(), "withdraw", nil, nil) | |
187 | 187 | if ((result == result)) | |
188 | 188 | then result | |
189 | 189 | else throw("Strict value is not equal to itself.") | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func currentRate () = (lastRate() + (growthRate() * dt())) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | @Callable(i) | |
197 | 197 | func init (_minerAddress) = { | |
198 | 198 | let check = mustAdmin(i) | |
199 | 199 | if ((check == check)) | |
200 | 200 | then if (initialized()) | |
201 | 201 | then throw("Already initialized") | |
202 | 202 | else { | |
203 | 203 | let sWaves = Issue("sWaves", "", 0, 8, true, unit, 0) | |
204 | 204 | let sWavesAssetId = calculateAssetId(sWaves) | |
205 | 205 | [BooleanEntry(k_initialized, true), StringEntry(k_sWavesAsset, toBase58String(sWavesAssetId)), StringEntry(k_minerAddress, _minerAddress), IntegerEntry(k_lastRate, PRECISION), sWaves] | |
206 | 206 | } | |
207 | 207 | else throw("Strict value is not equal to itself.") | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(i) | |
213 | 213 | func compound () = if ((size(i.payments) != 0)) | |
214 | 214 | then throw("No payments allowed") | |
215 | 215 | else { | |
216 | 216 | let excessWaves = getExcessWaves() | |
217 | 217 | if ((excessWaves == excessWaves)) | |
218 | 218 | then if (((1 * DECIMALS) > excessWaves)) | |
219 | 219 | then nil | |
220 | 220 | else { | |
221 | 221 | let doWithdraw = withdraw() | |
222 | 222 | if ((doWithdraw == doWithdraw)) | |
223 | 223 | then { | |
224 | 224 | let newRate = currentRate() | |
225 | 225 | let timestamp = currentTimestampSec() | |
226 | 226 | let newGrowthRate = if ((timestamp > periodFinish())) | |
227 | 227 | then (divp(excessWaves, DECIMALS) / DURATION) | |
228 | 228 | else { | |
229 | 229 | let remainingTime = (periodFinish() - timestamp) | |
230 | 230 | let leftover = (growthRate() * remainingTime) | |
231 | 231 | (divp((excessWaves + leftover), DECIMALS) / DURATION) | |
232 | 232 | } | |
233 | 233 | ((lease(excessWaves) ++ updateRate(newRate, newGrowthRate)) ++ updateTime(timestamp, (timestamp + DURATION))) | |
234 | 234 | } | |
235 | 235 | else throw("Strict value is not equal to itself.") | |
236 | 236 | } | |
237 | 237 | else throw("Strict value is not equal to itself.") | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Callable(i) | |
243 | 243 | func stake () = { | |
244 | 244 | let doCompound = invoke(this, "compound", nil, nil) | |
245 | 245 | if ((doCompound == doCompound)) | |
246 | 246 | then { | |
247 | 247 | let payment = i.payments[0] | |
248 | 248 | if ((payment.assetId != unit)) | |
249 | 249 | then throw("Only WAVES supported") | |
250 | 250 | else if ((size(i.payments) != 1)) | |
251 | 251 | then throw("Wrong payments amount") | |
252 | 252 | else { | |
253 | 253 | let rate = currentRate() | |
254 | 254 | let toReissue = divp(payment.amount, rate) | |
255 | 255 | ((lease(payment.amount) ++ issueSWaves(toReissue)) ++ sendSWaves(i.caller, toReissue)) | |
256 | 256 | } | |
257 | 257 | } | |
258 | 258 | else throw("Strict value is not equal to itself.") | |
259 | 259 | } | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | ||
263 | 263 | @Callable(i) | |
264 | 264 | func unstake () = { | |
265 | 265 | let doCompound = invoke(this, "compound", nil, nil) | |
266 | 266 | if ((doCompound == doCompound)) | |
267 | 267 | then { | |
268 | 268 | let payment = i.payments[0] | |
269 | 269 | if ((payment.assetId != sWavesAsset())) | |
270 | 270 | then throw("Only sWAVES supported") | |
271 | 271 | else if ((size(i.payments) != 1)) | |
272 | 272 | then throw("Wrong payments amount") | |
273 | 273 | else { | |
274 | 274 | let rate = currentRate() | |
275 | 275 | let transferAmount = mulp(payment.amount, rate) | |
276 | 276 | ((lease(-(transferAmount)) ++ burnSWaves(payment.amount)) ++ sendWaves(i.caller, transferAmount)) | |
277 | 277 | } | |
278 | 278 | } | |
279 | 279 | else throw("Strict value is not equal to itself.") | |
280 | 280 | } | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | @Verifier(tx) | |
284 | 284 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
285 | 285 |
github/deemru/w8io/169f3d6 42.46 ms ◑