tx · 3nqweDHRCk3TZkDRoXFtAfKP2E7Tzyx5zZksstbusc12 3MrmdNGZgtXdc8PX5hC1FnNSEdGYtCg3QEu: -0.01000000 Waves 2019.12.03 10:54 [792247] smart account 3MrmdNGZgtXdc8PX5hC1FnNSEdGYtCg3QEu > SELF 0.00000000 Waves
{ "type": 13, "id": "3nqweDHRCk3TZkDRoXFtAfKP2E7Tzyx5zZksstbusc12", "fee": 1000000, "feeAssetId": null, "timestamp": 1575359679177, "version": 1, "sender": "3MrmdNGZgtXdc8PX5hC1FnNSEdGYtCg3QEu", "senderPublicKey": "3t8ixEtnb5zDYQHvdRPCfy1tueGQpMapHSotAsHGUcQC", "proofs": [ "3U8A8rT51qTPHsTgerGbrAqGv9EVFJVAGxVDBVaTobGXCDEwaiRVgwEFkVSNYpgFG41rxcBtx1cWxoZ3uDYJDySq" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQEAAAAlAAAAAAdXQVZFTEVUCQAAaAAAAAIJAABoAAAAAgAAAAAAAAAAZAAAAAAAAAAD6AAAAAAAAAAD6AAAAAAFTVJURUMAAAAAAAAAAGQAAAAACW1heFJvdW5kcwAAAAAAAAAAAgAAAAAHcG10U3RlcAkAAGgAAAACAAAAAAAAAAAKBQAAAAVNUlRFQwAAAAAQcGFydHlPd25lclB1YktleQkAAlkAAAABAgAAACw4Tjh4elNBU3gyMzJhVlNGQkVHQWRVb3NXeTJCeUxTenhxSlZmQzd6TmRUaQAAAAARcGFydHlPd25lckFkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAEHBhcnR5T3duZXJQdWJLZXkAAAAADndpdGhkcmF3UGVyaW9kAAAAAAAAAAAFAAAAAAZ3aW5BbXQJAABoAAAAAgAAAAAAAAAAAQUAAAAHV0FWRUxFVAAAAAAKaGVpZ2h0U3RlcAAAAAAAAAAAAwAAAAARYmxvY2tzT25HYW1lU3RhcnQAAAAAAAAMFrkAAAAADmJsb2Nrc1BlclJvdW5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AAAADdHR4AAAAA2ZlZQUAAAAGTWluRkVFCQAAAgAAAAEJAAEsAAAAAgIAAAA1SW1wb3NzaWJsZSB0byB0cmFuc2ZlciB3aXRoIGZlZSBsZXNzIG9yIGdyZWF0ZXIgdGhhbiAJAAGkAAAAAQUAAAAGTWluRkVFBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQnVyblRyYW5zYWN0aW9uBAAAAANidHgFAAAAByRtYXRjaDADCQEAAAABIQAAAAEFAAAAE3dpdGhkcmF3UGVyaW9kRW5kZWQJAAACAAAAAQIAAAA0TVJUIHBhcnR5IGhhcyBub3QgZmluaXNoZWQgeWV0LiBCdXJuIGlzIG5vdCBhbGxvd2VkLgMJAQAAAAEhAAAAAQkAAfQAAAADCAUAAAADYnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAADYnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAQcGFydHlPd25lclB1YktleQkAAAIAAAABAgAAACVCdXJuIGlzIGFsbG93ZWQgZm9yIFBhcnR5IE93bmVyIG9ubHkuAwkBAAAAAiE9AAAAAggFAAAAA2J0eAAAAANmZWUFAAAABk1pbkZFRQkAAAIAAAABCQABLAAAAAICAAAAMUltcG9zc2libGUgdG8gYnVybiB3aXRoIGZlZSBsZXNzIG9yIGdyZWF0ZXIgdGhhbiAJAAGkAAAAAQUAAAAGTWluRkVFBgfjDTV7", "chainId": 84, "height": 792247, "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("8N8xzSASx232aVSFBEGAdUosWy2ByLSzxqJVfC7zNdTi") | |
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 = 792249 | |
23 | + | ||
24 | + | let blocksPerRound = 7 | |
25 | + | ||
26 | + | let blocksPerCompetition = 4 | |
27 | + | ||
28 | + | let MRT = fromBase58String("4nwPugzeKGkTeQ74Ma8CcbmKqzoHJUWeb9uN5c2bcwqU") | |
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 = sharedState[2] | |
76 | + | let newLastPlayersAddr = if (if ((currLastPlayersAddr != "")) | |
77 | + | then (size(currLastPlayersAddr) > ((addressLength + 1) * 10)) | |
78 | + | else false) | |
79 | + | then (("-" + newWinAddressStr) + dropRight(currLastPlayersAddr, (addressLength + 1))) | |
80 | + | else (("-" + newWinAddressStr) + currLastPlayersAddr) | |
81 | + | WriteSet([roundData, DataEntry("RoundsSharedState", ((((newWinHeightStr + "_") + newTotalGamesCountStr) + "_") + newLastPlayersAddr))]) | |
82 | + | } | |
83 | + | else if ((type == "WITHDRAW")) | |
84 | + | then WriteSet([roundData]) | |
85 | + | else throw(("Unsupported type in writeSetOfRoundData method: " + type)) | |
86 | + | } | |
87 | + | ||
88 | + | ||
89 | + | let offset = (height - blocksOnGameStart) | |
90 | + | ||
91 | + | let currRoundNum = if ((offset >= 0)) | |
92 | + | then (offset / blocksPerRound) | |
93 | + | else throw(("Please do not hurry. MRT party will start on " + toString(blocksOnGameStart))) | |
94 | + | ||
95 | + | let currRoundHeight = (offset % blocksPerRound) | |
96 | + | ||
97 | + | let currRoundHeightStart = ((currRoundNum * blocksPerRound) + blocksOnGameStart) | |
98 | + | ||
99 | + | let currRoundCompetitionEnd = (currRoundHeightStart + blocksPerCompetition) | |
100 | + | ||
101 | + | let currRoundDataList = readRoundDataListOrFail(currRoundNum) | |
102 | + | ||
103 | + | let currWinHeight = parseIntValue(currRoundDataList[IdxWinHeight]) | |
104 | + | ||
105 | + | let currMinPmtAmt = pmtStep | |
106 | + | ||
107 | + | func isWinByHeight (h) = (height >= h) | |
108 | + | ||
109 | + | ||
110 | + | let atLeastOneMoveInRoundPresent = (currWinHeight > currRoundHeightStart) | |
111 | + | ||
112 | + | let firstCountdownFinished = if ((currWinHeight == 0)) | |
113 | + | then isWinByHeight((currRoundHeightStart + heightStep)) | |
114 | + | else false | |
115 | + | ||
116 | + | let isPauseByWin = if (isWinByHeight(currWinHeight)) | |
117 | + | then atLeastOneMoveInRoundPresent | |
118 | + | else false | |
119 | + | ||
120 | + | let isPauseByTime = if ((currRoundHeight > blocksPerCompetition)) | |
121 | + | then true | |
122 | + | else firstCountdownFinished | |
123 | + | ||
124 | + | let isPause = if (isPauseByWin) | |
125 | + | then true | |
126 | + | else isPauseByTime | |
127 | + | ||
128 | + | let isCompetition = !(isPause) | |
129 | + | ||
130 | + | @Callable(inv) | |
131 | + | func move () = { | |
132 | + | let overflowedNewWinHeight = (height + heightStep) | |
133 | + | let newWinHeight = if ((overflowedNewWinHeight >= currRoundCompetitionEnd)) | |
134 | + | then currRoundCompetitionEnd | |
135 | + | else overflowedNewWinHeight | |
136 | + | let payment = if (isDefined(inv.payment)) | |
137 | + | then extract(inv.payment) | |
138 | + | else throw("Please attach payment with MRT to participate in MRT party") | |
139 | + | if ((currRoundNum >= maxRounds)) | |
140 | + | then throw("MRT party is over") | |
141 | + | else if (isPause) | |
142 | + | then throw((("Sorry but round #" + toString(currRoundNum)) + " is finished.")) | |
143 | + | else if ((payment.assetId != MRT)) | |
144 | + | then throw("Please use MRT as a payment asset to participate in MRT party") | |
145 | + | else if ((currMinPmtAmt > payment.amount)) | |
146 | + | then throw(("Sorry my friend but your payment is too small. Current min payment is " + toString(currMinPmtAmt))) | |
147 | + | else writeSetOfRoundData("MOVE", currRoundNum, newWinHeight, toString(addressFromPublicKey(inv.callerPublicKey)), toBase58String(inv.callerPublicKey), "?") | |
148 | + | } | |
149 | + | ||
150 | + | ||
151 | + | ||
152 | + | @Callable(inv) | |
153 | + | func withdraw (round) = { | |
154 | + | let roundDataList = readRoundDataListOrFail(round) | |
155 | + | let winnerPubKey = fromBase58String(roundDataList[IdxWinPubKey]) | |
156 | + | let withdrawId58 = roundDataList[IdxWithdrawId] | |
157 | + | if ((round > currRoundNum)) | |
158 | + | then throw("Impossible to withdraw win amount for round in future") | |
159 | + | else if (if ((round == currRoundNum)) | |
160 | + | then isCompetition | |
161 | + | else false) | |
162 | + | then throw("Impossible to withdraw win amount - winner has not been determined yet") | |
163 | + | else if ((withdrawId58 != "?")) | |
164 | + | then throw((("Winner of round #" + toString(round)) + " has already taken the prize")) | |
165 | + | else { | |
166 | + | let withdrawPeriodEnded = (height > ((blocksOnGameStart + (maxRounds * blocksPerRound)) + withdrawPeriod)) | |
167 | + | let winAmtRecipient = if (withdrawPeriodEnded) | |
168 | + | then partyOwnerAddress | |
169 | + | else addressFromPublicKey(winnerPubKey) | |
170 | + | let roundWinHeight = parseIntValue(roundDataList[IdxWinHeight]) | |
171 | + | ScriptResult(writeSetOfRoundData("WITHDRAW", round, roundWinHeight, roundDataList[IdxWinAddress], roundDataList[IdxWinPubKey], toBase58String(inv.transactionId)), TransferSet([ScriptTransfer(winAmtRecipient, winAmt, unit)])) | |
172 | + | } | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | @Verifier(tx) | |
177 | + | func verify () = { | |
178 | + | let withdrawPeriodEnded = (height > ((blocksOnGameStart + (maxRounds * blocksPerRound)) + withdrawPeriod)) | |
179 | + | match tx { | |
180 | + | case ttx: TransferTransaction => | |
181 | + | if (!(withdrawPeriodEnded)) | |
182 | + | then throw("MRT party has not finished yet. Transfer is not allowed.") | |
183 | + | else if (!(sigVerify(ttx.bodyBytes, ttx.proofs[0], partyOwnerPubKey))) | |
184 | + | then throw("Transfer is allowed for Party Owner only.") | |
185 | + | else if ((ttx.fee != MinFEE)) | |
186 | + | then throw(("Impossible to transfer with fee less or greater than " + toString(MinFEE))) | |
187 | + | else true | |
188 | + | case btx: BurnTransaction => | |
189 | + | if (!(withdrawPeriodEnded)) | |
190 | + | then throw("MRT party has not finished yet. Burn is not allowed.") | |
191 | + | else if (!(sigVerify(btx.bodyBytes, btx.proofs[0], partyOwnerPubKey))) | |
192 | + | then throw("Burn is allowed for Party Owner only.") | |
193 | + | else if ((btx.fee != MinFEE)) | |
194 | + | then throw(("Impossible to burn with fee less or greater than " + toString(MinFEE))) | |
195 | + | else true | |
196 | + | case _ => | |
197 | + | false | |
198 | + | } | |
199 | + | } | |
200 | + |
github/deemru/w8io/169f3d6 42.62 ms ◑