Smart Contract Deployment

Anyone can build a smart contract application on the Bitrock network. Below is a step-by-step walkthrough on how to deploy a simple smart contract counter using Remix.

Note: Before you start deploying using Remix, make sure you are connected Bitrock network in your Metamask. See the Connect to Chain section for details.

1. What is Remix?

Remix is open-source Ethereum IDE you can use to write, compile and debug Solidity code. As such, Remix can be a hugely important tool in Web3 and dApps development.

You can jump to the Remix text editor https://remix.ethereum.org and copy paste this code below.

counter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

contract TestBitRockSimpleCounter {
    int private count = 0;
    function incrementCounter() public {
        count += 1;
    }
    function decrementCounter() public {
        count -= 1;
    }

    function getCount() public view returns (int) {
        return count;
    }
}

2. Compile Code

After the code is written, compile it using Solidity version based on the code written.

Once the code is compiled, a green Check will be shown.

3. Deploy and view on Bitrock Explorer

After the code is compiled, it is ready to be deployed on the Bitrock Network. Click the Deploy button and a Metamask confirmation window will pop up.

Note: Bitrock Blockchain smart contract deployment fees are near-zero.

4. The smart contract is ready to be used

After the smart contract is deployed, the contract address can be seen and explored on Bitrock explorer.

Last updated