# Using Remix

<figure><img src="https://2372007595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Tecsoe4KNURIiIXeVdO%2Fuploads%2FPXiJgrsutNmi30mDl8oZ%2FUsing-Remix.jpg?alt=media&#x26;token=3d65fde2-c2cf-4a0c-ac7e-9c0733526087" alt=""><figcaption></figcaption></figure>

## Overview

This tutorial will show you how to compile and deploy an existing smart contract using Remix.

Remix IDE is a no-setup smart contract development tool with a GUI. Beginners and experts alike will benefit from Remix. Remix plays well with other tools, and allows for a simple deployment process to the chain of your choice. The Remix Project also can serve as a learning lab for teaching and experimenting with EVM-compatible chains.

## Pre-requisites <a href="#pre-requisites" id="pre-requisites"></a>

* Install Metamask
* Configure KuCoin Community Chain Testnet on Metamask
* Get Testnet token

## What you will do

* Create a file on Remix
* Upload or code the smart contract to the IDE
* Compile the smart contract
* Connect the application to KCC Testnet via Metamask
* Deploy the smart contract

## Getting started with [Remix IDE](https://remix.ethereum.org/)

To start building a smart contract, click on **New File** and name it as `HelloWorld.sol`.

<figure><img src="https://2372007595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Tecsoe4KNURIiIXeVdO%2Fuploads%2FgOrtNiqrjgtNmRo44pv5%2Fimage.png?alt=media&#x26;token=00651abf-235e-4083-8a53-5b891d085ad9" alt=""><figcaption></figcaption></figure>

## Writing smart contract

Copy the code given below to `HelloWorld.sol` file

```solidity
// SPDX-License-Identifier: MIT
// Specifies that the source code is for a version
// of Solidity greater than 0.8.15
pragma solidity ^0.8.15;

contract HelloWorld {

    // A publicly accessible function that takes a string as a parameter
    // and echoes the `message`
    function echo(string memory message) public pure returns (string memory) {
        return message;
    }
}
```

The first line, `pragma solidity ^0.8.15` specifies that the source code is for a Solidity version greater than 0.8.15. [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

* Switch to the **Compiler** tab
* Select compiler version **0.8.15**
* Now, compile `HelloWorld.sol`
* After successful compilation, it will show a green tick mark on the **Compiler** tab button

<figure><img src="https://2372007595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Tecsoe4KNURIiIXeVdO%2Fuploads%2F5LR2LHxPvOngkpbtVL8r%2Fimage.png?alt=media&#x26;token=1455a62c-52dc-418b-8a30-8b05c0dcc308" alt=""><figcaption></figcaption></figure>

## Configure KCC Testnet on Metamask

{% content-ref url="../../individuals/network-configuration" %}
[network-configuration](https://docs.kcc.io/individuals/network-configuration)
{% endcontent-ref %}

## Deploy Smart Contract to KCC Testnet

In both Testnet and Mainnet, you do the below to deploy your smart contract using Remix.

* Navigate to the **Deployment tab**
* Select **Injected Provider** Metamask in the **Environment** dropdown, and your contract

![](https://2372007595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Tecsoe4KNURIiIXeVdO%2Fuploads%2F3o7yUr7iBgNwcc2buOhx%2Fimage.png?alt=media\&token=a18bbf42-f466-4ccc-97de-45dbb3c7749f)

<figure><img src="https://2372007595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Tecsoe4KNURIiIXeVdO%2Fuploads%2FnCMs8MjjQDy9sisLGKQy%2Fimage.png?alt=media&#x26;token=d6515725-026c-44dc-a674-7dd3fde11699" alt=""><figcaption></figcaption></figure>

* Accept the Connect request received in MetaMask. You can also manually launch MetaMask if the popup doesn't open by default
* In MetaMask, once a transaction is deployed, you will receive another MetaMask pop-up that requires you to confirm the transaction. You just need to confirm the transaction

<figure><img src="https://2372007595-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Tecsoe4KNURIiIXeVdO%2Fuploads%2FouTH8tpdWDV3XgWzZ9TY%2Fimage.png?alt=media&#x26;token=17da646f-c34c-4c26-a605-8906fbe0a9a9" alt=""><figcaption></figcaption></figure>

**Congratulations! You have successfully deployed the** [`HelloWorld`](https://scan-testnet.kcc.network/tx/0xfac405bc36a1e4230b5e6e7616877e48c81ee8d73b95a6d54d8aa7c9aa80b90f) **Smart Contract** to the **KuCoin Community Chain Testnet**. You can start interacting with your Smart Contract. Check the deployment status at <https://scan-testnet.kcc.network/>
