# Deploy a Smart Contract on Cronos zkEVM

> Learn how to deploy a smart contract on Cronos zkEVM using GetBlock's RPC endpoint.

Cronos zkEVM is a **ZKsync ZK Stack** chain, so its EVM is compatible at the application level but contracts must be compiled with the ZKsync Solidity compiler (`zksolc`) and deployed with the ZKsync toolchain — standard `solc`/vanilla Foundry bytecode is not deployed directly. Use `@matterlabs/hardhat-zksync` (or `foundry-zksync`). Gas is paid in zkCRO. This guide covers adding the network to a wallet and deploying with Hardhat + ZKsync.

> **Warning:** Do not deploy Cronos zkEVM contracts with vanilla `solc`/Foundry as you would on a standard EVM chain. Cronos zkEVM requires the `zksolc` compiler; deploy and verify through `@matterlabs/hardhat-zksync` or `foundry-zksync`.

## Prerequisites

* [Node.js](https://nodejs.org/) 18+ and a package manager
* An EVM wallet (such as MetaMask) with zkCRO for gas — see [Add Network to Your Wallet](/api-reference/cronos-zkevm-zkcro/deploy-a-smart-contract-on-cronos-zkevm/#add-network-to-your-wallet) and [Funding Your Deployer](/api-reference/cronos-zkevm-zkcro/deploy-a-smart-contract-on-cronos-zkevm/#funding-your-deployer)
* A GetBlock access token — the endpoint is `https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/`
* A funded deployer address with zkCRO

## Network Details

| Property | Value |
| --- | --- |
| Network Name | Cronos zkEVM Mainnet |
| RPC URL | https://shared.eu-central-1.getblock.io// |
| Chain ID | 388 (0x184) |
| Currency Symbol | zkCRO |
| Block Explorer | [explorer.zkevm.cronos.org](https://explorer.zkevm.cronos.org/) |

## Add Network to Your Wallet

Cronos zkEVM is not pre-configured in MetaMask by default, so it must be added manually — follow the steps below:

### Open your wallet

Open MetaMask (or your EVM wallet of choice).

### Add a custom network

Open the network selector and choose **Add a custom network**.

### Enter the network details

Enter the values from the [Network Details](/api-reference/cronos-zkevm-zkcro/deploy-a-smart-contract-on-cronos-zkevm/#network-details) table above.

### Confirm the chain ID

Confirm the Chain ID resolves to `388`.

### Save and switch networks

Save and switch to the newly added Cronos zkEVM network.

## Funding Your Deployer

Cronos zkEVM gas is paid in zkCRO.

* **Mainnet** — bridge to Cronos zkEVM through the official bridge, or acquire zkCRO from a supported exchange.

## Deploy with Hardhat + ZKsync

### Create the project and install the ZKsync toolchain

```bash
mkdir hello-cronos-zkevm && cd hello-cronos-zkevm
npm init --yes
npm install --save-dev hardhat @matterlabs/hardhat-zksync zksync-ethers ethers
```

### Configure zksolc and the network

#### hardhat.config.js

```javascript
require('@matterlabs/hardhat-zksync');

module.exports = {
  zksolc: {
    version: 'latest',
    settings: {}
  },
  defaultNetwork: 'cronosZkevm',
  networks: {
    cronosZkevm: {
      url: process.env.RPC_URL,
      ethNetwork: 'mainnet',
      zksync: true,
      verifyURL: 'https://explorer.zkevm.cronos.org/api'
    }
  },
  solidity: { version: '0.8.24' }
};
```

### Write the contract

#### contracts/Hello.sol

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

contract Hello {
    string public greeting = "Hello, Cronos zkEVM";

    function setGreeting(string calldata greeting_) external {
        greeting = greeting_;
    }
}
```

### Compile with zksolc

```bash
npx hardhat compile
```

### Deploy

#### deploy/deploy.js

```javascript
const { Deployer } = require('@matterlabs/hardhat-zksync');
const { Wallet } = require('zksync-ethers');

module.exports = async function (hre) {
  const wallet = new Wallet(process.env.PRIVATE_KEY);
  const deployer = new Deployer(hre, wallet);
  const artifact = await deployer.loadArtifact('Hello');
  const contract = await deployer.deploy(artifact, []);
  console.log('Deployed to:', await contract.getAddress());
};
```

```bash
export RPC_URL=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/
export PRIVATE_KEY=0xyour_deployer_private_key

npx hardhat deploy-zksync --script deploy.js
```

### Verify on the block explorer

```bash
npx hardhat verify --network cronosZkevm <DEPLOYED_ADDRESS>
```

## After Deploying

* Read contract state through the `eth_call` method against your GetBlock endpoint.
* Watch contract events with `eth_getLogs`.
* Explore your contract and transactions on the [Cronos zkEVM explorer](https://explorer.zkevm.cronos.org/).
