File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 32
32
from ethereum_test_tools .vm .opcode import Opcodes as Op
33
33
34
34
35
+ @pytest .mark .valid_from ("Frontier" )
35
36
def test_xen_approve (
36
37
blockchain_test : BlockchainTestFiller ,
37
38
pre : Alloc ,
@@ -47,7 +48,9 @@ def test_xen_approve(
47
48
xen_contract = 0x06450DEE7FD2FB8E39061434BABCFC05599A6FB8
48
49
gas_threshold = 40_000
49
50
50
- fn_signature_approve = 0x095EA7B3 # Function selector of `approve(address,uint256)`
51
+ fn_signature_approve = bytes .fromhex (
52
+ "095EA7B3"
53
+ ) # Function selector of `approve(address,uint256)`
51
54
# This code loops until there is less than threshold_gas left and reads two items from calldata:
52
55
# The first 32 bytes are interpreted as the start address to start approving for
53
56
# The second 32 bytes is the approval amount
@@ -57,7 +60,7 @@ def test_xen_approve(
57
60
# The attack block can then target all of the just initialized storage slots to edit
58
61
# (This should thus yield more dirty trie nodes than the )
59
62
approval_loop_code = (
60
- Op .MSTORE (0 , Hash ( fn_signature_approve , left_padding = True ) )
63
+ Om .MSTORE (fn_signature_approve )
61
64
+ Op .MSTORE (4 + 32 , Op .CALLDATALOAD (32 ))
62
65
+ Op .CALLDATALOAD (0 )
63
66
+ While (
You can’t perform that action at this time.
0 commit comments