---
eip: 7512
label: ERC-7512
title: Onchain Representation for Audits
status: Draft
type: Standards Track
category: ERC
created: 2023-09-05
requires: 712
official: https://eips.ethereum.org/EIPS/eip-7512
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7512.md
canonical: https://eips.huatuo.xyz/ko/eip-7512/
lang: ko
tldr: 감사자가 감사의 EIP-712 요약에 서명하는 초안 형식. 컨트랙트가 특정 배포가 신뢰할 만한 주체에게 감사받았는지, 그리고 어떤 ERC를 구현하는지 온체인에서 확인할 수 있게 한다.
tags: [audit, security, eip-712, signatures]
---

# ERC-7512: Onchain Representation for Audits

> Proposal to define a contract parseable representation of Audit reports.

**TL;DR:** 감사자가 감사의 EIP-712 요약에 서명하는 초안 형식. 컨트랙트가 특정 배포가 신뢰할 만한 주체에게 감사받았는지, 그리고 어떤 ERC를 구현하는지 온체인에서 확인할 수 있게 한다.

## 어떤 문제를 해결하나요?

오늘날 감사 보고서는 웹사이트에 올라온 PDF입니다. 새 토큰을 등록하는 브리지나 모듈을 설치하는 스마트 계정처럼 감사받은 코드만 받아들이고 싶은 컨트랙트는, 특정 배포가 검토되었는지, 누가 했는지, 어떤 표준을 기준으로 했는지 기계가 읽을 수 있는 방식으로 확인할 방법이 없습니다.

ERC-7512는 컨트랙트가 검증할 수 있는 간결하고 서명된 **감사 요약(audit summary)**을 정의합니다. 예를 들어 브리지 운영자는 신뢰하는 감사자 키 목록을 두고, 그 키 중 하나가 정확히 그 컨트랙트 주소와 체인에 대해 서명한 요약을 제출하는 누구에게든 토큰을 등록하게 할 수 있습니다.

## 어떻게 동작하나요?

요약은 타입이 지정된 구조체입니다.

- **Auditor**: `name`, `uri`, `authors` 목록.
- **Contract**: `chainId`([EIP-155](/eip-155/) 체인 ID를 `bytes32`로 표현)와 `deployment` 주소. 요약 하나는 컨트랙트 인스턴스 하나를 다룹니다.
- **AuditSummary**: 감사자, `issuedAt`, `ercs`(컨트랙트가 완전히 구현한 ERC 번호 목록이며 비어 있을 수 있음), 감사 대상 컨트랙트, `auditHash`(원본 보고서의 해시), `auditUri`.

감사자는 [EIP-712](/eip-712/) 타입 데이터로 `AuditSummary`에 서명하고, 그 결과를 `signedAt`과 `Signature { type, data }`를 가진 `SignedAuditSummary`로 첨부합니다. 지원되는 서명 타입은 `SECP256K1`, `SECP256R1`, `ERC1271`(스마트 컨트랙트 서명자, [ERC-1271](/eip-1271/) 참고), `BLS`(인코딩은 아직 미정)입니다.

발견 사항과 심각도는 의도적으로 포함하지 않습니다. 요약은 "이 인스턴스는 감사받았다"와 "이 ERC들을 구현한다"만 말합니다.

## 샘플 코드

ethers v6로 요약에 서명하기(타입은 명세의 구조체를 따름):

```ts
import { Wallet, keccak256, toUtf8Bytes, zeroPadValue, toBeHex } from "ethers";

const domain = { name: "ERC-7652: Onchain Audit Representation", version: "1.0" }; // as written in the spec
const types = {
  Auditor: [{ name: "name", type: "string" }, { name: "uri", type: "string" }, { name: "authors", type: "string[]" }],
  Contract: [{ name: "chainId", type: "bytes32" }, { name: "deployment", type: "address" }],
  AuditSummary: [
    { name: "auditor", type: "Auditor" },
    { name: "issuedAt", type: "uint256" },
    { name: "ercs", type: "uint256[]" },
    { name: "auditedContract", type: "Contract" },
    { name: "auditHash", type: "bytes32" },
    { name: "auditUri", type: "string" },
  ],
};

const summary = {
  auditor: { name: "Example Audits", uri: "https://example.com", authors: ["Alice"] },
  issuedAt: 1700000000,
  ercs: [20],
  auditedContract: { chainId: zeroPadValue(toBeHex(1), 32), deployment: tokenAddress },
  auditHash: keccak256(toUtf8Bytes(reportPdfContents)),
  auditUri: "https://example.com/reports/token.pdf",
};

const sig = await auditorWallet.signTypedData(domain, types, summary);
```

## 알아둘 점

- 상태는 **Draft**이며 레퍼런스 구현은 TBD로 표시되어 있습니다.
- 제안은 ERC-7512인데도 명세 본문의 도메인 이름은 "ERC-7652"로 되어 있습니다. 구현은 최종 명세가 확정하는 내용을 따라야 합니다.
- 서명된 요약은 보안에 대한 보증이 **아닙니다**. 명세는 연동하는 쪽이 감사자와 감사 범위를 직접 판단해야 한다고 말합니다.
- 모든 것은 감사자의 키 관리에 달려 있습니다. 감사자 키의 표준 레지스트리나 폐기 메커니즘은 아직 없으며, 감사자가 직접 키를 공개하리라 기대됩니다.
- 프록시와 업그레이드 가능한 컨트랙트는 다루지 않습니다. 요약은 주소에 묶이며, 그 뒤의 코드에 묶이지 않습니다.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7512
