tx · F96iXne7dshnS1yBoebf9zPz9RHn3fV2wJRWTz6RZ6E7 3N3wfxXmkHj8vzHBk7dStUxPgfFPv8b7y6S: -0.01000000 Waves 2019.10.24 12:25 [733995] smart account 3N3wfxXmkHj8vzHBk7dStUxPgfFPv8b7y6S > SELF 0.00000000 Waves
{ "type": 13, "id": "F96iXne7dshnS1yBoebf9zPz9RHn3fV2wJRWTz6RZ6E7", "fee": 1000000, "feeAssetId": null, "timestamp": 1571909204279, "version": 1, "sender": "3N3wfxXmkHj8vzHBk7dStUxPgfFPv8b7y6S", "senderPublicKey": "VJa1gTWuZpTpYuBWzHrimMPYeBcpX171Zhc7Qc9bYdF", "proofs": [ "4pLn742FeuuZaN1FkdEGcnpWKtybjELfAWF8dM5xDqi7GsFpcob6Y7BYP9wq4y5w5jJw3SMUNnH53CQM5kfJLKeH" ], "script": "base64:AAIDAAAAAAAAAAoIARIAEgQKAgEIAAAAKgAAAAAHV0FWRUxFVAkAAGgAAAACCQAAaAAAAAIAAAAAAAAAAGQAAAAAAAAAA+gAAAAAAAAAA+gAAAAABU1SVEVDAAAAAAAAAABkAAAAAAltYXhSb3VuZHMAAAAAAAX14QAAAAAAB3BtdFN0ZXAJAABoAAAAAgAAAAAAAAAACgUAAAAFTVJURUMAAAAAEHBhcnR5T3duZXJQdWJLZXkJAAJZAAAAAQIAAAAsNGY4allKY2NDamFyVmdjOEZIbjVtczVZTGtwaTZQZkhweFRubWpRWk1rSmsAAAAAEXBhcnR5T3duZXJBZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAABBwYXJ0eU93bmVyUHViS2V5AAAAAA1sZWFzaW5nUGVyaW9kAAAAAAAAAAAKAAAAABFsZWFzaW5nSWRMaWZldGltZQAAAAAAAAAABQAAAAAXbGVhc2luZ0lkRGlmZkluTGlmZXRpbWUAAAAAAAAAAAIAAAAACmxlYXNpbmdBbXQJAABoAAAAAgAAAAAAAAAAAQUAAAAHV0FWRUxFVAAAA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CAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0J1cm5UcmFuc2FjdGlvbgQAAAADYnR4BQAAAAckbWF0Y2gwAwkBAAAAASEAAAABBQAAABJsZWFzaW5nUGVyaW9kRW5kZWQJAAACAAAAAQIAAAA4TVJUIHBhcnR5IGhhcyBub3QgZmluaXNoZWQgeWV0LiBUcmFuc2ZlciBpcyBub3QgYWxsb3dlZC4DCQEAAAABIQAAAAEJAAH0AAAAAwgFAAAAA2J0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAA2J0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAEHBhcnR5T3duZXJQdWJLZXkJAAACAAAAAQIAAAApVHJhbnNmZXIgaXMgYWxsb3dlZCBmb3IgUGFydHkgT3duZXIgb25seS4DCQEAAAACIT0AAAACCAUAAAADYnR4AAAAA2ZlZQUAAAAGTWluRkVFCQAAAgAAAAEJAAEsAAAAAgIAAAA1SW1wb3NzaWJsZSB0byB0cmFuc2ZlciB3aXRoIGZlZSBsZXNzIG9yIGdyZWF0ZXIgdGhhbiAJAAGkAAAAAQUAAAAGTWluRkVFBgfQXMgL", "chainId": 84, "height": 733995, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let WAVELET = ((100 * 1000) * 1000) | |
5 | + | ||
6 | + | let MRTEC = 100 | |
7 | + | ||
8 | + | let maxRounds = 100000000 | |
9 | + | ||
10 | + | let pmtStep = (10 * MRTEC) | |
11 | + | ||
12 | + | let partyOwnerPubKey = fromBase58String("4f8jYJccCjarVgc8FHn5ms5YLkpi6PfHpxTnmjQZMkJk") | |
13 | + | ||
14 | + | let partyOwnerAddress = addressFromPublicKey(partyOwnerPubKey) | |
15 | + | ||
16 | + | let leasingPeriod = 10 | |
17 | + | ||
18 | + | let leasingIdLifetime = 5 | |
19 | + | ||
20 | + | let leasingIdDiffInLifetime = 2 | |
21 | + | ||
22 | + | let leasingAmt = (1 * WAVELET) | |
23 | + | ||
24 | + | let heightStep = 2 | |
25 | + | ||
26 | + | let blocksOnGameStart = 733995 | |
27 | + | ||
28 | + | let blocksPerRound = 12 | |
29 | + | ||
30 | + | let blocksPerCompetition = 8 | |
31 | + | ||
32 | + | let MRT = fromBase58String("8b4jE7X1yCNcbF4YXZGBKc8T5xdit7b1gENxxx31daua") | |
33 | + | ||
34 | + | let MinFEE = ((5 * WAVELET) / 1000) | |
35 | + | ||
36 | + | let IdxWinHeight = 0 | |
37 | + | ||
38 | + | let IdxWinAddress = 1 | |
39 | + | ||
40 | + | let IdxWinPubKey = 2 | |
41 | + | ||
42 | + | let IdxLeasingId = 3 | |
43 | + | ||
44 | + | let IdxLeasingIdValidTill = 4 | |
45 | + | ||
46 | + | func convertChar (charBase58) = { | |
47 | + | let B0 = "q" | |
48 | + | let B1 = "r" | |
49 | + | let B2 = "s" | |
50 | + | let B3 = "t" | |
51 | + | let B4 = "u" | |
52 | + | let B5 = "v" | |
53 | + | let B6 = "w" | |
54 | + | let B7 = "x" | |
55 | + | let B8 = "y" | |
56 | + | let B9 = "z" | |
57 | + | if ((charBase58 == B0)) | |
58 | + | then "0" | |
59 | + | else if ((charBase58 == B1)) | |
60 | + | then "1" | |
61 | + | else if ((charBase58 == B2)) | |
62 | + | then "2" | |
63 | + | else if ((charBase58 == B3)) | |
64 | + | then "3" | |
65 | + | else if ((charBase58 == B4)) | |
66 | + | then "4" | |
67 | + | else if ((charBase58 == B5)) | |
68 | + | then "5" | |
69 | + | else if ((charBase58 == B6)) | |
70 | + | then "6" | |
71 | + | else if ((charBase58 == B7)) | |
72 | + | then "7" | |
73 | + | else if ((charBase58 == B8)) | |
74 | + | then "8" | |
75 | + | else if ((charBase58 == B9)) | |
76 | + | then "9" | |
77 | + | else throw("Unsupported char") | |
78 | + | } | |
79 | + | ||
80 | + | ||
81 | + | func proofToStr (roundNumProof) = { | |
82 | + | let s = size(roundNumProof) | |
83 | + | if ((s > 2)) | |
84 | + | then throw("Invalid ecoded round - size couldn't be greater than 2") | |
85 | + | else if ((0 >= s)) | |
86 | + | then throw("Invalid ecoded round - size couldn't be less than or equals 0") | |
87 | + | else if ((s == 1)) | |
88 | + | then convertChar(take(roundNumProof, 1)) | |
89 | + | else if ((s == 2)) | |
90 | + | then (convertChar(take(roundNumProof, 1)) + convertChar(take(drop(roundNumProof, 1), 1))) | |
91 | + | else throw("Invalid encoded round") | |
92 | + | } | |
93 | + | ||
94 | + | ||
95 | + | func getRoundDataKeyOrFail (round) = if ((0 > round)) | |
96 | + | then throw("Invalid round number") | |
97 | + | else ("round" + toString(round)) | |
98 | + | ||
99 | + | ||
100 | + | func readRoundDataListOrFail (round) = { | |
101 | + | let roundDataOpt = getString(this, getRoundDataKeyOrFail(round)) | |
102 | + | let roundDataStr = if (isDefined(roundDataOpt)) | |
103 | + | then extract(roundDataOpt) | |
104 | + | else "" | |
105 | + | let partyOwnerAddressStr = toBase58String(partyOwnerAddress.bytes) | |
106 | + | if ((roundDataStr != "")) | |
107 | + | then split(roundDataStr, "_") | |
108 | + | else ["0", toString(pmtStep), "?", "?", "?", "0"] | |
109 | + | } | |
110 | + | ||
111 | + | ||
112 | + | func readSharedState () = { | |
113 | + | let sharedStateOpt = getString(this, "RoundsSharedState") | |
114 | + | let sharedStateStr = if (isDefined(sharedStateOpt)) | |
115 | + | then extract(sharedStateOpt) | |
116 | + | else "" | |
117 | + | if ((sharedStateStr != "")) | |
118 | + | then split(sharedStateStr, "_") | |
119 | + | else ["", "0", ""] | |
120 | + | } | |
121 | + | ||
122 | + | ||
123 | + | func writeSetOfRoundData (type,round,newWinHeight,newWinAddressStr,newWinPubKeyStr,leasingId58,leaseIdExpirationHeight) = { | |
124 | + | let newWinHeightStr = toString(newWinHeight) | |
125 | + | let roundData = DataEntry(getRoundDataKeyOrFail(round), ((((((((newWinHeightStr + "_") + newWinAddressStr) + "_") + newWinPubKeyStr) + "_") + leasingId58) + "_") + toString(leaseIdExpirationHeight))) | |
126 | + | if ((type == "MOVE")) | |
127 | + | then { | |
128 | + | let addressLength = size(newWinAddressStr) | |
129 | + | let sharedState = readSharedState() | |
130 | + | let newTotalGamesCountStr = toString((parseIntValue(sharedState[1]) + 1)) | |
131 | + | let currLastPlayersAddr = sharedState[2] | |
132 | + | let newLastPlayersAddr = if (if ((currLastPlayersAddr != "")) | |
133 | + | then (size(currLastPlayersAddr) > ((addressLength + 1) * 10)) | |
134 | + | else false) | |
135 | + | then (("-" + newWinAddressStr) + dropRight(currLastPlayersAddr, (addressLength + 1))) | |
136 | + | else (("-" + newWinAddressStr) + currLastPlayersAddr) | |
137 | + | WriteSet([roundData, DataEntry("RoundsSharedState", ((((newWinHeightStr + "_") + newTotalGamesCountStr) + "_") + newLastPlayersAddr))]) | |
138 | + | } | |
139 | + | else if ((type == "LEASING")) | |
140 | + | then WriteSet([roundData]) | |
141 | + | else throw(("Unsupported type in writeSetOfRoundData method: " + type)) | |
142 | + | } | |
143 | + | ||
144 | + | ||
145 | + | let offset = (height - blocksOnGameStart) | |
146 | + | ||
147 | + | let currRoundNum = if ((offset >= 0)) | |
148 | + | then (offset / blocksPerRound) | |
149 | + | else throw(("Please do not hurry. MRT party will start on " + toString(blocksOnGameStart))) | |
150 | + | ||
151 | + | let currRoundHeight = (offset % blocksPerRound) | |
152 | + | ||
153 | + | let currRoundHeightStart = ((currRoundNum * blocksPerRound) + blocksOnGameStart) | |
154 | + | ||
155 | + | let currRoundCompetitionEnd = (currRoundHeightStart + blocksPerCompetition) | |
156 | + | ||
157 | + | let currRoundDataList = readRoundDataListOrFail(currRoundNum) | |
158 | + | ||
159 | + | let currWinHeight = parseIntValue(currRoundDataList[IdxWinHeight]) | |
160 | + | ||
161 | + | let currMinPmtAmt = pmtStep | |
162 | + | ||
163 | + | func isWinByHeight (h) = (height >= h) | |
164 | + | ||
165 | + | ||
166 | + | let atLeastOneMoveInRoundPresent = (currWinHeight > currRoundHeightStart) | |
167 | + | ||
168 | + | let firstCountdownFinished = if ((currWinHeight == 0)) | |
169 | + | then isWinByHeight((currRoundHeightStart + heightStep)) | |
170 | + | else false | |
171 | + | ||
172 | + | let isPauseByWin = if (isWinByHeight(currWinHeight)) | |
173 | + | then atLeastOneMoveInRoundPresent | |
174 | + | else false | |
175 | + | ||
176 | + | let isPauseByTime = if ((currRoundHeight > blocksPerCompetition)) | |
177 | + | then true | |
178 | + | else firstCountdownFinished | |
179 | + | ||
180 | + | let isPause = if (isPauseByWin) | |
181 | + | then true | |
182 | + | else isPauseByTime | |
183 | + | ||
184 | + | let isCompetition = !(isPause) | |
185 | + | ||
186 | + | @Callable(inv) | |
187 | + | func move () = { | |
188 | + | let overflowedNewWinHeight = (height + heightStep) | |
189 | + | let newWinHeight = if ((overflowedNewWinHeight >= currRoundCompetitionEnd)) | |
190 | + | then currRoundCompetitionEnd | |
191 | + | else overflowedNewWinHeight | |
192 | + | let payment = if (isDefined(inv.payment)) | |
193 | + | then extract(inv.payment) | |
194 | + | else throw("Please attach payment with MRT to participate in MRT party") | |
195 | + | if ((currRoundNum >= maxRounds)) | |
196 | + | then throw("MRT party is over") | |
197 | + | else if (isPause) | |
198 | + | then throw((("Sorry but round #" + toString(currRoundNum)) + " is finished.")) | |
199 | + | else if ((payment.assetId != MRT)) | |
200 | + | then throw("Please use MRT as a payment asset to participate in MRT party") | |
201 | + | else if ((currMinPmtAmt > payment.amount)) | |
202 | + | then throw(("Sorry my friend but your payment is to small. Current min payment is " + toString(currMinPmtAmt))) | |
203 | + | else writeSetOfRoundData("MOVE", currRoundNum, newWinHeight, toString(addressFromPublicKey(inv.callerPublicKey)), toBase58String(inv.callerPublicKey), "?", 0) | |
204 | + | } | |
205 | + | ||
206 | + | ||
207 | + | ||
208 | + | @Callable(inv) | |
209 | + | func registerLeasingTx (round,leasingId58) = { | |
210 | + | let leasingId = fromBase58String(leasingId58) | |
211 | + | let roundDataList = readRoundDataListOrFail(round) | |
212 | + | let prevLeasingId58 = roundDataList[IdxLeasingId] | |
213 | + | let prevLeasingId = if ((prevLeasingId58 == "?")) | |
214 | + | then fromBase58String("emptyid") | |
215 | + | else fromBase58String(prevLeasingId58) | |
216 | + | let winnerPubKey = fromBase58String(roundDataList[IdxWinPubKey]) | |
217 | + | let leaseIdExpirationHeight = parseIntValue(roundDataList[IdxLeasingIdValidTill]) | |
218 | + | if ((round > currRoundNum)) | |
219 | + | then throw("Impossible to register leasing transaction for round in future") | |
220 | + | else if (if ((round == currRoundNum)) | |
221 | + | then isCompetition | |
222 | + | else false) | |
223 | + | then throw("Impossible to register leasing transaction - winner has not been determined yet") | |
224 | + | else if ((size(leasingId) > 100)) | |
225 | + | then throw("Invalid leasing transaction id length") | |
226 | + | else if ((0 >= size(leasingId))) | |
227 | + | then throw("Leasing transaction id is not encoded as Base58 format") | |
228 | + | else if (isDefined(transactionHeightById(leasingId))) | |
229 | + | then throw("Passed leasingId has already existed in blockchain") | |
230 | + | else if (isDefined(transactionHeightById(prevLeasingId))) | |
231 | + | then throw("Previous registered leasingId has already existed in blockchain") | |
232 | + | else if (if ((leaseIdExpirationHeight != 0)) | |
233 | + | then (leaseIdExpirationHeight > height) | |
234 | + | else false) | |
235 | + | then throw(("Leasing id can be re-registered only on " + toString(leaseIdExpirationHeight))) | |
236 | + | else if ((inv.callerPublicKey != winnerPubKey)) | |
237 | + | then throw("Leasing tx can be registered by round winner only") | |
238 | + | else { | |
239 | + | let roundWinHeight = parseIntValue(roundDataList[IdxWinHeight]) | |
240 | + | writeSetOfRoundData("LEASING", round, roundWinHeight, roundDataList[IdxWinAddress], roundDataList[IdxWinPubKey], leasingId58, (height + leasingIdLifetime)) | |
241 | + | } | |
242 | + | } | |
243 | + | ||
244 | + | ||
245 | + | @Verifier(tx) | |
246 | + | func verify () = { | |
247 | + | let leasingPeriodEnded = (height > ((blocksOnGameStart + (maxRounds * blocksPerRound)) + leasingPeriod)) | |
248 | + | match tx { | |
249 | + | case ltx: LeaseTransaction => | |
250 | + | let sig = ltx.proofs[0] | |
251 | + | let roundBase58Str = toBase58String(ltx.proofs[1]) | |
252 | + | let round = valueOrErrorMessage(parseInt(proofToStr(roundBase58Str)), "Error during converting round num into integer representation") | |
253 | + | let roundDataList = readRoundDataListOrFail(round) | |
254 | + | let roundWinPubKey = fromBase58String(roundDataList[IdxWinPubKey]) | |
255 | + | let registeredLeasingId = fromBase58String(roundDataList[IdxLeasingId]) | |
256 | + | let leaseIdExpirationHeight = parseIntValue(roundDataList[IdxLeasingIdValidTill]) | |
257 | + | if (leasingPeriodEnded) | |
258 | + | then throw("Sorry but leasing period has been ended") | |
259 | + | else if ((height > (leaseIdExpirationHeight - leasingIdDiffInLifetime))) | |
260 | + | then throw("Sorry but lifetime of your leasing transaction id has been expired") | |
261 | + | else if (!(sigVerify(ltx.bodyBytes, sig, roundWinPubKey))) | |
262 | + | then throw("Invalid leasing transaction signature. Leasing is allowed for winner only.") | |
263 | + | else if ((ltx.id != registeredLeasingId)) | |
264 | + | then throw("Leasing transaction id doesn't match with registered leasing id") | |
265 | + | else if ((ltx.amount != leasingAmt)) | |
266 | + | then throw(("Impossible to lease less or greater than " + toString(leasingAmt))) | |
267 | + | else if ((ltx.fee != MinFEE)) | |
268 | + | then throw(("Impossible to lease with fee less or greater than " + toString(MinFEE))) | |
269 | + | else true | |
270 | + | case cltx: LeaseCancelTransaction => | |
271 | + | if (!(leasingPeriodEnded)) | |
272 | + | then throw("MRT party has not finished yet. Leasing Cancel is not allowed.") | |
273 | + | else if (!(sigVerify(tx.bodyBytes, tx.proofs[0], partyOwnerPubKey))) | |
274 | + | then throw("Leasing Cancel is allowed to Party Owner only") | |
275 | + | else if ((cltx.fee != MinFEE)) | |
276 | + | then throw(("Impossible to cancle leasing with fee less or greater than " + toString(MinFEE))) | |
277 | + | else true | |
278 | + | case ttx: TransferTransaction => | |
279 | + | if (!(leasingPeriodEnded)) | |
280 | + | then throw("MRT party has not finished yet. Transfer is not allowed.") | |
281 | + | else if (!(sigVerify(ttx.bodyBytes, ttx.proofs[0], partyOwnerPubKey))) | |
282 | + | then throw("Transfer is allowed for Party Owner only.") | |
283 | + | else if ((ttx.fee != MinFEE)) | |
284 | + | then throw(("Impossible to transfer with fee less or greater than " + toString(MinFEE))) | |
285 | + | else true | |
286 | + | case stx: SetScriptTransaction => | |
287 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
288 | + | case btx: BurnTransaction => | |
289 | + | if (!(leasingPeriodEnded)) | |
290 | + | then throw("MRT party has not finished yet. Transfer is not allowed.") | |
291 | + | else if (!(sigVerify(btx.bodyBytes, btx.proofs[0], partyOwnerPubKey))) | |
292 | + | then throw("Transfer is allowed for Party Owner only.") | |
293 | + | else if ((btx.fee != MinFEE)) | |
294 | + | then throw(("Impossible to transfer with fee less or greater than " + toString(MinFEE))) | |
295 | + | else true | |
296 | + | case _ => | |
297 | + | false | |
298 | + | } | |
299 | + | } | |
300 | + |
github/deemru/w8io/026f985 37.05 ms ◑