Skip to main content
The Contract ERC-721 plugin calls standard EIP-721 methods on an NFT collection contract deployed on Hedera. Deploy or import the contract first with the Contract plugin. For fungible (ERC-20) calls, see the Contract ERC-20 plugin.

Most Used Commands

Read collection metadata and token ownership
hcli contract-erc721 name --contract my-nft
hcli contract-erc721 owner-of --contract my-nft --token-id 1
hcli contract-erc721 token-uri --contract my-nft --token-id 1
Approve and transfer a specific token
hcli contract-erc721 approve --contract my-nft --to bob --token-id 1
hcli contract-erc721 safe-transfer-from --contract my-nft --from alice --to bob --token-id 1

Full Command Reference

Commands use the contract-erc721 namespace (for example hcli contract-erc721 name). --contract / -c accepts a local alias, Hedera contract ID (0.0.xxx), or EVM address (0x…) where the manifest allows it.
Call name() (read-only).
-c, --contract
string
required
Smart contract ID or local alias.
Example
hcli contract-erc721 name --contract my-nft
Call symbol() (read-only).
-c, --contract
string
required
Smart contract ID or local alias.
Example
hcli contract-erc721 symbol --contract my-nft
Call balanceOf(address) (read-only).
-c, --contract
string
required
Smart contract ID or local alias.
-o, --owner
string
required
Owner account: alias, account ID, or EVM address.
Example
hcli contract-erc721 balance-of --contract my-nft --owner alice
Call ownerOf(uint256 tokenId) (read-only).
-c, --contract
string
required
Smart contract ID or local alias.
-T, --token-id
number
required
Token ID (uint256).
Example
hcli contract-erc721 owner-of --contract my-nft --token-id 1
Call getApproved(uint256 tokenId) (read-only).
-c, --contract
string
required
Smart contract ID or local alias.
-T, --token-id
number
required
Token ID to query.
Example
hcli contract-erc721 get-approved --contract my-nft --token-id 1
Call isApprovedForAll(address owner, address operator) (read-only).
-c, --contract
string
required
Smart contract ID, alias, or EVM address.
-o, --owner
string
required
Owner account: alias, account ID, or EVM address.
-p, --operator
string
required
Operator account: alias, account ID, or EVM address.
Example
hcli contract-erc721 is-approved-for-all --contract my-nft --owner alice --operator bob
Call tokenURI(uint256 tokenId) (read-only).
-c, --contract
string
required
Smart contract ID or local alias.
-T, --token-id
number
required
Token ID to query.
Example
hcli contract-erc721 token-uri --contract my-nft --token-id 1
Call approve(address to, uint256 tokenId). State-changing (operator signs).
-c, --contract
string
required
Smart contract ID, alias, or EVM address.
-t, --to
string
required
Address approved to transfer the token: alias, account ID, or EVM address.
-T, --token-id
number
required
Token ID to approve.
-g, --gas
number
default:"100000"
Gas for the contract call.
Example
hcli contract-erc721 approve --contract my-nft --to bob --token-id 1
Call setApprovalForAll(address operator, bool approved). State-changing.
-c, --contract
string
required
Smart contract ID, alias, or EVM address.
-o, --operator
string
required
Operator account: alias, account ID, or EVM address.
-a, --approved
string
required
Must be the string true or false.
-g, --gas
number
default:"100000"
Gas for the contract call.
Example
hcli contract-erc721 set-approval-for-all --contract my-nft --operator bob --approved true
Call safeTransferFrom (with or without the extra bytes argument). State-changing.
-c, --contract
string
required
Smart contract ID, alias, or EVM address.
-f, --from
string
required
Current owner: alias, account ID, or EVM address.
-t, --to
string
required
New owner: alias, account ID, or EVM address.
-T, --token-id
number
required
Token ID to transfer.
-g, --gas
number
default:"100000"
Gas for the contract call.
-d, --data
string
Optional data payload for the 4-argument safeTransferFrom overload.
Example
hcli contract-erc721 safe-transfer-from --contract my-nft --from alice --to bob --token-id 1
Call transferFrom(address from, address to, uint256 tokenId). State-changing.
-c, --contract
string
required
Smart contract ID, alias, or EVM address.
-f, --from
string
required
Current owner: alias, account ID, or EVM address.
-t, --to
string
required
Recipient: alias, account ID, or EVM address.
-T, --token-id
number
required
Token ID to transfer.
-g, --gas
number
default:"100000"
Gas for the contract call.
Example
hcli contract-erc721 transfer-from --contract my-nft --from alice --to bob --token-id 1
Calls a custom mint(address to, uint256 tokenId) style entry point (experimental). The manifest marks this command as experimental and assumes a contract that exposes a compatible mint used for testing.
-c, --contract
string
required
Smart contract ID, alias, or EVM address.
-t, --to
string
required
Recipient of the minted token: alias, account ID, or EVM address.
-T, --token-id
number
required
Token ID to mint.
-g, --gas
number
default:"100000"
Gas for the contract call.
Example
hcli contract-erc721 mint --contract my-nft --to alice --token-id 42
Fungible token helpers: Contract ERC-20 plugin. Deploy and import: Contract plugin.