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

# 스마트 컨트랙트 가이드

> DATA Foundation 위에서 직접 빌드하려는 스마트 컨트랙트 개발자를 위한 가이드입니다.

이 섹션에서는 프로토콜 컨트랙트를 간단히 소개한 다음, 프로토콜 위에서 빌드를 시작하는 방법을 안내합니다. 아직 전체 아키텍처에 익숙하지 않다면, 먼저 [아키텍처 개요](/concepts/overview) 섹션을 살펴보길 권장합니다.

## 스마트 컨트랙트 튜토리얼

<Card title="완성된 코드" href="https://github.com/thedatafoundation/story-protocol-boilerplate" icon="thumbs-up">
  튜토리얼을 건너뛰고 완성된 코드를 확인하세요. README의 지침에 따라 테스트를 실행하거나,
  `/test` 폴더로 이동해 모든 예제 컨트랙트를 살펴보세요.
</Card>

**처음부터 직접 설정하고 싶다면**, [자체 프로젝트 설정하기](/developers/smart-contracts-guide/setup) 단계부터 다음 튜토리얼을 계속 따라가세요.

## 우리의 스마트 컨트랙트

현재 버전 기준으로, Proof-of-Creativity 프로토콜은 모든 EVM 체인과 호환되며 Solidity로 작성된 스마트 컨트랙트 묶음으로 구성되어 있습니다. 개발자로서 상호작용할 수 있는 두 개의 저장소가 있습니다:

* [DATA Foundation Core](https://github.com/thedatafoundation/protocol-core-v1) - 이 저장소에는 핵심 프로토콜 로직이 포함되어 있습니다. 얇은 IP 레지스트리(IP Asset Registry), [라이선싱](/concepts/licensing-module/overview) 및 메타데이터 관련 로직을 정의하는 모듈 집합, 그리고 모듈 및 사용자 접근 제어를 관리하는 모듈 매니저로 구성됩니다.
* [DATA Foundation Periphery](https://github.com/thedatafoundation/protocol-periphery-v1) - 코어 컨트랙트가 기반 프로토콜 로직을 다루는 반면, 페리페리 컨트랙트는 UX를 크게 향상시키고 IPA 관리를 단순화하는 프로토콜 확장 기능을 다룹니다. 대부분은 [SPG](/concepts/spg/overview)를 통해 처리됩니다.

## DATA Foundation에 컨트랙트 배포 및 검증하기

<Note>
  컨트랙트 배포 및 검증 방법은 [Blockscout 공식
  문서](https://docs.blockscout.com/developer-support/verifying-a-smart-contract/foundry-verification)에서 가져왔습니다.
</Note>

배포 직후 Blockscout으로 컨트랙트를 검증합니다 (Blockscout 홈페이지 익스플로러 URL 끝에 "/api/"를 추가하세요):

```shell theme={null}
forge create \
  --rpc-url <rpc_https_endpoint> \
  --private-key $PRIVATE_KEY \
  <contract_file>:<contract_name> \
  --verify \
  --verifier blockscout \
  --verifier-url <blockscout_homepage_explorer_url>/api/
```

Foundry 스크립트를 사용하는 경우:

```shell theme={null}
forge script <script_file> \
  --rpc-url <rpc_https_endpoint> \
  --private-key $PRIVATE_KEY \
  --broadcast \
  --verify \
  --verifier blockscout \
  --verifier-url <blockscout_homepage_explorer_url>/api/
```

<Warning>
  의사 난수 생성을 위해 RANDAO를 사용하지 마세요. 대신 온체인 VRF (Pyth 또는 Gelato)를 사용하세요. 현재 RANDAO 값은 부모 블록 해시로 설정되어 있어, X-1 블록에 대해서는 무작위가 아닙니다.
</Warning>
