diff --git a/web3/contract.py b/web3/contract.py index 6138bb7c17..a3c23dba9b 100644 --- a/web3/contract.py +++ b/web3/contract.py @@ -474,6 +474,10 @@ def _encode_constructor_data(cls, args=None, kwargs=None): encode_abi(cls.web3, constructor_abi, arguments, data=cls.bytecode) ) else: + if args is not None or kwargs is not None: + msg = "Constructor args were provided, but no constructor function was provided." + raise TypeError(msg) + deploy_data = to_hex(cls.bytecode) return deploy_data