You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document is the result of a full event-emission completeness audit
(Issue #538): every state-changing (storage-mutating) function across all
five contracts was mapped and checked for event coverage. Gaps found during
the audit have been fixed in the same change that produced this document —
see "Audit summary" below for what was added and why.
Events are consumed by indexers, blockchain explorers, and off-chain backend
integrations as the audit trail for on-chain state transitions. Indexers
should reconstruct state from these events rather than scraping ledger
entries directly.
Audit summary
Contract
Function
Before
Fix
invoice_liquidity
initialize
No event
Added ContractInitialized
invoice_liquidity
set_distribution_contract
No event
Added DistributionContractUpdated
invoice_liquidity
set_price_oracle
No event
Added PriceOracleUpdated
invoice_liquidity
set_max_oracle_age
No event
Reused ParameterUpdated
insurance_pool
initialize
No event
Added inline init event (coverage cap)
reputation_bonus
init
No event
Added ContractInitialized
reputation_bonus
set_config (raw setter, distinct from update_config)
No event
Added ConfigSet
reputation_bonus
submit_invoice
No event
Added InvoiceSubmitted
reputation_bonus
mark_paid
No event
Added InvoiceStatusChanged
reputation_bonus
handle_default
No event
Added InvoiceStatusChanged
iln_distribution
initialize
No event
Added ContractInitialized
iln_distribution
accrue_lp
No event
Added LpVolumeAccrued
iln_distribution
accrue_settlement
No event
Added SettlementAccrued
iln_distribution
claim_tokens
No event
Added TokensClaimed
iln_governance
initialize
No event
Added GovernanceInitialized
iln_governance
set_min_quorum_bps
No event
Added GovernanceParameterUpdated
iln_governance
set_min_proposal_balance
No event
Added GovernanceParameterUpdated
iln_governance
set_execution_delay
No event
Added GovernanceParameterUpdated
iln_governance
disable_veto_power
No event
Added VetoPowerDisabled
All other state-changing functions across all five contracts already emitted
events prior to this audit (verified function-by-function; see per-contract
sections below for the full inventory, including functions that were
correctly found to need no event because they are pure read-only views).
Two events referenced by a stale prior version of this document —
ContractPaused/ContractUnpaused "missing struct" and TokenAdded/
TokenRemoved/InvoiceExpired/InvoiceDisputed/ReputationUpdated/
LPPositionTransferred "not emitted" — were already fully implemented in
the code by the time of this audit; the document had simply not been kept in
sync with the contract. This rewrite corrects that drift for all five
contracts and should be kept current going forward.
✅ ParameterUpdated ×3 (one per changed field — pre-existing)
submit_invoice
✅ InvoiceSubmitted (added by this audit)
mark_paid
✅ InvoiceStatusChanged (added by this audit)
handle_default
✅ InvoiceStatusChanged (added by this audit)
get_config / get_reputation
🔍 read-only views
update_config and set_config both write to the same underlying storage
key but are kept as separate entrypoints with separate events:
update_config is the fine-grained, per-field audited path (three
ParameterUpdated events, one per field, each carrying the old and new
value), while set_config is a bulk replace that emits a single ConfigSet
snapshot of the whole config. Note: set_config currently has no admin
auth check in lib.rs — this is a pre-existing access-control gap, outside
the scope of this event-emission audit, and should be tracked separately.
iln_distribution
Function
Event coverage
initialize
✅ init topic → ContractInitialized (added by this audit)
accrue_lp
✅ lp_accr topic → LpVolumeAccrued (added by this audit)
accrue_settlement
✅ settled topic → SettlementAccrued (added by this audit)
claim_tokens
✅ claimed topic → TokensClaimed (added by this audit)
get_accrual
🔍 read-only view
iln_governance
Function
Event coverage
initialize
✅ GovernanceInitialized (added by this audit)
set_min_quorum_bps
✅ GovernanceParameterUpdated (added by this audit)
create_proposal
✅ ProposalCreated
set_min_proposal_balance
✅ GovernanceParameterUpdated (added by this audit)
delegate_votes
✅ VotesDelegated
undelegate_votes
✅ VotesUndelegated
cast_vote
✅ VoteCast
set_execution_delay
✅ GovernanceParameterUpdated (added by this audit)
execute_proposal
✅ ProposalExecuted
veto_proposal
✅ ProposalVetoed
disable_veto_power
✅ VetoPowerDisabled (added by this audit)
get_* / list_proposals / has_voted
🔍 read-only views
GovernanceInitialized
Emitted once, when the governance contract is initialised.
Topics: ["initialized", admin]
Field
Type
Description
iln_contract
Address
The ILN contract address
gov_token
Address
The governance token address
admin
Address
The initial admin address
GovernanceParameterUpdated
Emitted whenever a governance-controlled numeric parameter changes.
Topics: ["parameter_updated", param_name]
Field
Type
Description
param_name
Symbol
e.g. "min_quorum_bps", "min_proposal_balance", "execution_delay"
old_value
i128
Previous value
new_value
i128
New value
ProposalCreated
Emitted when a new governance proposal is created.
Emitted when admin veto power is permanently disabled.
Topics: ["veto_power_disabled"]
Field
Type
Description
disabled_by
Address
The ILN contract that disabled veto power
Indexer Notes
Event Ordering Assumptions: In invoice_liquidity, InvoiceSubmitted
always precedes InvoiceFunded, which precedes InvoicePaid or
InvoiceDefaulted.
State Reconstruction: InvoiceSubmitted/ContractInitialized/
GovernanceInitialized include a timestamp field specifically so
indexers can reconstruct creation time without querying ledger headers.
Timestamps: All timestamps are u64 seconds since the Unix epoch.
Amounts: All numeric amounts (amount, fund_amount, lp_payout,
etc.) are i128 in the token's native unit (stroops); format using the
token's configured decimals for display.
Cross-contract correlation: iln_distribution's LpVolumeAccrued/
SettlementAccrued events correlate with invoice_liquidity's
InvoiceFunded/InvoicePaid events (same ledger, triggered by the same
underlying call), but carry no shared invoice id — indexers should
correlate by ledger sequence + participant address if they need to join
the two streams.