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