50415 sc low getmaxnumberoftokens returns wrong value when arctokens are withdrawn
Previous49863 sc critical dex aggregator erc20 token theftNext49854 sc critical dex aggregator partial fill token loss
Was this helpful?
Submitted on Jul 24th 2025 at 11:34:57 UTC by @KlosMitSoss for Attackathon | Plume Network
Report ID: #50415
Report Type: Smart Contract
Report severity: Low
Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/arc/src/ArcTokenPurchase.sol
Impacts:
Contract fails to deliver promised returns, but doesn't lose value
Brief/Intro
The getMaxNumberOfTokens() function returns the maximum number of ArcTokens that can be bought. However, this function returns incorrect values when ArcTokens have been withdrawn.
getMaxNumberOfTokens() returns the difference between totalAmountForSale and amountSold. This does not account for ArcTokens that were withdrawn. When tokens are withdrawn, they are no longer available for purchase, but the function continues to count them as available, leading to an overestimation of purchasable tokens.
The function should subtract withdrawn tokens from the available supply to provide accurate information about how many tokens can actually be purchased.
getMaxNumberOfTokens() returns wrong values.
enableToken(): https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcTokenPurchase.sol#L142-L178
withdrawUnsoldArcTokens(): https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcTokenPurchase.sol#L439-L461
getMaxNumberOfTokens(): https://github.com/immunefi-team/attackathon-plume-network/blob/580cc6d61b08a728bd98f11b9a2140b84f41c802/arc/src/ArcTokenPurchase.sol#L359-L364
Was this helpful?
Was this helpful?