Adding a Contract

The most common operation is adding a deployed contract to the cache.

# Add by specifying contract address directly
smart-cache add 0x1234567890abcdef1234567890abcdef12345678

# Add using configuration file defaults
smart-cache add

# Add with network and metadata
smart-cache add 0x1234... \
  --network arbitrum-sepolia \
  --name "Counter" \
  --description "A simple counter contract" \
  --version "1.0.0" \
  --tx-hash 0xabcd1234...

For convenience, an interactive mode is also available:

smart-cache add 0x1234... --interactive

Command Reference

The CLI comes with a full set of commands, each with its own flags and help options. Here are the most important ones:

smart-cache init

Creates a smartcache.toml file for configuration.

Flags:

  • --force : Overwrite existing config file

  • --interactive : Prompt-based setup

  • --help : Command help

smart-cache add <address>

Adds a deployed contract to the cache.

Flags:

  • --network : Specify deployment network

  • --tx-hash : Deployment transaction hash

  • --name, --description, --version : Contract metadata

  • --metadata : Custom JSON metadata

  • --interactive : Guided setup

  • --deployed-by : deployer of the contract

Last updated