-
Install Docker Desktop for your operating system;
To install Docker RISC-V support without using Docker Desktop, run the following command:
docker run --privileged --rm tonistiigi/binfmt --install all
-
Cartesi CLI is an easy-to-use tool to build and deploy your dApps on devnet. To install it, run:
npm install -g @cartesi/cli
-
Install Foundry for smart contract development and testing;
-
Install Go (version 1.24.4 or later) for backend development;
-
Create the environment variables file:
make env
-
Edit the
.envfile with your configuration values. -
Import your private key for contract deployment:
cast wallet import defaultKey --interactive
This will prompt you to enter your private key securely for contract deployment operations.
The contract suite features emergency delegate call operations for secure asset recovery in critical situations. The system also includes asset contracts comprising a Stablecoin and Collateral token for the debt capital market operations, and ERC1155 Badge contracts for managing badges.
Each deployment script saves its configuration to individual JSON files in the ./contracts/deployments/ directory for easy reference and integration.
-
Deploy all contracts:
make deploy-contracts
-
Deploy individual contracts:
# Deploy BadgeFactory contract (ERC1155 Badge factory) make deploy-badge-factory # Deploy Tokens (Collateral and Stablecoin) make deploy-tokens # Deploy Emergency contracts (EmergencyWithdraw) make deploy-emergency # Deploy SafeERC1155Mint contract (Safe ERC1155 minting) make deploy-safe-erc1155-mint
-
Simulate deployment (without broadcasting):
make deploy-contracts-simulate
This is useful for testing deployment scripts and verifying gas costs without actually deploying contracts.
The backend is built on Cartesi Rollups, a Layer 2 scaling solution that combines the security of blockchain with the computational power of Linux. This architecture enables complex off-chain computations while maintaining cryptographic guarantees of correctness and data availability. The system runs a full Linux environment inside the blockchain, handling business logic off-chain for better performance while keeping all computations verifiable on-chain.
-
Generate bytecode and Go bindings
make generate
-
Devnet
2.1 Build application:
make build
2.2 Run application on devnet:
cartesi run
Run all tests (Contracts + Backend):
make testThis command will:
- Clean and test smart contracts with Foundry;
- Run mock tests with Go;
- Run integration tests with Vitest;
-
Format all code (Contracts + Backend):
make fmt
-
View test coverage report:
make coverage
-
Check contract sizes:
make size
Shows the size of all compiled contracts to ensure they fit within deployment limits.
-
Run gas reports:
make gas
Generates detailed gas usage reports for all contract functions during testing.
For a complete list of available commands:
make helpThis will show all available make targets with their descriptions.
