The pool creation function performs multiple separate validation checks for asset parameters that could be combined into a single check for better gas efficiency:
/contracts/pool-manager/src/manager/commands.rs#L88-L103
The code performs two separate ensure! checks:
This requires:
Low severity. While functionally correct, this approach:
Uses more computability than necessary due to redundant length checks due to multiple ensure! expansions and makes code slightly less maintainable with split validation logic.
Combine the validations into a single ensure! check:
Pseudo Code:
