Loss of functionality.
Tokens that don't support type(uint256).max amount could not be deposited.
Vulnerability Details
There are tokens that doesn't support type(uint256).max amount. So the maxDeposit will not work for some tokens like UNI or COMP who will revert when approve type(uint256).max amount.
/** @dev See {IPrincipalToken-maxDeposit}. */
function maxDeposit(address) external pure override returns (uint256) {
return type(uint256).max;
}
Tools Used
Manual Review
Recommended Mitigation Steps
I would suggest approve only the necessary amount of token instead of max amount.
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L442
Vulnerability details
Impact
Loss of functionality. Tokens that don't support type(uint256).max amount could not be deposited.
Vulnerability Details
There are tokens that doesn't support
type(uint256).max
amount. So themaxDeposit
will not work for some tokens likeUNI
orCOMP
who will revert when approvetype(uint256).max
amount.Tools Used
Manual Review
Recommended Mitigation Steps
I would suggest approve only the necessary amount of token instead of max amount.
Assessed type
ERC20