tx · 995YqVDxcowe84RpH2nhXsk9c54Y57FK6jcMw5nMQYeN 3MvjTVdccn9BAJcy9uK2uiMj3rWzuRPceNJ: -0.01200000 Waves 2022.12.20 12:54 [2368454] smart account 3MvjTVdccn9BAJcy9uK2uiMj3rWzuRPceNJ > SELF 0.00000000 Waves
{ "type": 13, "id": "995YqVDxcowe84RpH2nhXsk9c54Y57FK6jcMw5nMQYeN", "fee": 1200000, "feeAssetId": null, "timestamp": 1671530182206, "version": 1, "sender": "3MvjTVdccn9BAJcy9uK2uiMj3rWzuRPceNJ", "senderPublicKey": "Fctyv3ezWUWWuoap6B4qwJYC95K8E8q6JcAYEU5anZcF", "proofs": [ "3dACY6XfHfusEzKbm4Mcbc2z9zo8jLSCo6GokbF7TYqTsTTSsbZP2tbcyVKTDKvZmpBaqCTLyMT32zHz2KyU5pr7" ], "script": "base64:AgQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAObWluV2l0aGRyYXdGZWUAAAAAAAAHoSAEAAAAEHJlZ2lzdGVyQmV0VHhGZWUAAAAAAAAHoSAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAp3aXRoZHJhd1R4BQAAAAckbWF0Y2gwBAAAAAR0eElkCQEAAAAHZXh0cmFjdAAAAAEJAAQdAAAAAgUAAAACbWUJAAEsAAAAAgkAAlgAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAECAAAACV93aXRoZHJhdwQAAAAHJG1hdGNoMQkAA+gAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEDCQAAAQAAAAIFAAAAByRtYX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ABAAAAAAAAAAAFAAAAAAAAAAAHCQAAygAAAAIJAADJAAAAAgUAAAAKdmFsQ29tcGxleAAAAAAAAAAABwAAAAAAAAAABgkAAAIAAAABAgAAACBJbmNvcnJlY3QgdHlwZSBvZiBndWVzcyBwcm92aWRlZAQAAAAFaXNXaW4JAAAAAAAAAgkAAMoAAAACBQAAAAVndWVzcwAAAAAAAAAAAQUAAAAHdmFsUmVhbAQAAAASaXNNb25leVN0aWxsRW5vdWdoCQAAZgAAAAIJAABkAAAAAgkAAGgAAAACCQAAZQAAAAIIBQAAAAlwYXltZW50VHgAAAAGYW1vdW50BQAAABByZWdpc3RlckJldFR4RmVlBQAAAAVrb2VmZgUAAAAObWluV2l0aGRyYXdGZWUFAAAAB25ld0ZlZXMDAwUAAAAFaXNXaW4GCQAAAgAAAAECAAAAEFlvdSBkaWRuJ3QgZ3Vlc3MDBQAAABJpc01vbmV5U3RpbGxFbm91Z2gGCQAAAgAAAAECAAAAHU5vdCBlbm91Z2ggbW9uZXkgZm9yIHdpdGhkcmF3BwcHBwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnNTQ9C", "chainId": 84, "height": 2368454, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6DFKpT4FGdJneoQfYNrkJd9eSBETK9jnmkEczM2VJZBo Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 2 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let me = tx.sender | |
4 | 4 | let oracle = extract(addressFromString("3NCzaYTNDGtR8zf9yfcqePFjCqFx9S5zhs4")) | |
5 | 5 | let minWithdrawFee = 500000 | |
6 | 6 | let registerBetTxFee = 500000 | |
7 | 7 | match tx { | |
8 | 8 | case withdrawTx: TransferTransaction => | |
9 | 9 | let txId = extract(getString(me, (toBase58String(tx.proofs[1]) + "_withdraw"))) | |
10 | 10 | match transactionById(tx.proofs[1]) { | |
11 | 11 | case paymentTx: TransferTransaction => | |
12 | 12 | let isPaymentTookPlace = if ((txId == toBase58String(tx.id))) | |
13 | 13 | then sigVerify(tx.bodyBytes, tx.proofs[0], paymentTx.senderPublicKey) | |
14 | 14 | else false | |
15 | 15 | let feesKey = (toBase58String(tx.proofs[1]) + "_withdraw_fees") | |
16 | 16 | let dataTxsFees = extract(getInteger(me, feesKey)) | |
17 | 17 | let guessUnit = getBinary(me, toBase58String(tx.proofs[1])) | |
18 | 18 | let correctAmount = if (!(isDefined(guessUnit))) | |
19 | 19 | then ((paymentTx.amount - dataTxsFees) - withdrawTx.fee) | |
20 | 20 | else { | |
21 | 21 | let guess = extract(guessUnit) | |
22 | 22 | let type = take(guess, 1) | |
23 | 23 | let val = drop(guess, 1) | |
24 | 24 | let key = extract(getString(me, (toBase58String(tx.proofs[1]) + "_round"))) | |
25 | 25 | let valComplex = extract(getBinary(oracle, key)) | |
26 | 26 | let koeff = if ((type == drop(toBytes(0), 7))) | |
27 | 27 | then 36 | |
28 | 28 | else if ((type == drop(toBytes(1), 7))) | |
29 | 29 | then 2 | |
30 | 30 | else if ((type == drop(toBytes(2), 7))) | |
31 | 31 | then 2 | |
32 | 32 | else if ((type == drop(toBytes(3), 7))) | |
33 | 33 | then 2 | |
34 | 34 | else if ((type == drop(toBytes(4), 7))) | |
35 | 35 | then 3 | |
36 | 36 | else if ((type == drop(toBytes(5), 7))) | |
37 | 37 | then 3 | |
38 | 38 | else 0 | |
39 | 39 | ((((paymentTx.amount - registerBetTxFee) * koeff) - dataTxsFees) - withdrawTx.fee) | |
40 | 40 | } | |
41 | 41 | if (if (if (isPaymentTookPlace) | |
42 | 42 | then true | |
43 | 43 | else throw("There was no bet")) | |
44 | 44 | then if ((withdrawTx.amount == correctAmount)) | |
45 | 45 | then true | |
46 | 46 | else throw(("Amount is incorrect. Correct amount is " + toString(correctAmount))) | |
47 | 47 | else false) | |
48 | 48 | then if (if (!(isDefined(withdrawTx.feeAssetId))) | |
49 | 49 | then !(isDefined(withdrawTx.assetId)) | |
50 | 50 | else false) | |
51 | 51 | then true | |
52 | 52 | else throw("Withdraw and fee must be in WAVES") | |
53 | 53 | else false | |
54 | 54 | case _ => | |
55 | 55 | false | |
56 | 56 | } | |
57 | 57 | case dtx: DataTransaction => | |
58 | 58 | if ((size(dtx.data) == 3)) | |
59 | 59 | then { | |
60 | 60 | let minBet = 50000000 | |
61 | 61 | let maxSumBet = 1000000000 | |
62 | 62 | let paymentTxIdStr = extract(dtx.data[0].key) | |
63 | 63 | let guessStr = extract(getString(dtx.data, paymentTxIdStr)) | |
64 | 64 | let paymentRoundKey = (paymentTxIdStr + "_round") | |
65 | 65 | let paymentRound = extract(getString(dtx.data, paymentRoundKey)) | |
66 | 66 | let sumBetsOld = if (isDefined(getInteger(me, (paymentRound + "_betsSum")))) | |
67 | 67 | then extract(getInteger(me, (paymentRound + "_betsSum"))) | |
68 | 68 | else 0 | |
69 | 69 | let sumBetsNew = extract(getInteger(dtx.data, (paymentRound + "_betsSum"))) | |
70 | 70 | let itsTooLate = isDefined(getString(me, (paymentRound + "_stop"))) | |
71 | 71 | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
72 | 72 | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
73 | 73 | match paymentTx { | |
74 | 74 | case paymentTx: TransferTransaction => | |
75 | 75 | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
76 | 76 | let correctSumBets = ((sumBetsOld + paymentTx.amount) - dtx.fee) | |
77 | 77 | if (if (if (if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me)) | |
78 | 78 | then true | |
79 | 79 | else throw("Incorrect recipient of the payment")) | |
80 | 80 | then if (!(isPaymentAlreadyMentioned)) | |
81 | 81 | then true | |
82 | 82 | else throw("This transfer is already used as a bet") | |
83 | 83 | else false) | |
84 | 84 | then if ((sumBetsNew == correctSumBets)) | |
85 | 85 | then true | |
86 | 86 | else throw(("Wrong value for Sum of Bets. Must be " + toString(correctSumBets))) | |
87 | 87 | else false) | |
88 | 88 | then if ((maxSumBet > sumBetsNew)) | |
89 | 89 | then true | |
90 | 90 | else throw(((("Maximum amount of bets for round " + toString(maxSumBet)) + ". With your bet it's ") + toString(sumBetsNew))) | |
91 | 91 | else false) | |
92 | 92 | then if ((dtx.fee == registerBetTxFee)) | |
93 | 93 | then true | |
94 | 94 | else throw(("Fee of bet registration data transaction must be " + toString(registerBetTxFee))) | |
95 | 95 | else false) | |
96 | 96 | then if (((paymentTx.amount - registerBetTxFee) >= minBet)) | |
97 | 97 | then true | |
98 | 98 | else throw(((("Your Bet amount is less then minimal bet " + toString(minBet)) + ". Payment amount for such bet must be ") + toString((minBet + registerBetTxFee)))) | |
99 | 99 | else false) | |
100 | 100 | then if (!(isDefined(paymentTx.feeAssetId))) | |
101 | 101 | then true | |
102 | 102 | else throw("Paymnet must be in WAVES") | |
103 | 103 | else false) | |
104 | 104 | then if (!(itsTooLate)) | |
105 | 105 | then true | |
106 | 106 | else throw("It's too late to play this round. Try next one") | |
107 | 107 | else false | |
108 | 108 | case _ => | |
109 | 109 | false | |
110 | 110 | } | |
111 | 111 | } | |
112 | 112 | else if ((size(dtx.data) == 2)) | |
113 | 113 | then { | |
114 | 114 | let isDataCountOk = (size(dtx.data) == 2) | |
115 | 115 | let paymentTxIdStr = dropRight(extract(dtx.data[0].key), 9) | |
116 | 116 | let feesKey = (paymentTxIdStr + "_withdraw_fees") | |
117 | 117 | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
118 | 118 | let newFees = extract(getInteger(dtx.data, feesKey)) | |
119 | 119 | let oldFeesUnit = getInteger(me, feesKey) | |
120 | 120 | let oldFees = if (isDefined(oldFeesUnit)) | |
121 | 121 | then extract(oldFeesUnit) | |
122 | 122 | else 0 | |
123 | 123 | let isFeeCorrect = (newFees == (oldFees + dtx.fee)) | |
124 | 124 | let withdrawTxIdUnit = getString(me, paymentTxIdStr) | |
125 | 125 | let isPaymentAlreadyMentioned = isDefined(withdrawTxIdUnit) | |
126 | 126 | let withdrawTransactionId = fromBase58String(extract(withdrawTxIdUnit)) | |
127 | 127 | match paymentTx { | |
128 | 128 | case paymentTx: TransferTransaction => | |
129 | 129 | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
130 | 130 | if (if (if (if (if ((addressFromRecipient(paymentTx.recipient) == me)) | |
131 | 131 | then if (!(isPaymentAlreadyMentioned)) | |
132 | 132 | then true | |
133 | 133 | else !(isDefined(transactionById(withdrawTransactionId))) | |
134 | 134 | else false) | |
135 | 135 | then isDtxSignedByPayer | |
136 | 136 | else false) | |
137 | 137 | then isFeeCorrect | |
138 | 138 | else false) | |
139 | 139 | then isDataCountOk | |
140 | 140 | else false) | |
141 | 141 | then { | |
142 | 142 | let guess = extract(getBinary(me, paymentTxIdStr)) | |
143 | 143 | let type = take(guess, 1) | |
144 | 144 | let key = extract(getString(me, (paymentTxIdStr + "_round"))) | |
145 | 145 | let valComplex = extract(getBinary(oracle, key)) | |
146 | 146 | let koeff = if ((type == drop(toBytes(0), 7))) | |
147 | 147 | then 36 | |
148 | 148 | else if ((type == drop(toBytes(1), 7))) | |
149 | 149 | then 2 | |
150 | 150 | else if ((type == drop(toBytes(2), 7))) | |
151 | 151 | then 2 | |
152 | 152 | else if ((type == drop(toBytes(3), 7))) | |
153 | 153 | then 2 | |
154 | 154 | else if ((type == drop(toBytes(4), 7))) | |
155 | 155 | then 3 | |
156 | 156 | else if ((type == drop(toBytes(5), 7))) | |
157 | 157 | then 3 | |
158 | 158 | else 0 | |
159 | 159 | let valReal = if ((type == drop(toBytes(0), 7))) | |
160 | 160 | then drop(take(valComplex, 2), 1) | |
161 | 161 | else if ((type == drop(toBytes(1), 7))) | |
162 | 162 | then drop(take(valComplex, 3), 2) | |
163 | 163 | else if ((type == drop(toBytes(2), 7))) | |
164 | 164 | then drop(take(valComplex, 4), 3) | |
165 | 165 | else if ((type == drop(toBytes(3), 7))) | |
166 | 166 | then drop(take(valComplex, 5), 4) | |
167 | 167 | else if ((type == drop(toBytes(4), 7))) | |
168 | 168 | then drop(take(valComplex, 6), 5) | |
169 | 169 | else if ((type == drop(toBytes(5), 7))) | |
170 | 170 | then drop(take(valComplex, 7), 6) | |
171 | 171 | else throw("Incorrect type of guess provided") | |
172 | 172 | let isWin = (drop(guess, 1) == valReal) | |
173 | 173 | let isMoneyStillEnough = ((((paymentTx.amount - registerBetTxFee) * koeff) + minWithdrawFee) > newFees) | |
174 | 174 | if (if (isWin) | |
175 | 175 | then true | |
176 | 176 | else throw("You didn't guess")) | |
177 | 177 | then if (isMoneyStillEnough) | |
178 | 178 | then true | |
179 | 179 | else throw("Not enough money for withdraw") | |
180 | 180 | else false | |
181 | 181 | } | |
182 | 182 | else false | |
183 | 183 | case _ => | |
184 | 184 | false | |
185 | 185 | } | |
186 | 186 | } | |
187 | 187 | else false | |
188 | 188 | case _ => | |
189 | 189 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
190 | 190 | } |
github/deemru/w8io/169f3d6 52.00 ms ◑