Skip to content
LogoLogo

Idempotent deploys

getOrDeploy declares desired state: this contract should exist on this network.

Behavior

CallResult
First callDeploys, records to deployments/, returns freshDeploy: true
Later callsReturns existing contract, no transaction, freshDeploy: false
force: trueRedeploys intentionally, new address and tx
After reset()Next call deploys again

You never branch on "did it already exist?" to get your contract — destructure contract from the result. Use freshDeploy only for one-time setup.

Stale bytecode warning

If compiled bytecode or constructor args change but a record exists, deployoor warns and reuses the recorded deployment (no surprise address churn). Use force: true to redeploy, or reset() to forget the record first.

An opt-in bytecode-diff redeploy policy is planned.

External vs deployed

register records an address you did not deploy. It will not overwrite a real deployment at the same (chain, deploymentName) — reset first or pick a different name.