diff --git a/boa/contracts/vvm/vvm_contract.py b/boa/contracts/vvm/vvm_contract.py index 2c028be0..6eedc2b8 100644 --- a/boa/contracts/vvm/vvm_contract.py +++ b/boa/contracts/vvm/vvm_contract.py @@ -54,7 +54,7 @@ def constructor(self): return ABIFunction(t, contract_name=self.filename) return None - def deploy(self, *args, env=None): + def deploy(self, *args, env=None, **kwargs): encoded_args = b"" if self.constructor is not None: encoded_args = self.constructor.prepare_calldata(*args) @@ -64,7 +64,7 @@ def deploy(self, *args, env=None): if env is None: env = Env.get_singleton() - address, _ = env.deploy_code(bytecode=self.bytecode + encoded_args) + address, _ = env.deploy_code(bytecode=self.bytecode + encoded_args, **kwargs) return self.at(address) diff --git a/tests/unitary/contracts/vvm/test_vvm.py b/tests/unitary/contracts/vvm/test_vvm.py index 6a2da16f..3f10106d 100644 --- a/tests/unitary/contracts/vvm/test_vvm.py +++ b/tests/unitary/contracts/vvm/test_vvm.py @@ -37,3 +37,16 @@ def test_loads_vvm(): assert contract.foo() == 42 assert contract.bar() == 43 + + +def test_forward_args_on_deploy(): + with open(mock_3_10_path) as f: + code = f.read() + + contract_vvm_deployer = boa.loads_partial(code) + + random_addy = boa.env.generate_address() + + contract = contract_vvm_deployer.deploy(43, override_address=random_addy) + + assert random_addy == contract.address