# Sample Contracts

아래는 string을 저장해서 view 함수로 값을 확인 할 수 있는 간단한 예제입니다.

```solidity
//SPDX-License-Identifier: MIT

pragma solidity 0.8.0;

contract HelloWorld {
    string private word;

    constructor (string memory _word) {
        word = _word;
    }

    function setWord(string memory _word) external returns (bool) {
        word = _word;
        return true;
    }

    function hello() public view returns (string memory) {
        return word;
    }
}
```

Remix IDE를 활용해 간단하게 컨트랙트 배포가 가능합니다.

* Testnet 배포에 필요한 가스는 아래 링크에서 확보 할 수 있습니다.
  * <https://testnet.meversescan.io/faucet>
* 생성자 파라미터에 원하는 문구를 넣어 컨트랙트를 배포합니다.
* IDE에서 hello를 호출하면 입력한 문구를 확인할 수 있습니다.
* setWord함수를 호출하여 입력된 문구를 갱신할 수 있습니다.


---

# 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/sample-contracts.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.
