There will be 2 impacts.
rescueTokens() checks the below condition to rescue muteToken.
else if (tokenToRescue == muteToken) {
if (totalStakers > 0) {
require(amount <= IERC20(muteToken).balanceOf(address(this)).sub(totalRewards.sub(totalClaimedRewards)),
"MuteAmplifier::rescueTokens: that muteToken belongs to stakers"
);
}
}
But there are 2 problems.
Manual Review
It should be modified like the below.
else if (tokenToRescue == muteToken) {
if (totalStakers > 0) { //should check totalReclaimed as well
require(amount <= IERC20(muteToken).balanceOf(address(this)).sub(totalRewards.sub(totalClaimedRewards).sub(totalReclaimed)),
"MuteAmplifier::rescueTokens: that muteToken belongs to stakers"
);
}
else if(block.timestamp <= endTime) { //no stakers but staking is still active, should maintain totalRewards
require(amount <= IERC20(muteToken).balanceOf(address(this)).sub(totalRewards),
"MuteAmplifier::rescueTokens: that muteToken belongs to stakers"
);
}
}
The text was updated successfully, but these errors were encountered:
All reactions