Skip to content

Contract architecture

Every Solidity source file, its kind, and how modules depend on each other.

BugCrawl's on-chain side is 47 Solidity source files compiled with solc 0.8.30, optimizer on (200 runs), EVM target cancun. Every module inherits ModuleBase, which checks roles against one AccessHub and pause flags against one PauseGuard. Dependencies are passed to constructors and stored as immutables, so there are no proxies, no upgrade hooks and no cycles.

Roles

DEFAULT_ADMINGrants roles, unpauses, edits parameters. Two-step transfer with a delay; intended to end up with AdminTimelock.
REGISTRARAdds directory entries, records deployment manifests, publishes versions.
CURATORNetworks, providers, auditors, revocations, appeals, triage.
VERIFIERThe off-chain service account that reports explorer results through VerificationCoordinator.
PAUSERCan pause one module or everything. Cannot unpause.
module rolesRECORD_WRITER, EVIDENCE_WRITER, REQUEST_OPERATOR, REPUTATION_WRITER: held by contracts, not people.

Source files

access

AccessHubdeployable (core)Single role registry for every BugCrawl module.
AdminTimelockdeployable (separate script)Delays privileged changes so the community can see them coming. Intended to become the AccessHub default admin once the deployment is stable.
BugCrawlRoleslibraryCanonical role identifiers. Kept in one place so modules, scripts and the web app agree.
ModuleBaseabstractCommon plumbing for BugCrawl modules: role checks against AccessHub and pause checks against PauseGuard.
PauseGuarddeployable (core)Emergency pause controller. Pausers can stop one module or the whole protocol quickly; only the admin can resume, so a compromised pauser cannot flip modules back on.

core

BugCrawlCoredeployable (core)The "nest": an address book mapping module names to their live deployments, so clients only need one address to discover the whole system.
ContractDirectorydeployable (core)The catalogue ("trail index") of contracts BugCrawl tracks, across any supported EVM chain.
ContractMetadataRegistrydeployable (core)Public links and descriptive fields for directory entries (website, repository, docs, ...).
ContractRelationshipRegistrydeployable (core)Directed links between directory entries ("trails"), e.g. proxy -> implementation, module -> dependency, factory -> child.
DeploymentRegistrydeployable (core)Anchors the hash of each BugCrawl deployment manifest on-chain, so the JSON manifest published in the repository can be checked against what the registrar recorded.
NetworkRegistrydeployable (core)Networks whose contracts BugCrawl catalogues, with their explorer base URLs.
VersionRegistrydeployable (core)Protocol release history with strictly increasing semantic versions.

verification

AttestationRegistrydeployable (core)Security-review attestations signed (by transaction) by curator-approved auditors.
VerificationAppealsdeployable (core)Entry controllers can contest a Failed or Revoked result. A curator either upholds the appeal (which opens a fresh verification request) or rejects it with a public note.
VerificationCoordinatordeployable (core)The single door through which the off-chain verification service reports explorer results. One call appends the record, attaches its evidence and closes the open request.
VerificationEvidenceStoredeployable (core)Content digests and locations of the evidence behind each verification record (standard-JSON input, explorer response, compiler output).
VerificationExpiryManagerdeployable (core)Decides whether a positive verification is still "fresh". Upgradeable proxies can change implementation after a check, so results age out and must be re-checked.
VerificationRecordStoredeployable (core)Append-only history of source-verification results per directory entry.
VerificationRequestManagerdeployable (core)Queue asking the verification service to (re)check a directory entry against its explorer.
VerificationRevocationManagerdeployable (core)Lets curators withdraw a positive verification with a public reason, e.g. when a proxy is upgraded to unverified code or the explorer later reports a mismatch.

ecosystem

AuditorDirectorydeployable (core)Security reviewers that curators have approved to publish attestations.
BugBountyRegistrydeployable (full)Listing of bug-bounty programmes run by projects: scope, terms and declared reward ceiling.
BugReportRegistrydeployable (full)Public, non-sensitive bug reports against directory entries and their triage outcome.
ContributorRegistrydeployable (full)Public list of addresses that work on a project ("colony members"), each with a role tag.
ProjectRegistrydeployable (core)Self-service projects ("colonies") that group related contracts under one owner.
ReputationRegistrydeployable (core)Non-transferable activity points earned by auditors and bug reporters (e.g. +severity when a reported bug is confirmed fixed).
SecurityDisclosureRegistrydeployable (full)Projects publish how to report vulnerabilities; researchers timestamp private reports with a commitment and reveal them after the project ships a fix.

periphery

BugCrawlLensdeployable (core)Read-only aggregator for the web app: one call returns an entry together with its latest source-verification result, freshness, open request and active attestation count.
ConfigurationRegistrydeployable (core)Typed protocol parameters (e.g. "verification.maxAge") with optional bounds that the admin sets once per key, so a later value cannot leave its sane range.
IntegrationRegistrydeployable (core)External services BugCrawl relies on, chiefly verification providers (e.g. a Blockscout instance). Every on-chain verification record cites a provider id from here.

interfaces

IAccessHubinterfaceRead interface for the central role registry every BugCrawl module consults.
IAuditorDirectoryinterfaceRead interface for curator-approved security reviewers.
IConfigurationRegistryinterfaceRead interface for typed protocol parameters.
IContractDirectoryinterfaceRead interface for the catalogue of contracts known to BugCrawl.
IEvidenceStoreinterfaceWrite interface for verification evidence references.
IIntegrationRegistryinterfaceRead interface for registered verification providers / integrations.
INetworkRegistryinterfaceRead interface for supported networks.
IPauseGuardinterfaceRead interface for the emergency pause controller.
IProjectRegistryinterfaceRead interface for projects that group related contracts.
IReputationRegistryinterfaceWrite interface used by modules that award or deduct activity-based reputation points.
IVerificationRecordStoreinterfaceAppend-only history of source-verification results.
IVerificationRequestManagerinterfaceQueue of reconciliation requests for directory entries.

libraries

AddressCheckslibrarySmall validation helpers shared by modules that accept addresses and strings.
BugCrawlTypestypesShared enums and structs used across BugCrawl modules.
EvidenceHashLiblibraryDeterministic digests for off-chain evidence so anyone can recompute and compare them.
PaginationLiblibraryBounds arithmetic for paginated view functions so they never revert on out-of-range pages.
VerificationStatusLiblibraryState machine for source-verification statuses.

See the live picture on the ecosystem page.