Skip to content

Commit

Permalink
Add istanbul opcodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
palkeo committed Feb 18, 2020
1 parent 88f77e5 commit a44423b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pakala/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
("calldata_size", None, 2 ** 20),
("coinbase", None, None),
("difficulty", None, None),
("chainid", None, None),
)


Expand Down
4 changes: 4 additions & 0 deletions pakala/sm.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,10 @@ def solution(variable):
state.stack_push(state.env.gas)
elif op == opcode_values.ADDRESS:
state.stack_push(state.env.address)
elif op == opcode_values.CHAINID:
state.stack_push(state.env.chainid)
elif op == opcode_values.SELFBALANCE:
state.stack_push(state.env.balance)
elif op == opcode_values.BALANCE:
addr = solution(state.stack_pop())
if addr != solution(state.env.address):
Expand Down

0 comments on commit a44423b

Please sign in to comment.