@@ -493,15 +493,8 @@ def test_worst_selfdestruct_existing(
493
493
env = Environment (gas_limit = 100_000_000_000 )
494
494
attack_gas_limit = Environment ().gas_limit
495
495
496
- # Create an account that will be used as the beneficiary of the SELFDESTRUCT calls, to avoid
497
- # account creation costs. All SELFDESTRUCT calls will target the same account to avoid
498
- # cold costs.
499
- selfdestruct_beneficiary = pre .fund_eoa ()
500
-
501
496
# Template code that will be used to deploy a large number of contracts.
502
- selfdestructable_contract_addr = pre .deploy_contract (
503
- code = Op .SELFDESTRUCT (selfdestruct_beneficiary )
504
- )
497
+ selfdestructable_contract_addr = pre .deploy_contract (code = Op .SELFDESTRUCT (Op .COINBASE ))
505
498
initcode = Op .EXTCODECOPY (
506
499
address = selfdestructable_contract_addr ,
507
500
dest_offset = 0 ,
@@ -629,15 +622,8 @@ def test_worst_selfdestruct_created(
629
622
"""
630
623
env = Environment ()
631
624
632
- # Create an account that will be used as the beneficiary of the SELFDESTRUCT calls, to avoid
633
- # account creation costs. All SELFDESTRUCT calls will target the same account to avoid
634
- # cold costs.
635
- selfdestruct_beneficiary = pre .fund_eoa ()
636
-
637
625
# Template code that will be used to deploy a large number of contracts.
638
- selfdestructable_contract_addr = pre .deploy_contract (
639
- code = Op .SELFDESTRUCT (selfdestruct_beneficiary )
640
- )
626
+ selfdestructable_contract_addr = pre .deploy_contract (code = Op .SELFDESTRUCT (Op .COINBASE ))
641
627
initcode = Op .EXTCODECOPY (
642
628
address = selfdestructable_contract_addr ,
643
629
dest_offset = 0 ,
@@ -665,7 +651,7 @@ def test_worst_selfdestruct_created(
665
651
),
666
652
# Stop before we run out of gas for the whole tx execution.
667
653
# The value was found by trial-error rounded to the next 1000 multiple.
668
- condition = Op .GT (Op .GAS , 33_000 ),
654
+ condition = Op .GT (Op .GAS , 42_000 ),
669
655
)
670
656
+ Op .SSTORE (0 , 42 ) # Done for successful tx execution assertion below.
671
657
)
@@ -679,7 +665,6 @@ def test_worst_selfdestruct_created(
679
665
)
680
666
681
667
post = {code_addr : Account (storage = {0 : 42 })} # Check for successful execution.
682
-
683
668
state_test (
684
669
env = env ,
685
670
pre = pre ,
0 commit comments