Migration Guide
Governance Integration
Proposal Flow
Create Batch Proposal: Submit MsgMigrateContractProposal with multiple contracts
Voting Period: Standard governance voting process
Execution: If passed, authorizations are stored for all contracts
Migration: Admin/Proxy contract can execute migrations
Cleanup: Authorizations are consumed and deleted
For Contract Admins
Enable Governance for Your Contract
# Enable governance requirement (one-way operation)
secretcli tx compute set-contract-governance <your-contract> --from <admin>
Check Authorization Status
# Check if your contract has pending authorization
secretcli query compute authorized-migration <your-contract>
For Governance-Only Contracts
Setup Governance-Only Migration
# 1. Set GovernanceProxy as admin
secretcli tx compute set-contract-admin <target-contract> <governance-proxy-contract> --from current-admin
For Governance Participants
Create Migration Proposal
# Submit proposal to authorize migration
secretcli tx gov submit-proposal proposal.json
--from <proposer>
Execute Authorized Migration
# After proposal passes, execute via admin or Migr contract
secretcli tx compute migrate <contract> <code-id> '{}' --from <admin>
# Or via GovernanceProxy contract (governance-only pattern)
secretcli tx compute execute <migr-contract> \
'{"migrate_contract": {"contract_addr": "<contract>", "new_code_id": 42, "migrate_msg": "e30="}}' \
--from any-user
Last updated
Was this helpful?