Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for missing contract address in deployment receipt Update d… #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/demo/amm_demo/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ def deploy_contract(batch_prover: BatchProver, w3: Web3, operator: BaseAccount)
)
print("Deploying the AMM demo smart contract...")
tx_receipt = send_transaction(w3, transaction, operator)

# Check if the contract address is found in the tx_receipt
if tx_receipt.get("contractAddress"):
contract_address = tx_receipt["contractAddress"]
else:
print("Error: Contract address not found.")
exit(1)

assert (
tx_receipt["status"] == 1
), f'Failed to deploy contract. Transaction hash: {tx_receipt["transactionHash"]}.'
Expand Down