Skip to content

Commit

Permalink
works
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-agarwal-coinbase committed Sep 30, 2024
1 parent 711be69 commit 30fa162
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cdp/smart_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
6 changes: 5 additions & 1 deletion cdp/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 30fa162

Please sign in to comment.