diff --git a/cdp/smart_contract.py b/cdp/smart_contract.py index aa34679..b82a258 100644 --- a/cdp/smart_contract.py +++ b/cdp/smart_contract.py @@ -225,7 +225,7 @@ def broadcast(self) -> "SmartContract": model = Cdp.api_clients.smart_contracts.deploy_smart_contract( wallet_id=self.wallet_id, - deployer_address=self.deployer_address, + address_id=self.deployer_address, smart_contract_id=self.smart_contract_id, deploy_smart_contract_request=deploy_smart_contract_request, ) diff --git a/cdp/transaction.py b/cdp/transaction.py index 14f078b..e314838 100644 --- a/cdp/transaction.py +++ b/cdp/transaction.py @@ -125,12 +125,16 @@ def raw(self) -> DynamicFeeTransaction: "maxPriorityFeePerGas": int(parsed_payload["maxPriorityFeePerGas"], 16), "maxFeePerGas": int(parsed_payload["maxFeePerGas"], 16), "gas": int(parsed_payload["gas"], 16), - "to": Web3.to_bytes(hexstr=parsed_payload["to"]), "value": int(parsed_payload["value"], 16), "data": parsed_payload.get("input", ""), "type": "0x2", # EIP-1559 transaction type } + # Handle the 'to' field separately + if parsed_payload["to"]: + transaction_dict["to"] = Web3.to_bytes(hexstr=parsed_payload["to"]) + else: + transaction_dict["to"] = b"" # Empty bytes for contract deployment self._raw = DynamicFeeTransaction(transaction_dict) return self._raw