#[event] macro.
Event Structure
Events are emitted using Anchor’semit! macro and written to transaction logs. They can be parsed by indexers like Helius, QuickNode, or custom RPC listeners.
Location: lib.rs:532-573
ProtocolInitialized
Emitted once when the protocol is first initialized. Location:lib.rs:532-536
Emitted by: initialize_protocol (line 30)
Fields
Pubkey
required
The protocol admin wallet address that initialized the protocol.
u16
required
The protocol fee rate in basis points (e.g., 250 = 2.5%).
Code Reference
Example Usage
Indexers can track protocol deployment and fee configuration:NullResultSubmitted
Emitted when a new Null Knowledge Asset (NKA) is submitted. Location:lib.rs:538-542
Emitted by: submit_null_result (line 65)
Fields
u64
required
The sequential ID assigned to this NKA (e.g., 1, 2, 3…). Displayed as
NKA-{specimen_number:04} in the UI.Pubkey
required
The wallet address of the researcher who submitted the NKA.
Code Reference
Example Usage
Track new NKA submissions in real-time:BountyCreated
Emitted when a new bounty is created and USDC is escrowed. Location:lib.rs:544-550
Emitted by: create_bounty (line 114)
Fields
u64
required
The sequential ID assigned to this bounty (e.g., 1, 2, 3…). Displayed as
NB-{bounty_number:04} in the UI.Pubkey
required
The wallet address of the bounty creator.
u64
required
The USDC reward amount in base units (6 decimals). Divide by 1,000,000 to get human-readable USDC.Example:
2500000 = 2.5 USDCi64
required
Unix timestamp deadline for submissions.
Code Reference
Example Usage
Monitor new bounties and their rewards:BountySubmissionCreated
Emitted when a researcher submits their NKA to a bounty. Location:lib.rs:552-557
Emitted by: submit_to_bounty (line 147)
Fields
u64
required
The sequential ID of the bounty receiving the submission.
u64
required
The sequential ID of the NKA being submitted.
Pubkey
required
The wallet address of the researcher submitting the NKA.
Code Reference
Example Usage
Track bounty-NKA matching:BountyFulfilled
Emitted when a bounty creator approves a submission and payouts are executed. Location:lib.rs:559-566
Emitted by: approve_bounty_submission (line 221)
Fields
u64
required
The sequential ID of the bounty being fulfilled.
u64
required
The sequential ID of the NKA that won the bounty.
Pubkey
required
The wallet address of the researcher receiving the payout.
u64
required
The USDC amount paid to the researcher in base units (6 decimals). Equals
reward_amount - fee.Example: 97500000 = 97.5 USDCu64
required
The USDC protocol fee paid to the treasury in base units (6 decimals).Example:
2500000 = 2.5 USDC (2.5% of 100 USDC)Code Reference
Example Usage
Monitor payouts and fee collection:BountyClosed
Emitted when a bounty creator closes a bounty and reclaims escrowed USDC. Location:lib.rs:568-573
Emitted by: close_bounty (line 267)
Fields
u64
required
The sequential ID of the bounty being closed.
Pubkey
required
The wallet address of the bounty creator receiving the refund.
u64
required
The USDC amount refunded to the creator in base units (6 decimals). Equals the vault’s balance at closure time.Example:
100000000 = 100 USDCCode Reference
Example Usage
Track bounty closures and refunds:Event Summary Table
Indexing Events
All events can be indexed using Anchor’s event listener:- Helius or QuickNode webhooks for real-time event streams
- The Graph protocol for decentralized indexing
- Custom RPC polling with
getProgramAccounts+ transaction parsing