Docs
Getting Started
Developer Guide
Deploy Smart Contract
Using Remix IDE

Using Remix IDE

Setting up and launching a NRC20 Token Smart Contract on the Now Chain using Remix IDE.

What is Remix IDE ?

Remix IDE is an open-source web and desktop application that aids in smart contract development, written in Solidity language for the Ethereum blockchain. It provides a range of tools that help developers write, test, debug, and deploy smart contracts with ease. Some notable features of Remix IDE include.

Prerequisites

  1. Add NOW in your MetaMask, to add refer to our guide Add NOW to Metamask

  2. Faucet NOW coins

Creating and Deploying NRC20 Token on Remix IDE

You'll be greeted with the following screen.

deploy-using-remix-1

  • Click on the icon mentioned below to generate a new file called SwipeNOW.sol.

deploy-using-remix-2

  • An empty file will appear as shown below.

deploy-using-remix-3

  • Copy the following code and insert it into SwipeNOW.sol.
    // SPDX-License-Identifier: MIT
    pragma solidity >=0.4.22 <0.9.0;
 
    import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
    import "@openzeppelin/contracts/access/Ownable.sol";
 
    contract SwipeNOW is ERC20, Ownable {
        constructor() ERC20("SwipeNOW", "SWIPENOW") Ownable(msg.sender) {
            _mint(msg.sender, 1000000000 * 10 ** decimals());
        }
 
        function mint(address to, uint256 amount) public onlyOwner {
            _mint(to, amount);
        }
    }
  • Now, click on the "Solidity compiler" icon to go to the compilation tab. After that toggle the "Advanced Configurations" dropdown and toggle the "EVM VERSION" dropdown menu and select "paris" instead of "default".

  • Press the "Compile" button to your contract, ensuring you select the checkbox highlighted within the blue circle.

deploy-using-remix-4

  • To deploy your contract, click on the indicated button below to go to the deploy and run transactions tab

deploy-using-remix-5

  • Now, select the "Remix VM...." dropdown, and then choose the "Injected Provider" highlighted in red.

deploy-using-remix-6

  • After making that selection, MetaMask will prompt you to unlock your wallet. If you're already logged into MetaMask, you'll see a display similar to the one below.

deploy-using-remix-7

ℹ️

Ensure that you're connected to the Now Chain Mainnet, which carries a chain ID of 2488.

  • To finalize the deployment of your NRC20 Smart Contract on the Now Chain, press the "Deploy" button highlighted in orange, as shown below.

deploy-using-remix-8

ℹ️

Ensure you have enough NOW Tokens to cover the gas fees for the transaction.

ℹ️

If you haven't added the NOW Chain in your MetaMask, refer to our guide Add Now Chain to Metamask

After clicking the "Deploy" button, MetaMask will pop up prompting you to approve the transaction. Once you confirm, your contract will deploy within a few seconds, and you'll be able to view your deployed contract here.

deploy-using-remix-9

Well done! You've successfully created and launched the NRC20 token on the Now Chain.