Setup code studio
Guide to setup code studio IDE to develop and deploy smart contracts and sub-graphs
Summary
To start developing and deploying smart contracts on the SettleMint platform, you'll first need to add code studio to your application. This provides you with a full-featured web-based IDE, pre-configured for blockchain development using tools like Hardhat, Foundry, and The Graph. Once added, you can use built-in tasks to build, test, deploy, and index your smart contracts and subgraphs, all within the same environment.
You can add code studio through the platform UI by selecting it as a dev tool and linking it with a smart contract set and a template. Alternatively, you can use the SDK CLI or SDK JS to programmatically create and manage smart contract sets. These interfaces give you flexibility depending on whether you're working from the console or integrating via scripts or automation.
After setup, you'll be able to customize your smart contracts directly within the IDE. A task manager will guide you through building and deploying them to local or SettleMint-hosted blockchain networks. You can also integrate subgraphs for indexing and querying contract data using The Graph.
To speed up development, SettleMint offers a rich library of open-source smart contract templates, from ERC standards to more complex business use cases. These templates can be modified, extended, or used as-is, and you also have the option to create and manage custom templates within your consortium for reuse across projects.
How to setup code studio and deploy smart contracts on SettleMint platform
Code studio is SettleMint's fully integrated, web-based IDE built specifically for blockchain development. It provides developers with a familiar Visual Studio Code experience directly in the browser, pre-configured with essential tools like Hardhat, Foundry, and The Graph. Code studio enables seamless development, testing, deployment, and indexing of smart contracts and subgraphs, all within a unified environment.
It eliminates the need for complex local setups, simplifies DevOps workflows, and reduces time-to-market by combining infrastructure, templates, and automation under one interface. By offering pre-built tasks, contract templates, and GitHub integration, it solves the traditional challenges of fragmented tooling, inconsistent environments, and steep setup requirements for web3 development.
Despite offering full configurability, code studio includes all essential dependencies pre-installed, saving time and avoiding setup friction. It supports extensions for formatting, linting, testing, and AI-assisted development, mirroring the convenience of a local VS Code setup. Every component, from contracts to testing and subgraph development is wired into a well-structured, maintainable codebase that is continuously updated and thoroughly tested to align with the latest development standards. This makes it ideal for both rapid prototyping and production-grade blockchain applications.
Smart contract sets allow you to incorporate business logic into your application by deploying smart contracts that run on the blockchain. You can add a smart contract set via different methods as part of your development workflow.
IDE project structure
The EVM IDE project structure in code studio is thoughtfully organized to support efficient smart contract development, testing, and deployment. Each folder serves a specific purpose in the dApp development lifecycle, aligning with industry-standard tools like Hardhat, Foundry, and The Graph.
Folder | Description |
---|---|
contracts/ | Contains Solidity smart contracts that define the core logic and business rules of the dApp. |
test/ | Holds test files. These can be written in TypeScript for Hardhat or Solidity for Foundry. |
script/ | Stores deployment and interaction scripts, often used to automate tasks like contract deployment. |
lib/ | Optional directory for external Solidity libraries or reusable modules to avoid code repetition. |
ignitions/ | Contains Hardhat Ignition configuration for defining declarative deployment plans. |
out/ | Output folder used by Foundry, containing compiled contract artifacts like ABIs and bytecode. |
artifacts/ | Output folder used by Hardhat, similar to out/ , containing build artifacts and metadata. |
subgraphs/ | Contains files for The Graph integration, schema, mappings, and manifest for data indexing. |
cache/ | Caching directory for Hardhat to improve build performance by avoiding redundant compilation. |
cache_forge/ | Caching directory for Foundry to speed up compilation and reuse outputs. |
node_modules/ | Contains installed npm packages and dependencies used in Hardhat or other JS-based tools. |
Code studio task manager
The code studio IDE task manager acts as a centralized hub for running all essential development scripts, giving developers a streamlined way to manage the entire smart contract lifecycle. It also includes integrated SettleMint CLI tasks for logging in and managing authenticated platform interactions, ensuring that everything needed for blockchain development is accessible and executable directly from within the IDE.
Below is a categorized table of tasks or scripts available with concise explanations.
Task | Tool | Description |
---|---|---|
SettleMint - Login | SettleMint CLI | Logs into the SettleMint platform via CLI for authenticated deployments. |
Foundry - Build | Foundry | Compiles the smart contracts using Foundry. |
Hardhat - Build | Hardhat | Compiles the smart contracts using Hardhat. |
Foundry - Test | Foundry | Runs tests using Foundry's native testing framework. |
Hardhat - Test | Hardhat | Executes tests using Hardhat's JavaScript-based test suite. |
Foundry - Format | Foundry | Formats smart contract code for readability (optional). |
Foundry - Start network | Foundry | Starts a local Foundry testnet environment. |
Hardhat - Start network | Hardhat | Starts a local Hardhat network for JS-based testing. |
Hardhat - Deploy to local network | Hardhat | Deploys compiled contracts to the local Hardhat network. |
Hardhat - Reset & Deploy to local network | Hardhat | Resets the local chain state and redeploys contracts. |
Hardhat - Deploy to platform network | Hardhat | Deploys contracts to a blockchain network hosted on SettleMint. |
Hardhat - Reset & Deploy to platform network | Hardhat | Resets the platform network state and redeploys contracts. |
The Graph - Codegen the subgraph types | The Graph CLI | Generates TypeScript types based on subgraph GraphQL schema. |
The Graph - Build the subgraph | The Graph CLI | Compiles the subgraph for deployment to The Graph. |
The Graph - Deploy or update the subgraph | The Graph CLI | Deploys or updates the subgraph on The Graph's hosted service. |
When using Hardhat Ignition for deploying smart contracts, the deployed contract addresses are stored in the file ignition/deployments/chain-CHAIN_ID/deployed_addresses.json. This file serves as a reliable reference for all contracts deployed on a specific network. It maps contract names to their respective blockchain addresses, making it easy to retrieve addresses later for interactions, frontend integrations, or upgrades.
You must have an existing application before you add a smart contract set.
How to add code studio
First, ensure you are authenticated:
You can create a smart contract set either on the platform or locally:
Create on platform
Then create a smart contract set with the following command (refer to the CLI docs for more details):
For example:
Working with smart contract sets locally
You can also work with smart contract sets in your local development environment. This is useful for development and testing before deploying to the platform.
To create a smart contract set locally:
Once created, you can use these commands to work with your local smart contract set:
The scaffolded project includes everything you need to start developing smart contracts:
- Contract templates
- Testing framework
- Deployment scripts
- Development tools configuration
Managing platform smart contract sets
Manage your platform smart contract sets with:
All operations require that you have the necessary permissions in your workspace.
Customize smart contracts
You can customize your smart contracts using the built-in IDE. The smart contract sets include a generative AI plugin to assist with development. Learn more about the AI plugin here.
Smart contract template library
SettleMint's smart contract templates serve as open-source, ready-to-use foundations for blockchain application development, significantly accelerating the deployment process. These templates enable users to quickly customize and extend their blockchain applications, leveraging tested and community-enhanced frameworks to reduce development time and accelerate market entry.
Open-source smart contract templates under the mit license
Benefit from the expertise of the blockchain community and trust in the reliability of your smart contracts. These templates are vetted and used by major enterprises and institutions, ensuring enhanced security and confidence in your deployments.
Smart contract template library
The programming language used depends on the target protocol:
- Solidity for EVM-compatible networks
Template | Description |
---|---|
Empty | Basic Solidity project scaffold with no predefined logic. Ideal for starting from scratch. |
ERC20 token | Standard ERC20 token implementation for fungible tokens. |
ERC1155 token | Multi-token standard supporting both fungible and non-fungible tokens in a single contract. |
ERC20 token with MetaTx | ERC20 token with meta-transaction support to enable gasless transfers. |
Supplychain | Token-based supply chain logic for tracking assets and ownership across stages. |
State Machine | Contract template for building stateful workflows and processes using a finite state machine. |
ERC20 token with crowdsale mechanism | ERC20 token with built-in crowdsale logic for fundraising campaigns. |
ERC721 | Standard implementation of ERC721 non-fungible tokens (NFTs). |
ERC721a | Gas-optimized ERC721 implementation for efficient batch minting. |
ERC721 Generative Art | NFT template for generating on-chain artwork using ERC721 standard. |
Soulbound Token | Non-transferable token (SBT) representing identity or credentials. |
Diamond bond | Example of a tokenized bond using modular smart contracts (Diamond pattern). |
Attestation Service | Service template for managing on-chain verifiable claims and attestations. |
Create your own smart contract templates for your consortium
Within the self-managed SettleMint Platform, you can create and add your own templates for use within your consortium. This fosters a collaborative environment where templates can be reused and built upon, promoting innovation and efficiency within your network.
To get started, visit: SettleMint GitHub Repository
Congratulations.!!
You have succesfully deployed the code studio. From here you can proceed for development and deployment of smart contracts and indexing sub-graphs.