tx · 2bfEvD8zhxzNBgu1o6T4uQB54GUDR6gwjUXnUUKsvWkT 3MvVwhWUmLfFgk1WJuyx2aiYqUfAfzdnvvE: -0.01000000 Waves 2019.03.19 18:33 [543312] smart account 3MvVwhWUmLfFgk1WJuyx2aiYqUfAfzdnvvE > SELF 0.00000000 Waves
{ "type": 13, "id": "2bfEvD8zhxzNBgu1o6T4uQB54GUDR6gwjUXnUUKsvWkT", "fee": 1000000, "feeAssetId": null, "timestamp": 1553009651620, "version": 1, "sender": "3MvVwhWUmLfFgk1WJuyx2aiYqUfAfzdnvvE", "senderPublicKey": "9JDtqb9iVgocc74p3a56YBHDFdQ9Nx1XbWVuT873EUMH", "proofs": [ "34BX1PqR4KKBZQ525hELaKj3suyKeyQfKNEKWFAUoma5Lbe5Z9RZKEV6yAZSPcLQ7g1Pg7eeywTtXQFPFjPvrmAV" ], "script": "base64:AgQAAAAMbWluQmV0QW1vdW50AAAAAAAF9eEABAAAAAZtaW5GZWUAAAAAAAAHoSAEAAAADW1pbkhlaWdodERpZmYAAAAAAAAAAAEEAAAADW1heEhlaWdodERpZmYAAAAAAAAAAAUEAAAAEWJsb2Nrc09uR2FtZVN0YXJ0AAAAAAAACEpQBAAAAA5ibG9ja3NQZXJSb3VuZAAAAAAAAAAACgQAAAAUYmxvY2tzUGVyQ29tcGV0aXRpb24AAAAAAAAAAAYEAAAABm9mZnNldAkAAGUAAAACBQAAAAZoZWlnaHQFAAAAEWJsb2Nrc09uR2FtZVN0YXJ0BAAAAAhyb3VuZE51bQkAAGkAAAACBQAAAAZvZmZzZXQFAAAADmJsb2Nrc1BlclJvdW5kBAAAAAtyb3VuZEhlaWdodAkAAGoAAAACBQAAAAZvZmZzZXQFAAAADmJsb2Nrc1BlclJvdW5kBAAAABByb3VuZEhlaWdodFN0YXJ0CQAAZAAAAAIJAABoAAAAAgUAAAAIcm91bmROdW0FAAAADmJsb2Nrc1BlclJvdW5kBQAAABFibG9ja3NPbkdhbWVTdGFydAQAAAAOcm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AAAAHZXh0cmFjdAAAAAEJAAQdAAAAAgUAAAAEU0VMRgIAAAALbGFzdFBheW1lbnQEAAAAByRtYXRjaDEFAAAADWxhc3RQYXltZW50VHgDCQAAAQAAAAIFAAAAByRtYXRjaDECAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAADWxhc3RQYXltZW50VHgFAAAAByRtYXRjaDEEAAAAC29mZnNldFZhbGlkCQAAZwAAAAIFAAAABm9mZnNldAAAAAAAAAAAAAQAAAAQcGF5b3V0Um91bmRWYWxpZAkAAGYAAAACBQAAABBoZWlnaHRUb0dldE1vbmV5BQAAABByb3VuZEhlaWdodFN0YXJ0BAAAABFwYXlvdXRBbW91bnRWYWxpZAkAAGcAAAACCAUAAAAGcGF5b3V0AAAABmFtb3VudAkAAGUAAAACCQEAAAAMd2F2ZXNCYWxhbmNlAAAAAQUAAAAEU0VMRgUAAAAGbWluRmVlBAAAABRwYXlvdXRSZWNpcGllbnRWYWxpZAkAAAAAAAACCAUAAAANbGFzdFBheW1lbnRUeAAAAAZzZW5kZXIIBQAAAAZwYXlvdXQAAAAJcmVjaXBpZW50BAAAAA5wYXlvdXRGZWVWYWxpZAMJAAAAAAAAAggFAAAABnBheW91dAAAAANmZWUFAAAABm1pbkZlZQkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAABnBheW91dAAAAApmZWVBc3NldElkBwMDAwMDBQAAAAtvZmZzZXRWYWxpZAUAAAAKaXNXaXRoZHJhdwcFAAAAEHBheW91dFJvdW5kVmFsaWQHBQAAABFwYXlvdXRBbW91bnRWYWxpZAcFAAAAFHBheW91dFJlY2lwaWVudFZhbGlkBwUAAAAOcGF5b3V0RmVlVmFsaWQHBwfeUWfG", "chainId": 84, "height": 543312, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 2 #-} | |
2 | + | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | + | let minBetAmount = 100000000 | |
4 | + | let minFee = 500000 | |
5 | + | let minHeightDiff = 1 | |
6 | + | let maxHeightDiff = 5 | |
7 | + | let blocksOnGameStart = 543312 | |
8 | + | let blocksPerRound = 10 | |
9 | + | let blocksPerCompetition = 6 | |
10 | + | let offset = (height - blocksOnGameStart) | |
11 | + | let roundNum = (offset / blocksPerRound) | |
12 | + | let roundHeight = (offset % blocksPerRound) | |
13 | + | let roundHeightStart = ((roundNum * blocksPerRound) + blocksOnGameStart) | |
14 | + | let roundHeightEnd = (roundHeightStart + blocksPerRound) | |
15 | + | let SELF = tx.sender | |
16 | + | let heightToGetMoney = extract(getInteger(SELF, "heightToGetMoney")) | |
17 | + | let isWithdrawByWin = if ((height >= heightToGetMoney)) | |
18 | + | then (heightToGetMoney > roundHeightStart) | |
19 | + | else false | |
20 | + | let isWithdrawByTime = (roundHeight > blocksPerCompetition) | |
21 | + | let isWithdraw = if (isWithdrawByWin) | |
22 | + | then true | |
23 | + | else isWithdrawByTime | |
24 | + | let isCompetition = !(isWithdraw) | |
25 | + | match tx { | |
26 | + | case dtx: DataTransaction => | |
27 | + | let newHeightToGetMoney = extract(getInteger(dtx.data, "heightToGetMoney")) | |
28 | + | let paymentTxId = extract(getString(dtx.data, "lastPayment")) | |
29 | + | let paymentTxIdVec = fromBase58String(paymentTxId) | |
30 | + | let paymentTx = transactionById(paymentTxIdVec) | |
31 | + | let paymentTxHeight = extract(transactionHeightById(paymentTxIdVec)) | |
32 | + | let newHeightToGetMoneyValid = if (((height + minHeightDiff) >= roundHeightEnd)) | |
33 | + | then (roundHeightEnd > newHeightToGetMoney) | |
34 | + | else if (((newHeightToGetMoney - height) > minHeightDiff)) | |
35 | + | then (maxHeightDiff > (newHeightToGetMoney - height)) | |
36 | + | else false | |
37 | + | match paymentTx { | |
38 | + | case paymentTx: TransferTransaction => | |
39 | + | let offsetValid = (offset >= 0) | |
40 | + | let paymentFromCurrentRound = if ((paymentTxHeight >= roundHeightStart)) | |
41 | + | then (roundHeightEnd > paymentTxHeight) | |
42 | + | else false | |
43 | + | let paymentNotUsedBefore = !(isDefined(getString(SELF, paymentTxId))) | |
44 | + | let paymentRecipientValid = (paymentTx.recipient == SELF) | |
45 | + | let paymentAmountValid = (paymentTx.amount >= (minBetAmount + minFee)) | |
46 | + | let paymentAssetValid = !(isDefined(paymentTx.assetId)) | |
47 | + | let dataFormatValid = if ((size(dtx.data) == 3)) | |
48 | + | then isDefined(getString(dtx.data, paymentTxId)) | |
49 | + | else false | |
50 | + | let sigValid = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
51 | + | let feeValid = if ((dtx.fee >= minFee)) | |
52 | + | then ((paymentTx.amount - minBetAmount) >= dtx.fee) | |
53 | + | else false | |
54 | + | if (if (if (if (if (if (if (if (if (if (offsetValid) | |
55 | + | then isCompetition | |
56 | + | else false) | |
57 | + | then paymentFromCurrentRound | |
58 | + | else false) | |
59 | + | then paymentNotUsedBefore | |
60 | + | else false) | |
61 | + | then paymentRecipientValid | |
62 | + | else false) | |
63 | + | then paymentAmountValid | |
64 | + | else false) | |
65 | + | then paymentAssetValid | |
66 | + | else false) | |
67 | + | then newHeightToGetMoneyValid | |
68 | + | else false) | |
69 | + | then dataFormatValid | |
70 | + | else false) | |
71 | + | then sigValid | |
72 | + | else false) | |
73 | + | then feeValid | |
74 | + | else false | |
75 | + | case _ => | |
76 | + | false | |
77 | + | } | |
78 | + | case payout: TransferTransaction => | |
79 | + | let lastPaymentTx = transactionById(fromBase58String(extract(getString(SELF, "lastPayment")))) | |
80 | + | match lastPaymentTx { | |
81 | + | case lastPaymentTx: TransferTransaction => | |
82 | + | let offsetValid = (offset >= 0) | |
83 | + | let payoutRoundValid = (heightToGetMoney > roundHeightStart) | |
84 | + | let payoutAmountValid = (payout.amount >= (wavesBalance(SELF) - minFee)) | |
85 | + | let payoutRecipientValid = (lastPaymentTx.sender == payout.recipient) | |
86 | + | let payoutFeeValid = if ((payout.fee == minFee)) | |
87 | + | then !(isDefined(payout.feeAssetId)) | |
88 | + | else false | |
89 | + | if (if (if (if (if (offsetValid) | |
90 | + | then isWithdraw | |
91 | + | else false) | |
92 | + | then payoutRoundValid | |
93 | + | else false) | |
94 | + | then payoutAmountValid | |
95 | + | else false) | |
96 | + | then payoutRecipientValid | |
97 | + | else false) | |
98 | + | then payoutFeeValid | |
99 | + | else false | |
100 | + | case _ => | |
101 | + | false | |
102 | + | } | |
103 | + | case _ => | |
104 | + | false | |
105 | + | } |
github/deemru/w8io/169f3d6 31.98 ms ◑