Description
The Factory contract's list_pools function does not validate that start_id is less than pool_count. A caller can pass any u32 value, which could cause unexpected behavior.
Current behavior
pub fn list_pools(
env: Env,
start_id: u32,
limit: u32,
) -> Result<ListPoolsResponse, FactoryError> {
// No validation on start_id
}
Expected behavior
Add validation:
if start_id >= count {
return Ok(ListPoolsResponse {
records: vec![&env],
next_start_id: count,
total: count,
});
}
Why this matters
Invalid start_id values could cause confusing behavior or wasted gas.
Labels
enhancement, factory, good first issue
Description
The Factory contract's
list_poolsfunction does not validate thatstart_idis less thanpool_count. A caller can pass any u32 value, which could cause unexpected behavior.Current behavior
Expected behavior
Add validation:
Why this matters
Invalid start_id values could cause confusing behavior or wasted gas.
Labels
enhancement, factory, good first issue