Skip to content

Commit

Permalink
Update src/ape/contracts/base.py
Browse files Browse the repository at this point in the history
Co-authored-by: El De-dog-lo <[email protected]>
  • Loading branch information
Aviksaikat and fubuloubu authored Aug 11, 2023
1 parent 3380bab commit daa44e1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ape/contracts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,13 +1300,9 @@ def __call__(self, *args, **kwargs) -> TransactionAPI:
def deploy(self, *args, publish: bool = False, **kwargs) -> ContractInstance:
txn = self(*args, **kwargs)
private = kwargs.get("private", False)
has_value = kwargs.get("value")

if has_value:
has_non_payable_constructor = self.contract_type.constructor.is_payable
# print(has_non_payable_constructor)
if not has_non_payable_constructor:
raise ContractError("Sending funds to a non-payable constructor!!")
if kwargs.get("value") and not self.contract_type.constructor.is_payable
raise ContractError("Sending funds to a non-payable constructor.")

if "sender" in kwargs and isinstance(kwargs["sender"], AccountAPI):
# Handle account-related preparation if needed, such as signing
Expand Down

0 comments on commit daa44e1

Please sign in to comment.