Skip to content

Comments

fix(contract): check receipt status before contract address in deploy#3654

Merged
mattsse merged 2 commits intoalloy-rs:mainfrom
snazzysam933:contract
Feb 7, 2026
Merged

fix(contract): check receipt status before contract address in deploy#3654
mattsse merged 2 commits intoalloy-rs:mainfrom
snazzysam933:contract

Conversation

@snazzysam933
Copy link
Contributor

@snazzysam933 snazzysam933 commented Feb 7, 2026

When a contract constructor reverts, deploy() and deploy_sync() return the misleading error
"missing contractAddress from deployment transaction receipt"
because the code only checks contract_address() without first checking receipt.status().

adds a status() check before the contract_address() check, and introduces a new Error::DeploymentReverted variant. Now when the constructor reverts, users see "deployment transaction reverted" instead of being pointed toward a missing address problem that doesn't reflect the actual failure.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes sense because some clients always return the address even if the tx reverted

smol nit

@github-project-automation github-project-automation bot moved this to In Progress in Alloy Feb 7, 2026
@snazzysam933 snazzysam933 requested a review from mattsse February 7, 2026 14:37
@github-project-automation github-project-automation bot moved this from In Progress to Reviewed in Alloy Feb 7, 2026
@mattsse mattsse merged commit 5b1c191 into alloy-rs:main Feb 7, 2026
30 checks passed
@github-project-automation github-project-automation bot moved this from Reviewed to Done in Alloy Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants