> For the complete documentation index, see [llms.txt](https://blocx.gitbook.io/blocx./llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blocx.gitbook.io/blocx./get-started/build-on-blocx..md).

# Build on BLOCX.

Guide to Deploy BLOCX-20 Token via Remix + MetaMask on BLOCX Mainnet.

### Find Reference&#x20;

Reference token: <https://blocxscan.com/address/0x17Fe8466DF6a2dD30c87576367CA398ef24128C7>

***

### Open Remix

* Open Remix at:\
  <https://remix.ethereum.org/>
* Next, open the **contracts** folder and create a new file—in this case, `demo.sol`."

<div align="left"><figure><img src="https://3523560304-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ3XU2pgITbQ6SZ7MFGOr%2Fuploads%2FkCMEJoupzHnNZlIz6Knb%2Fimage%201970.png?alt=media&amp;token=82f35979-d80d-4024-8cda-b1eabf6056f9" alt="" width="321"><figcaption></figcaption></figure></div>

***

### **Write Your Contract**

In Remix:

* Open the Solidity file (e.g., `Demo.sol`)
* Import the **BLOCX-20** contract from an audited **OpenZeppelin ERC-20** source, then set your variables, such as the name, minted amount, and other parameters.\
  **Screenshot Reference:** `Basic.png`

<div align="left"><figure><img src="https://3523560304-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ3XU2pgITbQ6SZ7MFGOr%2Fuploads%2FJVUVulCQEXamDyoFEhKP%2FBasic.png?alt=media&amp;token=91080c68-c1e8-4f5e-9fb2-5d2f553b52e2" alt="" width="375"><figcaption></figcaption></figure></div>

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract Demo is ERC20 {
    constructor(address recipient) ERC20("demo", "demo") {
        _mint(recipient, 10000 * 10 ** decimals());
    }
}
```

***

### **Compile the Contract**

* Go to the **Solidity Compiler** tab (🔨 icon).
* Select the correct compiler version (`0.8.20`).
* Hit **"Compile Demo.sol"** ✅.

***

### **Connect MetaMask (Injected Provider)**

* Go to the **Deploy & Run Transactions** tab (Ethereum icon).
* Under **ENVIRONMENT**, choose `Injected Provider - MetaMask`\
  ➤ This connects Remix to MetaMask's current network.

**Screenshot Reference:** `Injected Provider - MetaMask`, account shown.

<div align="left"><figure><img src="https://3523560304-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ3XU2pgITbQ6SZ7MFGOr%2Fuploads%2FJ0DrR920ytw3sR6pitrw%2FInjected%20Provider%20-%20MetaMask.png?alt=media&amp;token=85e027c8-db44-48f3-b333-f48d4746377a" alt="" width="218"><figcaption></figcaption></figure></div>

Make sure **MetaMask** is **connected** to your **target chain** (e.g., **BLOCX-Mainnet** with **ID 86996** as in screenshot).

<div align="left"><figure><img src="https://3523560304-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ3XU2pgITbQ6SZ7MFGOr%2Fuploads%2F1rJZLcLnafvpTMTEMS9j%2FScreenshot%20from%202025-06-11%2012-11-05.png?alt=media&amp;token=64409fc9-6df1-471c-8abb-8b282afda369" alt="" width="223"><figcaption></figcaption></figure></div>

***

### **Set Deployment Settings**

* Set **Value**: Leave at `0` (unless the constructor needs BLOCX).
* Select **Contract**: `Demo - Demo.sol`

<div align="left"><figure><img src="https://3523560304-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ3XU2pgITbQ6SZ7MFGOr%2Fuploads%2Fdgn3J8BuQLS0nPLhsL6j%2FScreenshot%20from%202025-06-11%2012-11-21.png?alt=media&amp;token=e3d9746f-041a-4870-ba71-a1d7d882a0a1" alt="" width="191"><figcaption></figcaption></figure></div>

* In the **DEPLOY** section, enter the `recipient` address (who will receive the minted tokens).

Make sure it’s a valid BLOCX address (starts with `0x...`).

***

### **Deploy**

* Click **Transact** ➝ MetaMask popup appears.
* Review and **Confirm** the transaction.

**Screenshot Reference:** MetaMask deploy confirmation window with fee and data.

<div align="left"><figure><img src="https://3523560304-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ3XU2pgITbQ6SZ7MFGOr%2Fuploads%2FuyN864qQTG50Nw9egYKf%2FMetaMask%20deploy%20confirmation%20window%20with%20fee%20and%20data.png?alt=media&amp;token=5568f84b-c935-49fd-8bae-71a839c93f3b" alt="" width="198"><figcaption></figcaption></figure></div>

Wait for transaction confirmation on-chain ⛓️.

***

### **Interact with the Deployed Contract**

After deployment:

* Under **Deployed Contracts**, expand your contract instance.
* You can now interact with:
  * `balanceOf(address)`
  * `transfer(to, value)`
  * `approve`, `transferFrom`
  * `totalSupply`, `name`, `symbol`, `decimals`

**Screenshot Reference:** Interaction UI with `balanceOf`, `transfer`, etc.

<div align="left"><figure><img src="https://3523560304-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJ3XU2pgITbQ6SZ7MFGOr%2Fuploads%2FgxH0tnw7TEW8444G1dc3%2FInteraction%20UI.png?alt=media&amp;token=1f2ebc44-cac5-4bdf-a084-815f5bb9b8f2" alt="" width="178"><figcaption></figcaption></figure></div>

For example:

* Check balance with `balanceOf(recipient)`
* Transfer tokens using `transfer(to, amount)` with appropriate decimals.
