16 case OP_0 :
return "0";
22 case OP_1 :
return "1";
23 case OP_2 :
return "2";
24 case OP_3 :
return "3";
25 case OP_4 :
return "4";
26 case OP_5 :
return "5";
27 case OP_6 :
return "6";
28 case OP_7 :
return "7";
29 case OP_8 :
return "8";
30 case OP_9 :
return "9";
31 case OP_10 :
return "10";
32 case OP_11 :
return "11";
33 case OP_12 :
return "12";
34 case OP_13 :
return "13";
35 case OP_14 :
return "14";
36 case OP_15 :
return "15";
37 case OP_16 :
return "16";
40 case OP_NOP :
return "OP_NOP";
41 case OP_VER :
return "OP_VER";
42 case OP_IF :
return "OP_IF";
46 case OP_ELSE :
return "OP_ELSE";
55 case OP_2DUP :
return "OP_2DUP";
56 case OP_3DUP :
return "OP_3DUP";
58 case OP_2ROT :
return "OP_2ROT";
62 case OP_DROP :
return "OP_DROP";
63 case OP_DUP :
return "OP_DUP";
64 case OP_NIP :
return "OP_NIP";
65 case OP_OVER :
return "OP_OVER";
66 case OP_PICK :
return "OP_PICK";
67 case OP_ROLL :
return "OP_ROLL";
68 case OP_ROT :
return "OP_ROT";
69 case OP_SWAP :
return "OP_SWAP";
70 case OP_TUCK :
return "OP_TUCK";
73 case OP_CAT :
return "OP_CAT";
75 case OP_LEFT :
return "OP_LEFT";
77 case OP_SIZE :
return "OP_SIZE";
81 case OP_AND :
return "OP_AND";
82 case OP_OR :
return "OP_OR";
83 case OP_XOR :
return "OP_XOR";
90 case OP_1ADD :
return "OP_1ADD";
91 case OP_1SUB :
return "OP_1SUB";
92 case OP_2MUL :
return "OP_2MUL";
93 case OP_2DIV :
return "OP_2DIV";
95 case OP_ABS :
return "OP_ABS";
96 case OP_NOT :
return "OP_NOT";
98 case OP_ADD :
return "OP_ADD";
99 case OP_SUB :
return "OP_SUB";
100 case OP_MUL :
return "OP_MUL";
101 case OP_DIV :
return "OP_DIV";
102 case OP_MOD :
return "OP_MOD";
114 case OP_MIN :
return "OP_MIN";
115 case OP_MAX :
return "OP_MAX";
120 case OP_SHA1 :
return "OP_SHA1";
131 case OP_NOP1 :
return "OP_NOP1";
134 case OP_NOP4 :
return "OP_NOP4";
135 case OP_NOP5 :
return "OP_NOP5";
136 case OP_NOP6 :
return "OP_NOP6";
137 case OP_NOP7 :
return "OP_NOP7";
138 case OP_NOP8 :
return "OP_NOP8";
139 case OP_NOP9 :
return "OP_NOP9";
144 case OP_CALL :
return "OP_CALL";
167 if (!
GetOp(pc, opcode))
173 if (fAccurate && lastOpcode >=
OP_1 && lastOpcode <=
OP_16)
176 n += MAX_PUBKEYS_PER_MULTISIG;
192 std::vector<unsigned char> vData;
193 while (pc < scriptSig.
end())
196 if (!scriptSig.
GetOp(pc, opcode, vData))
203 CScript subscript(vData.begin(), vData.end());
210 return (this->
size() == 23 &&
212 (*
this)[1] == 0x14 &&
220 if (this->
size() == 35 && (*
this)[0] == 33 && (*
this)[34] ==
OP_CHECKSIG 221 && ((*
this)[1] == 0x02 || (*
this)[1] == 0x03)) {
224 if (this->
size() == 67 && (*
this)[0] == 65 && (*
this)[66] ==
OP_CHECKSIG 225 && (*
this)[1] == 0x04) {
234 return (this->
size() == 25 &&
237 (*
this)[2] == 0x14 &&
245 return (this->
size() == 34 &&
246 (*
this)[0] ==
OP_0 &&
254 if (this->
size() < 4 || this->
size() > 42) {
257 if ((*
this)[0] !=
OP_0 && ((*
this)[0] <
OP_1 || (*
this)[0] >
OP_16)) {
260 if ((
size_t)((*
this)[1] + 2) == this->
size()) {
262 program = std::vector<unsigned char>(this->
begin() + 2, this->
end());
273 if (!
GetOp(pc, opcode))
292 std::string ret =
"CScriptWitness(";
293 for (
unsigned int i = 0; i < stack.size(); i++) {
307 std::vector<unsigned char> item;
308 if (!
GetOp(it, opcode, item) || opcode > MAX_OPCODE || item.size() > MAX_SCRIPT_ELEMENT_SIZE) {
bool IsPayToPubkeyHash() const
bool IsPayToPubkey() const
static int DecodeOP_N(opcodetype opcode)
Encode/decode small integers:
bool IsPayToScriptHash() const
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
bool IsPayToWitnessScriptHash() const
opcodetype
Script opcodes.
unsigned int GetSigOpCount(bool fAccurate) const
Pre-version-0.6, Fabcoin always counted CHECKMULTISIGs as 20 sigops.
bool IsWitnessProgram(int &version, std::vector< unsigned char > &program) const
const char * GetOpName(opcodetype opcode)
bool HasValidOps() const
Check if the script contains valid OP_CODES.
Serialized script, used inside transaction inputs and outputs.
std::string ToString() const
bool GetOp(iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet)