mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-01-31 07:12:17 +00:00
Add all script OP constants from the reference client.
This commit is contained in:
parent
8cc41330e6
commit
8b07672922
@ -57,14 +57,140 @@ class ScriptChunk {
|
||||
public class Script {
|
||||
private static Logger log = LoggerFactory.getLogger(Script.class);
|
||||
|
||||
// Some constants used for decoding the scripts.
|
||||
public static final int OP_PUSHDATA1 = 76;
|
||||
public static final int OP_PUSHDATA2 = 77;
|
||||
public static final int OP_PUSHDATA4 = 78;
|
||||
public static final int OP_DUP = 118;
|
||||
public static final int OP_HASH160 = 169;
|
||||
public static final int OP_EQUALVERIFY = 136;
|
||||
public static final int OP_CHECKSIG = 172;
|
||||
// Some constants used for decoding the scripts, copied from the reference client
|
||||
// push value
|
||||
public static final int OP_0 = 0x00;
|
||||
public static final int OP_FALSE = OP_0;
|
||||
public static final int OP_PUSHDATA1 = 0x4c;
|
||||
public static final int OP_PUSHDATA2 = 0x4d;
|
||||
public static final int OP_PUSHDATA4 = 0x4e;
|
||||
public static final int OP_1NEGATE = 0x4f;
|
||||
public static final int OP_RESERVED = 0x50;
|
||||
public static final int OP_1 = 0x51;
|
||||
public static final int OP_TRUE=OP_1;
|
||||
public static final int OP_2 = 0x52;
|
||||
public static final int OP_3 = 0x53;
|
||||
public static final int OP_4 = 0x54;
|
||||
public static final int OP_5 = 0x55;
|
||||
public static final int OP_6 = 0x56;
|
||||
public static final int OP_7 = 0x57;
|
||||
public static final int OP_8 = 0x58;
|
||||
public static final int OP_9 = 0x59;
|
||||
public static final int OP_10 = 0x5a;
|
||||
public static final int OP_11 = 0x5b;
|
||||
public static final int OP_12 = 0x5c;
|
||||
public static final int OP_13 = 0x5d;
|
||||
public static final int OP_14 = 0x5e;
|
||||
public static final int OP_15 = 0x5f;
|
||||
public static final int OP_16 = 0x60;
|
||||
|
||||
// control
|
||||
public static final int OP_NOP = 0x61;
|
||||
public static final int OP_VER = 0x62;
|
||||
public static final int OP_IF = 0x63;
|
||||
public static final int OP_NOTIF = 0x64;
|
||||
public static final int OP_VERIF = 0x65;
|
||||
public static final int OP_VERNOTIF = 0x66;
|
||||
public static final int OP_ELSE = 0x67;
|
||||
public static final int OP_ENDIF = 0x68;
|
||||
public static final int OP_VERIFY = 0x69;
|
||||
public static final int OP_RETURN = 0x6a;
|
||||
|
||||
// stack ops
|
||||
public static final int OP_TOALTSTACK = 0x6b;
|
||||
public static final int OP_FROMALTSTACK = 0x6c;
|
||||
public static final int OP_2DROP = 0x6d;
|
||||
public static final int OP_2DUP = 0x6e;
|
||||
public static final int OP_3DUP = 0x6f;
|
||||
public static final int OP_2OVER = 0x70;
|
||||
public static final int OP_2ROT = 0x71;
|
||||
public static final int OP_2SWAP = 0x72;
|
||||
public static final int OP_IFDUP = 0x73;
|
||||
public static final int OP_DEPTH = 0x74;
|
||||
public static final int OP_DROP = 0x75;
|
||||
public static final int OP_DUP = 0x76;
|
||||
public static final int OP_NIP = 0x77;
|
||||
public static final int OP_OVER = 0x78;
|
||||
public static final int OP_PICK = 0x79;
|
||||
public static final int OP_ROLL = 0x7a;
|
||||
public static final int OP_ROT = 0x7b;
|
||||
public static final int OP_SWAP = 0x7c;
|
||||
public static final int OP_TUCK = 0x7d;
|
||||
|
||||
// splice ops
|
||||
public static final int OP_CAT = 0x7e;
|
||||
public static final int OP_SUBSTR = 0x7f;
|
||||
public static final int OP_LEFT = 0x80;
|
||||
public static final int OP_RIGHT = 0x81;
|
||||
public static final int OP_SIZE = 0x82;
|
||||
|
||||
// bit logic
|
||||
public static final int OP_INVERT = 0x83;
|
||||
public static final int OP_AND = 0x84;
|
||||
public static final int OP_OR = 0x85;
|
||||
public static final int OP_XOR = 0x86;
|
||||
public static final int OP_EQUAL = 0x87;
|
||||
public static final int OP_EQUALVERIFY = 0x88;
|
||||
public static final int OP_RESERVED1 = 0x89;
|
||||
public static final int OP_RESERVED2 = 0x8a;
|
||||
|
||||
// numeric
|
||||
public static final int OP_1ADD = 0x8b;
|
||||
public static final int OP_1SUB = 0x8c;
|
||||
public static final int OP_2MUL = 0x8d;
|
||||
public static final int OP_2DIV = 0x8e;
|
||||
public static final int OP_NEGATE = 0x8f;
|
||||
public static final int OP_ABS = 0x90;
|
||||
public static final int OP_NOT = 0x91;
|
||||
public static final int OP_0NOTEQUAL = 0x92;
|
||||
|
||||
public static final int OP_ADD = 0x93;
|
||||
public static final int OP_SUB = 0x94;
|
||||
public static final int OP_MUL = 0x95;
|
||||
public static final int OP_DIV = 0x96;
|
||||
public static final int OP_MOD = 0x97;
|
||||
public static final int OP_LSHIFT = 0x98;
|
||||
public static final int OP_RSHIFT = 0x99;
|
||||
|
||||
public static final int OP_BOOLAND = 0x9a;
|
||||
public static final int OP_BOOLOR = 0x9b;
|
||||
public static final int OP_NUMEQUAL = 0x9c;
|
||||
public static final int OP_NUMEQUALVERIFY = 0x9d;
|
||||
public static final int OP_NUMNOTEQUAL = 0x9e;
|
||||
public static final int OP_LESSTHAN = 0x9f;
|
||||
public static final int OP_GREATERTHAN = 0xa0;
|
||||
public static final int OP_LESSTHANOREQUAL = 0xa1;
|
||||
public static final int OP_GREATERTHANOREQUAL = 0xa2;
|
||||
public static final int OP_MIN = 0xa3;
|
||||
public static final int OP_MAX = 0xa4;
|
||||
|
||||
public static final int OP_WITHIN = 0xa5;
|
||||
|
||||
// crypto
|
||||
public static final int OP_RIPEMD160 = 0xa6;
|
||||
public static final int OP_SHA1 = 0xa7;
|
||||
public static final int OP_SHA256 = 0xa8;
|
||||
public static final int OP_HASH160 = 0xa9;
|
||||
public static final int OP_HASH256 = 0xaa;
|
||||
public static final int OP_CODESEPARATOR = 0xab;
|
||||
public static final int OP_CHECKSIG = 0xac;
|
||||
public static final int OP_CHECKSIGVERIFY = 0xad;
|
||||
public static final int OP_CHECKMULTISIG = 0xae;
|
||||
public static final int OP_CHECKMULTISIGVERIFY = 0xaf;
|
||||
|
||||
// expansion
|
||||
public static final int OP_NOP1 = 0xb0;
|
||||
public static final int OP_NOP2 = 0xb1;
|
||||
public static final int OP_NOP3 = 0xb2;
|
||||
public static final int OP_NOP4 = 0xb3;
|
||||
public static final int OP_NOP5 = 0xb4;
|
||||
public static final int OP_NOP6 = 0xb5;
|
||||
public static final int OP_NOP7 = 0xb6;
|
||||
public static final int OP_NOP8 = 0xb7;
|
||||
public static final int OP_NOP9 = 0xb8;
|
||||
public static final int OP_NOP10 = 0xb9;
|
||||
|
||||
public static final int OP_INVALIDOPCODE = 0xff;
|
||||
|
||||
byte[] program;
|
||||
private int cursor;
|
||||
|
Loading…
Reference in New Issue
Block a user