Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ops/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const (
SHR = OpCode(0x1C)
SAR = OpCode(0x1D)

SHA3 = OpCode(0x20)
KECCAK256 = OpCode(0x20)
)

// 0x30 range - closure state.
Expand Down Expand Up @@ -257,6 +257,10 @@ func init() {
stringToOp[elem.name] = k
ValidOpcodes = append(ValidOpcodes, k)
}

// Add mapping for legacy opcode names
stringToOp["SHA3"] = KECCAK256
stringToOp["SUICIDE"] = SELFDESTRUCT
}

// StringToOp finds the opcode whose name is stored in `str`.
Expand Down Expand Up @@ -301,7 +305,7 @@ var opCodeInfo = map[OpCode]opInfo{
MULMOD: {"MULMOD", []string{"a", "b", "x"}, []string{"(a * b) mod x"}},

// 0x20 range - crypto.
SHA3: {"SHA3", []string{"offset", "size"}, []string{"keccak256(mem[offset:offset+size])"}},
KECCAK256: {"KECCAK256", []string{"offset", "size"}, []string{"keccak256(mem[offset:offset+size])"}},
// 0x30 range - closure state.
ADDRESS: {"ADDRESS", nil, []string{"address of current context"}},
BALANCE: {"BALANCE", []string{"address"}, []string{"balance of address"}},
Expand Down