Deploy with Remix

Remix is a no-setup toolset for developing smart contracts. Used by experts and beginners alike, Remix will get you going in no time.

Remix is available as a web-based environment, a desktop program, and even a CLI tool. In this page, we will use the web-based version.

Here is how to deploy a smart contract using Remix Online IDE:

  1. Go to https://remix.ethereum.org. The Remix IDE opens in your browser.

  2. Click the "Create a new Workspace" button, then choose an option: blank workspace, AI-generated workspace, contract wizard, or project import. You also rely on categorized templates. For the purpose of this tutorial, we'll use an OpenZeppelin ERC20 template. You can of course deploy your own smart contract using a blank workspace.

Chiliz's Fan Tokens are CAP20 tokens, which are Chiliz Chain-specific extension of the Ethereum ERC20 token standard. Learn more about CAP20 here.

  1. Scroll down to the "OpenZeppelin" template category, and click the "ERC20" template.

  1. Give your ERC20 token a name using the form that Remix displays, then click the "Validate workspace" button.

Once you validate your choice, Remix loads a standard workspace with folders and files that appear in the File Explorer on the left. Click in the /contracts/MyToken.sol file to display the ERC20 contract that you are about to deploy:

As you can see, your MyToken.sol smart contract imports the ERC20.sol contract from OpenZeppelin. You can open the .deps/npm/@openzeppelin/contracts/token/ERC20/ERC20.sol file to display the ERC20 contract itself.

You are free to edit your MyToken.sol contract as you see fit. For instance, in order to work with the Chiliz Chain EVM, your contract should rely on Solidity 0.8.24 at most, so make this change:

pragma solidity ^0.8.24;
  1. Click the "Compile" above your contract file.

If there are no mistakes in your changes, Remix IDE should display a green checkmark in the "Solidity Compiler" menu on the left:

  1. Open the "Deploy & run transactions" section.

  • Select "Browser Extension > Injected Provider - MetaMask" in the "Environment" dropdown menu. This will link the deployed token to your MetaMask account — which should be configured to work with Chiliz Chain already (if not, see here)

  • Make sure that Remix displays the correct network: Chiliz Chain Mainnet.

  • Make sure that your contract file is selected and that the chosen EVM version is "Shangai".

  • Click "Deploy & Verify". If you prefer to verify the contract by yourself, you can just have Remix deploy the contract by unchecking the "Verify Contract on Explorers" box.

  1. Your MetaMask wallet should open automatically.

8. Click "Confirm" to link your MetaMask Wallet with your token's smart contract. You should receive a notification confirming the transaction within a few seconds, along with an invitation to view the transaction on the Chiliscan block explorer.

From the transaction, you can can access the deployed contract itself (here, the link after "Contract"):

In your MetaMask wallet, under the "Activity" tab, you will see the contract deployment information. Click it to see all the information about it:

Congratulations! Your contract is now deployed on Chiliz Chain!

Now it is time to verify it:

Verifiy a Smart Contract

Last updated

Was this helpful?