# Remix

Remix는 브라우저에서 솔리디티를 이용하여 스마트 컨트랙트를 개발하도록 도와주는 IDE입니다.

* <https://remix.ethereum.org/>

## 1. Layout

아래는 Remix IDE 레이아웃입니다.

* A : 사이드패널(B)에 표시할 플러그인을 선택할 수 있는 아이콘 패입니다.
* B : 플러그인이 표시 되는 패널입니다. 대부분의 플러그인에 대한 GUI가 측면 패널에 표시됩니다.
* C : 기본 패널이며, 컴파일할 파일을 편집할 수 있습니다.
* D : 터미널이 표시되며, 결과를 보거나 스크립트를 실행 할 수 있습니다.

<figure><img src="/files/X96bJCvLfDlqaxRHu0so" alt=""><figcaption><p>Remix Layoit</p></figcaption></figure>

## 2. 모듈 소개&#x20;

Remix IDE를 처음 열때 기본 모듈은 File Explorer, Plugin Manager 및 Editor입니다.

### File Explorer

File Explorer 아이콘은 아이콘 패널의 맨 위에 있습니다.

<figure><img src="/files/jqH2vwPw7lPYpFiID27T" alt=""><figcaption><p>File Explorer</p></figcaption></figure>

### Plugin Manager <a href="#plugin-manager" id="plugin-manager"></a>

Remix IDE는 플러그인을 기반으로 실행됩니다. 다양한 기능을 사용하려면 플러그인 관리자에서 모듈을 활성화해야 합니다. 아이콘 패널의 기본 모듈은 파일 탐색기, 컴파일, 배포 및 실행입니다.

<figure><img src="/files/24P0RSWrno8N5vHIYdVj" alt=""><figcaption><p>Plugin Manager</p></figcaption></figure>

### Code Editor <a href="#code-editor" id="code-editor"></a>

기본 패널의 코드 편집기에서 코드를 작성하고 편집할 수 있습니다. 기존 코드를 변경할 경우 다시 컴파일해야 합니다.

<figure><img src="/files/FkWCEzBe4OEddR35oH9r" alt=""><figcaption><p>Code Editor</p></figcaption></figure>

contracts 디렉토리에 Code Editor로 MEVerseGreeter.sol을 생성합니다.&#x20;

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.6;
contract Mortal {
    /* 주소 타입의 소유자(owner) 변수 정의 */
    address payable owner;
    /* 이 함수는 초기화 시점에 실행되어 컨트랙트 소유자를 설정합니다 */
    constructor () public { owner = msg.sender; }
    /* 컨트랙트에서 자금을 회수하는 함수 */
    function kill() public payable { if (msg.sender == owner) selfdestruct(owner); }
}

contract MEVerseGreeter is Mortal {
    /* 문자열 타입의 변수 greeting 정의 */
    string greeting;
    /* 이 함수는 컨트랙트가 실행될 때 작동합니다 */
    constructor (string memory _greeting) public {
        greeting = _greeting;
    }
    /* 주(Main) 함수 */
    function greet() public view returns (string memory) {
        return greeting;
    }
}
```

### Terminal <a href="#terminal" id="terminal"></a>

터미널에서 컴파일 결과, 오류, 배포 상태 및 트랜잭션 정보를 확인할 수 있습니다. 세부 정보를 보려면 선택한 아이콘을 클릭하십시오.

<figure><img src="/files/9QYdBU53LISgPkBdKpvv" alt=""><figcaption><p>Terminal</p></figcaption></figure>

## 3. Solidity Compiler

코드 작성을 마쳤으면 컴파일을 사용하여 오류 또는 경고를 확인합니다. 계약서를 작성한 후에야 배포할 수 있습니다.

<figure><img src="/files/OmQQrQjcaC330bEXO8vI" alt=""><figcaption><p>Solidity Compiler</p></figcaption></figure>

## 4. DEPLOY & RUN TRANSACTIONS

계약이 컴파일된 경우 아이콘 패널에서 이더리움 아이콘을 선택하여 배포합니다.

<figure><img src="/files/ruAxyl9ACDvUnBUwz1Kd" alt=""><figcaption><p>Deploy &#x26; Run</p></figcaption></figure>

* **ENVIRONMENT** : 개발 환경을 설정하는 부분으로 MEVerse 네트워크에 배포할 경우는 **Injected Provider - MetaMask**를 선택하여 MetaMask 지갑에 접속하여 진행합니다.
* **ACCOUNT** : 스마트 컨트랙트를 배포하는 계정 정보가 보여집니다.
* **CONTRACT** : 배포하고자 하는 컨트랙트를 선택합니다. 컴파일된 컨트랙트만 선택가능합니다.

<figure><img src="/files/w3MeBN7fTkl5tYyIGS6w" alt=""><figcaption><p>Remix - MetaMask</p></figcaption></figure>

<figure><img src="/files/FLSDCZJ5iBRJgEM2VWmX" alt=""><figcaption><p>Injected Provider - MetaMask 연동 화면</p></figcaption></figure>

### Deploy

Environment, Account, Contract를 확인한 다음 Deploy 버튼을 클릭하여 스마트 컨트랙트를 배포합니다. 메타 마스크에서 수수료에 대한 정보를 확인 한 다음 확인을 눌러 스마트 컨트랙트 배포를 완료합니다.

<figure><img src="/files/Cil4qM8haG1Yept97E22" alt=""><figcaption><p>MetaMask - 컨트랙트 배포 승인</p></figcaption></figure>

Transactions recorded와 Deployed Contract를 확인하여 정상적으로 배포 되었는지 확인이 가능합니다. greet라는 버튼을 클릭하여 스마트 컨트랙트 내의 greet함수를 호출하여 결과를 확인할 수 있습니다.

<figure><img src="/files/ozKacw2Aq3hNmiccJ9cg" alt=""><figcaption><p>배포된 컨트랙트 확인</p></figcaption></figure>

```shell
[block:28755068 txIndex:0]from: 0x193...449E7to: value: 0 weidata: 60806...00000logs: 0hash: 0x96a...d0065
status	                true Transaction mined and execution succeed
transaction hash	0xab577d01c5583bea3971eca8ae132713c5ad23157a318183fbfb45328066f4b9
from	                0x19368fCd2F0EE8d2C788b754F6504FD49de449E7
gas	                500000000 gas
transaction cost	223369 gas 
input	                60806...00000
decoded output	         - 
val	                0 wei
MetaMask Tx Signature: User denied transaction signature.. Execution failed at 0
```

<figure><img src="/files/TnIo4tkePgE6SPMAEObo" alt=""><figcaption><p>Testnet Scan(배포 트랜잭션 해시값으로 조회)</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://meversedex.gitbook.io/meverse-dev-docs/meverse-dev-docs-kr/undefined-1/ide-and-tools/remix.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
