Platform: Code4rena
Start Date: 23/02/2024
Pot Size: $36,500 USDC
Total HM: 2
Participants: 39
Period: 7 days
Judge: Dravee
Id: 338
League: ETH
Rank: 30/39
Findings: 1
Award: $53.72
🌟 Selected for report: 0
🚀 Solo Findings: 0
53.7155 USDC - $53.72
The maxRedeem function is designed to return the maximum amount a user can redeem. However, it lacks a check to adjust its behavior when the protocol is paused, potentially misleading users or external contracts about the available actions during the pause state. This oversight may lead to failed transactions or unintended interactions, as users might attempt to redeem based on incorrect assumptions about their capabilities during a pause.
The issue lies within the maxRedeem function implementation in the PrincipalToken.sol contract. The function is intended to return the maximum amount that can be redeemed by a given owner. However, when the protocol is paused, the function does not account for this state and should, for security and clarity purposes, return 0 to indicate that no redemption actions are possible.
function maxRedeem(address owner) public view override returns (uint256) { return _maxBurnable(owner); //@audit must return 0 when protocol is paused }
Manual
To address this issue, it's recommended to modify the maxRedeem function to include a check for the protocol's paused state. If the protocol is paused, the function should immediately return 0, clearly indicating that no redemption actions are possible under the current state.
The modification could involve using a state variable or a function call to check the pause state, similar to how other functions might check for such conditions. Here is a conceptual implementation:
function maxRedeem(address owner) public view override returns (uint256) { if (protocolPaused()) { // This is a placeholder for the actual paused state check return 0; } return _maxBurnable(owner); }
Context
#0 - c4-pre-sort
2024-03-03T09:23:05Z
gzeon-c4 marked the issue as duplicate of #33
#1 - c4-pre-sort
2024-03-03T09:23:08Z
gzeon-c4 marked the issue as sufficient quality report
#2 - c4-judge
2024-03-11T00:24:14Z
JustDravee marked the issue as satisfactory
#3 - c4-judge
2024-03-11T00:24:19Z
JustDravee marked the issue as partial-50