---
description: >-
  Hello World style starter project. Deploys a smart contract with a message,
  and renders it in the front-end. You can change the message using the interact
  panel!
---

# Using Remix

This dapp implements a "Hello World" style application that echoes a message passed to the contract to the front end. This tutorial is intended to be followed using the online IDE available at [Remix IDE](https://remix.ethereum.org/).

#### Setting up [Remix IDE](https://remix.ethereum.org/) <a href="#setting-up-remix-ide" id="setting-up-remix-ide"></a>

* **Remix IDE** is an online IDE to develop smart contracts.
* If you’re new to Remix, You’ll first need to activate two modules: **Solidity Compiler** and **Deploy & Run Transactions**.
* Search for '**Solidity Compiler**' and '**Deploy & Run Transactions**' plugins in the plugin tab in Remix.

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FIuIE5j3mFIWdZjdxhe3p%2Fsearch-plugins.jpg?alt=media&#x26;token=4d38c360-da14-4507-b023-bb81958c86e1" alt=""><figcaption></figcaption></figure>

* Activate the two plugins

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2F6dHbl4qPdfXhlrz7NYp6%2Fadd-plugins.jpg?alt=media&#x26;token=8a99b88d-2884-4fbb-9d1d-409549906097" alt=""><figcaption></figcaption></figure>

* Select **Solidity** Environment

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FqF4lznH4z8my7xg0VF6F%2FRemixIDE_Step1.jpg?alt=media&#x26;token=b06b761b-2093-4b7f-b359-8f4334d52e2e" alt=""><figcaption></figcaption></figure>

* Go to **File Explorers**, and Create a new file ![](https://docs.polygon.technology/img/helloworld/Screenshot_2020-02-14_at_12.51.59_PM.png), Name it Hellorupto.sol
* Copy/Paste the Smart contract below into the newly created file `Hellorupto.sol`

### **The smart contract**

```
pragma solidity ^0.8.10
contract helloWorld { 
  string public hello = "Hello World!"
}
```

The first line, `pragma solidity ^0.8.10` specifies that the source code is for a Solidity version greater than 0.8.10. [Pragmas](https://solidity.readthedocs.io/en/latest/layout-of-source-files.html#pragma) are common instructions for compilers about how to treat the source code (e.g., pragma once).

### Compile Smart Contract <a href="#compile-smart-contract" id="compile-smart-contract"></a>

* Go to Solidity Compiler.
* Select Compiler Version to 0.8.10.
* Now, Compile **`Hellorupto.sol`**

Now, We have to deploy our smart contract on **Rupto Chain** network. For that, we have to connect to web3 world, this can be done by using **Metamask**.

Please follow this tutorial to setup a **Metamask** Account.

* Open **Metamask** and select Add Network from the networks dropdown.

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FGMoFiilTZpbvX5NKgWGf%2F1%20(5).PNG?alt=media&#x26;token=2566b8e9-91c1-456b-a1cb-12268dff70a9" alt=""><figcaption></figcaption></figure>

* Put in a Network name - “Rupto Testnet”
* In URL field you can add the URL as "[https://testnet.rbcscan.com/](https://testnet.rbcscan.com/)["](https://rpc-mumbai.maticvigil.com"/)
* Enter the Chain ID: 990 or 0x3de

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FW5rsvor0r6drNSifaNww%2Fmetamask-1.jpg?alt=media&#x26;token=195f8865-e599-44a5-a37a-5b4b5c1cdb8e" alt=""><figcaption></figcaption></figure>

* (Optional Fields) Symbol: "ICT" and Block Explorer URL: "[https://testnet.rbcscan.com](https://testnet.rbcscan.com)["](https://mumbai.polygonscan.com/%22)
* Go ahead and click save
* Copy your address from Metamask

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2Ft6HrZmKcULFDIDV2ghDL%2Fmetamask-2.jpg?alt=media&#x26;token=290b2721-1ecb-4933-ba6f-b964fc4e29f6" alt=""><figcaption></figcaption></figure>

Head over to Rupto[ **Faucet**](https://faucet.ignitescan.com/) and request test RPT - you will need this pay for gas on **Rupto Chain**

Now, let's Deploy the Smart Contract on **Rupto Chain**:

* Select Injected Web3 in the Environment dropdown and your contract

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FlQNQH5cRb6pPYxqIJxdX%2Fmetamask-3.jpg?alt=media&#x26;token=4cb802e0-4675-416a-8cae-8ba5d6ace787" alt=""><figcaption></figcaption></figure>

* Accept the Connection Request

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FXilAI5gP63qQyWjuAkBV%2F5%20(2).PNG?alt=media&#x26;token=4331d907-ddfd-4f72-beb3-38d7c171b12b" alt=""><figcaption></figcaption></figure>

Once **Metamask** is connected to Remix, the ‘Deploy’ transaction would generate another **Metamask** popup that requires transaction confirmation.

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2Fpj9Q2V6hv5Pqdnf1DY8L%2Fmetamask-5.jpg?alt=media&#x26;token=c720ccbc-7660-435a-b9b4-60e1cb2e852b" alt=""><figcaption></figcaption></figure>

**Congratulations!** You have successfully deployed **HelloRupto** Smart Contract. Now you can interact with the Smart Contract.&#x20;

Check the deployment status here: [.](https://test.ignitescan.com/)[https://testnet.rbcscan.com](https://testnet.rbcscan.com)

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FeIpmtEJLR7BgdMqW2Tzx%2Fmetamask-7.jpg?alt=media&#x26;token=8002e542-61ce-4455-a7bc-b7c48840e58f" alt=""><figcaption></figcaption></figure>

### **Verifying your Contracts on RuptoScan**

The first and foremost step is to flatten the solidity contract into a single file.

#### **Flatten your solidity contract** <a href="#flatten-your-solidity-contract" id="flatten-your-solidity-contract"></a>

* Install [truffle-flattener](https://github.com/nomiclabs/truffle-flattener) or [sol-merger](https://github.com/RyuuGan/sol-merger)
* Flatten using command

`sol-merger \"./contracts/*.sol\" ./build`

#### **Verifying Contract on Ruptoscan** <a href="#verifying-on-polygonscan" id="verifying-on-polygonscan"></a>

* Navigate to your contract's Rupto**scan** page and then click verify and publish

<figure><img src="https://3965199344-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FanSVxxujHpBss1qyH41O%2Fuploads%2FLyEuoaGF7t7DB67xQoNq%2Fmetamask-4.jpg?alt=media&#x26;token=ab9d131d-1275-4584-bf69-961e9559010c" alt=""><figcaption></figcaption></figure>

* Select `Solidity (Single File)` in compiler type
* Select appropriate compiler version
* Choose the license type of your contract

Onto the next section, paste your flattened contract here.

If you had enabled optimization then adjust the `optimization` section accordingly.

Constructor arguments should have been filled in automatically, if not, they can be retrieved from the trailing bytes of the deployment transaction, they resemble something like `0000000000000000076172d1a6fa476172d1fb5f76172d178d61b04b0ecd319c`

If you have followed the process successfully, the contract would be verified.&#x20;
