Raven Core  3.0.0
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 // Copyright (c) 2017-2019 The Raven Core developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 #include "streams.h"
7 #include "version.h"
8 #include "assets/assets.h"
9 #include "script.h"
10 
11 #include "tinyformat.h"
12 #include "utilstrencodings.h"
13 #include "standard.h"
14 
15 const char* GetOpName(opcodetype opcode)
16 {
17  switch (opcode)
18  {
19  // push value
20  case OP_0 : return "0";
21  case OP_PUSHDATA1 : return "OP_PUSHDATA1";
22  case OP_PUSHDATA2 : return "OP_PUSHDATA2";
23  case OP_PUSHDATA4 : return "OP_PUSHDATA4";
24  case OP_1NEGATE : return "-1";
25  case OP_RESERVED : return "OP_RESERVED";
26  case OP_1 : return "1";
27  case OP_2 : return "2";
28  case OP_3 : return "3";
29  case OP_4 : return "4";
30  case OP_5 : return "5";
31  case OP_6 : return "6";
32  case OP_7 : return "7";
33  case OP_8 : return "8";
34  case OP_9 : return "9";
35  case OP_10 : return "10";
36  case OP_11 : return "11";
37  case OP_12 : return "12";
38  case OP_13 : return "13";
39  case OP_14 : return "14";
40  case OP_15 : return "15";
41  case OP_16 : return "16";
42 
43  // control
44  case OP_NOP : return "OP_NOP";
45  case OP_VER : return "OP_VER";
46  case OP_IF : return "OP_IF";
47  case OP_NOTIF : return "OP_NOTIF";
48  case OP_VERIF : return "OP_VERIF";
49  case OP_VERNOTIF : return "OP_VERNOTIF";
50  case OP_ELSE : return "OP_ELSE";
51  case OP_ENDIF : return "OP_ENDIF";
52  case OP_VERIFY : return "OP_VERIFY";
53  case OP_RETURN : return "OP_RETURN";
54 
55  // stack ops
56  case OP_TOALTSTACK : return "OP_TOALTSTACK";
57  case OP_FROMALTSTACK : return "OP_FROMALTSTACK";
58  case OP_2DROP : return "OP_2DROP";
59  case OP_2DUP : return "OP_2DUP";
60  case OP_3DUP : return "OP_3DUP";
61  case OP_2OVER : return "OP_2OVER";
62  case OP_2ROT : return "OP_2ROT";
63  case OP_2SWAP : return "OP_2SWAP";
64  case OP_IFDUP : return "OP_IFDUP";
65  case OP_DEPTH : return "OP_DEPTH";
66  case OP_DROP : return "OP_DROP";
67  case OP_DUP : return "OP_DUP";
68  case OP_NIP : return "OP_NIP";
69  case OP_OVER : return "OP_OVER";
70  case OP_PICK : return "OP_PICK";
71  case OP_ROLL : return "OP_ROLL";
72  case OP_ROT : return "OP_ROT";
73  case OP_SWAP : return "OP_SWAP";
74  case OP_TUCK : return "OP_TUCK";
75 
76  // splice ops
77  case OP_CAT : return "OP_CAT";
78  case OP_SUBSTR : return "OP_SUBSTR";
79  case OP_LEFT : return "OP_LEFT";
80  case OP_RIGHT : return "OP_RIGHT";
81  case OP_SIZE : return "OP_SIZE";
82 
83  // bit logic
84  case OP_INVERT : return "OP_INVERT";
85  case OP_AND : return "OP_AND";
86  case OP_OR : return "OP_OR";
87  case OP_XOR : return "OP_XOR";
88  case OP_EQUAL : return "OP_EQUAL";
89  case OP_EQUALVERIFY : return "OP_EQUALVERIFY";
90  case OP_RESERVED1 : return "OP_RESERVED1";
91  case OP_RESERVED2 : return "OP_RESERVED2";
92 
93  // numeric
94  case OP_1ADD : return "OP_1ADD";
95  case OP_1SUB : return "OP_1SUB";
96  case OP_2MUL : return "OP_2MUL";
97  case OP_2DIV : return "OP_2DIV";
98  case OP_NEGATE : return "OP_NEGATE";
99  case OP_ABS : return "OP_ABS";
100  case OP_NOT : return "OP_NOT";
101  case OP_0NOTEQUAL : return "OP_0NOTEQUAL";
102  case OP_ADD : return "OP_ADD";
103  case OP_SUB : return "OP_SUB";
104  case OP_MUL : return "OP_MUL";
105  case OP_DIV : return "OP_DIV";
106  case OP_MOD : return "OP_MOD";
107  case OP_LSHIFT : return "OP_LSHIFT";
108  case OP_RSHIFT : return "OP_RSHIFT";
109  case OP_BOOLAND : return "OP_BOOLAND";
110  case OP_BOOLOR : return "OP_BOOLOR";
111  case OP_NUMEQUAL : return "OP_NUMEQUAL";
112  case OP_NUMEQUALVERIFY : return "OP_NUMEQUALVERIFY";
113  case OP_NUMNOTEQUAL : return "OP_NUMNOTEQUAL";
114  case OP_LESSTHAN : return "OP_LESSTHAN";
115  case OP_GREATERTHAN : return "OP_GREATERTHAN";
116  case OP_LESSTHANOREQUAL : return "OP_LESSTHANOREQUAL";
117  case OP_GREATERTHANOREQUAL : return "OP_GREATERTHANOREQUAL";
118  case OP_MIN : return "OP_MIN";
119  case OP_MAX : return "OP_MAX";
120  case OP_WITHIN : return "OP_WITHIN";
121 
122  // crypto
123  case OP_RIPEMD160 : return "OP_RIPEMD160";
124  case OP_SHA1 : return "OP_SHA1";
125  case OP_SHA256 : return "OP_SHA256";
126  case OP_HASH160 : return "OP_HASH160";
127  case OP_HASH256 : return "OP_HASH256";
128  case OP_CODESEPARATOR : return "OP_CODESEPARATOR";
129  case OP_CHECKSIG : return "OP_CHECKSIG";
130  case OP_CHECKSIGVERIFY : return "OP_CHECKSIGVERIFY";
131  case OP_CHECKMULTISIG : return "OP_CHECKMULTISIG";
132  case OP_CHECKMULTISIGVERIFY : return "OP_CHECKMULTISIGVERIFY";
133 
134  // expansion
135  case OP_NOP1 : return "OP_NOP1";
136  case OP_CHECKLOCKTIMEVERIFY : return "OP_CHECKLOCKTIMEVERIFY";
137  case OP_CHECKSEQUENCEVERIFY : return "OP_CHECKSEQUENCEVERIFY";
138  case OP_NOP4 : return "OP_NOP4";
139  case OP_NOP5 : return "OP_NOP5";
140  case OP_NOP6 : return "OP_NOP6";
141  case OP_NOP7 : return "OP_NOP7";
142  case OP_NOP8 : return "OP_NOP8";
143  case OP_NOP9 : return "OP_NOP9";
144  case OP_NOP10 : return "OP_NOP10";
145 
147  case OP_RVN_ASSET : return "OP_RVN_ASSET";
150  case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE";
151 
152  // Note:
153  // The template matching params OP_SMALLINTEGER/etc are defined in opcodetype enum
154  // as kind of implementation hack, they are *NOT* real opcodes. If found in real
155  // Script, just let the default: case deal with them.
156 
157  default:
158  return "OP_UNKNOWN";
159  }
160 }
161 
162 unsigned int CScript::GetSigOpCount(bool fAccurate) const
163 {
164  unsigned int n = 0;
165  const_iterator pc = begin();
166  opcodetype lastOpcode = OP_INVALIDOPCODE;
167  while (pc < end())
168  {
169  opcodetype opcode;
170  if (!GetOp(pc, opcode))
171  break;
172  if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY)
173  n++;
174  else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY)
175  {
176  if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16)
177  n += DecodeOP_N(lastOpcode);
178  else
179  n += MAX_PUBKEYS_PER_MULTISIG;
180  }
181  lastOpcode = opcode;
182  }
183  return n;
184 }
185 
186 unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const
187 {
188  if (!IsPayToScriptHash())
189  return GetSigOpCount(true);
190 
191  // This is a pay-to-script-hash scriptPubKey;
192  // get the last item that the scriptSig
193  // pushes onto the stack:
194  const_iterator pc = scriptSig.begin();
195  std::vector<unsigned char> vData;
196  while (pc < scriptSig.end())
197  {
198  opcodetype opcode;
199  if (!scriptSig.GetOp(pc, opcode, vData))
200  return 0;
201  if (opcode > OP_16)
202  return 0;
203  }
204 
206  CScript subscript(vData.begin(), vData.end());
207  return subscript.GetSigOpCount(true);
208 }
209 
211 {
212  // Extra-fast test for pay-to-pubkey-hash CScripts:
213  return (this->size() == 25 &&
214  (*this)[0] == OP_DUP &&
215  (*this)[1] == OP_HASH160 &&
216  (*this)[2] == 0x14 &&
217  (*this)[23] == OP_EQUALVERIFY &&
218  (*this)[24] == OP_CHECKSIG);
219 }
220 
222 {
223  // Extra-fast test for pay-to-script-hash CScripts:
224  return (this->size() == 23 &&
225  (*this)[0] == OP_HASH160 &&
226  (*this)[1] == 0x14 &&
227  (*this)[22] == OP_EQUAL);
228 }
229 
232 {
233  int nType = 0;
234  bool isOwner = false;
235  int start = 0;
236  return IsAssetScript(nType, isOwner, start);
237 }
238 
239 bool CScript::IsAssetScript(int& nType, bool& isOwner) const
240 {
241  int start = 0;
242  return IsAssetScript(nType, isOwner, start);
243 }
244 
245 bool CScript::IsAssetScript(int& nType, bool& fIsOwner, int& nStartingIndex) const
246 {
247  if (this->size() > 30) {
248  if ((*this)[25] == OP_RVN_ASSET) { // OP_RVN_ASSET is always in the 25 index of the script if it exists
249  int index = -1;
250  if ((*this)[27] == RVN_R) { // Check to see if RVN starts at 27 ( this->size() < 105)
251  if ((*this)[28] == RVN_V)
252  if ((*this)[29] == RVN_N)
253  index = 30;
254  } else {
255  if ((*this)[28] == RVN_R) // Check to see if RVN starts at 28 ( this->size() >= 105)
256  if ((*this)[29] == RVN_V)
257  if ((*this)[30] == RVN_N)
258  index = 31;
259  }
260 
261  if (index > 0) {
262  nStartingIndex = index + 1; // Set the index where the asset data begins. Use to serialize the asset data into asset objects
263  if ((*this)[index] == RVN_T) { // Transfer first anticipating more transfers than other assets operations
264  nType = TX_TRANSFER_ASSET;
265  return true;
266  } else if ((*this)[index] == RVN_Q && this->size() > 39) {
267  nType = TX_NEW_ASSET;
268  fIsOwner = false;
269  return true;
270  } else if ((*this)[index] == RVN_O) {
271  nType = TX_NEW_ASSET;
272  fIsOwner = true;
273  return true;
274  } else if ((*this)[index] == RVN_R) {
275  nType = TX_REISSUE_ASSET;
276  return true;
277  }
278  }
279  }
280  }
281  return false;
282 }
283 
284 
286 {
287 
288  int nType = 0;
289  bool fIsOwner = false;
290  if (IsAssetScript(nType, fIsOwner))
291  return !fIsOwner && nType == TX_NEW_ASSET;
292 
293  return false;
294 }
295 
297 {
298  int nType = 0;
299  bool fIsOwner = false;
300  if (IsAssetScript(nType, fIsOwner))
301  return fIsOwner && nType == TX_NEW_ASSET;
302 
303  return false;
304 }
305 
307 {
308  int nType = 0;
309  bool fIsOwner = false;
310  if (IsAssetScript(nType, fIsOwner))
311  return nType == TX_REISSUE_ASSET;
312 
313  return false;
314 }
315 
317 {
318  int nType = 0;
319  bool fIsOwner = false;
320  if (IsAssetScript(nType, fIsOwner))
321  return nType == TX_TRANSFER_ASSET;
322 
323  return false;
324 }
325 
327 {
329 }
330 
332 {
333  return (this->size() > 23 &&
334  (*this)[0] == OP_RVN_ASSET &&
335  (*this)[1] == 0x14);
336 }
337 
339 {
340  // 1 OP_RVN_ASSET followed by two OP_RESERVED + atleast 4 characters for the restricted name $ABC
341  return (this->size() > 6 &&
342  (*this)[0] == OP_RVN_ASSET &&
343  (*this)[1] == OP_RESERVED &&
344  (*this)[2] == OP_RESERVED);
345 }
346 
347 
349 {
350  // 1 OP_RVN_ASSET followed by one OP_RESERVED
351  return (this->size() > 3 &&
352  (*this)[0] == OP_RVN_ASSET &&
353  (*this)[1] == OP_RESERVED &&
354  (*this)[2] != OP_RESERVED);
355 }
359 {
360  // Extra-fast test for pay-to-witness-script-hash CScripts:
361  return (this->size() == 34 &&
362  (*this)[0] == OP_0 &&
363  (*this)[1] == 0x20);
364 }
365 
366 // A witness program is any valid CScript that consists of a 1-byte push opcode
367 // followed by a data push between 2 and 40 bytes.
368 bool CScript::IsWitnessProgram(int& version, std::vector<unsigned char>& program) const
369 {
370  if (this->size() < 4 || this->size() > 42) {
371  return false;
372  }
373  if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {
374  return false;
375  }
376  if ((size_t)((*this)[1] + 2) == this->size()) {
377  version = DecodeOP_N((opcodetype)(*this)[0]);
378  program = std::vector<unsigned char>(this->begin() + 2, this->end());
379  return true;
380  }
381  return false;
382 }
383 
385 {
386  // Test for pay-to-pubkey CScript with both
387  // compressed or uncompressed pubkey
388  if (this->size() == 35) {
389  return ((*this)[1] == 0x02 || (*this)[1] == 0x03) &&
390  (*this)[34] == OP_CHECKSIG;
391  }
392  if (this->size() == 67) {
393  return (*this)[1] == 0x04 &&
394  (*this)[66] == OP_CHECKSIG;
395 
396  }
397  return false;
398 }
399 
401 {
402  while (pc < end())
403  {
404  opcodetype opcode;
405  if (!GetOp(pc, opcode))
406  return false;
407 
408  // Note that IsPushOnly() *does* consider OP_RESERVED to be a
409  // push-type opcode, however execution of OP_RESERVED fails, so
410  // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to
411  // the P2SH special validation code being executed.
412  if (opcode > OP_16)
413  return false;
414 
415  }
416  return true;
417 }
418 
420 {
421  return this->IsPushOnly(begin());
422 }
423 
424 std::string CScriptWitness::ToString() const
425 {
426  std::string ret = "CScriptWitness(";
427  for (unsigned int i = 0; i < stack.size(); i++) {
428  if (i) {
429  ret += ", ";
430  }
431  ret += HexStr(stack[i]);
432  }
433  return ret + ")";
434 }
435 
437 {
439  while (it < end()) {
440  opcodetype opcode;
441  std::vector<unsigned char> item;
442  if (!GetOp(it, opcode, item) || opcode > MAX_OPCODE || item.size() > MAX_SCRIPT_ELEMENT_SIZE) {
443  return false;
444  }
445  }
446  return true;
447 }
448 
450 {
451  CAmount nAmount;
452  return (size() > 0 && *begin() == OP_RETURN) || (size() > 0 && *begin() == OP_RVN_ASSET) || (size() > MAX_SCRIPT_SIZE) || (GetAssetAmountFromScript(*this, nAmount) && nAmount == 0);
453 }
454 
459 
461 bool GetAssetAmountFromScript(const CScript& script, CAmount& nAmount)
462 {
463  // Placeholder strings that will get set if you successfully get the transfer or asset from the script
464  std::string address = "";
465  std::string assetName = "";
466 
467  int nType = 0;
468  bool fIsOwner = false;
469  if (!script.IsAssetScript(nType, fIsOwner)) {
470  return false;
471  }
472 
473  txnouttype type = txnouttype(nType);
474 
475  // Get the New Asset or Transfer Asset from the scriptPubKey
476  if (type == TX_NEW_ASSET && !fIsOwner) {
477  if (AmountFromNewAssetScript(script, nAmount)) {
478  return true;
479  }
480  } else if (type == TX_TRANSFER_ASSET) {
481  if (AmountFromTransferScript(script, nAmount)) {
482  return true;
483  }
484  } else if (type == TX_NEW_ASSET && fIsOwner) {
485  nAmount = OWNER_ASSET_AMOUNT;
486  return true;
487  } else if (type == TX_REISSUE_ASSET) {
488  if (AmountFromReissueScript(script, nAmount)) {
489  return true;
490  }
491  }
492 
493  return false;
494 }
495 
496 bool ScriptNewAsset(const CScript& scriptPubKey, int& nStartingIndex)
497 {
498  int nType = 0;
499  bool fIsOwner =false;
500  if (scriptPubKey.IsAssetScript(nType, fIsOwner, nStartingIndex)) {
501  return nType == TX_NEW_ASSET && !fIsOwner;
502  }
503 
504  return false;
505 }
506 
507 bool ScriptTransferAsset(const CScript& scriptPubKey, int& nStartingIndex)
508 {
509  int nType = 0;
510  bool fIsOwner =false;
511  if (scriptPubKey.IsAssetScript(nType, fIsOwner, nStartingIndex)) {
512  return nType == TX_TRANSFER_ASSET;
513  }
514 
515  return false;
516 }
517 
518 bool ScriptReissueAsset(const CScript& scriptPubKey, int& nStartingIndex)
519 {
520  int nType = 0;
521  bool fIsOwner =false;
522  if (scriptPubKey.IsAssetScript(nType, fIsOwner, nStartingIndex)) {
523  return nType == TX_REISSUE_ASSET;
524  }
525 
526  return false;
527 }
528 
529 
530 bool AmountFromNewAssetScript(const CScript& scriptPubKey, CAmount& nAmount)
531 {
532  int nStartingIndex = 0;
533  if (!ScriptNewAsset(scriptPubKey, nStartingIndex))
534  return false;
535 
536  std::vector<unsigned char> vchNewAsset;
537  vchNewAsset.insert(vchNewAsset.end(), scriptPubKey.begin() + nStartingIndex, scriptPubKey.end());
538  CDataStream ssAsset(vchNewAsset, SER_NETWORK, PROTOCOL_VERSION);
539 
540  CNewAsset assetNew;
541  try {
542  ssAsset >> assetNew;
543  } catch(std::exception& e) {
544  std::cout << "Failed to get the asset from the stream: " << e.what() << std::endl;
545  return false;
546  }
547 
548  nAmount = assetNew.nAmount;
549  return true;
550 }
551 
552 bool AmountFromTransferScript(const CScript& scriptPubKey, CAmount& nAmount)
553 {
554  int nStartingIndex = 0;
555  if (!ScriptTransferAsset(scriptPubKey, nStartingIndex))
556  return false;
557 
558  std::vector<unsigned char> vchAsset;
559  vchAsset.insert(vchAsset.end(), scriptPubKey.begin() + nStartingIndex, scriptPubKey.end());
560  CDataStream ssAsset(vchAsset, SER_NETWORK, PROTOCOL_VERSION);
561 
562  CAssetTransfer asset;
563  try {
564  ssAsset >> asset;
565  } catch(std::exception& e) {
566  std::cout << "Failed to get the asset from the stream: " << e.what() << std::endl;
567  return false;
568  }
569 
570  nAmount = asset.nAmount;
571  return true;
572 }
573 
574 bool AmountFromReissueScript(const CScript& scriptPubKey, CAmount& nAmount)
575 {
576  int nStartingIndex = 0;
577  if (!ScriptReissueAsset(scriptPubKey, nStartingIndex))
578  return false;
579 
580  std::vector<unsigned char> vchNewAsset;
581  vchNewAsset.insert(vchNewAsset.end(), scriptPubKey.begin() + nStartingIndex, scriptPubKey.end());
582  CDataStream ssAsset(vchNewAsset, SER_NETWORK, PROTOCOL_VERSION);
583 
584  CReissueAsset asset;
585  try {
586  ssAsset >> asset;
587  } catch(std::exception& e) {
588  std::cout << "Failed to get the asset from the stream: " << e.what() << std::endl;
589  return false;
590  }
591 
592  nAmount = asset.nAmount;
593  return true;
594 }
596 
597 
Definition: script.h:136
Definition: script.h:65
Definition: script.h:121
unsigned int GetSigOpCount(bool fAccurate) const
Pre-version-0.6, Raven always counted CHECKMULTISIGs as 20 sigops.
Definition: script.cpp:162
#define OWNER_ASSET_AMOUNT
Definition: assets.h:35
RVN START.
Definition: script.h:188
Definition: script.h:104
bool IsOwnerAsset() const
Definition: script.cpp:296
static int DecodeOP_N(opcodetype opcode)
Encode/decode small integers:
Definition: script.h:583
Definition: script.h:157
Definition: script.h:96
bool ScriptReissueAsset(const CScript &scriptPubKey, int &nStartingIndex)
Definition: script.cpp:518
bool IsPayToScriptHash() const
Definition: script.cpp:221
Definition: script.h:82
Definition: script.h:75
Definition: script.h:71
#define RVN_Q
Definition: assets.h:22
bool IsNewAsset() const
Definition: script.cpp:285
Definition: script.h:98
Definition: script.h:135
bool AmountFromTransferScript(const CScript &scriptPubKey, CAmount &nAmount)
Definition: script.cpp:552
Definition: script.h:63
Definition: script.h:142
Definition: script.h:69
bool IsNullAsset() const
Definition: script.cpp:326
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
Definition: script.h:64
bool IsPushOnly() const
Definition: script.cpp:419
bool ScriptNewAsset(const CScript &scriptPubKey, int &nStartingIndex)
Definition: script.cpp:496
bool IsReissueAsset() const
Definition: script.cpp:306
bool HasValidOps() const
Check if the script contains valid OP_CODES.
Definition: script.cpp:436
bool IsWitnessProgram(int &version, std::vector< unsigned char > &program) const
Definition: script.cpp:368
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:147
Definition: script.h:156
#define RVN_T
Definition: assets.h:23
#define RVN_N
Definition: assets.h:21
Definition: script.h:77
Definition: script.h:73
Definition: script.h:122
bool IsUnspendable() const
Returns whether the script is guaranteed to fail at execution, regardless of the initial stack...
Definition: script.cpp:449
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
bool AmountFromNewAssetScript(const CScript &scriptPubKey, CAmount &nAmount)
Definition: script.cpp:530
Definition: script.h:66
iterator end()
Definition: prevector.h:293
bool IsPayToPublicKey() const
RVN END.
Definition: script.cpp:384
Definition: script.h:143
opcodetype
Script opcodes.
Definition: script.h:51
Definition: script.h:113
#define RVN_R
Definition: assets.h:19
Definition: script.h:68
Definition: script.h:61
Definition: script.h:80
#define RVN_V
Definition: assets.h:20
bool AmountFromReissueScript(const CScript &scriptPubKey, CAmount &nAmount)
Definition: script.cpp:574
bool IsTransferAsset() const
Definition: script.cpp:316
Definition: script.h:140
Definition: script.h:108
bool IsNullAssetVerifierTxDataScript() const
Definition: script.cpp:348
Definition: script.h:141
Definition: script.h:86
const char * GetOpName(opcodetype opcode)
Definition: script.cpp:15
CAmount nAmount
Definition: assettypes.h:240
Definition: script.h:70
txnouttype
Definition: standard.h:57
Definition: script.h:95
CAmount nAmount
Definition: assettypes.h:101
bool IsNullAssetTxDataScript() const
Definition: script.cpp:331
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:396
RVN START.
Definition: standard.h:69
Definition: script.h:67
#define RVN_O
Definition: assets.h:24
iterator begin()
Definition: prevector.h:291
size_type size() const
Definition: prevector.h:283
bool GetAssetAmountFromScript(const CScript &script, CAmount &nAmount)
-----------------------------------------------------------------------------------------------------...
Definition: script.cpp:461
bool GetOp(iterator &pc, opcodetype &opcodeRet, std::vector< unsigned char > &vchRet)
Definition: script.h:503
Definition: script.h:74
bool ScriptTransferAsset(const CScript &scriptPubKey, int &nStartingIndex)
Definition: script.cpp:507
Definition: script.h:123
Definition: script.h:72
Definition: script.h:81
bool IsAssetScript() const
RVN START.
Definition: script.cpp:231
Definition: script.h:54
std::string ToString() const
Definition: script.cpp:424
bool IsPayToPublicKeyHash() const
Definition: script.cpp:210
bool IsNullGlobalRestrictionAssetTxDataScript() const
Definition: script.cpp:338
CAmount nAmount
Definition: assettypes.h:191
Definition: script.h:139
Definition: script.h:76
bool IsPayToWitnessScriptHash() const
RVN END.
Definition: script.cpp:358
Definition: script.h:103
bool IsAssetScript(int &nType, bool &fIsOwner, int &nStartingIndex) const
Definition: script.cpp:245