> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fuse.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Remix And Metamask

# Using Remix and Metamask

Remix is an IDE for smart contract development, including compilation, deployment, testing, and debugging.

Check out the [official documentation](https://remix-ide.readthedocs.io/en/latest/) to learn more about setting up and using Remix.

For help setting up MetaMask, please visit [the official documentation](https://metamask.zendesk.com/hc/en-us).

### Connecting Remix to Fuse via MetaMask <a href="#connecting-remix-to-gnosis-via-metamask" id="connecting-remix-to-gnosis-via-metamask" />

Remix supports the following environments for contract deployment via Fuse:

* Javascript VM
* Injected Web3
* Web3 Provider

Using MetaMask with Remix is an example of Injected Web3, which is illustrated in this guide.

* To start, go to [https://remix-project.org/](https://remix-project.org/)

<img src="https://mintcdn.com/fuse-43a2bc2e/_K7grF7JrJhznGiu/img/remix-ide/landing.png?fit=max&auto=format&n=_K7grF7JrJhznGiu&q=85&s=a6d8c453126fd2cf4392e157ff8f957f" width="2464" height="1386" data-path="img/remix-ide/landing.png" />

Create a Folder or a File where you want to write your Smart Contract, in this guide we will code and deploy an ERC-20 Token. Create a file called `Token.sol` and add the code:

```solidity theme={null}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

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

contract MyToken is ERC20, ERC20Burnable, Ownable {
    constructor(address initialOwner)
        ERC20("MyToken", "MTK")
        Ownable()
    {}

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }
}
```

The next step is to compile your Smart Contract Code to ensure there are no bugs or syntax errors.

Click the Compile button and select a **Compiler** version. In this example, it is `0.8.0`

<img src="https://mintcdn.com/fuse-43a2bc2e/_K7grF7JrJhznGiu/img/remix-ide/compile.png?fit=max&auto=format&n=_K7grF7JrJhznGiu&q=85&s=3e917fe87a315296c3213c50fc7e70e2" width="2016" height="1134" data-path="img/remix-ide/compile.png" />

If your code compiles successfully, you will see the **Solidity** logo with a green tick. After a successful Smart Contract compile, you can also copy the abi code which is used for interacting with your Smart Contract methods via a UI.

The next step is to deploy the Smart Contract. Remix IDE provides an environment where you can deploy and interact with a deployed Smart Contract via its UI. It can be used for Testing purposes and also for deploying actual production ready contratcs both to mainnet and testnets. Remix provides a list of **ENVIRONMENTS** enabling deployments. To deploy to Fuse Blockchain, you have to connect your MetaMask Wallet to Remix.

Go to the deploy tab. Select the **ENVIRONMENT** dropdown and select the option **Injected Provider**

<img src="https://mintcdn.com/fuse-43a2bc2e/_K7grF7JrJhznGiu/img/remix-ide/inject.png?fit=max&auto=format&n=_K7grF7JrJhznGiu&q=85&s=a71189fc9a6abb3389713b4fb84a18a3" width="1920" height="1080" data-path="img/remix-ide/inject.png" />

This will prompt you to sign into your MetaMask, if you are already signed in, it will display your Wallet Address information and the Fuse Network information: mainnet or testnet.

<img src="https://mintcdn.com/fuse-43a2bc2e/_K7grF7JrJhznGiu/img/remix-ide/injected.png?fit=max&auto=format&n=_K7grF7JrJhznGiu&q=85&s=32d4ea063cb59d7cccb89c789da6bc7d" width="1952" height="1098" data-path="img/remix-ide/injected.png" />

After you have connected your MetaMask, the next step is to deploy the Smart Contract. Go to the deploy tab, and simply click the button **Deploy**. This will prompt an interaction with MetaMask which requires your approval. Approve the Transaction and it will deploy the Smart Contract to the Blockchain.

<img src="https://mintcdn.com/fuse-43a2bc2e/_K7grF7JrJhznGiu/img/remix-ide/deploy.png?fit=max&auto=format&n=_K7grF7JrJhznGiu&q=85&s=5e64432d335e96e2533a68cf677af797" width="2368" height="1332" data-path="img/remix-ide/deploy.png" />

You can view your deployed Smart Contract by copying the Transaction Hash and looking it up in the Fuse explorers.

Fuse Mainnet Explorer is at [https://explorer.fuse.io/](https://explorer.fuse.io/)

Fuse Testnet Spark is at [https://explorer.fusespark.io/](https://explorer.fusespark.io/)
