Closed c4-bot-2 closed 8 months ago
gzeon-c4 marked the issue as duplicate of #33
gzeon-c4 marked the issue as sufficient quality report
JustDravee marked the issue as partial-75
JustDravee marked the issue as satisfactory
JustDravee marked the issue as partial-75
Lines of code
https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L446 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L460 https://github.com/code-423n4/2024-02-spectra/blob/main/src/tokens/PrincipalToken.sol#L483
Vulnerability details
Impact
The sponsor mentioned in
Main invariants
that Principal Token is ERC5095, butPrincipalToken.sol
is not fully EIP-5095 compliant, variation from the standard could break composability.Proof of Concept
According to EIP-5095 method specifications (https://eips.ethereum.org/EIPS/eip-5095) For
maxRedeem
Violates the following standard:
For
maxWithdraw
Violates the following standards:
For
previewWithdraw
Violates the following standard:
When
PrincipalToken.sol
is paused,maxRedeem
andmaxWithdraw
should return 0, and all these functions should not revert.Tools Used
Manual Review
Recommended Mitigation Steps
maxRedeem
andmaxWithdraw
should be updated to return 0 when contract is paused.whenNotPaused
modifier because that would cause a revert(maxRedeem and maxWithdraw should never revert according to EIP-5095).Assessed type
Error