|
|
@ -9,57 +9,57 @@ type OpCode int |
|
|
|
|
|
|
|
|
|
|
|
// Op codes
|
|
|
|
// Op codes
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
oSTOP OpCode = iota |
|
|
|
oSTOP = 0x00 |
|
|
|
oADD |
|
|
|
oADD = 0x01 |
|
|
|
oMUL |
|
|
|
oMUL = 0x02 |
|
|
|
oSUB |
|
|
|
oSUB = 0x03 |
|
|
|
oDIV |
|
|
|
oDIV = 0x04 |
|
|
|
oSDIV |
|
|
|
oSDIV = 0x05 |
|
|
|
oMOD |
|
|
|
oMOD = 0x06 |
|
|
|
oSMOD |
|
|
|
oSMOD = 0x07 |
|
|
|
oEXP |
|
|
|
oEXP = 0x08 |
|
|
|
oNEG |
|
|
|
oNEG = 0x09 |
|
|
|
oLT |
|
|
|
oLT = 0x0a |
|
|
|
oLE |
|
|
|
oLE = 0x0b |
|
|
|
oGT |
|
|
|
oGT = 0x0c |
|
|
|
oGE |
|
|
|
oGE = 0x0d |
|
|
|
oEQ |
|
|
|
oEQ = 0x0e |
|
|
|
oNOT |
|
|
|
oNOT = 0x0f |
|
|
|
oMYADDRESS |
|
|
|
oMYADDRESS = 0x10 |
|
|
|
oTXSENDER |
|
|
|
oTXSENDER = 0x11 |
|
|
|
oTXVALUE |
|
|
|
oTXVALUE = 0x12 |
|
|
|
oTXFEE |
|
|
|
oTXDATAN = 0x13 |
|
|
|
oTXDATAN |
|
|
|
oTXDATA = 0x14 |
|
|
|
oTXDATA |
|
|
|
oBLK_PREVHASH = 0x15 |
|
|
|
oBLK_PREVHASH |
|
|
|
oBLK_COINBASE = 0x16 |
|
|
|
oBLK_COINBASE |
|
|
|
oBLK_TIMESTAMP = 0x17 |
|
|
|
oBLK_TIMESTAMP |
|
|
|
oBLK_NUMBER = 0x18 |
|
|
|
oBLK_NUMBER |
|
|
|
oBLK_DIFFICULTY = 0x19 |
|
|
|
oBLK_DIFFICULTY |
|
|
|
oBLK_NONCE = 0x1a |
|
|
|
oBASEFEE |
|
|
|
oBASEFEE = 0x1b |
|
|
|
oSHA256 OpCode = 32 |
|
|
|
oSHA256 = 0x20 |
|
|
|
oRIPEMD160 OpCode = 33 |
|
|
|
oRIPEMD160 = 0x21 |
|
|
|
oECMUL OpCode = 34 |
|
|
|
oECMUL = 0x22 |
|
|
|
oECADD OpCode = 35 |
|
|
|
oECADD = 0x23 |
|
|
|
oECSIGN OpCode = 36 |
|
|
|
oECSIGN = 0x24 |
|
|
|
oECRECOVER OpCode = 37 |
|
|
|
oECRECOVER = 0x25 |
|
|
|
oECVALID OpCode = 38 |
|
|
|
oECVALID = 0x26 |
|
|
|
oSHA3 OpCode = 39 |
|
|
|
oSHA3 = 0x27 |
|
|
|
oPUSH OpCode = 48 |
|
|
|
oPUSH = 0x30 |
|
|
|
oPOP OpCode = 49 |
|
|
|
oPOP = 0x31 |
|
|
|
oDUP OpCode = 50 |
|
|
|
oDUP = 0x32 |
|
|
|
oSWAP OpCode = 51 |
|
|
|
oSWAP = 0x33 |
|
|
|
oMLOAD OpCode = 52 |
|
|
|
oMLOAD = 0x34 |
|
|
|
oMSTORE OpCode = 53 |
|
|
|
oMSTORE = 0x35 |
|
|
|
oSLOAD OpCode = 54 |
|
|
|
oSLOAD = 0x36 |
|
|
|
oSSTORE OpCode = 55 |
|
|
|
oSSTORE = 0x37 |
|
|
|
oJMP OpCode = 56 |
|
|
|
oJMP = 0x38 |
|
|
|
oJMPI OpCode = 57 |
|
|
|
oJMPI = 0x39 |
|
|
|
oIND OpCode = 58 |
|
|
|
oIND = 0x3a |
|
|
|
oEXTRO OpCode = 59 |
|
|
|
oEXTRO = 0x3b |
|
|
|
oBALANCE OpCode = 60 |
|
|
|
oBALANCE = 0x3c |
|
|
|
oMKTX OpCode = 61 |
|
|
|
oMKTX = 0x3d |
|
|
|
oSUICIDE OpCode = 62 |
|
|
|
oSUICIDE = 0x3f |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// Since the opcodes aren't all in order we can't use a regular slice
|
|
|
|
// Since the opcodes aren't all in order we can't use a regular slice
|
|
|
@ -83,7 +83,6 @@ var opCodeToString = map[OpCode]string{ |
|
|
|
oMYADDRESS: "MYADDRESS", |
|
|
|
oMYADDRESS: "MYADDRESS", |
|
|
|
oTXSENDER: "TXSENDER", |
|
|
|
oTXSENDER: "TXSENDER", |
|
|
|
oTXVALUE: "TXVALUE", |
|
|
|
oTXVALUE: "TXVALUE", |
|
|
|
oTXFEE: "TXFEE", |
|
|
|
|
|
|
|
oTXDATAN: "TXDATAN", |
|
|
|
oTXDATAN: "TXDATAN", |
|
|
|
oTXDATA: "TXDATA", |
|
|
|
oTXDATA: "TXDATA", |
|
|
|
oBLK_PREVHASH: "BLK_PREVHASH", |
|
|
|
oBLK_PREVHASH: "BLK_PREVHASH", |
|
|
|