primitivefinance / portfolio

Portfolio is an automated market making protocol for implementing custom strategies at the lowest cost possible.

Home Page:https://www.primitive.xyz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add custom errors to avoid underflows/overflows

Alexangelj opened this issue · comments

Functions like computeMaxInput in RMM01Portfolio.sol will revert with underflows if the arguments are not within some bounds. This function should have a custom error for this instead of relying on the overflow/underflow reverts, since those are extremely hard to find the location they were thrown and debug in general.