const LabelProven, LabelNotReproduced, LabelStaticWarning
Labels, exactly as the prover writes them.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package bouncer is Bouncer's on-chain registry: scan requests, attestations, disputes and author replies, plus the re...
Package bouncer is Bouncer's on-chain registry: scan requests, attestations, disputes and author replies, plus the reads other realms use (Check, Score) and the Tavern pages in Render.
One realm holds all state and every write, and every logic-data type is declared here (security guide §3A). Writes are crossing functions that check cur.IsCurrent() and take the caller from cur.Previous(). Reads are plain functions that return values or copies, never pointers into state, and never take callbacks.
Labels, exactly as the prover writes them.
Severities.
Verdicts.
1const Disclaimer = "A high score means Bouncer found no issues with its current rules. It is not a guarantee of safety."Disclaimer is shown on every Passport.
AddAttester allows addr to post attestations.
1func Attest(cur realm, pkgpath, sourceHash, scannerVersion, rulesetHash, toolchain, reportHash, reportURI, findings string, directAtRisk, indirectAtRisk, unverified int) uint64Attest records a scan result for pkgpath. Attesters only. findings is a ";"-separated list of "RULE,severity,LABEL,file,line" entries ("" for none). Score, grade and verdict are computed here from the findings and dependency counts.
ByAuthor returns the attested packages in addr's namespace, sorted.
CancelRequest withdraws the caller's open request.
Check reports whether the latest attestation of pkgpath satisfies p. An unattested package never passes.
CloseRequest lets an attester close a request it cannot serve, such as a package that does not exist.
Dispute files a challenge against the latest attestation of pkgpath, backed by a report with a different hash. One open dispute per filer per package.
IsAttester reports whether addr may post attestations.
RemoveAttester revokes addr. Its past attestations stay on record.
Reply lets the author of an address-namespace package answer its Passport and, optionally, name the fixed version (successor) in the same namespace.
RequestScan asks the scanner bot to scan pkgpath. Each address may have one open request at a time.
ResolveDispute closes a dispute with a resolution note. Admin or an attester.
Score returns the latest score for pkgpath.
ScoreFor exposes the formula, so anyone can check an attestation or score a report before attesting it.
TransferAdmin hands the admin role to next.
History returns every attestation for pkgpath, oldest first.
Latest returns the newest attestation for pkgpath.
Replies returns the author's replies on pkgpath, oldest first.
DisputesFor returns copies of every dispute on pkgpath, oldest first.
Custom starts a policy at minScore that is otherwise as strict as the zero value; loosen it with the With methods:
1bouncer.Custom(60).WithProvenOther().WithOpenDisputes()
Other realms must build policies this way: the VM refuses to allocate a Bouncer type in a foreign realm, so a bouncer.Policy{...} literal written in another realm panics.
Standard: score 75 or more and no PROVEN Critical.
Strict: score 90 or more, no PROVEN findings, every dependency verified, no open disputes.
GetRequest returns a copy of request id.
OpenRequests returns up to limit open requests, oldest first, for the scanner bot.
1type Attestation struct {
2 ID uint64
3 PkgPath string
4 SourceHash string // sha256 of the scanned source, hex
5 ScannerVersion string
6 RulesetHash string // hex
7 Toolchain string // gno version the exploits ran on
8 ReportHash string // sha256 of the full JSON report, hex
9 ReportURI string // where the full report lives (ipfs:// or https://)
10 Findings []Finding
11 Deps Deps
12 Score int
13 Grade string
14 Verdict string
15 Attester address
16 Height int64
17 Time int64 // unix seconds, block time
18}Attestation is a scan result posted by an attester.
AuthorReply is an author's response to a Passport.
Deps counts dependency trust for an attestation.
DisputeRecord is a challenge to an attestation, backed by a different report.
Finding is one attested finding.
1type Policy struct {
2 MinScore int
3 // AllowProvenCritical and AllowProvenOther permit PROVEN findings of
4 // critical, or of high and medium, severity.
5 AllowProvenCritical bool
6 AllowProvenOther bool
7 // RequireVerifiedDeps forbids at-risk and unverified dependencies.
8 RequireVerifiedDeps bool
9 AllowOpenDisputes bool
10}Policy is an integration policy for Check. The zero value is the most conservative: no PROVEN findings, no open disputes, any score.
WithOpenDisputes allows open disputes.
WithProvenCritical allows PROVEN critical findings.
WithProvenOther allows PROVEN high and medium findings.
WithVerifiedDeps requires every dependency to be verified.
Request is a scan request, as returned by reads.