_totalSupply not updated in _transferMint() and _transferBurn()
The token contract's internal mint and burn helper functions do not update the total supply variable, unlike the standard mint and burn functions. This causes the reported total supply to be inaccurate, which could mislead external protocols, user interfaces, and analytics platforms that rely on it.
Submitted by gpersoon, also found by WatchPug, harleythedog, hubble, xYrYuYx, cmichel, and defsec
Impact
The functions \_transferMint() and \_transferBurn() of OverlayToken.sol don’t update \_totalSupply. Whereas the similar functions \_mint() and \_burn() do update \_totalSupply.
This means that \_totalSupply and totalSupply() will not show a realistic view of the total OVL tokens.
For the protocol itself it isn’t such a problem because this value isn’t used in the protocol (as far as I can see). But other protocols building on Overlay may use it, as well as user interfaces and analytic platforms.
Proof of Concept
function _mint( address account, uint256 amount) internal virtual {
...
_totalSupply += amount;
function _burn(address account, uint256 amount) internal virtual {
...
_totalSupply -= amount;
https:
https:
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the internal helper functions for minting and burning were written without including the total supply update that the standard mint and burn functions perform.
Impact
The total supply value becomes inaccurate, which could mislead external protocols, user interfaces, and analytics platforms that rely on it, though the protocol itself does not use this value.
What the attacker needed
None
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A token contract keeps a running total of how many tokens exist, called the total supply. Some functions that create or destroy tokens forgot to update this total, so the reported number is wrong. This can confuse other programs or dashboards that read the total supply.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.