Skip to content
Request an audit

‹ All findings

IDOPoolAbstract::withdrawSpareIDO() does not take into account that several rounds may use the same IdoToken

MediumBlast IDO Pools·Three Sigma · IDO launchpad · 7th August, 2024M-1

Description

IDOPoolAbstract::withdrawSpareIDO() checks if contractBal >= ido.idoSize, where contractBal = IERC20(ido.idoToken).balanceOf(address(this)). When several rounds use the same ido.idoToken, this check is incomplete as ido.idoSize only tracks the tokens of one round.

Recommendation

The correct check is withdrawing contractBal - globalTokenAllocPerIDORound[idoConfig.idoToken], correctly tracking excess tokens.