Description:
The docs/error-codes.md file serves as the definitive reference for all numeric error codes returned by the ILN contracts. However, several error codes introduced in recent features are missing from this documentation.
Specifically, the following error codes are defined in contracts/invoice_liquidity/src/errors.rs but not documented:
InvoiceNftAlreadyExists (value 37) — returned when attempting to mint an NFT for an invoice that already has one
InvoiceNftNotFound (value 38) — returned when querying or transferring a non-existent NFT
InvoiceNftNotOwned (value 39) — returned when a non-owner attempts to transfer or burn an NFT
AmountTooSmall (value 36) — returned when an invoice amount is below the configurable minimum threshold
Additionally, the InsuranceError enum from contracts/insurance_pool/src/lib.rs is entirely undocumented:
NotInitialized (1) — contract has not been initialised with an admin
AlreadyClaimed (2) — a claim has already been processed for this invoice
InvalidAmount (3) — premium/coverage amount must be positive
PoolEmpty (4) — pool has no balance available to pay a claim
AlreadyInitialized (5) — contract is already initialised
The GovernanceError enum from contracts/iln_governance/src/lib.rs also has undocumented codes:
InvalidQuorumBps (15) — invalid quorum basis points
NotAdmin (16) — caller is not the admin
NotVetoable (17) — proposal cannot be vetoed in its current status
VetoPowerDisabled (18) — admin veto power has been disabled
InsufficientProposerBalance (19) — proposer does not hold minimum required token balance
Why it matters: Contributors debugging contract interactions rely on this file to understand error responses. Missing error codes force developers to read raw source code, slowing down integration work.
Acceptance Criteria:
Relevant Files: docs/error-codes.md, contracts/invoice_liquidity/src/errors.rs:1-58, contracts/insurance_pool/src/lib.rs:33-46, contracts/iln_governance/src/lib.rs:34-63
Description:
The
docs/error-codes.mdfile serves as the definitive reference for all numeric error codes returned by the ILN contracts. However, several error codes introduced in recent features are missing from this documentation.Specifically, the following error codes are defined in
contracts/invoice_liquidity/src/errors.rsbut not documented:InvoiceNftAlreadyExists(value 37) — returned when attempting to mint an NFT for an invoice that already has oneInvoiceNftNotFound(value 38) — returned when querying or transferring a non-existent NFTInvoiceNftNotOwned(value 39) — returned when a non-owner attempts to transfer or burn an NFTAmountTooSmall(value 36) — returned when an invoice amount is below the configurable minimum thresholdAdditionally, the
InsuranceErrorenum fromcontracts/insurance_pool/src/lib.rsis entirely undocumented:NotInitialized(1) — contract has not been initialised with an adminAlreadyClaimed(2) — a claim has already been processed for this invoiceInvalidAmount(3) — premium/coverage amount must be positivePoolEmpty(4) — pool has no balance available to pay a claimAlreadyInitialized(5) — contract is already initialisedThe
GovernanceErrorenum fromcontracts/iln_governance/src/lib.rsalso has undocumented codes:InvalidQuorumBps(15) — invalid quorum basis pointsNotAdmin(16) — caller is not the adminNotVetoable(17) — proposal cannot be vetoed in its current statusVetoPowerDisabled(18) — admin veto power has been disabledInsufficientProposerBalance(19) — proposer does not hold minimum required token balanceWhy it matters: Contributors debugging contract interactions rely on this file to understand error responses. Missing error codes force developers to read raw source code, slowing down integration work.
Acceptance Criteria:
invoice_liquidity/src/errors.rswith their numeric values, enum variant names, descriptions, and remediation stepsInsuranceErrorcodes frominsurance_pool/src/lib.rs:33-46GovernanceErrorcodes fromiln_governance/src/lib.rs:34-63| Code | Name | Description | Remediation |Relevant Files:
docs/error-codes.md,contracts/invoice_liquidity/src/errors.rs:1-58,contracts/insurance_pool/src/lib.rs:33-46,contracts/iln_governance/src/lib.rs:34-63