Most Used Commands
Deploy from a Solidity fileCreate: --file vs --default
You must supply --file (path to a .sol file) or --default (erc20 or erc721 built-in template). They are mutually exclusive.Full Command Reference
Contract Create
Contract Create
Compile a Solidity source (or use a built-in template), deploy the contract to the current network, and run verification where the CLI supports it.Examples
Smart contract name or alias stored in CLI state.
Path to a Solidity file (absolute or relative). Use with
--base-path when imports need a root directory.Use a built-in template instead of
--file. Mutually exclusive with --file.Base directory for resolving the Solidity file. Defaults to the current directory when using
--file (see CLI README for --default behavior).Gas limit for contract creation.
Admin key credential(s) for the new contract. Pass multiple times for KeyList / ThresholdKey style setups. See
hcli contract create --help for accepted formats.M-of-N: how many of the
--admin-key values must sign the create flow. Only applies when multiple --admin-key entries are provided.Contract memo.
Solidity compiler version to use for compilation.
Constructor argument values, in order. Repeat the flag once per argument.
Key manager to use:
local or local_encrypted (defaults to config setting).Initial HBAR balance for the contract. Examples:
100 (HBAR) or 100t (tinybars).Auto-renew period: seconds as an integer, or with suffix
s, m, h, or d (e.g. 500, 500s, 50m, 2h, 30d).Account ID (
0.0.xxx) that pays for contract auto-renewal.Maximum automatic token associations (
-1 for unlimited, 0 to disable).Account ID (
0.0.xxx) to stake the contract to. Mutually exclusive with --staked-node-id.Node ID to stake the contract to. Mutually exclusive with
--staked-account-id.Whether to decline staking rewards for this contract.
Contract List
Contract List
List smart contracts stored in CLI state (including metadata such as network and verification flags where available).Example
Contract Import
Contract Import
Import an existing contract from Hedera by
0.0.xxx ID or 0x… EVM address. The CLI reads contract info from the mirror node and stores admin key metadata in local state for later operations.Contract ID (
0.0.xxx) or EVM address (0x…).Optional local alias for the imported contract.
Contract Delete
Contract Delete
By default, submits a ExamplesThis command uses
ContractDeleteTransaction on Hedera and then removes the contract from local state. With --state-only, only local state is cleared (no network transaction).Contract ID (
0.0.xxx) or local alias.-s, --state-only
Remove from local CLI state only. No network delete.
Account (ID or alias) that receives remaining HBAR after an on-chain delete. For a network delete, supply exactly one of
--transfer-id or --transfer-contract-id. Do not combine with --state-only.Contract (ID or alias) that receives remaining HBAR. For a network delete, supply exactly one of
--transfer-id or --transfer-contract-id (never both).Optional signing credential(s) for the network delete. Not allowed with
--state-only. If omitted on a network delete, the CLI derives required admin keys from the mirror node and matches KMS keys (including M-of-N). Pass multiple times when several keys must sign.Key manager used when resolving
--admin-key (defaults to config).requireConfirmation. In non-interactive environments, use the root --confirm flag (see Overview → Global Flags) so the CLI does not block on the prompt.Related plugins
ERC-20 and ERC-721 helper plugins focus on calling deployed contracts. This page covers compile, deploy, import, list, and delete for Solidity sources and built-inerc20 / erc721 templates.