Skip to main content

Grainlify Contracts — Event Schema & Indexer Guide

Last updated: 16 August 2026

Archived — describes a contract that does not exist

This page is in the archive: it documents a Soroban contract surface with no implementation in any Grainlify repository, verified 16 August 2026. Kept as a design record, not as a description of working software.

Overview​

All events across bounty-escrow, program-escrow, and grainlify-core follow the EVENT_VERSION_V2 envelope. Every event payload carries a version: u32 = 2 field so indexers can detect schema changes without decoding the full XDR body.

Topic Layout​

topics[0] — category Symbol (always present, e.g. "f_lock", "fee")
topics[1] — bounty_id: u64 (present where applicable)
data — typed event struct (always carries version: u32)

All topic strings use symbol_short! and are ≤ 9 bytes — enforced at compile time by the Soroban SDK.

Full Event Inventory​

bounty-escrow​

Topic[0]Topic[1]StructSince
init—BountyEscrowInitializedV2
f_lockbounty_idFundsLockedV2
f_relbounty_idFundsReleasedV2
f_refbounty_idFundsRefundedV2
pubbounty_idEscrowPublishedV2
archivebounty_idEscrowArchivedV2
orc_cfg—OracleConfigUpdatedV2
fee—FeeCollectedV2
fee_cfg—FeeConfigUpdatedV2
fee_rtebounty_idFeeRoutingUpdatedV2
fee_rtbounty_idFeeRoutedV2
b_lock—BatchFundsLockedV2
b_rel—BatchFundsReleasedV2
approvalbounty_idApprovalAddedV2
prng_selbounty_idDeterministicSelectionDerivedV2
f_lkanonbounty_idFundsLockedAnonV2
deprec—DeprecationStateChangedV2
maint—MaintenanceModeChangedV2
pf_mode—ParticipantFilterModeChangedV2
riskbounty_idRiskFlagsUpdatedV2
ticket_iticket_idTicketIssuedV2
ticket_cticket_idTicketClaimedV2
pauseoperationPauseStateChangedV2
em_wtd—EmergencyWithdrawEventV2
cap_newcapability_idCapabilityIssuedV2
cap_usecapability_idCapabilityUsedV2
cap_revcapability_idCapabilityRevokedV2
tmlk_cfg—TimelockConfiguredV2
act_prop—AdminActionProposedV2
act_exec—AdminActionExecutedV2
act_cncl—AdminActionCancelledV2

program-escrow​

Topic[0]StructSince
PrgInitProgramInitializedEventV2
FndsLockFundsLockedEventV2
BatLckBatchFundsLockedV2
BatRelBatchFundsReleasedV2
BatchPayBatchPayoutEventV2
PayoutPayoutEventV2
RelSchedReleaseScheduledEventV2
SchRelScheduleReleasedEventV2
DspOpenDisputeOpenedEventV2
DspRslvDisputeResolvedEventV2
PauseStPauseStateChangedV2
em_wtdEmergencyWithdrawEventV2

grainlify-core​

Topic[0]Topic[1]Notes
metricopOperationMetric
metricperfPerformanceMetric
initgovGovernance initialized
upgradewasmUpgradeEvent
ROModeChg—ReadOnlyModeEvent
cfg_snapcreateSnapshot created
cfg_snaprestoreSnapshot restored
migration—MigrationEvent

Unknown Version Handling (for indexers)​

When version > 2 is encountered:

  1. Do not hard-fail — emit a warning and skip payload decoding
  2. Preserve raw XDR bytes for reprocessing after decoder update
  3. Never discard topic data — topics are stable across versions

Security Invariants​

  • Events are emitted after all state mutations (CEI ordering)
  • No PII, KYC data, or private keys appear in any event payload
  • All symbol_short! strings are ≤ 9 bytes (compile-time enforced)

Running Tests​

cargo test -p bounty-escrow
cargo test -p program-escrow
cargo test -p grainlify-core