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

# Deploy a smart contract on Monad using Remix

[Remix IDE](https://remix.ethereum.org/) is a browser-based IDE that can be used for the entire journey of smart contract development by users at every knowledge level. It requires no setup, fosters a fast development cycle, and has a rich set of plugins with intuitive GUIs.

In this guide you will learn how to deploy and interact with a simple Greeting smart contract on Monad Testnet using [Remix IDE](https://remix.ethereum.org/).

## Requirements

* You need to have the Monad Testnet network added to your wallet.

## Deploying the smart contract

Head over to [Remix IDE](https://remix.ethereum.org/) in your browser. Click 'Start Coding' to create a new project template.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/1.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=d74186e980cd55d5dba92c89eccae4b6" alt="remix-ide" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/1.png" />

Make sure the 'contracts' folder is selected, then create a new file using the "Create new file" button on top left corner.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/2.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=bce873a74b1d4ca53cfea30f11945d49" alt="create-file" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/2.png" />

Name the new file "Gmonad.sol" and add the following code to it

```solidity lines title="src/Gmonad.sol" theme={null}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

contract Gmonad { 
    string public greeting;

    constructor(string memory _greeting) {
        greeting = _greeting;
    }

    function setGreeting(string calldata _greeting) external {
        greeting = _greeting;
    }
}
```

**Note:** You may see a red squiggly line underneath the `pragma solidity...` line; this is because the default compiler version is outside of the range specified in the contract. We'll fix that in the next step.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/3.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=23ff70a7caab81ad78c1e5034bbeda84" alt="code" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/3.png" />

Let's compile the smart contract. Navigate to the compiler view by clicking the "Solidity compiler" tab on the far left. Then select the right compiler version (0.8.24).

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/4.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=8c74e6abf6663738cb05bf7ca3d7ba98" alt="compiler" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/4.png" />

Once you have the right compiler version selected, click on the "Compile Gmonad.sol" button. If succesful, you will see a green check mark on the "Solidity compiler" tab icon.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/5.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=c67d64facd5a36b7a2053d8e1b472ce8" alt="compile" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/5.png" />

Now we can deploy the smart contract! Navigate to the deploy view using the "Deploy & run transactions" tab on the far left.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/6.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=c14b7088128bdcb25d23cdc8260271e5" alt="deploy" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/6.png" />

Using the "Environment" dropdown, select "Injected Provider" to connect to your wallet.

The screenshot below says "Injected Provider - Metamask"; in case you are using some wallet other than Metamask you may see an appropriate option.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/7.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=e74caed646c556eee495cb2645a2339b" alt="environment" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/7.png" />

Your wallet should pop up asking for permission to connect to Remix, click "Connect".

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/8.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=6ea49d87f3175399aa0ce8168a26b003" alt="connect" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/8.png" />

Once connected you should be able to see your address with your balance in the "Account" dropdown.

Make sure you also see the correct chain id under the "Environment" dropdown.

Now let's deploy the contract. `Gmonad.sol` requires a greeting message to be passed to the constructor before it can be deployed; choose the greeting message of your choice (in this example it is "gmonad").

Now you can deploy the smart contract by clicking the "Deploy" button.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/9.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=a9f3f9c51816f6f9d22dfbbec79981ad" alt="deploy" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/9.png" />

You should see a wallet popup asking for confirmation to deploy the smart contract. Click "Confirm".

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/10.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=98acf99674bf6dd50d6e4ffa3aa28917" alt="confirm" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/10.png" />

Once the transaction is confirmed you will see the smart contract address in the "Deployed Contracts" section on the bottom left.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/11.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=37a0cafd10c9cad2a8ba9411b0fd5e3f" alt="deployed" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/11.png" />

## Interacting with the smart contract

You can expand the smart contract to see the functions available.

There you will find a `greeting` button which can be used to read the current greeting message stored in the smart contract.

Click the "greeting" button to call the `greeting()` method (which outputs the current greeting message). You'll need to click the expand arrow in the terminal output to see the decoded output.

<Info>
  This "greeting" button is a getter function which is automatically created for the *public* `greeting` state variable in the smart contract.
</Info>

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/12.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=0e9687b07bf9fb0033ce070bdc1304de" alt="expand" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/12.png" />

You can change the greeting message by using the `setGreeting` function.

In this example, we will change the greeting message to "gmonad molandak".

Once again, click the "transact" button to initiate the transaction.

You should see a wallet popup asking for confirmation to change the greeting message. Click "Confirm".

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/13.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=41266d6ad4d4e7b4a6d1269b4fb079c1" alt="transact" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/13.png" />

Once the transaction is confirmed you can view the updated greeting message using the `greeting` button.

<img src="https://mintcdn.com/monadfoundation-40611fb6/c3ZcPFY7YVeS_v57/static/img/guides/deploy-smart-contract/remix/14.png?fit=max&auto=format&n=c3ZcPFY7YVeS_v57&q=85&s=8375acac61119c2d3313ce75adfe68a6" alt="updated" width="3024" height="1570" data-path="static/img/guides/deploy-smart-contract/remix/14.png" />

Congratulations! You have successfully deployed and interacted with a smart contract on Monad  Testnet using Remix IDE.

{/* ## Next steps

Check out how to verify your smart contract on Monad using Explorer */}
