Documentation

Contracts Verification API

Verify your smart contracts and fetch verified contract artifacts via BuildBear’s unified verification endpoints.

Supported Verification Types

Foundry

  • Etherscan
  • Sourcify

Hardhat

  • Etherscan
  • Sourcify

Note: All the verification are cross compatible. Contract(s) verified using Etherscan can also be fetched from Sourcify endpoint and vice versa. And the endpoints also support external verified contracts from mainnet.


Etherscan Verification (Foundry/Hardhat)

POST
https://rpc.buildbear.io/verify/etherscan/{sandboxId}
segments
sandboxId(string)
RequiredThe ID of the sandbox you're verifying for.

Request Example

  • The verification endpoint follows this format, which your contract verification request should be sent to:
  https://rpc.buildbear.io/verify/etherscan/eventual-rictor-5d49da19

Sourcify Verification (Foundry/Hardhat)

POST
https://rpc.buildbear.io/verify/sourcify/server/{sandboxId}
segments
sandboxId(string)
RequiredThe ID of the sandbox you're verifying for.

Request Example

  • The verification endpoint follows this format, which your contract verification request should be sent to:
https://rpc.buildbear.io/verify/sourcify/server/eventual-rictor-5d49da19 

Fetch Contract Artifacts (Etherscan)

GET
https://api.buildbear.io/v1/explorer/{sandboxId}?module=contract&action=getsourcecode&address={address}
segments
sandboxId(string)
RequiredThe ID of the sandbox.
address(string)
RequiredContract address whose artifacts are being fetched.

Request Example

curl https://api.buildbear.io/v1/explorer/eventual-rictor-5d49da19?module=contract&action=getsourcecode&address=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

Fetch Contract Artifacts (Sourcify)

GET
https://api.buildbear.io/v1/sourcify/{sandboxId}/files/any/{chain}/{address}
segments
sandboxId(string)
RequiredThe ID of the sandbox.
chain(string)
RequiredThe chain ID of the contract.
address(string)
RequiredContract address whose artifacts are being fetched.

Request Example

curl https://api.buildbear.io/v1/sourcify/eventual-rictor-5d49da19/files/any/1/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48