Bitcoin ABC  0.24.7
P2P Digital Currency
script.cpp
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #include <script/script.h>
7 
8 #include <script/script_flags.h>
9 #include <util/strencodings.h>
10 
11 #include <algorithm>
12 #include <string>
13 
14 std::string GetOpName(opcodetype opcode) {
15  switch (opcode) {
16  // push value
17  case OP_0:
18  return "0";
19  case OP_PUSHDATA1:
20  return "OP_PUSHDATA1";
21  case OP_PUSHDATA2:
22  return "OP_PUSHDATA2";
23  case OP_PUSHDATA4:
24  return "OP_PUSHDATA4";
25  case OP_1NEGATE:
26  return "-1";
27  case OP_RESERVED:
28  return "OP_RESERVED";
29  case OP_1:
30  return "1";
31  case OP_2:
32  return "2";
33  case OP_3:
34  return "3";
35  case OP_4:
36  return "4";
37  case OP_5:
38  return "5";
39  case OP_6:
40  return "6";
41  case OP_7:
42  return "7";
43  case OP_8:
44  return "8";
45  case OP_9:
46  return "9";
47  case OP_10:
48  return "10";
49  case OP_11:
50  return "11";
51  case OP_12:
52  return "12";
53  case OP_13:
54  return "13";
55  case OP_14:
56  return "14";
57  case OP_15:
58  return "15";
59  case OP_16:
60  return "16";
61 
62  // control
63  case OP_NOP:
64  return "OP_NOP";
65  case OP_VER:
66  return "OP_VER";
67  case OP_IF:
68  return "OP_IF";
69  case OP_NOTIF:
70  return "OP_NOTIF";
71  case OP_VERIF:
72  return "OP_VERIF";
73  case OP_VERNOTIF:
74  return "OP_VERNOTIF";
75  case OP_ELSE:
76  return "OP_ELSE";
77  case OP_ENDIF:
78  return "OP_ENDIF";
79  case OP_VERIFY:
80  return "OP_VERIFY";
81  case OP_RETURN:
82  return "OP_RETURN";
83 
84  // stack ops
85  case OP_TOALTSTACK:
86  return "OP_TOALTSTACK";
87  case OP_FROMALTSTACK:
88  return "OP_FROMALTSTACK";
89  case OP_2DROP:
90  return "OP_2DROP";
91  case OP_2DUP:
92  return "OP_2DUP";
93  case OP_3DUP:
94  return "OP_3DUP";
95  case OP_2OVER:
96  return "OP_2OVER";
97  case OP_2ROT:
98  return "OP_2ROT";
99  case OP_2SWAP:
100  return "OP_2SWAP";
101  case OP_IFDUP:
102  return "OP_IFDUP";
103  case OP_DEPTH:
104  return "OP_DEPTH";
105  case OP_DROP:
106  return "OP_DROP";
107  case OP_DUP:
108  return "OP_DUP";
109  case OP_NIP:
110  return "OP_NIP";
111  case OP_OVER:
112  return "OP_OVER";
113  case OP_PICK:
114  return "OP_PICK";
115  case OP_ROLL:
116  return "OP_ROLL";
117  case OP_ROT:
118  return "OP_ROT";
119  case OP_SWAP:
120  return "OP_SWAP";
121  case OP_TUCK:
122  return "OP_TUCK";
123 
124  // splice ops
125  case OP_CAT:
126  return "OP_CAT";
127  case OP_SPLIT:
128  return "OP_SPLIT";
129  case OP_NUM2BIN:
130  return "OP_NUM2BIN";
131  case OP_BIN2NUM:
132  return "OP_BIN2NUM";
133  case OP_SIZE:
134  return "OP_SIZE";
135 
136  // bit logic
137  case OP_INVERT:
138  return "OP_INVERT";
139  case OP_AND:
140  return "OP_AND";
141  case OP_OR:
142  return "OP_OR";
143  case OP_XOR:
144  return "OP_XOR";
145  case OP_EQUAL:
146  return "OP_EQUAL";
147  case OP_EQUALVERIFY:
148  return "OP_EQUALVERIFY";
149  case OP_RESERVED1:
150  return "OP_RESERVED1";
151  case OP_RESERVED2:
152  return "OP_RESERVED2";
153 
154  // numeric
155  case OP_1ADD:
156  return "OP_1ADD";
157  case OP_1SUB:
158  return "OP_1SUB";
159  case OP_2MUL:
160  return "OP_2MUL";
161  case OP_2DIV:
162  return "OP_2DIV";
163  case OP_NEGATE:
164  return "OP_NEGATE";
165  case OP_ABS:
166  return "OP_ABS";
167  case OP_NOT:
168  return "OP_NOT";
169  case OP_0NOTEQUAL:
170  return "OP_0NOTEQUAL";
171  case OP_ADD:
172  return "OP_ADD";
173  case OP_SUB:
174  return "OP_SUB";
175  case OP_MUL:
176  return "OP_MUL";
177  case OP_DIV:
178  return "OP_DIV";
179  case OP_MOD:
180  return "OP_MOD";
181  case OP_LSHIFT:
182  return "OP_LSHIFT";
183  case OP_RSHIFT:
184  return "OP_RSHIFT";
185  case OP_BOOLAND:
186  return "OP_BOOLAND";
187  case OP_BOOLOR:
188  return "OP_BOOLOR";
189  case OP_NUMEQUAL:
190  return "OP_NUMEQUAL";
191  case OP_NUMEQUALVERIFY:
192  return "OP_NUMEQUALVERIFY";
193  case OP_NUMNOTEQUAL:
194  return "OP_NUMNOTEQUAL";
195  case OP_LESSTHAN:
196  return "OP_LESSTHAN";
197  case OP_GREATERTHAN:
198  return "OP_GREATERTHAN";
199  case OP_LESSTHANOREQUAL:
200  return "OP_LESSTHANOREQUAL";
202  return "OP_GREATERTHANOREQUAL";
203  case OP_MIN:
204  return "OP_MIN";
205  case OP_MAX:
206  return "OP_MAX";
207  case OP_WITHIN:
208  return "OP_WITHIN";
209 
210  // crypto
211  case OP_RIPEMD160:
212  return "OP_RIPEMD160";
213  case OP_SHA1:
214  return "OP_SHA1";
215  case OP_SHA256:
216  return "OP_SHA256";
217  case OP_HASH160:
218  return "OP_HASH160";
219  case OP_HASH256:
220  return "OP_HASH256";
221  case OP_CODESEPARATOR:
222  return "OP_CODESEPARATOR";
223  case OP_CHECKSIG:
224  return "OP_CHECKSIG";
225  case OP_CHECKSIGVERIFY:
226  return "OP_CHECKSIGVERIFY";
227  case OP_CHECKMULTISIG:
228  return "OP_CHECKMULTISIG";
230  return "OP_CHECKMULTISIGVERIFY";
231  case OP_CHECKDATASIG:
232  return "OP_CHECKDATASIG";
234  return "OP_CHECKDATASIGVERIFY";
235  case OP_REVERSEBYTES:
236  return "OP_REVERSEBYTES";
237 
238  // expansion
239  case OP_NOP1:
240  return "OP_NOP1";
242  return "OP_CHECKLOCKTIMEVERIFY";
244  return "OP_CHECKSEQUENCEVERIFY";
245  case OP_NOP4:
246  return "OP_NOP4";
247  case OP_NOP5:
248  return "OP_NOP5";
249  case OP_NOP6:
250  return "OP_NOP6";
251  case OP_NOP7:
252  return "OP_NOP7";
253  case OP_NOP8:
254  return "OP_NOP8";
255  case OP_NOP9:
256  return "OP_NOP9";
257  case OP_NOP10:
258  return "OP_NOP10";
259 
260  case OP_INVALIDOPCODE:
261  return "OP_INVALIDOPCODE";
262 
263  default:
264  return "OP_UNKNOWN";
265  }
266 }
267 
268 bool CheckMinimalPush(const std::vector<uint8_t> &data, opcodetype opcode) {
269  // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal
270  assert(0 <= opcode && opcode <= OP_PUSHDATA4);
271  if (data.size() == 0) {
272  // Should have used OP_0.
273  return opcode == OP_0;
274  }
275  if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) {
276  // Should have used OP_1 .. OP_16.
277  return false;
278  }
279  if (data.size() == 1 && data[0] == 0x81) {
280  // Should have used OP_1NEGATE.
281  return false;
282  }
283  if (data.size() <= 75) {
284  // Must have used a direct push (opcode indicating number of bytes
285  // pushed + those bytes).
286  return opcode == data.size();
287  }
288  if (data.size() <= 255) {
289  // Must have used OP_PUSHDATA.
290  return opcode == OP_PUSHDATA1;
291  }
292  if (data.size() <= 65535) {
293  // Must have used OP_PUSHDATA2.
294  return opcode == OP_PUSHDATA2;
295  }
296  return true;
297 }
298 
299 bool CScriptNum::IsMinimallyEncoded(const std::vector<uint8_t> &vch,
300  const size_t nMaxNumSize) {
301  if (vch.size() > nMaxNumSize) {
302  return false;
303  }
304 
305  if (vch.size() > 0) {
306  // Check that the number is encoded with the minimum possible number
307  // of bytes.
308  //
309  // If the most-significant-byte - excluding the sign bit - is zero
310  // then we're not minimal. Note how this test also rejects the
311  // negative-zero encoding, 0x80.
312  if ((vch.back() & 0x7f) == 0) {
313  // One exception: if there's more than one byte and the most
314  // significant bit of the second-most-significant-byte is set it
315  // would conflict with the sign bit. An example of this case is
316  // +-255, which encode to 0xff00 and 0xff80 respectively.
317  // (big-endian).
318  if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) {
319  return false;
320  }
321  }
322  }
323 
324  return true;
325 }
326 
327 bool CScriptNum::MinimallyEncode(std::vector<uint8_t> &data) {
328  if (data.size() == 0) {
329  return false;
330  }
331 
332  // If the last byte is not 0x00 or 0x80, we are minimally encoded.
333  uint8_t last = data.back();
334  if (last & 0x7f) {
335  return false;
336  }
337 
338  // If the script is one byte long, then we have a zero, which encodes as an
339  // empty array.
340  if (data.size() == 1) {
341  data = {};
342  return true;
343  }
344 
345  // If the next byte has it sign bit set, then we are minimaly encoded.
346  if (data[data.size() - 2] & 0x80) {
347  return false;
348  }
349 
350  // We are not minimally encoded, we need to figure out how much to trim.
351  for (size_t i = data.size() - 1; i > 0; i--) {
352  // We found a non zero byte, time to encode.
353  if (data[i - 1] != 0) {
354  if (data[i - 1] & 0x80) {
355  // We found a byte with it sign bit set so we need one more
356  // byte.
357  data[i++] = last;
358  } else {
359  // the sign bit is clear, we can use it.
360  data[i - 1] |= last;
361  }
362 
363  data.resize(i);
364  return true;
365  }
366  }
367 
368  // If we the whole thing is zeros, then we have a zero.
369  data = {};
370  return true;
371 }
372 
374  // Extra-fast test for pay-to-script-hash CScripts:
375  return (this->size() == 23 && (*this)[0] == OP_HASH160 &&
376  (*this)[1] == 0x14 && (*this)[22] == OP_EQUAL);
377 }
378 
379 bool CScript::IsCommitment(const std::vector<uint8_t> &data) const {
380  // To ensure we have an immediate push, we limit the commitment size to 64
381  // bytes. In addition to the data themselves, we have 2 extra bytes:
382  // OP_RETURN and the push opcode itself.
383  if (data.size() > 64 || this->size() != data.size() + 2) {
384  return false;
385  }
386 
387  if ((*this)[0] != OP_RETURN || (*this)[1] != data.size()) {
388  return false;
389  }
390 
391  for (size_t i = 0; i < data.size(); i++) {
392  if ((*this)[i + 2] != data[i]) {
393  return false;
394  }
395  }
396 
397  return true;
398 }
399 
400 // A witness program is any valid CScript that consists of a 1-byte push opcode
401 // followed by a data push between 2 and 40 bytes.
402 bool CScript::IsWitnessProgram(int &version,
403  std::vector<uint8_t> &program) const {
404  if (this->size() < 4 || this->size() > 42) {
405  return false;
406  }
407  if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {
408  return false;
409  }
410  if (size_t((*this)[1] + 2) == this->size()) {
411  version = DecodeOP_N((opcodetype)(*this)[0]);
412  program = std::vector<uint8_t>(this->begin() + 2, this->end());
413  return true;
414  }
415  return false;
416 }
417 
418 // Wrapper returning only the predicate
420  int version;
421  std::vector<uint8_t> program;
422  return IsWitnessProgram(version, program);
423 }
424 
426  while (pc < end()) {
427  opcodetype opcode;
428  if (!GetOp(pc, opcode)) {
429  return false;
430  }
431 
432  // Note that IsPushOnly() *does* consider OP_RESERVED to be a push-type
433  // opcode, however execution of OP_RESERVED fails, so it's not relevant
434  // to P2SH/BIP62 as the scriptSig would fail prior to the P2SH special
435  // validation code being executed.
436  if (opcode > OP_16) {
437  return false;
438  }
439  }
440  return true;
441 }
442 
443 bool CScript::IsPushOnly() const {
444  return this->IsPushOnly(begin());
445 }
446 
448  CScriptBase::const_iterator end, opcodetype &opcodeRet,
449  std::vector<uint8_t> *pvchRet) {
450  opcodeRet = OP_INVALIDOPCODE;
451  if (pvchRet) {
452  pvchRet->clear();
453  }
454  if (pc >= end) {
455  return false;
456  }
457 
458  // Read instruction
459  if (end - pc < 1) {
460  return false;
461  }
462 
463  uint32_t opcode = *pc++;
464 
465  // Immediate operand
466  if (opcode <= OP_PUSHDATA4) {
467  uint32_t nSize = 0;
468  if (opcode < OP_PUSHDATA1) {
469  nSize = opcode;
470  } else if (opcode == OP_PUSHDATA1) {
471  if (end - pc < 1) {
472  return false;
473  }
474  nSize = *pc++;
475  } else if (opcode == OP_PUSHDATA2) {
476  if (end - pc < 2) {
477  return false;
478  }
479  nSize = ReadLE16(&pc[0]);
480  pc += 2;
481  } else if (opcode == OP_PUSHDATA4) {
482  if (end - pc < 4) {
483  return false;
484  }
485  nSize = ReadLE32(&pc[0]);
486  pc += 4;
487  }
488  if (end - pc < 0 || uint32_t(end - pc) < nSize) {
489  return false;
490  }
491  if (pvchRet) {
492  pvchRet->assign(pc, pc + nSize);
493  }
494  pc += nSize;
495  }
496 
497  opcodeRet = static_cast<opcodetype>(opcode);
498  return true;
499 }
500 
501 bool CScript::HasValidOps() const {
503  while (it < end()) {
504  opcodetype opcode;
505  std::vector<uint8_t> item;
506  if (!GetOp(it, opcode, item) || opcode > MAX_OPCODE ||
507  item.size() > MAX_SCRIPT_ELEMENT_SIZE) {
508  return false;
509  }
510  }
511  return true;
512 }
OP_NOP1
@ OP_NOP1
Definition: script.h:168
OP_ROT
@ OP_ROT
Definition: script.h:102
OP_NUMEQUALVERIFY
@ OP_NUMEQUALVERIFY
Definition: script.h:144
OP_0
@ OP_0
Definition: script.h:48
GetOpName
std::string GetOpName(opcodetype opcode)
Definition: script.cpp:14
OP_SWAP
@ OP_SWAP
Definition: script.h:103
OP_2MUL
@ OP_2MUL
Definition: script.h:126
OP_INVERT
@ OP_INVERT
Definition: script.h:114
prevector::const_iterator
Definition: prevector.h:139
OP_RESERVED
@ OP_RESERVED
Definition: script.h:54
OP_TOALTSTACK
@ OP_TOALTSTACK
Definition: script.h:86
OP_LESSTHANOREQUAL
@ OP_LESSTHANOREQUAL
Definition: script.h:148
CheckMinimalPush
bool CheckMinimalPush(const std::vector< uint8_t > &data, opcodetype opcode)
Check whether the given stack element data would be minimally pushed using the given opcode.
Definition: script.cpp:268
OP_OR
@ OP_OR
Definition: script.h:116
OP_NOP
@ OP_NOP
Definition: script.h:74
OP_2SWAP
@ OP_2SWAP
Definition: script.h:93
OP_RSHIFT
@ OP_RSHIFT
Definition: script.h:139
OP_3DUP
@ OP_3DUP
Definition: script.h:90
OP_7
@ OP_7
Definition: script.h:62
OP_0NOTEQUAL
@ OP_0NOTEQUAL
Definition: script.h:131
OP_BIN2NUM
@ OP_BIN2NUM
Definition: script.h:110
OP_NOP7
@ OP_NOP7
Definition: script.h:176
OP_SHA1
@ OP_SHA1
Definition: script.h:157
OP_2OVER
@ OP_2OVER
Definition: script.h:91
OP_11
@ OP_11
Definition: script.h:66
OP_10
@ OP_10
Definition: script.h:65
script_flags.h
CScript::HasValidOps
bool HasValidOps() const
Check if the script contains valid OP_CODES.
Definition: script.cpp:501
OP_NOP5
@ OP_NOP5
Definition: script.h:174
OP_ABS
@ OP_ABS
Definition: script.h:129
OP_1ADD
@ OP_1ADD
Definition: script.h:124
OP_HASH160
@ OP_HASH160
Definition: script.h:159
OP_SHA256
@ OP_SHA256
Definition: script.h:158
CScript::DecodeOP_N
static int DecodeOP_N(opcodetype opcode)
Encode/decode small integers:
Definition: script.h:511
OP_GREATERTHAN
@ OP_GREATERTHAN
Definition: script.h:147
OP_VERIF
@ OP_VERIF
Definition: script.h:78
OP_NUM2BIN
@ OP_NUM2BIN
Definition: script.h:109
ReadLE32
static uint32_t ReadLE32(const uint8_t *ptr)
Definition: common.h:23
OP_INVALIDOPCODE
@ OP_INVALIDOPCODE
Definition: script.h:195
CScript::IsPayToScriptHash
bool IsPayToScriptHash() const
Definition: script.cpp:373
OP_WITHIN
@ OP_WITHIN
Definition: script.h:153
OP_BOOLAND
@ OP_BOOLAND
Definition: script.h:141
OP_DROP
@ OP_DROP
Definition: script.h:96
ReadLE16
static uint16_t ReadLE16(const uint8_t *ptr)
Definition: common.h:17
OP_MIN
@ OP_MIN
Definition: script.h:150
OP_MOD
@ OP_MOD
Definition: script.h:137
OP_XOR
@ OP_XOR
Definition: script.h:117
OP_LESSTHAN
@ OP_LESSTHAN
Definition: script.h:146
OP_NOTIF
@ OP_NOTIF
Definition: script.h:77
prevector::end
iterator end()
Definition: prevector.h:392
strencodings.h
OP_2ROT
@ OP_2ROT
Definition: script.h:92
OP_RIPEMD160
@ OP_RIPEMD160
Definition: script.h:156
OP_MAX
@ OP_MAX
Definition: script.h:151
OP_RETURN
@ OP_RETURN
Definition: script.h:83
OP_6
@ OP_6
Definition: script.h:61
OP_NUMNOTEQUAL
@ OP_NUMNOTEQUAL
Definition: script.h:145
OP_1SUB
@ OP_1SUB
Definition: script.h:125
OP_2DROP
@ OP_2DROP
Definition: script.h:88
OP_CHECKSEQUENCEVERIFY
@ OP_CHECKSEQUENCEVERIFY
Definition: script.h:171
OP_14
@ OP_14
Definition: script.h:69
OP_3
@ OP_3
Definition: script.h:58
OP_VERNOTIF
@ OP_VERNOTIF
Definition: script.h:79
OP_CHECKSIGVERIFY
@ OP_CHECKSIGVERIFY
Definition: script.h:163
OP_PUSHDATA4
@ OP_PUSHDATA4
Definition: script.h:52
OP_IFDUP
@ OP_IFDUP
Definition: script.h:94
OP_VER
@ OP_VER
Definition: script.h:75
OP_2DIV
@ OP_2DIV
Definition: script.h:127
OP_NEGATE
@ OP_NEGATE
Definition: script.h:128
CScript::IsPushOnly
bool IsPushOnly() const
Definition: script.cpp:443
OP_DUP
@ OP_DUP
Definition: script.h:97
CScriptNum::IsMinimallyEncoded
static bool IsMinimallyEncoded(const std::vector< uint8_t > &vch, const size_t nMaxNumSize=CScriptNum::MAXIMUM_ELEMENT_SIZE)
Definition: script.cpp:299
OP_CHECKDATASIG
@ OP_CHECKDATASIG
Definition: script.h:182
OP_CHECKDATASIGVERIFY
@ OP_CHECKDATASIGVERIFY
Definition: script.h:183
OP_CHECKMULTISIG
@ OP_CHECKMULTISIG
Definition: script.h:164
OP_NOT
@ OP_NOT
Definition: script.h:130
OP_AND
@ OP_AND
Definition: script.h:115
OP_2
@ OP_2
Definition: script.h:57
OP_VERIFY
@ OP_VERIFY
Definition: script.h:82
OP_BOOLOR
@ OP_BOOLOR
Definition: script.h:142
OP_4
@ OP_4
Definition: script.h:59
OP_OVER
@ OP_OVER
Definition: script.h:99
OP_CHECKLOCKTIMEVERIFY
@ OP_CHECKLOCKTIMEVERIFY
Definition: script.h:169
OP_HASH256
@ OP_HASH256
Definition: script.h:160
OP_CHECKSIG
@ OP_CHECKSIG
Definition: script.h:162
OP_9
@ OP_9
Definition: script.h:64
OP_PUSHDATA1
@ OP_PUSHDATA1
Definition: script.h:50
OP_5
@ OP_5
Definition: script.h:60
OP_NOP9
@ OP_NOP9
Definition: script.h:178
OP_NOP4
@ OP_NOP4
Definition: script.h:173
CScript::IsWitnessProgram
bool IsWitnessProgram() const
Definition: script.cpp:419
OP_ADD
@ OP_ADD
Definition: script.h:133
OP_ROLL
@ OP_ROLL
Definition: script.h:101
OP_REVERSEBYTES
@ OP_REVERSEBYTES
Definition: script.h:186
ScriptError::OP_RETURN
@ OP_RETURN
OP_NOP8
@ OP_NOP8
Definition: script.h:177
OP_16
@ OP_16
Definition: script.h:71
OP_PICK
@ OP_PICK
Definition: script.h:100
OP_SIZE
@ OP_SIZE
Definition: script.h:111
OP_CODESEPARATOR
@ OP_CODESEPARATOR
Definition: script.h:161
CScriptNum::MinimallyEncode
static bool MinimallyEncode(std::vector< uint8_t > &data)
Definition: script.cpp:327
OP_NUMEQUAL
@ OP_NUMEQUAL
Definition: script.h:143
OP_SUB
@ OP_SUB
Definition: script.h:134
OP_RESERVED1
@ OP_RESERVED1
Definition: script.h:120
OP_TUCK
@ OP_TUCK
Definition: script.h:104
CScript::IsCommitment
bool IsCommitment(const std::vector< uint8_t > &data) const
Definition: script.cpp:379
OP_LSHIFT
@ OP_LSHIFT
Definition: script.h:138
CScript::GetOp
bool GetOp(const_iterator &pc, opcodetype &opcodeRet, std::vector< uint8_t > &vchRet) const
Definition: script.h:501
OP_12
@ OP_12
Definition: script.h:67
OP_2DUP
@ OP_2DUP
Definition: script.h:89
OP_FROMALTSTACK
@ OP_FROMALTSTACK
Definition: script.h:87
OP_PUSHDATA2
@ OP_PUSHDATA2
Definition: script.h:51
prevector::data
value_type * data()
Definition: prevector.h:610
OP_DIV
@ OP_DIV
Definition: script.h:136
prevector::size
size_type size() const
Definition: prevector.h:386
OP_EQUAL
@ OP_EQUAL
Definition: script.h:118
OP_NOP10
@ OP_NOP10
Definition: script.h:179
prevector::begin
iterator begin()
Definition: prevector.h:390
OP_1NEGATE
@ OP_1NEGATE
Definition: script.h:53
OP_GREATERTHANOREQUAL
@ OP_GREATERTHANOREQUAL
Definition: script.h:149
OP_RESERVED2
@ OP_RESERVED2
Definition: script.h:121
OP_MUL
@ OP_MUL
Definition: script.h:135
OP_IF
@ OP_IF
Definition: script.h:76
MAX_SCRIPT_ELEMENT_SIZE
static const unsigned int MAX_SCRIPT_ELEMENT_SIZE
Definition: script.h:23
script.h
OP_SPLIT
@ OP_SPLIT
Definition: script.h:108
OP_DEPTH
@ OP_DEPTH
Definition: script.h:95
OP_CHECKMULTISIGVERIFY
@ OP_CHECKMULTISIGVERIFY
Definition: script.h:165
OP_CAT
@ OP_CAT
Definition: script.h:107
MAX_OPCODE
static const unsigned int MAX_OPCODE
Definition: script.h:199
OP_13
@ OP_13
Definition: script.h:68
OP_NIP
@ OP_NIP
Definition: script.h:98
OP_NOP6
@ OP_NOP6
Definition: script.h:175
OP_EQUALVERIFY
@ OP_EQUALVERIFY
Definition: script.h:119
OP_1
@ OP_1
Definition: script.h:55
OP_8
@ OP_8
Definition: script.h:63
OP_ELSE
@ OP_ELSE
Definition: script.h:80
opcodetype
opcodetype
Script opcodes.
Definition: script.h:46
OP_15
@ OP_15
Definition: script.h:70
GetScriptOp
bool GetScriptOp(CScriptBase::const_iterator &pc, CScriptBase::const_iterator end, opcodetype &opcodeRet, std::vector< uint8_t > *pvchRet)
Definition: script.cpp:447
OP_ENDIF
@ OP_ENDIF
Definition: script.h:81