51412 sc low token admin can withdraw the token from the purchase contract making the token balance to be less than the totalamountforsale
Description
Brief/Intro
Vulnerability Details
function enableToken(
address _tokenContract,
uint256 _numberOfTokens,
uint256 _tokenPrice
) external onlyTokenAdmin(_tokenContract) {
...
if (
ArcToken(_tokenContract).balanceOf(address(this)) < _numberOfTokens
) {
revert ContractMissingRequiredTokens();
}
ps.tokenInfo[_tokenContract] =
TokenInfo({ isEnabled: true, tokenPrice: _tokenPrice, totalAmountForSale: _numberOfTokens, amountSold: 0 });
ps.enabledTokens.add(_tokenContract);
emit TokenSaleEnabled(_tokenContract, _numberOfTokens, _tokenPrice); //@audit should be restricted.
}Impact Details
Proof of Concept
References
Previous52424 sc high there is a retroactive commission miscalculation in plumerewardlogicNext52706 sc low multi quantity prize claims revert until all winners are drawn freezing early winners
Was this helpful?