tx · BRRweaA6mzp9DidpnJwg9AdxCwuHPJNhwpqEvBjgQP5j

3P81DBRyX9g5Yvp5JwbFUCifCEaCJKNYwH3:  -0.01400000 Waves

2022.01.20 16:43 [2952416] smart account 3P81DBRyX9g5Yvp5JwbFUCifCEaCJKNYwH3 > SELF 0.00000000 Waves

{ "type": 13, "id": "BRRweaA6mzp9DidpnJwg9AdxCwuHPJNhwpqEvBjgQP5j", "fee": 1400000, "feeAssetId": null, "timestamp": 1642686182021, "version": 2, "chainId": 87, "sender": "3P81DBRyX9g5Yvp5JwbFUCifCEaCJKNYwH3", "senderPublicKey": "EGBosxL1cqmmi8SGFjPXrAqEPDrB5zUCJSxC8mLkmej", "proofs": [ "3MRSiwuHiShR7brLt4m5duyAqmX6UpDA6ZqKVvbkp4qS2yv1EUpXVW5wYUEWLNGznoFkEbATFt8cZxuZFyNaJUJ5", "tFbZykzAkZVrLRWYNQuBBB7LgskeVtmFqmAJuhN7TppArx695czcU4kC8ZXsM2z4QRuZizt8JhuxyNnYetXtEjw", "61oXqecR3khPaQjKS9L136vBCirAqycgj2dqFeKVgm9fdCBhtsa8tz6FXugPmVShvDbrsrYaLsrQKUTKMZWrAtdW" ], "script": null, "height": 2952416, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2QgwhVVHSWKY9pX2GsGusG7nsXTQB9WRwZh51DSoWWr8 Next: 6xTrWNHzzEjra6o4TY1CRmPE6fjtvjoipCis8BMWxC4f Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let lpAssetId = base58'7KZbJrVopwJhkdwbe1eFDBbex4dkY63MxjTNjqXtrzj1'
5-
6-let wxAssetId = base58'Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on'
7-
8-let wxbAssetId = base58'BbP9tmd5Zxk345y9zipXkYaqDfxDG1suTj64eJmy1BAT'
9-
10-let proxyAddress = Address(base58'3P2ZpdHdm8cpi7oS2dBPiLVo21ryZm6DDkH')
11-
12-let roundHeight = 1440
13-
14-let decimals = 10000
15-
16-let targetBlock = 2958400
17-
18-let limit = 100000000000000000
19-
20-let adminPubKey1 = base58'8CPfYYUFZvLwMYqdhtwKnrQMAAnWiVakm3mf8MRGKtzN'
21-
22-let adminPubKey2 = base58'Aa5tsh5uzQYAYpDYswmQko1c79PSYLrGbwRZ5sBViNx5'
23-
24-let adminPubKey3 = base58'mTQL3HhYMeLQCe34H45YtLjbQeg5QyZJ5EPyU8An8jj'
25-
26-let adminPubKey4 = base58'HrzjFpn3V1Y5bB8r3JKGgR6qWUixJxuvToFXGJ4WDQu9'
27-
28-@Callable(i)
29-func deposit () = {
30- let isDepositLocked = valueOrElse(getBoolean("deposit_locked"), false)
31- let previousBalance = valueOrElse(getInteger("total_balance"), 0)
32- let isValidBlock = (targetBlock > height)
33- let isInitialized = valueOrElse(getBoolean("initialized"), false)
34- if (if (if (if (if (if (if (!(isDepositLocked))
35- then isInitialized
36- else false)
37- then (size(i.payments) == 1)
38- else false)
39- then (i.payments[0].amount > 0)
40- else false)
41- then (i.payments[0].assetId == lpAssetId)
42- else false)
43- then isValidBlock
44- else false)
45- then (limit > (previousBalance + i.payments[0].amount))
46- else false)
47- then {
48- let startBlock = getIntegerValue("start_block")
49- func getWalletPreviousShare () = {
50- let lastDepositBlock = valueOrElse(getInteger((toString(i.caller) + "_last_deposit_block")), 0)
51- let lastWithdrawBlock = valueOrElse(getInteger((toString(i.caller) + "_last_withdraw_block")), 0)
52- let previousShare = if (if (if ((lastDepositBlock != 0))
53- then (startBlock > lastDepositBlock)
54- else false)
55- then (startBlock > lastWithdrawBlock)
56- else false)
57- then {
58- let walletBalance = valueOrElse(getInteger((toString(i.caller) + "_balance")), 0)
59- fraction(walletBalance, roundHeight, decimals)
60- }
61- else valueOrElse(getInteger((((toString(i.caller) + "_") + toString(startBlock)) + "_share")), 0)
62- previousShare
63- }
64-
65- func getTotalPreviousShare () = {
66- let lastDepositBlock = valueOrElse(getInteger("last_deposit_block"), 0)
67- let lastWithdrawBlock = valueOrElse(getInteger("last_withdraw_block"), 0)
68- let previousShare = if (if (if ((lastDepositBlock != 0))
69- then (startBlock > lastDepositBlock)
70- else false)
71- then (startBlock > lastWithdrawBlock)
72- else false)
73- then {
74- let totalBalance = valueOrElse(getInteger("total_balance"), 0)
75- fraction(totalBalance, roundHeight, decimals)
76- }
77- else valueOrElse(getInteger((toString(startBlock) + "_total_share")), 0)
78- previousShare
79- }
80-
81- let walletPreviousShare = getWalletPreviousShare()
82- let walletShare = (walletPreviousShare + fraction(i.payments[0].amount, ((startBlock + roundHeight) - height), decimals))
83- let walletPreviousBalance = valueOrElse(getInteger((toString(i.caller) + "_balance")), 0)
84- let walletBalance = (walletPreviousBalance + i.payments[0].amount)
85- let totalPreviousShare = getTotalPreviousShare()
86- let totalShare = (totalPreviousShare + fraction(i.payments[0].amount, ((startBlock + roundHeight) - height), decimals))
87- let previousTotalBalance = valueOrElse(getInteger("total_balance"), 0)
88- let totalBalance = (previousTotalBalance + i.payments[0].amount)
89- let depositCall = invoke(proxyAddress, "stakeLP", nil, [AttachedPayment(i.payments[0].assetId, i.payments[0].amount)])
90- if ((depositCall == depositCall))
91- then {
92- let previousWalletActivity = match getString((toString(i.caller) + "_activity")) {
93- case p: String =>
94- true
95- case n: Unit =>
96- false
97- case _ =>
98- throw("Match error")
99- }
100- let walletActivity = if (previousWalletActivity)
101- then if (!(contains(getStringValue((toString(i.caller) + "_activity")), toString(startBlock))))
102- then ((getStringValue((toString(i.caller) + "_activity")) + "_") + toString(startBlock))
103- else getStringValue((toString(i.caller) + "_activity"))
104- else toString(startBlock)
105- let firstDeposit = match getInteger((toString(i.caller) + "_first_deposit")) {
106- case p: Int =>
107- p
108- case n: Unit =>
109- startBlock
110- case _ =>
111- throw("Match error")
112- }
113- $Tuple2([IntegerEntry((toString(i.caller) + "_balance"), walletBalance), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_share"), walletShare), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_balance"), walletBalance), StringEntry((toString(i.caller) + "_activity"), walletActivity), IntegerEntry((toString(i.caller) + "_last_deposit_block"), startBlock), IntegerEntry((toString(i.caller) + "_first_deposit"), firstDeposit), IntegerEntry("total_balance", totalBalance), IntegerEntry((toString(startBlock) + "_total_share"), totalShare), IntegerEntry("last_deposit_block", startBlock)], unit)
114- }
115- else throw("Strict value is not equal to itself.")
116- }
117- else throw("")
118- }
119-
120-
121-
122-@Callable(i)
123-func withdraw (amount) = {
124- let isWithdrawLocked = valueOrElse(getBoolean("withdraw_locked"), false)
125- let walletPreviousBalance = valueOrElse(getInteger((toString(i.caller) + "_balance")), 0)
126- if (if (if (if (!(isWithdrawLocked))
127- then (amount > 0)
128- else false)
129- then (walletPreviousBalance > 0)
130- else false)
131- then (walletPreviousBalance >= amount)
132- else false)
133- then {
134- let startBlock = getIntegerValue("start_block")
135- func getWalletPreviousShare () = {
136- let lastDepositBlock = valueOrElse(getInteger((toString(i.caller) + "_last_deposit_block")), 0)
137- let lastWithdrawBlock = valueOrElse(getInteger((toString(i.caller) + "_last_withdraw_block")), 0)
138- let previousShare = if (if ((startBlock > lastDepositBlock))
139- then (startBlock > lastWithdrawBlock)
140- else false)
141- then {
142- let walletBalance = valueOrElse(getInteger((toString(i.caller) + "_balance")), 0)
143- fraction(walletBalance, roundHeight, decimals)
144- }
145- else valueOrElse(getInteger((((toString(i.caller) + "_") + toString(startBlock)) + "_share")), 0)
146- previousShare
147- }
148-
149- func getTotalPreviousShare () = {
150- let lastDepositBlock = valueOrElse(getInteger("last_deposit_block"), 0)
151- let lastWithdrawBlock = valueOrElse(getInteger("last_withdraw_block"), 0)
152- let previousShare = if (if ((startBlock > lastDepositBlock))
153- then (startBlock > lastWithdrawBlock)
154- else false)
155- then {
156- let totalBalance = valueOrElse(getInteger("total_balance"), 0)
157- fraction(totalBalance, roundHeight, decimals)
158- }
159- else valueOrElse(getInteger((toString(startBlock) + "_total_share")), 0)
160- previousShare
161- }
162-
163- let walletBalance = (walletPreviousBalance - amount)
164- let walletShare = (getWalletPreviousShare() - fraction(amount, ((startBlock + roundHeight) - height), decimals))
165- let totalBalance = (valueOrElse(getInteger("total_balance"), 0) - amount)
166- let totalShare = (getTotalPreviousShare() - fraction(amount, ((startBlock + roundHeight) - height), decimals))
167- let previousWalletActivity = match getString((toString(i.caller) + "_activity")) {
168- case p: String =>
169- true
170- case n: Unit =>
171- false
172- case _ =>
173- throw("Match error")
174- }
175- let walletActivity = if (previousWalletActivity)
176- then if (!(contains(getStringValue((toString(i.caller) + "_activity")), toString(startBlock))))
177- then ((getStringValue((toString(i.caller) + "_activity")) + "_") + toString(startBlock))
178- else getStringValue((toString(i.caller) + "_activity"))
179- else toString(startBlock)
180- let isEnded = valueOrElse(getBoolean("ended"), false)
181- if (!(isEnded))
182- then {
183- let withdrawCall = invoke(proxyAddress, "unstakeLP", [amount], nil)
184- if ((withdrawCall == withdrawCall))
185- then $Tuple2([ScriptTransfer(i.caller, amount, lpAssetId), IntegerEntry((toString(i.caller) + "_balance"), walletBalance), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_share"), walletShare), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_balance"), walletBalance), StringEntry((toString(i.caller) + "_activity"), walletActivity), IntegerEntry((toString(i.caller) + "_last_withdraw_block"), startBlock), IntegerEntry("total_balance", totalBalance), IntegerEntry((toString(startBlock) + "_total_share"), totalShare), IntegerEntry("last_withdraw_block", startBlock)], unit)
186- else throw("Strict value is not equal to itself.")
187- }
188- else if ((targetBlock >= startBlock))
189- then $Tuple2([ScriptTransfer(i.caller, amount, lpAssetId), IntegerEntry((toString(i.caller) + "_balance"), walletBalance), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_share"), walletShare), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_balance"), walletBalance), StringEntry((toString(i.caller) + "_activity"), walletActivity), IntegerEntry((toString(i.caller) + "_last_withdraw_block"), startBlock), IntegerEntry("total_balance", totalBalance), IntegerEntry((toString(startBlock) + "_total_share"), totalShare), IntegerEntry("last_withdraw_block", startBlock)], unit)
190- else $Tuple2([ScriptTransfer(i.caller, amount, lpAssetId), IntegerEntry((toString(i.caller) + "_balance"), walletBalance), StringEntry((toString(i.caller) + "_activity"), walletActivity), IntegerEntry((toString(i.caller) + "_last_withdraw_block"), startBlock), IntegerEntry("total_balance", totalBalance), IntegerEntry("last_withdraw_block", startBlock)], unit)
191- }
192- else throw("")
193- }
194-
195-
196-
197-@Callable(i)
198-func end () = {
199- let isEndLocked = valueOrElse(getBoolean("end_locked"), false)
200- let startBlock = getIntegerValue("start_block")
201- let isEnded = valueOrElse(getBoolean((("start_block_" + toString(startBlock)) + "_ended")), false)
202- let isValidBlock = (height >= (startBlock + roundHeight))
203- if (if (if (if (!(isEndLocked))
204- then !(isEnded)
205- else false)
206- then isValidBlock
207- else false)
208- then (targetBlock >= startBlock)
209- else false)
210- then {
211- let previousWXAmount = assetBalance(this, wxAssetId)
212- if ((previousWXAmount == previousWXAmount))
213- then {
214- let previousWXBAmount = assetBalance(this, wxbAssetId)
215- if ((previousWXBAmount == previousWXBAmount))
216- then {
217- let claimWXCall = invoke(proxyAddress, "claim", nil, nil)
218- if ((claimWXCall == claimWXCall))
219- then {
220- let roundWXRewardAmount = (assetBalance(this, wxAssetId) - previousWXAmount)
221- if ((roundWXRewardAmount == roundWXRewardAmount))
222- then {
223- let roundWXBRewardAmount = (assetBalance(this, wxbAssetId) - previousWXBAmount)
224- if ((roundWXBRewardAmount == roundWXBRewardAmount))
225- then {
226- let totalWXRewardAmount = (valueOrElse(getInteger(this, "total_wx_reward_amount"), 0) + roundWXRewardAmount)
227- let totalWXBRewardAmount = (valueOrElse(getInteger(this, "total_wxb_reward_amount"), 0) + roundWXBRewardAmount)
228- let roundShare = match getInteger((toString(startBlock) + "_total_share")) {
229- case p: Int =>
230- p
231- case n: Unit =>
232- fraction(valueOrElse(getInteger("total_balance"), 0), roundHeight, decimals)
233- case _ =>
234- throw("Match error")
235- }
236- let roundActivity = match getString("round_activity") {
237- case p: String =>
238- ((p + "_") + toString(startBlock))
239- case n: Unit =>
240- toString(startBlock)
241- case _ =>
242- throw("Match error")
243- }
244- let rewardAmount = getIntegerValue("reward_amount")
245- $Tuple2([ScriptTransfer(i.caller, rewardAmount, wxbAssetId), IntegerEntry((("start_block_" + toString(startBlock)) + "_end_block"), height), BooleanEntry((("start_block_" + toString(startBlock)) + "_ended"), true), IntegerEntry((("start_block_" + toString(startBlock)) + "_wx_reward_amount"), roundWXRewardAmount), IntegerEntry((("start_block_" + toString(startBlock)) + "_wxb_reward_amount"), roundWXBRewardAmount), IntegerEntry("total_wx_reward_amount", totalWXRewardAmount), IntegerEntry("total_wxb_reward_amount", totalWXBRewardAmount), IntegerEntry((toString(startBlock) + "_total_share"), roundShare), StringEntry("round_activity", roundActivity), IntegerEntry("start_block", height)], unit)
246- }
247- else throw("Strict value is not equal to itself.")
248- }
249- else throw("Strict value is not equal to itself.")
250- }
251- else throw("Strict value is not equal to itself.")
252- }
253- else throw("Strict value is not equal to itself.")
254- }
255- else throw("Strict value is not equal to itself.")
256- }
257- else throw("")
258- }
259-
260-
261-
262-@Callable(i)
263-func claim (startBlock) = {
264- let isClaimLocked = valueOrElse(getBoolean("claim_locked"), false)
265- let isEnded = valueOrElse(getBoolean((("start_block_" + toString(startBlock)) + "_ended")), false)
266- let isClaimed = valueOrElse(getBoolean((((toString(i.caller) + "_") + toString(startBlock)) + "_claimed")), false)
267- if (if (if (if (!(isClaimLocked))
268- then isEnded
269- else false)
270- then !(isClaimed)
271- else false)
272- then (targetBlock >= startBlock)
273- else false)
274- then {
275- func getWalletShare () = {
276- let lastDepositBlock = valueOrElse(getInteger((toString(i.caller) + "_last_deposit_block")), 0)
277- let lastWithdrawBlock = valueOrElse(getInteger((toString(i.caller) + "_last_withdraw_block")), 0)
278- let walletShare = if ((lastDepositBlock == 0))
279- then throw("")
280- else if ((valueOrElse(getInteger((((toString(i.caller) + "_") + toString(startBlock)) + "_share")), 0) != 0))
281- then getIntegerValue((((toString(i.caller) + "_") + toString(startBlock)) + "_share"))
282- else if (if ((startBlock > lastDepositBlock))
283- then (startBlock > lastWithdrawBlock)
284- else false)
285- then {
286- let walletBalance = valueOrElse(getInteger((toString(i.caller) + "_balance")), 0)
287- fraction(walletBalance, roundHeight, decimals)
288- }
289- else {
290- let firstDeposit = getIntegerValue((toString(i.caller) + "_first_deposit"))
291- if (!((startBlock > firstDeposit)))
292- then throw("")
293- else {
294- let rounds = getStringValue("round_activity")
295- let previousRounds = dropRight(rounds, ((size(rounds) + 1) - value(indexOf(rounds, toString(startBlock)))))
296- let theIndexOfTheClosestRound = if ((valueOrElse(lastIndexOf(previousRounds, "_"), 0) != 0))
297- then (value(lastIndexOf(previousRounds, "_")) + 1)
298- else 0
299- let closestRound = drop(previousRounds, theIndexOfTheClosestRound)
300- let activities = split(getStringValue((toString(i.caller) + "_activity")), "_")
301- func findClosest (acc,next) = {
302- let closest = if (if ((value(parseInt(closestRound)) > value(parseInt(next))))
303- then (value(parseInt(next)) > value(parseInt(acc)))
304- else false)
305- then next
306- else acc
307- closest
308- }
309-
310- let closestActivity = if (containsElement(activities, closestRound))
311- then closestRound
312- else {
313- let closest = {
314- let $l = activities
315- let $s = size($l)
316- let $acc0 = "0"
317- func $f0_1 ($a,$i) = if (($i >= $s))
318- then $a
319- else findClosest($a, $l[$i])
320-
321- func $f0_2 ($a,$i) = if (($i >= $s))
322- then $a
323- else throw("List size exceeds 53")
324-
325- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($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), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53)
326- }
327- closest
328- }
329- let theShare = fraction(getIntegerValue((((toString(i.caller) + "_") + closestActivity) + "_balance")), roundHeight, decimals)
330- theShare
331- }
332- }
333- walletShare
334- }
335-
336- let walletShare = getWalletShare()
337- if ((walletShare > 0))
338- then {
339- let totalShare = getIntegerValue((toString(startBlock) + "_total_share"))
340- let roundTotalWXReward = valueOrElse(getInteger((("start_block_" + toString(startBlock)) + "_wx_reward_amount")), 0)
341- let roundUserWXReward = fraction(walletShare, roundTotalWXReward, totalShare)
342- let roundTotalWXBReward = valueOrElse(getInteger((("start_block_" + toString(startBlock)) + "_wxb_reward_amount")), 0)
343- let roundUserWXBReward = fraction(walletShare, roundTotalWXBReward, totalShare)
344- let roundTotalClaimedWX = (valueOrElse(getInteger((toString(startBlock) + "_total_claimed_wx_reward_amount")), 0) + roundUserWXReward)
345- let totalClaimedWX = (valueOrElse(getInteger("total_claimed_wx_reward_amount"), 0) + roundUserWXReward)
346- let roundTotalClaimedWXB = (valueOrElse(getInteger((toString(startBlock) + "_total_claimed_wxb_reward_amount")), 0) + roundUserWXBReward)
347- let totalClaimedWXB = (valueOrElse(getInteger("total_claimed_wxb_reward_amount"), 0) + roundUserWXBReward)
348- let userTotalClaimedWX = (valueOrElse(getInteger((toString(i.caller) + "_total_claimed_wx_amount")), 0) + roundUserWXReward)
349- let userTotalClaimedWXB = (valueOrElse(getInteger((toString(i.caller) + "_total_claimed_wxb_amount")), 0) + roundUserWXBReward)
350- $Tuple2([ScriptTransfer(i.caller, roundUserWXReward, wxAssetId), ScriptTransfer(i.caller, roundUserWXBReward, wxbAssetId), BooleanEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_claimed"), true), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_claimed_wx_reward_amount"), roundUserWXReward), IntegerEntry((toString(i.caller) + "_total_claimed_wx_amount"), userTotalClaimedWX), IntegerEntry((toString(startBlock) + "_total_claimed_wx_reward_amount"), roundTotalClaimedWX), IntegerEntry("total_claimed_wx_reward_amount", totalClaimedWX), IntegerEntry((((toString(i.caller) + "_") + toString(startBlock)) + "_claimed_wxb_reward_amount"), roundUserWXBReward), IntegerEntry((toString(i.caller) + "_total_claimed_wxb_amount"), userTotalClaimedWXB), IntegerEntry((toString(startBlock) + "_total_claimed_wxb_reward_amount"), roundTotalClaimedWXB), IntegerEntry("total_claimed_wxb_reward_amount", totalClaimedWXB)], unit)
351- }
352- else throw("")
353- }
354- else throw("")
355- }
356-
357-
358-
359-@Callable(i)
360-func init (startBlock) = {
361- let isInitialized = valueOrElse(getBoolean("initialized"), false)
362- if (if (!(isInitialized))
363- then containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKey4], i.callerPublicKey)
364- else false)
365- then $Tuple2([BooleanEntry("initialized", true), IntegerEntry("start_block", startBlock), IntegerEntry("first_block", startBlock), IntegerEntry("reward_amount", 10000000000)], unit)
366- else throw("")
367- }
368-
369-
370-
371-@Callable(i)
372-func changeRewardAmount (amount) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKey4], i.callerPublicKey))
373- then $Tuple2([IntegerEntry("reward_amount", amount)], unit)
374- else throw("")
375-
376-
377-
378-@Callable(i)
379-func finalize () = {
380- let isEnded = valueOrElse(getBoolean("ended"), false)
381- if (if (!(isEnded))
382- then (height > targetBlock)
383- else false)
384- then {
385- let totalBalance = valueOrElse(getInteger("total_balance"), 0)
386- let withdrawAll = invoke(proxyAddress, "unstakeLP", [totalBalance], nil)
387- if ((withdrawAll == withdrawAll))
388- then $Tuple2([BooleanEntry("ended", true), IntegerEntry("end_block", height)], unit)
389- else throw("Strict value is not equal to itself.")
390- }
391- else throw("")
392- }
393-
394-
395-
396-@Callable(i)
397-func lock (deposit,withdraw,end,claim) = if ((i.caller == this))
398- then $Tuple2([BooleanEntry("deposit_locked", deposit), BooleanEntry("withdraw_locked", withdraw), BooleanEntry("end_locked", end), BooleanEntry("claim_locked", claim)], unit)
399- else throw("")
400-
401-
402-@Verifier(tx)
403-func verify () = {
404- let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
405- then 1
406- else 0
407- let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
408- then 1
409- else 0
410- let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
411- then 1
412- else 0
413- let adminPubKey4Signed = if (sigVerify(tx.bodyBytes, tx.proofs[3], adminPubKey4))
414- then 1
415- else 0
416- ((((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) + adminPubKey4Signed) >= 3)
417- }
418-
1+# no script

github/deemru/w8io/3ef1775 
56.54 ms