본문으로 건너뛰기
이 페이지는 영문에서 기계 번역되었으므로 오역이나 어색한 표현이 있을 수 있습니다. 따라서 정확한 정보는 영어 원문을 참조하시기 바랍니다. 또한 잦은 업데이트로 인해 일부 콘텐츠는 영문이 그대로 남아있을 수 있습니다. Crowdin에서 이 페이지의 번역을 개선하는 데 동참하여 도움을 주세요. (Crowdin translation page, Contributing guide)

How to Verify Smart Contracts Using Sourcify

Sourcify is a Solidity (smart contracts) source code verification service for Ethereum and EVM-compatible chains like Kaia. One of its unique features is that it leverages the Solidity metadata file to "fully verify" the contracts.

In this guide, we'll take a look at how to verify a smart contract on Foundry using Sourcify.

Getting started

This guide expects that you have an idea of developing smart contracts with Foundry. See Deploy smart contract using Foundry to get started. Foundry provides native support for Sourcify verification—all you need to do is add a few flags to your forge command. To verify contracts with Sourcify using Foundry, see the steps below:

Deploy and verify a contract:


## deploy
forge create --rpc-url $KAIROS_RPC_URL --private-key $PRIVATE_KEY src/Counter.sol:Counter --broadcast


## verify an already deployed contract as seen above
forge verify-contract 0x2a31C3f597d8FD0Fbc5Ff02439ce6c6aEFb680a2 src/Counter.sol:Counter --chain-id 1001 --verifier sourcify --verifier-url https://sourcify.dev/server/

You can look up the verified contract here

Check if a contract is verified


forge verify-check 0x2a31C3f597d8FD0Fbc5Ff02439ce6c6aEFb680a2 --chain-id 1001 --verifier sourcify

페이지를 개선해 주세요