A comprehensive vscode extension for interacting with smart contracts as you build
Ankh brings the power of Starknet development directly into your VS Code workspace. Declare, deploy, and interact with Cairo smart contracts through an intuitive interface that streamlines your entire development workflow.
- Automatic Discovery: Automatically scans your workspace for compiled Cairo contracts (target/dev/*.contract_class.json)
- Tree View Interface: Organized view of all contracts in your project with dedicated sections for local and deployed contracts
- Multi-Contract Support: Work with multiple contracts simultaneously, each in its own persistent tab
- Declare Contracts: Deploy contract classes to Starknet and receive class hashes
- Deploy Instances: Deploy contract instances from declared classes
- Function Interaction: Call both view and write functions directly from the interface
- Real-time Logging: Track all operations with timestamped logs
- Intuitive Interface: Familiar UI similar to API Clients with modern VS Code theming
- Persistent State: Contract deployment info and logs persist across VS Code sessions
- Environment Integration: Automatically loads account credentials from .env files
- Monorepo Support: Configure custom workspace roots for projects within larger repositories
- ABI-Based Interface: Dynamically generates function interfaces from contract ABIs
- Input Validation: Smart input handling for different Cairo data types
- State Management: Remembers deployment information and interaction history
- Install the extension from the VS Code Marketplace
- Open a Cairo project with compiled contracts in target/dev/
- View contracts in the Ankh panel in the Explorer sidebar
- Scarb, for compilation of contracts
.envfile, for deployment/interaction settings, with starknet credentials
- Create a
.envfile in your project root
PRIVATE_KEY_SEPOLIA=0x1234...
ACCOUNT_ADDRESS_SEPOLIA=0x5678...
RPC_URL_SEPOLIA=https://starknet-sepolia.public.blastapi.io/rpc/v0_8- In your scarb.toml in your root contracts folder, set the line:
[[target.starknet-contract]]
sierra = true
casm = true
- View Contracts: Compiled contracts appear automatically in the Ankh tree view
- Open Interface: Click any contract to open its interaction interface
- Declare: Click "Declare Contract" to deploy the contract class
- Deploy: After declaration, click "Deploy Contract" to create an instance
- Interact: Use the generated function interface to call contract methods
For monorepos where cairo contracts are not in the root workspace root:
- Click "Configure Cairo workspace root" in the tree view
- Select the directory containing your Cairo project
- Ankh will remember this setting per workspace
- Click different contracts to open multiple interaction panels
- Each contract maintains its own state and deployment information
- Switch between panels using VS Code's tab system
Access these commands via the Command Palette (Ctrl+Shift+P):
Ankh: Refresh Contracts- Rescan workspace for contractsAnkh: Select Cairo Workspace Root- Configure custom project rootAnkh: Clear Cairo Workspace Root- Reset to default workspace scanningAnkh: Show Current Workspace Root- Display current configurationAnkh: Close All Contract Panels- Close all open contract interfacesAnkh: Show Active Panels- List currently open contract panels
- One-click contract declare and deploy to Starknet
- Automatic class hash generation and display
- Interact with an already-deployed address of a contract provided it is the same abi (or even similar enough)
Constructor CallData can be set once the panel is opened, before clicking deploy. If there is an already deployed version of the contract, interact with it by simply putting the contract address in the right input field, and clicking on Load Contract View functions and Write functions are displayed on separate tabs.
Sepolia Testnet (default)
Support for devnet coming soon...
Network configuration is handled through environment variables.
- VS Code 1.103.0 or higher
- Cairo project with Scarb configuration
- Compiled contracts in target/dev/ directory
Ankh stores workspace-specific settings including:
- Custom workspace root paths
- Panel state and logs
All settings are automatically saved and restored per workspace.
- Ensure contracts are compiled with
scarb build - Check that
.contract_class.jsonand.compiled_contract_class.jsonfiles exist intarget/dev/ - Use "Configure Cairo workspace root" for monorepos
- Verify .env file configuration
- Check RPC endpoint availability
- Ensure account has sufficient balance for transactions
- Try refreshing with Ankh: Refresh Contracts
- Check VS Code Developer Tools console for errors
- Verify React build completed successfully
Issues and feature requests are welcome. This extension is built with:
- TypeScript for VS Code extension logic
- React with Vite for the webview interface
- Tailwind CSS for styling
- Starknet.js for blockchain interactions
You can do one of the following
- Reach the Publisher at wilfridokorie@gmail.com
- Raise an issue at https://github.com/OWK50GA/Ankh/issues
License MIT
Ankh - Bringing life to your Cairo smart contracts ⚱️