@@ -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 ,
@@ -627,15 +620,8 @@ def test_worst_selfdestruct_created(
627
620
"""
628
621
env = Environment ()
629
622
630
- # Create an account that will be used as the beneficiary of the SELFDESTRUCT calls, to avoid
631
- # account creation costs. All SELFDESTRUCT calls will target the same account to avoid
632
- # cold costs.
633
- selfdestruct_beneficiary = pre .fund_eoa ()
634
-
635
623
# Template code that will be used to deploy a large number of contracts.
636
- selfdestructable_contract_addr = pre .deploy_contract (
637
- code = Op .SELFDESTRUCT (selfdestruct_beneficiary )
638
- )
624
+ selfdestructable_contract_addr = pre .deploy_contract (code = Op .SELFDESTRUCT (Op .COINBASE ))
639
625
initcode = Op .EXTCODECOPY (
640
626
address = selfdestructable_contract_addr ,
641
627
dest_offset = 0 ,
@@ -663,7 +649,7 @@ def test_worst_selfdestruct_created(
663
649
),
664
650
# Stop before we run out of gas for the whole tx execution.
665
651
# The value was found by trial-error rounded to the next 1000 multiple.
666
- condition = Op .GT (Op .GAS , 33_000 ),
652
+ condition = Op .GT (Op .GAS , 42_000 ),
667
653
)
668
654
+ Op .SSTORE (0 , 42 ) # Done for successful tx execution assertion below.
669
655
)
@@ -677,7 +663,6 @@ def test_worst_selfdestruct_created(
677
663
)
678
664
679
665
post = {code_addr : Account (storage = {0 : 42 })} # Check for successful execution.
680
-
681
666
state_test (
682
667
env = env ,
683
668
pre = pre ,
0 commit comments