52446 sc low withdrawing unsold tokens desynchronizes sale accounting
Description
Brief/Intro
Vulnerability Details
function withdrawUnsoldArcTokens(address _tokenContract, address to, uint256 amount)
external onlyTokenAdmin(_tokenContract)
{
// ...checks...
ArcToken token = ArcToken(_tokenContract);
uint256 bal = token.balanceOf(address(this));
if (bal < amount) revert InsufficientUnsoldTokens();
bool ok = token.transfer(to, amount);
if (!ok) revert ArcTokenWithdrawalFailed();
}Impact Details
Proof of Concept
References
Previous51920 sc insight unnecessary second hand of if check in calculaterewardswithcheckpointsview Next51457 sc low getaccruedcommission reverts when token was removed instead of returning the accrued commission
Was this helpful?