aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/types.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-17 00:25:24 +0800
committerobscuren <geffobscura@gmail.com>2014-06-17 00:25:24 +0800
commit5a0e75173626704c3d58be582dff318218569ef3 (patch)
tree801ec6d33fe21e46230a3082cd069534f64aa251 /ethchain/types.go
parent006ac772e6c81271a84ff56e00527b2adbc0129c (diff)
parentff0f15f7634ca713b0ce8232a8fa63eec5c3fad7 (diff)
downloaddexon-5a0e75173626704c3d58be582dff318218569ef3.tar.gz
dexon-5a0e75173626704c3d58be582dff318218569ef3.tar.zst
dexon-5a0e75173626704c3d58be582dff318218569ef3.zip
Merge branch 'release/0.5.13'
Diffstat (limited to 'ethchain/types.go')
-rw-r--r--ethchain/types.go53
1 files changed, 37 insertions, 16 deletions
diff --git a/ethchain/types.go b/ethchain/types.go
index 293871143..d89fad147 100644
--- a/ethchain/types.go
+++ b/ethchain/types.go
@@ -1,5 +1,9 @@
package ethchain
+import (
+ "fmt"
+)
+
type OpCode int
// Op codes
@@ -17,8 +21,10 @@ const (
NEG = 0x09
LT = 0x0a
GT = 0x0b
- EQ = 0x0c
- NOT = 0x0d
+ SLT = 0x0c
+ SGT = 0x0d
+ EQ = 0x0e
+ NOT = 0x0f
// 0x10 range - bit ops
AND = 0x10
@@ -37,7 +43,10 @@ const (
CALLVALUE = 0x34
CALLDATALOAD = 0x35
CALLDATASIZE = 0x36
- GASPRICE = 0x37
+ CALLDATACOPY = 0x37
+ CODESIZE = 0x38
+ CODECOPY = 0x39
+ GASPRICE = 0x3a
// 0x40 range - block operations
PREVHASH = 0x40
@@ -48,18 +57,19 @@ const (
GASLIMIT = 0x45
// 0x50 range - 'storage' and execution
- POP = 0x51
- DUP = 0x52
- SWAP = 0x53
- MLOAD = 0x54
- MSTORE = 0x55
- MSTORE8 = 0x56
- SLOAD = 0x57
- SSTORE = 0x58
- JUMP = 0x59
- JUMPI = 0x5a
- PC = 0x5b
- MSIZE = 0x5c
+ POP = 0x50
+ DUP = 0x51
+ SWAP = 0x52
+ MLOAD = 0x53
+ MSTORE = 0x54
+ MSTORE8 = 0x55
+ SLOAD = 0x56
+ SSTORE = 0x57
+ JUMP = 0x58
+ JUMPI = 0x59
+ PC = 0x5a
+ MSIZE = 0x5b
+ GAS = 0x5c
// 0x60 range
PUSH1 = 0x60
@@ -120,6 +130,8 @@ var opCodeToString = map[OpCode]string{
NEG: "NEG",
LT: "LT",
GT: "GT",
+ SLT: "SLT",
+ SGT: "SGT",
EQ: "EQ",
NOT: "NOT",
@@ -140,6 +152,9 @@ var opCodeToString = map[OpCode]string{
CALLVALUE: "CALLVALUE",
CALLDATALOAD: "CALLDATALOAD",
CALLDATASIZE: "CALLDATASIZE",
+ CALLDATACOPY: "CALLDATACOPY",
+ CODESIZE: "CODESIZE",
+ CODECOPY: "CODECOPY",
GASPRICE: "TXGASPRICE",
// 0x40 range - block operations
@@ -162,6 +177,7 @@ var opCodeToString = map[OpCode]string{
JUMPI: "JUMPI",
PC: "PC",
MSIZE: "MSIZE",
+ GAS: "GAS",
// 0x60 range - push
PUSH1: "PUSH1",
@@ -208,7 +224,12 @@ var opCodeToString = map[OpCode]string{
}
func (o OpCode) String() string {
- return opCodeToString[o]
+ str := opCodeToString[o]
+ if len(str) == 0 {
+ return fmt.Sprintf("Missing opcode %#x", int(o))
+ }
+
+ return str
}
// Op codes for assembling