Open code423n4 opened 3 years ago
https://github.com/code-423n4/2021-09-yaxis/pull/28#issuecomment-931650139 mentions that removing the parameter _token
would break the interface.
The check onlyToken(_token)
may still be removed, though. But I'll leave the decision to the other devs.
I would say if that would break the interface then this issue should be skipped even if it's still valid in my opinion, we can leave the acknowledged
label.
Sponsor acknowledged, agree with finding
Handle
0xRajeev
Vulnerability details
Impact
withdrawalProtectionFe() appears to be the same for all tokens and therefore the parameter _token and the onlyToken() modifier are unused. Removing it and the modifier can save gas.
Proof of Concept
https://github.com/code-423n4/2021-09-yaxis/blob/cf7d9448e70b5c1163a1773adb4709d9d6ad6c99/contracts/v3/controllers/LegacyController.sol#L130-L140
Tools Used
Manual Analysis
Recommended Mitigation Steps
Remove parameter and modifier to save gas.