A tool for sharing Foundry Cast commands with others.
- Share Cast commands via unique URLs
- Group related commands into collections
- Simple CLI tool for creating and managing commands
# Install globally from npm
npm install -g chainviewchainview submit "cast call --rpc-url=https://eth-mainnet.alchemyapi.io/v2/KEY 0xTOKEN 'function()' ARG" --title "My Command"chainview collection create "My Collection" --desc "Collection description"chainview collection add COLLECTION_ID "cast call ..." --title "New Command"# Clone the repository
git clone https://github.com/kanvgupta/simple-cast.git
cd simple-cast
# Install dependencies
npm install
# Start the server
npm startCreate a .env file with the following variables:
PORT=3000
DATABASE_URL=postgres://username:password@localhost:5432/chainview
NODE_ENV=production
The application uses PostgreSQL. Make sure you have it installed and running.
# Create a database
createdb chainviewThe server will automatically create the necessary tables on startup.
POST /api/commands- Create a commandGET /api/c/:id- View a command
POST /api/collections- Create a collectionGET /api/col/:id- View a collectionPOST /api/collections/:id/commands- Add a command to a collection
Create a collection of common ERC20 function calls:
# Create the collection
chainview collection create "ERC20 Functions" --desc "Common ERC20 token functions"
# Add balance check command
chainview collection add <collection-id> "cast call --rpc-url=https://eth-mainnet.alchemyapi.io/v2/KEY 0x6B175474E89094C44Da98b954EedeAC495271d0F 'balanceOf(address)' 0xWALLET" --title "Check DAI Balance"
# Add allowance check command
chainview collection add <collection-id> "cast call --rpc-url=https://eth-mainnet.alchemyapi.io/v2/KEY 0x6B175474E89094C44Da98b954EedeAC495271d0F 'allowance(address,address)' 0xOWNER 0xSPENDER" --title "Check DAI Allowance"
# Add total supply command
chainview collection add <collection-id> "cast call --rpc-url=https://eth-mainnet.alchemyapi.io/v2/KEY 0x6B175474E89094C44Da98b954EedeAC495271d0F 'totalSupply()'" --title "DAI Total Supply"MIT