Deploy a contract
Use Clarinet to publish your contracts to the devnet, testnet, or mainnet networks.
Generate a deployment plan:
Terminal
$clarinet deployments generate --<network>
Supported networks: consoledevnet
testnet
, consolemainnet
_
Deploy contracts:
Terminal
$clarinet deployments apply --<network>
Add Contract Requirements
Add external contract dependencies:
Terminal
$clarinet requirements add <contract-principal>
Example:
Terminal
$clarinet requirements add SP2PABAF9FTAJYNFZH93XENAJ8FVY99RRM50D2JG9.nft-trait
Deployment Plan Transactions
Your deployment plans can include various transaction types:
Contract Operations
- contract-publish:contract-name: my-contractexpected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGMcost: 5960path: contracts/my-contract.clarclarity-version: 2- contract-call:contract-id: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.my-contractexpected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGMmethod: my-functionparameters: []cost: 5960
Asset Transfers
- stx-transfer:expected-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGMrecipient: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.my-contractmstx-amount: 1000memo: '0x01'cost: 10000- btc-transfer:expected-sender: mjSrB3wS4xab3kYqFktwBzfTdPg367ZJ2drecipient: bcrt1qnxknq3wqtphv7sfwy07m7e4sr6ut9yt6ed99jgsats-amount: 100000000sats-per-byte: 10
Simnet Operations
- emulated-contract-publish:contract-name: my-contractemulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGMpath: contracts/my-contract.clarclarity-version: 2- emulated-contract-call:contract-id: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.my-contractemulated-sender: ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGMmethod: my-functionparameters: []
Note
For functions that take no arguments or read-only functions, use an empty parameters list: parameters: []