tx · 5CxzboHJMt8Cms5sGnTpXM6TsWhx5cfJsLzWYD6YeEKx 3MtH4FrMQ9w9CFCFRd9CpQYbTWRQPGM31vc: -0.01000000 Waves 2019.12.03 12:14 [792322] smart account 3MtH4FrMQ9w9CFCFRd9CpQYbTWRQPGM31vc > SELF 0.00000000 Waves
{ "type": 13, "id": "5CxzboHJMt8Cms5sGnTpXM6TsWhx5cfJsLzWYD6YeEKx", "fee": 1000000, "feeAssetId": null, "timestamp": 1575364499659, "version": 1, "sender": "3MtH4FrMQ9w9CFCFRd9CpQYbTWRQPGM31vc", "senderPublicKey": "ASvHQg5emPv44HWmT2BJkiAbavsLYj28LJ7cBRsGCswg", "proofs": [ "2ZKVYCeqWdyNnYj9jGcBZUsjTzAgbQDPK72FYCYxfKDGsyjwxbh1TiyHAzmHdmHhKyB3erNDa95yiTrnAoKHXq73" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAlAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAFTVJURUMAAAAAAAAAAGQAAAAACW1heFJvdW5kcwAAAAAAAAAAAgAAAAAHcG10U3RlcAkAAGgAAAACAAAAAAAAAAAKBQAAAAVNUlRFQwAAAAAQcGFydHlPd25lclB1YktleQkAAlkAAAABAgAAACtINEN5a3pQTmJOOEY3SlFjVHBHd0tKQ2VMNXNtb0JZWGZMS3dlVFBHZFRWAAAAABFwYXJ0eU93bmVyQWRkcmVzcwkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQUAAAAQcGFydHlPd25lclB1YktleQAAAAAOd2l0aGRyYXdQZXJpb2QAAAAAAAAAAAUAAAAABndpbkFtdAkAAGgAAAACAAAAAAAAAAABBQAAAAdXQVZFTEVUAAAAAApoZWlnaHRTdGVwAAAAAAAAAAADAAAAABFibG9ja3NPbkdhbWVTdGFydAAAAAAAAAwXBAAAAAAOYmxvY2tzUGVyUm91bmQ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FydHlPd25lclB1YktleQkAAAIAAAABAgAAAClUcmFuc2ZlciBpcyBhbGxvd2VkIGZvciBQYXJ0eSBPd25lciBvbmx5LgMJAQAAAAIhPQAAAAIIBQAAAAN0dHgAAAADZmVlBQAAAAZNaW5GRUUJAAACAAAAAQkAASwAAAACAgAAADVJbXBvc3NpYmxlIHRvIHRyYW5zZmVyIHdpdGggZmVlIGxlc3Mgb3IgZ3JlYXRlciB0aGFuIAkAAaQAAAABBQAAAAZNaW5GRUUGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9CdXJuVHJhbnNhY3Rpb24EAAAAA2J0eAUAAAAHJG1hdGNoMAMJAQAAAAEhAAAAAQUAAAATd2l0aGRyYXdQZXJpb2RFbmRlZAkAAAIAAAABAgAAADRNUlQgcGFydHkgaGFzIG5vdCBmaW5pc2hlZCB5ZXQuIEJ1cm4gaXMgbm90IGFsbG93ZWQuAwkBAAAAASEAAAABCQAB9AAAAAMIBQAAAANidHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAANidHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABBwYXJ0eU93bmVyUHViS2V5CQAAAgAAAAECAAAAJUJ1cm4gaXMgYWxsb3dlZCBmb3IgUGFydHkgT3duZXIgb25seS4DCQEAAAACIT0AAAACCAUAAAADYnR4AAAAA2ZlZQUAAAAGTWluRkVFCQAAAgAAAAEJAAEsAAAAAgIAAAAxSW1wb3NzaWJsZSB0byBidXJuIHdpdGggZmVlIGxlc3Mgb3IgZ3JlYXRlciB0aGFuIAkAAaQAAAABBQAAAAZNaW5GRUUGB0yG8vc=", "chainId": 84, "height": 792322, "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 = 2 | |
9 | + | ||
10 | + | let pmtStep = (10 * MRTEC) | |
11 | + | ||
12 | + | let partyOwnerPubKey = fromBase58String("H4CykzPNbN8F7JQcTpGwKJCeL5smoBYXfLKweTPGdTV") | |
13 | + | ||
14 | + | let partyOwnerAddress = addressFromPublicKey(partyOwnerPubKey) | |
15 | + | ||
16 | + | let withdrawPeriod = 5 | |
17 | + | ||
18 | + | let winAmt = (1 * WAVELET) | |
19 | + | ||
20 | + | let heightStep = 3 | |
21 | + | ||
22 | + | let blocksOnGameStart = 792324 | |
23 | + | ||
24 | + | let blocksPerRound = 7 | |
25 | + | ||
26 | + | let blocksPerCompetition = 4 | |
27 | + | ||
28 | + | let MRT = fromBase58String("G9ydHEr8DxxFJF1L6un86wiEGyXefkeuANQcXRce9Cu5") | |
29 | + | ||
30 | + | let MinFEE = ((5 * WAVELET) / 1000) | |
31 | + | ||
32 | + | let IdxWinHeight = 0 | |
33 | + | ||
34 | + | let IdxWinAddress = 1 | |
35 | + | ||
36 | + | let IdxWinPubKey = 2 | |
37 | + | ||
38 | + | let IdxWithdrawId = 3 | |
39 | + | ||
40 | + | func getRoundDataKeyOrFail (round) = if ((0 > round)) | |
41 | + | then throw("Invalid round number") | |
42 | + | else ("round" + toString(round)) | |
43 | + | ||
44 | + | ||
45 | + | func readRoundDataListOrFail (round) = { | |
46 | + | let roundDataOpt = getString(this, getRoundDataKeyOrFail(round)) | |
47 | + | let roundDataStr = if (isDefined(roundDataOpt)) | |
48 | + | then extract(roundDataOpt) | |
49 | + | else "" | |
50 | + | if ((roundDataStr != "")) | |
51 | + | then split(roundDataStr, "_") | |
52 | + | else ["0", toString(pmtStep), "?", "?", "?", "0"] | |
53 | + | } | |
54 | + | ||
55 | + | ||
56 | + | func readSharedState () = { | |
57 | + | let sharedStateOpt = getString(this, "RoundsSharedState") | |
58 | + | let sharedStateStr = if (isDefined(sharedStateOpt)) | |
59 | + | then extract(sharedStateOpt) | |
60 | + | else "" | |
61 | + | if ((sharedStateStr != "")) | |
62 | + | then split(sharedStateStr, "_") | |
63 | + | else ["?", "0", "?"] | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func writeSetOfRoundData (type,round,newWinHeight,newWinAddressStr,newWinPubKeyStr,withdrawId58) = { | |
68 | + | let newWinHeightStr = toString(newWinHeight) | |
69 | + | let roundData = DataEntry(getRoundDataKeyOrFail(round), ((((((newWinHeightStr + "_") + newWinAddressStr) + "_") + newWinPubKeyStr) + "_") + withdrawId58)) | |
70 | + | if ((type == "MOVE")) | |
71 | + | then { | |
72 | + | let addressLength = size(newWinAddressStr) | |
73 | + | let sharedState = readSharedState() | |
74 | + | let newTotalGamesCountStr = toString((parseIntValue(sharedState[1]) + 1)) | |
75 | + | let currLastPlayersAddr = if ((sharedState[2] == "?")) | |
76 | + | then "" | |
77 | + | else sharedState[2] | |
78 | + | let newLastPlayersAddr = if (if ((currLastPlayersAddr != "")) | |
79 | + | then (size(currLastPlayersAddr) > ((addressLength + 1) * 10)) | |
80 | + | else false) | |
81 | + | then (("-" + newWinAddressStr) + dropRight(currLastPlayersAddr, (addressLength + 1))) | |
82 | + | else (("-" + newWinAddressStr) + currLastPlayersAddr) | |
83 | + | WriteSet([roundData, DataEntry("RoundsSharedState", ((((newWinHeightStr + "_") + newTotalGamesCountStr) + "_") + newLastPlayersAddr))]) | |
84 | + | } | |
85 | + | else if ((type == "WITHDRAW")) | |
86 | + | then WriteSet([roundData]) | |
87 | + | else throw(("Unsupported type in writeSetOfRoundData method: " + type)) | |
88 | + | } | |
89 | + | ||
90 | + | ||
91 | + | let offset = (height - blocksOnGameStart) | |
92 | + | ||
93 | + | let currRoundNum = if ((offset >= 0)) | |
94 | + | then (offset / blocksPerRound) | |
95 | + | else throw(("Please do not hurry. MRT party will start on " + toString(blocksOnGameStart))) | |
96 | + | ||
97 | + | let currRoundHeight = (offset % blocksPerRound) | |
98 | + | ||
99 | + | let currRoundHeightStart = ((currRoundNum * blocksPerRound) + blocksOnGameStart) | |
100 | + | ||
101 | + | let currRoundCompetitionEnd = (currRoundHeightStart + blocksPerCompetition) | |
102 | + | ||
103 | + | let currRoundDataList = readRoundDataListOrFail(currRoundNum) | |
104 | + | ||
105 | + | let currWinHeight = parseIntValue(currRoundDataList[IdxWinHeight]) | |
106 | + | ||
107 | + | let currMinPmtAmt = pmtStep | |
108 | + | ||
109 | + | func isWinByHeight (h) = (height >= h) | |
110 | + | ||
111 | + | ||
112 | + | let atLeastOneMoveInRoundPresent = (currWinHeight > currRoundHeightStart) | |
113 | + | ||
114 | + | let firstCountdownFinished = if ((currWinHeight == 0)) | |
115 | + | then isWinByHeight((currRoundHeightStart + heightStep)) | |
116 | + | else false | |
117 | + | ||
118 | + | let isPauseByWin = if (isWinByHeight(currWinHeight)) | |
119 | + | then atLeastOneMoveInRoundPresent | |
120 | + | else false | |
121 | + | ||
122 | + | let isPauseByTime = if ((currRoundHeight > blocksPerCompetition)) | |
123 | + | then true | |
124 | + | else firstCountdownFinished | |
125 | + | ||
126 | + | let isPause = if (isPauseByWin) | |
127 | + | then true | |
128 | + | else isPauseByTime | |
129 | + | ||
130 | + | let isCompetition = !(isPause) | |
131 | + | ||
132 | + | @Callable(inv) | |
133 | + | func move () = { | |
134 | + | let overflowedNewWinHeight = (height + heightStep) | |
135 | + | let newWinHeight = if ((overflowedNewWinHeight >= currRoundCompetitionEnd)) | |
136 | + | then currRoundCompetitionEnd | |
137 | + | else overflowedNewWinHeight | |
138 | + | let payment = if (isDefined(inv.payment)) | |
139 | + | then extract(inv.payment) | |
140 | + | else throw("Please attach payment with MRT to participate in MRT party") | |
141 | + | if ((currRoundNum >= maxRounds)) | |
142 | + | then throw("MRT party is over") | |
143 | + | else if (isPause) | |
144 | + | then throw((("Sorry but round #" + toString(currRoundNum)) + " is finished.")) | |
145 | + | else if ((payment.assetId != MRT)) | |
146 | + | then throw("Please use MRT as a payment asset to participate in MRT party") | |
147 | + | else if ((currMinPmtAmt > payment.amount)) | |
148 | + | then throw(("Sorry my friend but your payment is too small. Current min payment is " + toString(currMinPmtAmt))) | |
149 | + | else writeSetOfRoundData("MOVE", currRoundNum, newWinHeight, toString(addressFromPublicKey(inv.callerPublicKey)), toBase58String(inv.callerPublicKey), "?") | |
150 | + | } | |
151 | + | ||
152 | + | ||
153 | + | ||
154 | + | @Callable(inv) | |
155 | + | func withdraw (round) = { | |
156 | + | let roundDataList = readRoundDataListOrFail(round) | |
157 | + | let winnerPubKey = fromBase58String(roundDataList[IdxWinPubKey]) | |
158 | + | let withdrawId58 = roundDataList[IdxWithdrawId] | |
159 | + | if ((round > currRoundNum)) | |
160 | + | then throw("Impossible to withdraw win amount for round in future") | |
161 | + | else if (if ((round == currRoundNum)) | |
162 | + | then isCompetition | |
163 | + | else false) | |
164 | + | then throw("Impossible to withdraw win amount - winner has not been determined yet") | |
165 | + | else if ((withdrawId58 != "?")) | |
166 | + | then throw((("Winner of round #" + toString(round)) + " has already taken the prize")) | |
167 | + | else { | |
168 | + | let withdrawPeriodEnded = (height > ((blocksOnGameStart + (maxRounds * blocksPerRound)) + withdrawPeriod)) | |
169 | + | let winAmtRecipient = if (withdrawPeriodEnded) | |
170 | + | then partyOwnerAddress | |
171 | + | else addressFromPublicKey(winnerPubKey) | |
172 | + | let roundWinHeight = parseIntValue(roundDataList[IdxWinHeight]) | |
173 | + | ScriptResult(writeSetOfRoundData("WITHDRAW", round, roundWinHeight, roundDataList[IdxWinAddress], roundDataList[IdxWinPubKey], toBase58String(inv.transactionId)), TransferSet([ScriptTransfer(winAmtRecipient, winAmt, unit)])) | |
174 | + | } | |
175 | + | } | |
176 | + | ||
177 | + | ||
178 | + | @Verifier(tx) | |
179 | + | func verify () = { | |
180 | + | let withdrawPeriodEnded = (height > ((blocksOnGameStart + (maxRounds * blocksPerRound)) + withdrawPeriod)) | |
181 | + | match tx { | |
182 | + | case ttx: TransferTransaction => | |
183 | + | if (!(withdrawPeriodEnded)) | |
184 | + | then throw("MRT party has not finished yet. Transfer is not allowed.") | |
185 | + | else if (!(sigVerify(ttx.bodyBytes, ttx.proofs[0], partyOwnerPubKey))) | |
186 | + | then throw("Transfer is allowed for Party Owner only.") | |
187 | + | else if ((ttx.fee != MinFEE)) | |
188 | + | then throw(("Impossible to transfer with fee less or greater than " + toString(MinFEE))) | |
189 | + | else true | |
190 | + | case btx: BurnTransaction => | |
191 | + | if (!(withdrawPeriodEnded)) | |
192 | + | then throw("MRT party has not finished yet. Burn is not allowed.") | |
193 | + | else if (!(sigVerify(btx.bodyBytes, btx.proofs[0], partyOwnerPubKey))) | |
194 | + | then throw("Burn is allowed for Party Owner only.") | |
195 | + | else if ((btx.fee != MinFEE)) | |
196 | + | then throw(("Impossible to burn with fee less or greater than " + toString(MinFEE))) | |
197 | + | else true | |
198 | + | case _ => | |
199 | + | false | |
200 | + | } | |
201 | + | } | |
202 | + |
github/deemru/w8io/169f3d6 25.13 ms ◑