Contract Inspection
Fetch source code, ABIs, and verify smart contracts
Inspect and verify smart contracts deployed to a BuildBear sandbox. Fetch verified source code, retrieve ABIs, or submit contracts for verification.
contract source
Get the verified source code for a contract deployed in a sandbox.
Arguments:
| Argument | Required | Description |
|---|---|---|
rpcUrl | Yes | BuildBear RPC URL |
Options:
| Flag | Type | Required | Description |
|---|---|---|---|
--address <contractAddress> | string | Yes | Contract address |
--json | flag | No | Output as JSON |
--quiet | flag | No | Suppress output except errors |
Example:
Returns the verified Solidity source code for the contract, including imports and compiler settings if available.
contract abi
Get the ABI for a contract deployed in a sandbox.
Arguments:
| Argument | Required | Description |
|---|---|---|
rpcUrl | Yes | BuildBear RPC URL |
Options:
| Flag | Type | Required | Description |
|---|---|---|---|
--address <contractAddress> | string | Yes | Contract address |
--json | flag | No | Output as JSON |
--quiet | flag | No | Suppress output except errors |
Example:
Example — pipe ABI into another tool:
contract verify
Verify a smart contract on a BuildBear sandbox. This acts as a passthrough to the BuildBear verification endpoint, making it compatible with Foundry and Hardhat verify plugins.
Arguments:
| Argument | Required | Description |
|---|---|---|
rpcUrl | Yes | BuildBear RPC URL |
Options:
| Flag | Type | Default | Required | Description |
|---|---|---|---|---|
--address <contractAddress> | string | — | Yes | Contract address to verify |
--type <type> | string | etherscan | No | Verification type: etherscan or sourcify |
--json | flag | — | No | Output as JSON |
--quiet | flag | — | No | Suppress output except errors |
Example — Etherscan-style verification:
Example — Sourcify verification:
Verification endpoints
The CLI submits verification requests to:
| Type | Endpoint |
|---|---|
etherscan | https://rpc.buildbear.io/verify/etherscan/<sandbox-id> |
sourcify | https://rpc.buildbear.io/verify/sourcify/server/<sandbox-id> |
These endpoints are compatible with Foundry's forge verify-contract --verifier flag and Hardhat's hardhat-etherscan plugin. Point your tool's verifier URL at the appropriate endpoint for your sandbox.