31521 - [SC - Medium] Early return in RewardsDistributorclaim can cau...
Description
Brief/Intro
Vulnerability Details
function claim(uint256 _tokenId, bool _compound) external payable nonReentrant returns (uint256) {
if (!_compound) {
require(msg.value == 0, "Value must be 0 if not compounding");
}
...
uint256 alcxAmount = _claim(_tokenId, votingEscrow, _lastTokenTime);
// Return 0 without reverting if there are no rewards
if (alcxAmount == 0) return alcxAmount;
...
if (_compound) {
(uint256 wethAmount, uint256[] memory normalizedWeights) = amountToCompound(alcxAmount);
require(
msg.value >= wethAmount || WETH.balanceOf(msg.sender) >= wethAmount,
"insufficient balance to compound"
);Impact Details
Recommendation
Output from POC
Proof of Concept
Previous31520 - [SC - Critical] Incorrect accounting of totalVoting leads to pe...Next31523 - [SC - Low] USDT Approval will cause function failure
Last updated
Was this helpful?