Submitted by 0x52, also found by berndartmueller, cryptphi, and Lambda
https://github.com/code-423n4/2022-08-frax/blob/c4189a3a98b38c8c962c5ea72f1a322fbc2ae45f/src/contracts/FraxlendPair.sol#L136-L138
https://github.com/code-423n4/2022-08-frax/blob/c4189a3a98b38c8c962c5ea72f1a322fbc2ae45f/src/contracts/FraxlendPair.sol#L140-L142
FraxlendPair.sol is not EIP-4626 compliant, variation from the standard could break composability and potentially lead to loss of funds.
According to EIP-4626 method specifications (https://eips.ethereum.org/EIPS/eip-4626)
For maxDeposit:
For maxMint:
When FraxlendPair.sol is paused, deposit and mint are both disabled. This means that maxMint and maxDeposit should return 0 when the contract is paused.
The current implementations of maxMint and maxDeposit do not follow this specification:
No matter the state of the contract they always return uint128.max, but they should return 0 when the contract is paused.
maxDeposit and maxMint should be updated to return 0 when contract is paused. Use of the whenNotPaused modifier is not appropriate because that would cause a revert and maxDeposit and maxMint should never revert according to EIP-4626.
DrakeEvans (Frax) confirmed
