51034 sc low sales information is lost when enabling token
Submitted on Jul 30th 2025 at 15:12:56 UTC by @holydevoti0n for Attackathon | Plume Network
- Report ID: #51034
- 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
Description
Brief/Intro
The ArcTokenPurchase lost all its historical (amountSold and totalAmountForSale) information when a previously stored token is re-enabled.
Vulnerability Details
The ArcTokenPurchase allows a previously enabled/disabled token to be enabled again, but the problem is that it overrides the information of the previous record:
function enableToken(
address _tokenContract,
uint256 _numberOfTokens,
uint256 _tokenPrice
) external onlyTokenAdmin(_tokenContract) {
...
ps.tokenInfo[_tokenContract] =
TokenInfo({ isEnabled: true, tokenPrice: _tokenPrice, totalAmountForSale: _numberOfTokens, amountSold: 0 });
...
}
This causes the sales information to be broken, as the token previously could have sold an X amount and had a Y amount left for sale.
Example 1 - Token is disabled and re-enabled later
- Token A is enabled first time with 100 tokens for sale,
amountSoldis 0. - Token A has 50 units sold. Now
totalAmountForSaleis 50 andamountSoldis 50. - Token A is disabled, the record information remains.
- After some time, Token A is enabled again, with 100 tokens. But now:
totalAmountForSaleis 100, even though it should be 150amountSoldis 0, even though 50 tokens were sold previously.
Example 2
- Token A is enabled first time with 100 tokens for sale,
amountSoldis 0. - Token A has 50 units sold. Now
totalAmountForSaleis 50 andamountSoldis 50. enableTokenis called again with the same information. TheamountSoldis set to zero again, andtotalAmountForSaleis 100, even though it should be 150.
Impact Details
Re-enabling a previously added token resets its sales data, causing amountSold and totalAmountForSale to misrepresent the actual tokens sold and available.
Recommendation (two alternatives):
- Prevent re-enabling a token that is already enabled.
- When re-enabling a disabled token, merge the new data with existing sales info to preserve accurate
amountSoldandtotalAmountForSalevalues.
Proof of Concept
PoC — examples demonstrating overwritten sales data
Context
The PoC below represents the same as added in the report. Two cases show how the sales data will be overwritten, hence incorrectly stored.
Example 1 - Token is disabled and re-enabled later
- Token A is enabled first time with 100 tokens for sale,
amountSoldis 0. - Token A has 50 units sold. Now
totalAmountForSaleis 50 andamountSoldis 50. - Token A is disabled, the record information remains.
- After some time, Token A is enabled again, with 100 tokens. But now:
totalAmountForSaleis 100, even though it should be 150amountSoldis 0, even though 50 tokens were sold previously.
Example 2 - Token is enabled again while already active
- Token A is enabled first time with 100 tokens for sale,
amountSoldis 0. - Token A has 50 units sold. Now
totalAmountForSaleis 50 andamountSoldis 50. enableTokenis called again with the same information. TheamountSoldis set to zero again, andtotalAmountForSaleis 100, even though it should be 150.