Skip to content

[celo-contracts] Add a Paginated Vet Directory Query Function #926

Description

@llinsss

Background:
PetChainRegistry (celo-contracts/contracts/PetChainRegistry.sol) has no way to enumerate registered vets at all — vets is a mapping(address => Vet), so a caller must already know a vet's address to look them up; isVerifiedVet only answers yes/no for a known address.

Problem:
There is no on-chain or even reasonably-cheap-to-derive way to answer "show me all verified vets" without an off-chain indexer replaying every VetRegistered/VetVerified event from genesis.

What "done" looks like:

  • An internal address[] private _vetAddresses is appended to on registration, and a paginated getVets(uint256 offset, uint256 limit) view function returns Vet structs for that page.
  • Tests cover pagination and an empty registry.

Implementation guidelines:

  • Key file: celo-contracts/contracts/PetChainRegistry.sol.

PR must include:

  • New enumerable directory + paginated query
  • Tests
  • Passing Hardhat test run

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions