@ -9,6 +9,7 @@ from mythril.laser.ethereum.transaction.transaction_models import (
MessageCallTransaction ,
MessageCallTransaction ,
TransactionStartSignal ,
TransactionStartSignal ,
)
)
from mythril . laser . smt import symbol_factory
from mythril . laser . ethereum . state . calldata import ConcreteCalldata
from mythril . laser . ethereum . state . calldata import ConcreteCalldata
from mythril . support . support_utils import get_code_hash
from mythril . support . support_utils import get_code_hash
@ -20,7 +21,7 @@ def generate_salted_address(code_str, salt, caller):
addr = hex ( caller . value ) [ 2 : ]
addr = hex ( caller . value ) [ 2 : ]
addr = " 0 " * ( 40 - len ( addr ) ) + addr
addr = " 0 " * ( 40 - len ( addr ) ) + addr
salt = hex ( salt ) [ 2 : ]
salt = hex ( salt . value ) [ 2 : ]
salt = " 0 " * ( 64 - len ( salt ) ) + salt
salt = " 0 " * ( 64 - len ( salt ) ) + salt
contract_address = int (
contract_address = int (
@ -46,9 +47,14 @@ def test_create2():
og_state . transaction_stack . append (
og_state . transaction_stack . append (
( MessageCallTransaction ( world_state = WorldState ( ) , gas_limit = 8000000 ) , None )
( MessageCallTransaction ( world_state = WorldState ( ) , gas_limit = 8000000 ) , None )
)
)
value = 3
value = symbol_factory . BitVecVal ( 3 , 256 )
salt = 10
salt = symbol_factory . BitVecVal ( 10 , 256 )
og_state . mstate . stack = [ salt , 6 , 0 , value ]
og_state . mstate . stack = [
salt ,
symbol_factory . BitVecVal ( 6 , 256 ) ,
symbol_factory . BitVecVal ( 0 , 256 ) ,
value ,
]
instruction = Instruction ( " create2 " , dynamic_loader = None )
instruction = Instruction ( " create2 " , dynamic_loader = None )
# Act + Assert
# Act + Assert