# Remix

Remix IDE allows developers to deploy their smart contracts using MetaMask, which is universally convenient. This platform doesn't require a setup, and comes with a series of plugins that offer simple GUIs.  &#x20;

Remix is supported by *Firefox, Chrome, Brave, and other Chromium-based browsers*. The platform is also available as a [Desktop IDE](https://github.com/ethereum/remix-desktop/releases) and a [VScode extension](https://github.com/ethereum/remix-vscode#ethereum-remix-project-extension-for-visual-studio-code). &#x20;

This guide assumes that the reader has at least some familiarity with the Solidity programming language for smart contracts, and general dApp development on the Ethereum network.&#x20;

The following steps will guide you to effective smart contract deployment on Remix.

**1.** Go to <https://remix.ethereum.org/>. Make sure that you have the **Atlantis Network** added to your Metamask and a few BCX tokens are in your wallet to be used as Gas for creating a smart contract.&#x20;

If you need some BCX tokens for the testnet, go to <https://faucet.blockxnet.com>, then enter your Metamask address.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FLXIeF2LRX10JCACJVQ3M%2F1.png?alt=media&#x26;token=b5581278-cba6-446b-8c4b-01e6fbb0f7c2" alt=""><figcaption><p>remix.ethereum.org</p></figcaption></figure>

Below is the default interface of Remix:

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2F5yX67DoRWBNj6BC3Zfeu%2Fsd.png?alt=media&#x26;token=b7bb68e0-6848-4661-ad0a-18ac371301df" alt=""><figcaption></figcaption></figure>

Let’s try to create a new file. We’ll create a new token within the Atlantis Network using just a few lines of Solidity code commonly available across the internet:

```solidity
pragma solidity ^0.8.2;
 
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
 
contract MyToken is ERC20, ERC20Burnable, Ownable {
   
    constructor() ERC20("My Token", "Myt") {
        _mint(msg.sender, 1000000 * 10 ** 18);
    }
 
    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}
```

**2.** Create a new file:

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FQRetOfttcCJeIOIIlZAE%2F1.png?alt=media&#x26;token=2e317d96-2505-4172-810b-c3f179b04346" alt=""><figcaption></figcaption></figure>

Then enter a filename. For this example, we've named it **MyToken.sol.**

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FG3cPXK4r6HILobM91sVW%2F2.png?alt=media&#x26;token=a7738e31-fe8e-43d8-b4a9-0e3f92140573" alt=""><figcaption></figcaption></figure>

**3.** Paste the Solidity code shown below to the newly created file. Then **Save.**

```solidity
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC20, ERC20Burnable, Ownable {
    
    constructor() ERC20("MyToken", "Myt") {
        _mint(msg.sender, 1000000 * 10 ** 18);
    }
    
    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}
```

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FCaMEM0xoLHZhexAePdv1%2F3.png?alt=media&#x26;token=1d3c9b76-7fc5-48e4-bd4b-6b19aba6f908" alt=""><figcaption></figcaption></figure>

**4.** Upon saving, you will see more files being added to your workspace. They are our new dependencies since we imported the OpenZeppelin libraries.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2F7OMNhCPmjPgWHm95IU2P%2F4.png?alt=media&#x26;token=7ecc1d79-6278-47bb-8ed7-d29e05859e8e" alt=""><figcaption></figcaption></figure>

**5.** Look for the **Compile** icon on the left navigation panel of Remix - the 3rd icon. Then click on the Compile button.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2Fp0CZqkrRgAYXATIPECE8%2F5.png?alt=media&#x26;token=732141d5-6154-4800-9c93-ba3428a7b19b" alt=""><figcaption></figcaption></figure>

**6.** Once you have successfully compiled the file, Remix will show you the Compile icon with a checkmark added to it. There’ll be no checkmark if an error had occurred during compilation and you’ll see error message(s) as well.&#x20;

You will now be able to copy the **ABI** of the contract which is commonly used in Web3 when it comes to tampering with the contract.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FoFW62eRDqYO5LxbUx8eA%2F6.png?alt=media&#x26;token=9ff2e4b4-6b4c-4e6e-8ed3-9399a6dba4f3" alt=""><figcaption></figcaption></figure>

**7.** To Deploy, click the **Deploy** button on the left which is the 4th icon in Remix. For the Environment, select **Injected Provider** - Metamask to use your Metamask wallet in deploying the contract. Make sure that the Atlantis Network is selected and the chosen wallet has BCX in it for gas fee coverage.&#x20;

One of the ways to verify if you’ve got the right wallet is checking if the address is correct, as well as the balance right beside it (displayed in **ether**).

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2Fi9pwe20GrdUdfXEBBXmW%2F7.png?alt=media&#x26;token=63a387c4-2524-415a-87fb-bb4e1e469d00" alt=""><figcaption></figcaption></figure>

**8.** Once you click **Deploy**, it will open up a MetaMask window where you’ll see the gas fee needed for deploying the contract. Click **Confirm** for the contract to be deployed.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FH7EPYZhfzm8mBLORG8tZ%2F8.png?alt=media&#x26;token=1224b162-b070-4a7c-85f9-c4024663f09f" alt=""><figcaption></figcaption></figure>

**9.** To find out the outcome of the deployment, check the lower section of Remix, which should show you something like this:

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FvKFcGZ5HCwpcTlmt1vOi%2F9.png?alt=media&#x26;token=ced6287a-4c5e-4e7b-b2fd-ded59ad21209" alt=""><figcaption></figcaption></figure>

On the **left side**, there is the **Deployed Contracts** section, which, if you click on the arrow on the left side of the MyToken contract, should open more options for interacting with the contract.&#x20;

The **Copy** icon allows you to copy the contract address of the deployed contract to add it to your Metamask since it is a token.&#x20;

On the **right side**, you’ll see more info if you click on the right arrow. It should show you transaction info.&#x20;

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FZL4SCfOVWozMNANWCfkm%2F10.png?alt=media&#x26;token=b5bc05c9-b19f-4fbe-bb2e-dc7bf29a212e" alt=""><figcaption></figcaption></figure>

**10.** Once you have copied the Contract Address, you can then add it to your Metamask. Once the Metamask window opens, you’ll notice that there is a small amount of BCX tokens deducted from your balance. Click on the **Assets** tab, then click **Import tokens**.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FWUN0C3u4584SuN1tMHYC%2F11.png?alt=media&#x26;token=fa8b0616-1482-4742-996d-0e209c4769d7" alt=""><figcaption></figcaption></figure>

**11.** Paste the **contract address** that you copied from Remix. If the contract address that you copied is correct, MetaMask will automatically show your token symbol.&#x20;

Click **Add Custom Token.** It will show you a confirmation page before being able to add the token. It will also show you your token balance.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FEtI98nLJMIRL7eMkverg%2F12.png?alt=media&#x26;token=dc8ac82b-835b-4b81-9060-44d28301be69" alt=""><figcaption></figcaption></figure>

**12.** A confirmation page will appear before you can add the token. Click **Import Tokens.**

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2Faw6gOfevx1MQthzgdZOV%2F13.png?alt=media&#x26;token=ac791896-8669-42c2-882e-1fe1bba099d7" alt=""><figcaption></figcaption></figure>

**13.** You should then be able to see your token on MetaMask where you can send tokens to other Atlantis Network users, just like you send tokens on **Ethereum** or **Binance Smart Chain**.

**14.** If you want to see further info on your contract, you can go to [**https://explorer.blockxnet.com**](https://explorer.blockxnet.com) and enter either the contract address or the transaction hash. Both are available in the Remix lower section after you deploy the contract.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FuBUry4nkAtktSPMnTXXr%2F14.png?alt=media&#x26;token=0c0dc7bc-8eea-4585-907a-ec4cceda4e1d" alt=""><figcaption></figcaption></figure>

Click on the token name that you deployed to see more info about the token.

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FeZofVCKC2OB0oJksGNxU%2F18.png?alt=media&#x26;token=6e9aca8f-fd8a-4401-9650-6dbd189c40ba" alt=""><figcaption></figcaption></figure>

**15.** If you clicked on the token name of your token, it should have taken you to the token page where you can see the **Token Holders**, **Total Supply**, **Number of Holders** and **Number of Transfers.**

<figure><img src="https://4145461321-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXnmMY63g38TZM2uGNbd1%2Fuploads%2FPtd1uK8FpNXRbaTlX6Iu%2F16.png?alt=media&#x26;token=2753e2c0-e8fc-40db-b3e6-0f36adec1184" alt=""><figcaption></figcaption></figure>

**Congratulations**, you have successfully deployed a smart contract on the Atlantis Testnet using Remix, and are now able to see transaction details on a block explorer!
