Skip to content

Commit

Permalink
Replace Yul with callable opcodes in eip3651 module.
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-tb committed Apr 13, 2023
1 parent 3b3c2e5 commit 0670954
Showing 1 changed file with 12 additions and 81 deletions.
93 changes: 12 additions & 81 deletions fillers/eips/eip3651.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,41 +74,13 @@ def test_warm_coinbase_call_out_of_gas(fork):
"""
)

call_code = Yul(
"""
{
let cb := coinbase()
pop(call(0, cb, 0, 0, 0, 0, 0))
}
"""
)
call_code = Op.POP(Op.CALL(0, Op.COINBASE, 0, 0, 0, 0, 0))

callcode_code = Yul(
"""
{
let cb := coinbase()
pop(callcode(0, cb, 0, 0, 0, 0, 0))
}
"""
)
callcode_code = Op.POP(Op.CALLCODE(0, Op.COINBASE, 0, 0, 0, 0, 0))

delegatecall_code = Yul(
"""
{
let cb := coinbase()
pop(delegatecall(0, cb, 0, 0, 0, 0))
}
"""
)
delegatecall_code = Op.POP(Op.DELEGATECALL(0, Op.COINBASE, 0, 0, 0, 0))

staticcall_code = Yul(
"""
{
let cb := coinbase()
pop(staticcall(0, cb, 0, 0, 0, 0))
}
"""
)
staticcall_code = Op.POP(Op.STATICCALL(0, Op.COINBASE, 0, 0, 0, 0))

pre = {
TestAddress: Account(balance=1000000000000000000000),
Expand Down Expand Up @@ -183,82 +155,41 @@ def test_warm_coinbase_gas_usage(fork):
# List of opcodes that are affected by
gas_measured_opcodes: Dict[str, CodeGasMeasure] = {
"EXTCODESIZE": CodeGasMeasure(
code=Op.EXTCODESIZE(
Op.COINBASE,
),
code=Op.EXTCODESIZE(Op.COINBASE),
overhead_cost=2,
extra_stack_items=1,
),
"EXTCODECOPY": CodeGasMeasure(
code=Op.EXTCODECOPY(
Op.COINBASE,
0,
0,
0,
),
code=Op.EXTCODECOPY(Op.COINBASE, 0, 0, 0),
overhead_cost=2 + 3 + 3 + 3,
),
"EXTCODEHASH": CodeGasMeasure(
code=Op.EXTCODEHASH(
Op.COINBASE,
),
code=Op.EXTCODEHASH(Op.COINBASE),
overhead_cost=2,
extra_stack_items=1,
),
"BALANCE": CodeGasMeasure(
code=Op.BALANCE(
Op.COINBASE,
),
code=Op.BALANCE(Op.COINBASE),
overhead_cost=2,
extra_stack_items=1,
),
"CALL": CodeGasMeasure(
code=Op.CALL(
0xFF,
Op.COINBASE,
0,
0,
0,
0,
0,
),
code=Op.CALL(0xFF, Op.COINBASE, 0, 0, 0, 0, 0),
overhead_cost=3 + 2 + 3 + 3 + 3 + 3 + 3,
extra_stack_items=1,
),
"CALLCODE": CodeGasMeasure(
code=Op.CALLCODE(
0xFF,
Op.COINBASE,
0,
0,
0,
0,
0,
),
code=Op.CALLCODE(0xFF, Op.COINBASE, 0, 0, 0, 0, 0),
overhead_cost=3 + 2 + 3 + 3 + 3 + 3 + 3,
extra_stack_items=1,
),
"DELEGATECALL": CodeGasMeasure(
code=Op.DELEGATECALL(
0xFF,
Op.COINBASE,
0,
0,
0,
0,
),
code=Op.DELEGATECALL(0xFF, Op.COINBASE, 0, 0, 0, 0),
overhead_cost=3 + 2 + 3 + 3 + 3 + 3,
extra_stack_items=1,
),
"STATICCALL": CodeGasMeasure(
code=Op.STATICCALL(
0xFF,
Op.COINBASE,
0,
0,
0,
0,
),
code=Op.STATICCALL(0xFF, Op.COINBASE, 0, 0, 0, 0),
overhead_cost=3 + 2 + 3 + 3 + 3 + 3,
extra_stack_items=1,
),
Expand Down

0 comments on commit 0670954

Please sign in to comment.