Skip to Content
MCN Blockchain

Solidity and deployment

Compile, test, and verify a simple Solidity contract before Mainnet deployment.

Start with a local contract

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Counter {
    uint256 public count;

    event Incremented(uint256 newCount);

    function increment() external {
        count += 1;
        emit Incremented(count);
    }
}

Use a local EVM such as Anvil or a Hardhat development network. Assert the initial count, state change, and event. Pin your compiler, optimizer settings, library versions, and EVM target. The Solidity pragma shown here is for the example. Validate the compiler EVM target against the active MCN fork.

Prepare the deployment

  1. Build and test locally. Confirm the expected deployer, target chain, constructor arguments, and estimated fees.
  2. Run deployment and call tests on a local EVM. No public MCN testnet parameters are listed in this guide; do not use Mainnet as a disposable test environment.
  3. On Mainnet, verify chain ID and genesis, use an approved signer, and save the transaction hash and exact build metadata.
  4. Check successful inclusion and finality. Compare deployed runtime bytecode with the expected artifact and use MCNScan where its supported verification tooling applies.

Preserve ABI and source for each deployment so users can reproduce and inspect the contract.

Solidity documentation · Foundry documentation

On this page