Cronos zkEVM Docs
  • Getting Started
    • πŸš€Getting started
    • Network status
    • πŸ—οΈArchitecture
    • πŸͺ™About zkCRO, vETH, vUSD
      • zkCRO
      • vETH
        • ybETH & vETH
      • vUSD
        • ybUSD & vUSD
    • πŸ“ƒzkEVM Litepaper v1.0
    • πŸ—ΊοΈCronos roadmap
  • For Users
    • πŸ’³Crypto.com Card Top Up
    • πŸ”₯Crypto Wallets
      • 🦁Crypto.com Onchain Wallet configuration
      • 🐰Rabby Configuration
      • 🦊MetaMask Configuration
      • 🦁Brave Wallet Configuration
      • 🧠Holdstation Smart Wallet
      • Zerion
    • πŸŒ‰Cronos zkEVM Bridge
    • πŸŒ‰Independent bridges
    • πŸ‘‘Pioneer Program
    • πŸ‘‘Yield rewards
    • πŸ“³Dapps
    • πŸ’‘FAQs
  • For Developers
    • πŸ”—Resources for Developers
    • πŸ’»Develop Smart Contracts and Dapps
      • Contract Deployment and Verification
      • Contract Verification Guide for the Cronos zkEVM Explorer
    • πŸ”§Developer Tools
      • Cronos zkEVM Developer Portal and APIs
      • Band Protocol (Oracle)
      • Covalent (Analytics)
      • Cronos Safe (Multi-sig)
      • Crypto.com AI Agent SDK (AI)
      • Debank (Analytics)
      • Dextools (Analytics)
      • deBridge (Bridge)
      • Eliza (AI)
      • Getblock (Node infra)
      • Goldsky (Subgraph hosting)
      • Google Bigquery (Analytics)
      • NFTs2Me (No code)
      • Pyth (Oracle)
      • Secret Network (Computing)
      • Sentio (Analytics)
      • Subquery (Analytics)
      • Thirdweb (App development)
      • txSync (Paymaster)
      • VIA Labs (Bridge)
      • XY Finance (Bridge)
      • Zyfi (Paymaster)
    • πŸ“’Contract Addresses
    • πŸ—³οΈAccount abstraction
    • πŸŒ‰Using zkCRO, vETH and vUSD
      • zkCRO
      • vETH
      • vUSD
      • Yield rewards
    • πŸŽ›οΈJSON-RPC API Overview
      • ZKs specific JSON-RPC API
      • Ethereum JSON-RPC API
  • FOR NODE HOSTS
    • ⛓️Running nodes
      • Cronos zkEVM Mainnet
      • Cronos zkEVM Sepolia Testnet
  • Resources
    • πŸ“šMedia/Brand Kit
Powered by GitBook
On this page
  • Contract Deployment
  • Contract Verification
  • Important note about tokens
  1. For Developers
  2. Develop Smart Contracts and Dapps

Contract Deployment and Verification

PreviousDevelop Smart Contracts and DappsNextContract Verification Guide for the Cronos zkEVM Explorer

Last updated 5 months ago

Contract Deployment

Like zkSync Era, Cronos zkEVM recommends the use of:

  • Hardhat for smart contract development

  • Node Typescript with the ethers library for backend and frontend development

While the are the most comprehensive and up to date source of information, you can also refer to , created especially for Cronos zkEVM Chain, which shows how to read the blockchain, write on the blockchain, and develop smart contracts:

  • Refer to the file for a list of frequently used commands.

  • The typical network configuration parameters are shown in the file.

  • The scripts directories contain some useful examples of scripts and functions that you may need to execute calls and transactions.

Contract Verification

In order to enable users and fellow developers to do their own research, it is imperative that you publish your smart contract code on Cronos zkEVM Explorer.

The Cronos zkEVM Explorer supports smart contract verification either through the web interface or programmatically via Hardhat (we recommend to use Hardhat).

Contract Verification Via Hardhat:

Cronos zkEVM is supported by Hardhat out of the box, to verify contract using Hardhat, we will need:

  1. Configure the network parameters in hardhat.config.js, referring to this . As an example, the verifyURL for mainnet should be set as

verifyURL: "https://explorer-api.zkevm.cronos.org/api/v1/contract/verify/hardhat?apikey={apikey}"
verifyURL: "https://explorer-api.testnet.zkevm.cronos.org/api/v1/contract/verify/hardhat?apikey={apikey}"
  1. A "Developers Portal" API key, refer to below guides on how to register and obtain one.

Note: During the contract verification Via Hardhat - Please install and use @matterlabs/hardhat-zksync-verify version 1.7.1+ instead of hardhat-etherscan

Contract Verification Via Explorer interface:

For verification via the web interface, visit the following URLs:


Important note about tokens

If you are planning to deploy a ERC20 token on Cronos zkEVM, keep in mind that there are two ways to do this:

  • Deploy directly on the L2: this approach is simple to implement, but in that case, the ERC20 token won’t be supported natively by the hyperbridge between L1 and L2, and between hyperchains. A custom bridge will be required to withdraw or transfer tokens from the L2.

  • Deploy first on the L1, then deposit to the L2: this approach requires two steps, but its advantage is that the tokens will be natively supported by the hyperbridge between L1 and L2. They can be deposited into the L2, or withdrawn from the L2, at will. When the first token is deposited from L1 to L2, the hyberbridge automatically creates a ERC20 smart contract on L2, which is the representation of the L1 token on the L2.

After deploying your smart contract, you will need to publish and verify its code in the block explorer:

  • If you have deployed directly on the L2, the deployment script included in the boilerplate project performs the contract code publication and verification automatically.

  • If you deploy first on the L1 (Ethereum Sepolia), you can publish and verify the contract code on the Etherscan Sepolia block explorer as usual. With respect to publishing and verifying the code of the L2 smart contract created by the hyperbridge, this is not yet supported.

Cronos zkEVM Mainnet:

Cronos zkEVM Testnet:

We can also refer to the example provided in .

After the contract verification is complete, the will display details about your smart contract code.

Mainnet:

Testnet:

Note that when using contract verification via the explorer interface, Standard-Json-Input method is required. Reference for the JSON file format:

πŸ’»
zkSync docs
this linked repository
README.md
hardhat.config.ts
guide
https://explorer-api-doc.zkevm.cronos.org/mainnet/index.html#overview
https://explorer-api-doc.zkevm.cronos.org/testnet/index.html#overview
this boilerplate repository
Cronos zkEVM Explorer
https://explorer.zkevm.cronos.org/verifyContract
https://explorer.zkevm.cronos.org/testnet/verifyContract
https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description