Overview
Cronos is fully EVM-compatible, which means Solidity contracts, ABI encoding, gas behaviour and tooling work the same way as on Ethereum. The main differences come from network parameters (RPC endpoints, chain IDs), as well as the surrounding ecosystem your contract ultimately interacts with.
This page walks through a minimal but production-ready workflow using Hardhat. It is suitable both for newcomers and for teams planning to deploy more advanced applications on Cronos.
If you want a deeper understanding of nodes, execution layers and how Cronos handles EVM calls, visit the Architecture section.
Environment setup
Before writing contracts, make sure you have the essential tools installed:
- Node.js (LTS), npm or yarn.
- Git and a code editor such as VS Code.
- A wallet configured for Cronos testnet with some test tokens.
Create a new Hardhat project
- Create a new project folder and open it in your terminal.
- Initialise a package.json:
npm init -y
- Install Hardhat and useful plugins:
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox dotenv
- Initialise Hardhat:
npx hardhatChoose “Create a basic sample project” when prompted.
Add Cronos networks to Hardhat
Update hardhat.config.js to include Cronos testnet and mainnet:
Store your private key securely in a local .env file:
PRIVATE_KEY=<your-private-key>.
Never commit this file to Git. A dedicated “deployment wallet” is strongly recommended.
Example contract
Below is a minimal counter contract. While simple, it demonstrates constructor parameters, events, state reads, restricted writes, and how to structure basic deployment scripts.
Deployment script
Create a basic deployment script that compiles the contract and prints its deployed address:
Deploy to Cronos
Deploy to Cronos testnet
- Ensure your deployer account has testnet tokens.
- Compile your contracts:
npx hardhat compile
- Deploy with the testnet configuration:
npx hardhat run scripts/deploy.js --network cronosTestnet
- Save your contract address — you’ll need it for front-end integration or further testing.
After deployment, you can extend the project with scripts, tests, or a front-end. If you're building a UI, see Developer tutorials & resources for examples of how to integrate Ethers.js or wagmi.
Deploy to Cronos mainnet
The mainnet deployment command is identical, except you switch networks:
Before deploying production contracts, always ensure:
- Your code and constructor parameters have been reviewed.
- You have full test coverage for key behaviours.
- The contract was deployed and tested on testnet first.
Next steps & best practices
- Add automated tests using Hardhat’s built-in test environment to verify state transitions and access control.
- Apply common Solidity patterns such as role-based permissions, pausing and upgrade-safe storage if relevant.
- Review Architecture to understand how Cronos nodes process transactions and blocks.
- Explore real-world examples and front-end integrations in Developer tutorials & resources.
- If you're new to the ecosystem, the Getting started section provides a broader introduction.