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