Get Started

In this section we'll get you deploying a sample contract on Zillion testnet using the Remix IDE in less than 10 minutes.

Before getting started

  1. Follow Using Zillion for the step-by-step on how to add Zillion testnet to Metamask.

  2. Get ETH on testnet from faucets.

Now we are ready to go ahead!

Remix & Sample Code

Remix is a hassle-free tool for developing smart contracts. It's incredibly easy to dive into, offering a straightforward deployment process, debugging capabilities, seamless interaction with smart contracts, and much more. It's an invaluable tool for swiftly testing modifications and engaging with deployed smart contracts.

In this tutorial, we'll deploy the '1_Storage.sol' smart contract provided as an example in Remix.

Here is the code:

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.8.2 <0.9.0;

/**
 * @title Storage
 * @dev Store & retrieve value in a variable
 * @custom:dev-run-script ./scripts/deploy_with_ethers.ts
 */
contract Storage {

    uint256 number;

    /**
     * @dev Store value in variable
     * @param num value to store
     */
    function store(uint256 num) public {
        number = num;
    }

    /**
     * @dev Return value 
     * @return value of 'number'
     */
    function retrieve() public view returns (uint256){
        return number;
    }
}

Steps to deploy

  1. Copy the example code and paste it into one of the .sol files in Remix.

  2. To compile your smart contract, navigate to the Solidity Compiler tab and choose the contract you wish to compile.

  3. Click "Compile". You can also activate "Auto Compile" for automatic compilation whenever you make changes to the contract code.

  4. After successfully compiling the smart contract, switch to the "Deploy & Run Transactions" tab.

  5. From the "Environment" dropdown menu, choose "Injected Provider - MetaMask". This will link your MetaMask account to Remix, enabling you to conduct transactions directly from that connected wallet. Make sure to have Zillion Testnet as your selected network in Metamask before deploying.

  6. Choose the compiled contract you wish to deploy and then click on 'Deploy'. Now, MetaMask should pop up, prompting you to confirm the transaction with very low fees.

Congratulations! You've successfully deployed your first smart contract on Zillion testnet.

Last updated