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:AAIFAAAAAAAAAA0IAhIDCgEIEgASABIAAAAAMwAAAAAJUFJFQ0lTSU9OAA3gtrOnZAAAAAAAAAhEVVJBVElPTgkAAGgAAAACCQAAaAAAAAIAAAAAAAAAADwAAAAAAAAAADwAAAAAAAAAABgAAAAACERFQ0lNQUxTAAAAAAAF9eEAAAAAABJrX2xhc3RDb21wb3VuZFRpbWUCAAAAEmtfbGFzdENvbXBvdW5kVGltZQAAAAAOa19wZXJpb2RGaW5pc2gCAAAADmtfcGVyaW9kRmluaXNoAAAAAAprX2xhc3RSYXRlAgAAAAprX2xhc3RSYXRlAAAAAAxrX2dyb3d0aFJhdGUCAAAADGtfZ3Jvd3RoUmF0ZQAAAAAJa19iYWxhbmNlAgAAAAlrX2JhbGFuY2UAAAAACWtfbGVhc2VJZAIAAAAJa19sZWFzZUlkAAAAAA1rX2luaXRpYWxpemVkAgAAAA1rX2luaXRpYWxpemVkAAAAABBrX2FkbWluUHVibGljS2V5AgAAABBrX2FkbWluUHVibGljS2V5AAAAAA5rX2FkbWluQWRkcmVzcwIAAAAOa19hZG1pbkFkZHJlc3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WNLZXkCVDxd", "height": 2318433, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6vso2nsZvvmUrKDBsnkeEJHxzoh7BPEudsw6vR9vB9A4 Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let PRECISION = 1000000000000000000
55
66 let DURATION = ((60 * 60) * 24)
77
88 let DECIMALS = 100000000
99
1010 let k_lastCompoundTime = "k_lastCompoundTime"
1111
1212 let k_periodFinish = "k_periodFinish"
1313
1414 let k_lastRate = "k_lastRate"
1515
1616 let k_growthRate = "k_growthRate"
1717
1818 let k_balance = "k_balance"
1919
2020 let k_leaseId = "k_leaseId"
2121
2222 let k_initialized = "k_initialized"
2323
2424 let k_adminPublicKey = "k_adminPublicKey"
2525
2626 let k_adminAddress = "k_adminAddress"
2727
2828 let k_minerAddress = "k_minerAddress"
2929
3030 let k_sWavesAsset = "k_sWavesAssetId"
3131
3232 func divd (_x,_y) = fraction(_x, DECIMALS, _y, HALFEVEN)
3333
3434
3535 func muld (_x,_y) = fraction(_x, _y, DECIMALS, HALFEVEN)
3636
3737
3838 func divp (_x,_y) = fraction(_x, PRECISION, _y, HALFEVEN)
3939
4040
4141 func mulp (_x,_y) = fraction(_x, _y, PRECISION, HALFEVEN)
4242
4343
4444 func abs (_x) = if ((_x > 0))
4545 then _x
4646 else -(_x)
4747
4848
4949 func minv (_x,_y) = if ((_x > _y))
5050 then _y
5151 else _x
5252
5353
5454 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
5555
5656
5757 func adminAddress () = addressFromString(getStringValue(this, k_adminAddress))
5858
5959
6060 func adminPublicKey () = fromBase58String(getStringValue(this, k_adminPublicKey))
6161
6262
6363 func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(this, k_minerAddress)), "Invalid miner address is not set")
6464
6565
6666 func sWavesAsset () = fromBase58String(getStringValue(this, k_sWavesAsset))
6767
6868
6969 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
7070
7171
7272 func int (k) = valueOrErrorMessage(getInteger(this, k), ("No value for " + k))
7373
7474
7575 func int0 (k) = valueOrElse(getInteger(this, k), 0)
7676
7777
7878 func lastCompoundTime () = int0(k_lastCompoundTime)
7979
8080
8181 func growthRate () = int0(k_growthRate)
8282
8383
8484 func balance () = int0(k_balance)
8585
8686
8787 func lastRate () = int(k_lastRate)
8888
8989
9090 func periodFinish () = int0(k_periodFinish)
9191
9292
9393 func adminPublicKeyOrUnit () = match getString(this, k_adminPublicKey) {
9494 case s: String =>
9595 fromBase58String(s)
9696 case _: Unit =>
9797 unit
9898 case _ =>
9999 throw("Match error")
100100 }
101101
102102
103103 func mustAdmin (i) = {
104104 let pd = throw("permission denied")
105105 match adminPublicKeyOrUnit() {
106106 case pk: ByteVector =>
107107 if ((i.callerPublicKey == pk))
108108 then true
109109 else pd
110110 case _: Unit =>
111111 if ((i.caller == this))
112112 then true
113113 else pd
114114 case _ =>
115115 throw("Match error")
116116 }
117117 }
118118
119119
120120 func currentTimestampSec () = (lastBlock.timestamp / 1000)
121121
122122
123123 func dt () = minv(currentTimestampSec(), periodFinish())
124124
125125
126126 func cancelLease () = match getBinary(k_leaseId) {
127127 case id: ByteVector =>
128128 [LeaseCancel(id), DeleteEntry(k_leaseId)]
129129 case _: Unit =>
130130 nil
131131 case _ =>
132132 throw("Match error")
133133 }
134134
135135
136136 func updateBalance (_amount) = [IntegerEntry(k_balance, _amount)]
137137
138138
139139 func updateTime (_lastCompoundTime,_periodFinish) = [IntegerEntry(k_lastCompoundTime, _lastCompoundTime), IntegerEntry(k_periodFinish, _periodFinish)]
140140
141141
142142 func updateRate (_rate,_growthRate) = [IntegerEntry(k_lastRate, _rate), IntegerEntry(k_growthRate, _growthRate)]
143143
144144
145145 func updateLease (_amount) = if ((_amount > 0))
146146 then {
147147 let newLease = Lease(minerAddress(), _amount)
148148 let newLeaseId = calculateLeaseId(newLease)
149149 [newLease, BinaryEntry(k_leaseId, newLeaseId)]
150150 }
151151 else nil
152152
153153
154154 func lease (_amount) = if ((_amount == 0))
155155 then nil
156156 else {
157157 let newAmount = (balance() + _amount)
158158 ((cancelLease() ++ updateLease(newAmount)) ++ updateBalance(newAmount))
159159 }
160160
161161
162162 func issueSWaves (_amount) = [Reissue(sWavesAsset(), _amount, true)]
163163
164164
165165 func burnSWaves (_amount) = [Burn(sWavesAsset(), _amount)]
166166
167167
168168 func sendSWaves (_recipient,_amount) = [ScriptTransfer(_recipient, _amount, sWavesAsset())]
169169
170170
171171 func sendWaves (_recipient,_amount) = [ScriptTransfer(_recipient, _amount, unit)]
172172
173173
174174 func sWavesQuantity () = match assetInfo(sWavesAsset()) {
175175 case asset: Asset =>
176176 asset.quantity
177177 case _ =>
178178 throw("Can't find asset")
179179 }
180180
181181
182182 func getExcessWaves () = wavesBalance(minerAddress()).regular
183183
184184
185185 func withdraw () = {
186186 let result = invoke(minerAddress(), "withdraw", nil, nil)
187187 if ((result == result))
188188 then result
189189 else throw("Strict value is not equal to itself.")
190190 }
191191
192192
193193 func currentRate () = (lastRate() + (growthRate() * dt()))
194194
195195
196196 @Callable(i)
197197 func init (_minerAddress) = {
198198 let check = mustAdmin(i)
199199 if ((check == check))
200200 then if (initialized())
201201 then throw("Already initialized")
202202 else {
203203 let sWaves = Issue("sWaves", "", 0, 8, true, unit, 0)
204204 let sWavesAssetId = calculateAssetId(sWaves)
205205 [BooleanEntry(k_initialized, true), StringEntry(k_sWavesAsset, toBase58String(sWavesAssetId)), StringEntry(k_minerAddress, _minerAddress), IntegerEntry(k_lastRate, PRECISION), sWaves]
206206 }
207207 else throw("Strict value is not equal to itself.")
208208 }
209209
210210
211211
212212 @Callable(i)
213213 func compound () = if ((size(i.payments) != 0))
214214 then throw("No payments allowed")
215215 else {
216216 let excessWaves = getExcessWaves()
217217 if ((excessWaves == excessWaves))
218218 then if (((1 * DECIMALS) > excessWaves))
219219 then nil
220220 else {
221221 let doWithdraw = withdraw()
222222 if ((doWithdraw == doWithdraw))
223223 then {
224224 let newRate = currentRate()
225225 let timestamp = currentTimestampSec()
226226 let newGrowthRate = if ((timestamp > periodFinish()))
227227 then (divp(excessWaves, DECIMALS) / DURATION)
228228 else {
229229 let remainingTime = (periodFinish() - timestamp)
230230 let leftover = (growthRate() * remainingTime)
231231 (divp((excessWaves + leftover), DECIMALS) / DURATION)
232232 }
233233 ((lease(excessWaves) ++ updateRate(newRate, newGrowthRate)) ++ updateTime(timestamp, (timestamp + DURATION)))
234234 }
235235 else throw("Strict value is not equal to itself.")
236236 }
237237 else throw("Strict value is not equal to itself.")
238238 }
239239
240240
241241
242242 @Callable(i)
243243 func stake () = {
244244 let doCompound = invoke(this, "compound", nil, nil)
245245 if ((doCompound == doCompound))
246246 then {
247247 let payment = i.payments[0]
248248 if ((payment.assetId != unit))
249249 then throw("Only WAVES supported")
250250 else if ((size(i.payments) != 1))
251251 then throw("Wrong payments amount")
252252 else {
253253 let rate = currentRate()
254254 let toReissue = divp(payment.amount, rate)
255255 ((lease(payment.amount) ++ issueSWaves(toReissue)) ++ sendSWaves(i.caller, toReissue))
256256 }
257257 }
258258 else throw("Strict value is not equal to itself.")
259259 }
260260
261261
262262
263263 @Callable(i)
264264 func unstake () = {
265265 let doCompound = invoke(this, "compound", nil, nil)
266266 if ((doCompound == doCompound))
267267 then {
268268 let payment = i.payments[0]
269269 if ((payment.assetId != sWavesAsset()))
270270 then throw("Only sWAVES supported")
271271 else if ((size(i.payments) != 1))
272272 then throw("Wrong payments amount")
273273 else {
274274 let rate = currentRate()
275275 let transferAmount = mulp(payment.amount, rate)
276276 ((lease(-(transferAmount)) ++ burnSWaves(payment.amount)) ++ sendWaves(i.caller, transferAmount))
277277 }
278278 }
279279 else throw("Strict value is not equal to itself.")
280280 }
281281
282282
283283 @Verifier(tx)
284284 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
285285

github/deemru/w8io/169f3d6 
42.46 ms