Migrating a Contract
Migrate moves a contract to a new code ID while preserving its address and state. The contract must have an admin, and the migration message is passed to the new code’smigrate entry point.
1
Upload the new code
2
Migrate the contract
Only the contract’s admin address can call
migrate. The sender must match the admin set during instantiation (or a subsequent updateAdmin call).Updating the Admin
Transfer admin privileges to a different address:osmo1newadmin... can migrate the contract or change the admin again. The original admin loses all privileges.
Clearing the Admin
Remove the admin entirely, making the contract permanently non-upgradeable:Contract Lifecycle Summary
Next Steps
Querying Contracts
Verify contract metadata and code history after migration.
Gas and Advanced Usage
Gas estimation, custom messages, and the wasm query extension.