tx · 2qBRRfJPSYsA9AZUSUkabE4HN6sAwU4R6PPQRzsABRkQ 3MsaKhVbqv8YvhVvk6Hb9VyzQTFYcjzxakH: -0.01400000 Waves 2022.10.08 19:13 [2263578] smart account 3MsaKhVbqv8YvhVvk6Hb9VyzQTFYcjzxakH > SELF 0.00000000 Waves
{ "type": 13, "id": "2qBRRfJPSYsA9AZUSUkabE4HN6sAwU4R6PPQRzsABRkQ", "fee": 1400000, "feeAssetId": null, "timestamp": 1665245637695, "version": 2, "chainId": 84, "sender": "3MsaKhVbqv8YvhVvk6Hb9VyzQTFYcjzxakH", "senderPublicKey": "9vpxbwwCxjqJFrq6Ec6wf3AjfQrkpEHs1gkyD35PSwxM", "proofs": [ "3pkk23qRcoiy9RHBq9pqcnfFPnbGK5Av7ZV9z8Z3a1BNifTForakRo9rwsWQUUir7JWxeaCwCSRyxTXpPWD2b4uw" ], "script": "base64:BgINCAISABIAEgMKAQESAAwACVNFUEFSQVRPUgICX18ADlBFUkNFTlRfRkFDVE9SCQC2AgEAgKCUpY0dAAtaRVJPX0JJR0lOVAkAtgIBAAAACk9ORV9CSUdJTlQJALYCAQABAApUT0tFTl9OQU1FAgxTdGFrZWQgV0FWRVMAEVRPS0VOX0RFU0NSSVBUSU9OAhJTdGFrZWQgV0FWRVMgdG9rZW4ADlRPS0VOX0RFQ0lNQUxTAAgBDGdldExlYXNlTm9kZQAEByRtYXRjaDAJAKIIAQIKTEVBU0VfTk9ERQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAWEFByRtYXRjaDAJAQdBZGRyZXNzAQkA2QQBBQFhCQACAQIjZ2V0TGVhc2VOb2RlOiBubyBsZWFzZSBub2RlIGFkZHJlc3MBB2xvYWRJbnQCBGtleV8IZGVmYXVsdF8EByRtYXRjaDAJAJ8IAQUEa2V5XwMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDAFAWEFCGRlZmF1bHRfAQpsb2FkQmlnSW50AgRrZXlfCGRlZmF1bHRfBAckb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"spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEPARATOR = "__" | |
5 | + | ||
6 | + | let PERCENT_FACTOR = toBigInt(1000000000000) | |
7 | + | ||
8 | + | let ZERO_BIGINT = toBigInt(0) | |
9 | + | ||
10 | + | let ONE_BIGINT = toBigInt(1) | |
11 | + | ||
12 | + | let TOKEN_NAME = "Staked WAVES" | |
13 | + | ||
14 | + | let TOKEN_DESCRIPTION = "Staked WAVES token" | |
15 | + | ||
16 | + | let TOKEN_DECIMALS = 8 | |
17 | + | ||
18 | + | func getLeaseNode () = match getString("LEASE_NODE") { | |
19 | + | case a: String => | |
20 | + | Address(fromBase58String(a)) | |
21 | + | case _ => | |
22 | + | throw("getLeaseNode: no lease node address") | |
23 | + | } | |
24 | + | ||
25 | + | ||
26 | + | func loadInt (key_,default_) = match getInteger(key_) { | |
27 | + | case a: Int => | |
28 | + | a | |
29 | + | case _ => | |
30 | + | default_ | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func loadBigInt (key_,default_) = match getBinary(key_) { | |
35 | + | case a: ByteVector => | |
36 | + | toBigInt(a) | |
37 | + | case _ => | |
38 | + | default_ | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func loadAsset () = match getString("ASSET") { | |
43 | + | case a: String => | |
44 | + | fromBase58String(a) | |
45 | + | case _ => | |
46 | + | base58'' | |
47 | + | } | |
48 | + | ||
49 | + | ||
50 | + | func _updateLeasing (amount_) = { | |
51 | + | let leaseId = getBinary("LEASE_ID") | |
52 | + | let leaseAmount = loadInt("LEASE_AMOUNT", 0) | |
53 | + | let newLeaseAmount = (leaseAmount + amount_) | |
54 | + | let unleaseOrEmpty = if (isDefined(leaseId)) | |
55 | + | then [LeaseCancel(value(leaseId))] | |
56 | + | else nil | |
57 | + | let leaseActions = if ((newLeaseAmount > 0)) | |
58 | + | then { | |
59 | + | let lease = Lease(getLeaseNode(), newLeaseAmount) | |
60 | + | [lease, BinaryEntry("LEASE_ID", calculateLeaseId(lease)), IntegerEntry("LEASE_AMOUNT", newLeaseAmount)] | |
61 | + | } | |
62 | + | else [DeleteEntry("LEASE_ID"), IntegerEntry("LEASE_AMOUNT", 0)] | |
63 | + | (unleaseOrEmpty ++ leaseActions) | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | @Callable(i) | |
68 | + | func init () = { | |
69 | + | let asset = loadAsset() | |
70 | + | let err = if ((asset != base58'')) | |
71 | + | then throw("init: already initialized") | |
72 | + | else unit | |
73 | + | if ((err == err)) | |
74 | + | then { | |
75 | + | let issue = Issue(TOKEN_NAME, TOKEN_DESCRIPTION, 0, TOKEN_DECIMALS, true) | |
76 | + | let assetId = calculateAssetId(issue) | |
77 | + | $Tuple2([StringEntry("ASSET", toBase58String(assetId)), issue], unit) | |
78 | + | } | |
79 | + | else throw("Strict value is not equal to itself.") | |
80 | + | } | |
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | @Callable(i) | |
85 | + | func deposit () = { | |
86 | + | let caller = toString(i.caller) | |
87 | + | let err = if ((1 > size(i.payments))) | |
88 | + | then throw("deposit: no payments") | |
89 | + | else if ((i.payments[0].assetId != unit)) | |
90 | + | then throw("deposit: payment is not waves") | |
91 | + | else if ((0 >= i.payments[0].amount)) | |
92 | + | then throw("deposit: invalid payment amount") | |
93 | + | else unit | |
94 | + | if ((err == err)) | |
95 | + | then { | |
96 | + | let asset = loadAsset() | |
97 | + | let assetQuantity = match assetInfo(asset) { | |
98 | + | case a: Asset => | |
99 | + | toBigInt(a.quantity) | |
100 | + | case _ => | |
101 | + | throw("deposit: contract not initialized") | |
102 | + | } | |
103 | + | let totalDeposit = loadInt("TOTAL_DEPOSIT", 0) | |
104 | + | let lastRate = loadBigInt("LAST_RATE", PERCENT_FACTOR) | |
105 | + | let currentRate = loadBigInt("CURRENT_RATE", ZERO_BIGINT) | |
106 | + | let lastHeight = loadInt("LAST_HEIGHT", 0) | |
107 | + | let targetHeight = min([loadInt("TARGET_HEIGHT", 0), lastBlock.height]) | |
108 | + | let lastRateUpdated = (lastRate + (currentRate * toBigInt((targetHeight - lastHeight)))) | |
109 | + | let issueAmount = toInt(fraction(toBigInt(i.payments[0].amount), PERCENT_FACTOR, lastRateUpdated, FLOOR)) | |
110 | + | let currentRateUpdated = fraction(currentRate, assetQuantity, (assetQuantity + toBigInt(issueAmount)), FLOOR) | |
111 | + | let lastHeightUpdated = targetHeight | |
112 | + | let leaseActions = _updateLeasing(i.payments[0].amount) | |
113 | + | $Tuple2(([Reissue(asset, issueAmount, true), ScriptTransfer(i.caller, issueAmount, asset), IntegerEntry("TOTAL_DEPOSIT", (totalDeposit + i.payments[0].amount)), BinaryEntry("LAST_RATE", toBytes(lastRateUpdated)), BinaryEntry("CURRENT_RATE", toBytes(currentRateUpdated)), IntegerEntry("LAST_HEIGHT", lastHeightUpdated)] ++ leaseActions), unit) | |
114 | + | } | |
115 | + | else throw("Strict value is not equal to itself.") | |
116 | + | } | |
117 | + | ||
118 | + | ||
119 | + | ||
120 | + | @Callable(i) | |
121 | + | func stake (atBlocks_) = { | |
122 | + | let caller = toString(i.caller) | |
123 | + | let asset = loadAsset() | |
124 | + | let assetQuantity = match assetInfo(asset) { | |
125 | + | case a: Asset => | |
126 | + | toBigInt(a.quantity) | |
127 | + | case _ => | |
128 | + | throw("stake: contract not initialized") | |
129 | + | } | |
130 | + | let err = if ((i.caller != getLeaseNode())) | |
131 | + | then throw("stake: caller is not allowed") | |
132 | + | else if ((0 >= atBlocks_)) | |
133 | + | then throw("stake: invalid blocks") | |
134 | + | else if ((1 > size(i.payments))) | |
135 | + | then throw("stake: no payments") | |
136 | + | else if ((i.payments[0].assetId != unit)) | |
137 | + | then throw("stake: payment is not waves") | |
138 | + | else if ((0 >= i.payments[0].amount)) | |
139 | + | then throw("stake: invalid payment amount") | |
140 | + | else if ((assetQuantity == ZERO_BIGINT)) | |
141 | + | then throw("stake: no deposits to stake for") | |
142 | + | else unit | |
143 | + | if ((err == err)) | |
144 | + | then { | |
145 | + | let lastRate = loadBigInt("LAST_RATE", PERCENT_FACTOR) | |
146 | + | let currentRate = loadBigInt("CURRENT_RATE", ZERO_BIGINT) | |
147 | + | let lastHeight = loadInt("LAST_HEIGHT", 0) | |
148 | + | let targetHeight = loadInt("TARGET_HEIGHT", 0) | |
149 | + | let minTargetHeight = min([targetHeight, lastBlock.height]) | |
150 | + | let actions = if ((minTargetHeight == lastBlock.height)) | |
151 | + | then { | |
152 | + | let lastRateUpdated = (lastRate + (toBigInt((minTargetHeight - lastHeight)) * currentRate)) | |
153 | + | let remainingReward = (currentRate * toBigInt((targetHeight - minTargetHeight))) | |
154 | + | let currentRateUpdated = fraction(((toBigInt(i.payments[0].amount) * PERCENT_FACTOR) + remainingReward), ONE_BIGINT, (assetQuantity * toBigInt(atBlocks_))) | |
155 | + | let lastHeightUpdated = lastBlock.height | |
156 | + | let targetHeightUpdated = (lastHeightUpdated + atBlocks_) | |
157 | + | [BinaryEntry("LAST_RATE", toBytes(lastRateUpdated)), BinaryEntry("CURRENT_RATE", toBytes(currentRateUpdated)), IntegerEntry("LAST_HEIGHT", lastHeightUpdated), IntegerEntry("TARGET_HEIGHT", targetHeightUpdated)] | |
158 | + | } | |
159 | + | else if ((targetHeight > lastHeight)) | |
160 | + | then { | |
161 | + | let lastRateUpdated = (lastRate + (toBigInt((targetHeight - lastHeight)) * currentRate)) | |
162 | + | let currentRateUpdated = fraction(toBigInt(i.payments[0].amount), PERCENT_FACTOR, (assetQuantity * toBigInt(atBlocks_))) | |
163 | + | let lastHeightUpdated = lastBlock.height | |
164 | + | let targetHeightUpdated = (lastHeightUpdated + atBlocks_) | |
165 | + | [BinaryEntry("LAST_RATE", toBytes(lastRateUpdated)), BinaryEntry("CURRENT_RATE", toBytes(currentRateUpdated)), IntegerEntry("LAST_HEIGHT", lastHeightUpdated), IntegerEntry("TARGET_HEIGHT", targetHeightUpdated)] | |
166 | + | } | |
167 | + | else { | |
168 | + | let currentRateUpdated = fraction(toBigInt(i.payments[0].amount), PERCENT_FACTOR, (assetQuantity * toBigInt(atBlocks_))) | |
169 | + | let lastHeightUpdated = lastBlock.height | |
170 | + | let targetHeightUpdated = (lastHeightUpdated + atBlocks_) | |
171 | + | [BinaryEntry("CURRENT_RATE", toBytes(currentRateUpdated)), IntegerEntry("LAST_HEIGHT", lastHeightUpdated), IntegerEntry("TARGET_HEIGHT", targetHeightUpdated)] | |
172 | + | } | |
173 | + | let leaseActions = _updateLeasing(i.payments[0].amount) | |
174 | + | $Tuple2((actions ++ leaseActions), unit) | |
175 | + | } | |
176 | + | else throw("Strict value is not equal to itself.") | |
177 | + | } | |
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | @Callable(i) | |
182 | + | func withdraw () = { | |
183 | + | let caller = toString(i.caller) | |
184 | + | let asset = loadAsset() | |
185 | + | let err = if ((1 > size(i.payments))) | |
186 | + | then throw("withdraw: no payments") | |
187 | + | else if ((i.payments[0].assetId != asset)) | |
188 | + | then throw("withdraw: payment is not staked waves") | |
189 | + | else if ((0 >= i.payments[0].amount)) | |
190 | + | then throw("withdraw: invalid payment amount") | |
191 | + | else unit | |
192 | + | if ((err == err)) | |
193 | + | then { | |
194 | + | let assetQuantity = match assetInfo(asset) { | |
195 | + | case a: Asset => | |
196 | + | toBigInt(a.quantity) | |
197 | + | case _ => | |
198 | + | throw("withdraw: contract not initialized") | |
199 | + | } | |
200 | + | let lastRate = loadBigInt("LAST_RATE", PERCENT_FACTOR) | |
201 | + | let currentRate = loadBigInt("CURRENT_RATE", ZERO_BIGINT) | |
202 | + | let lastHeight = loadInt("LAST_HEIGHT", 0) | |
203 | + | let targetHeight = min([loadInt("TARGET_HEIGHT", 0), lastBlock.height]) | |
204 | + | let lastRateUpdated = (lastRate + (currentRate * toBigInt((targetHeight - lastHeight)))) | |
205 | + | let wavesAmount = toInt(fraction(toBigInt(i.payments[0].amount), lastRateUpdated, PERCENT_FACTOR, FLOOR)) | |
206 | + | let currentRateUpdated = fraction(currentRate, assetQuantity, (assetQuantity - toBigInt(i.payments[0].amount)), FLOOR) | |
207 | + | let lastHeightUpdated = targetHeight | |
208 | + | let leaseActions = _updateLeasing((-1 * wavesAmount)) | |
209 | + | $Tuple2((leaseActions ++ [Burn(asset, i.payments[0].amount), ScriptTransfer(i.caller, wavesAmount, unit), BinaryEntry("LAST_RATE", toBytes(lastRateUpdated)), BinaryEntry("CURRENT_RATE", toBytes(currentRateUpdated)), IntegerEntry("LAST_HEIGHT", lastHeightUpdated)]), unit) | |
210 | + | } | |
211 | + | else throw("Strict value is not equal to itself.") | |
212 | + | } | |
213 | + | ||
214 | + | ||
215 | + | @Verifier(tx) | |
216 | + | func verify () = { | |
217 | + | let multisigContract = addressFromPublicKey(fromBase58String(getStringValue(this, "MULTISIG"))) | |
218 | + | let quorum = getIntegerValue(multisigContract, "QUORUM") | |
219 | + | let publicKeys = getStringValue(multisigContract, "PUBLIC_KEYS") | |
220 | + | let publicKeysList = split(publicKeys, SEPARATOR) | |
221 | + | func verifier (acc,publicKeyStr) = { | |
222 | + | let publicKey = fromBase58String(publicKeyStr) | |
223 | + | if (sigVerify(tx.bodyBytes, tx.proofs[acc._1], publicKey)) | |
224 | + | then $Tuple2((acc._1 + 1), (acc._2 + 1)) | |
225 | + | else $Tuple2((acc._1 + 1), acc._2) | |
226 | + | } | |
227 | + | ||
228 | + | let result = { | |
229 | + | let $l = publicKeysList | |
230 | + | let $s = size($l) | |
231 | + | let $acc0 = $Tuple2(1, 0) | |
232 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
233 | + | then $a | |
234 | + | else verifier($a, $l[$i]) | |
235 | + | ||
236 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
237 | + | then $a | |
238 | + | else throw("List size exceeds 10") | |
239 | + | ||
240 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
241 | + | } | |
242 | + | (result._2 >= quorum) | |
243 | + | } | |
244 | + |
github/deemru/w8io/169f3d6 21.63 ms ◑