users might pay enormous amounts of gas
When a user mints liquidity for a pair that does not exist, the contract deploys a new pair contract, which is very expensive on Ethereum. The user ends up paying thousands of dollars in gas fees.
Submitted by danb
when a user mints new liquidity, it the pair doesn’t already exist, it deploys it.
deploying a new contract on ethereum is super expensive, especially when it’s such a large contract like TimeswapPair, it can cost thousands of dollars.
Impact
user who try to mint liquidity on pair that doesn’t exist will end up paying thousands of dollars.
Recommended Mitigation Steps
If the pair doesn’t exist, revert instead of deploying it. deploying a new contract should be the user’s choice, since it’s so expensive.
Mathepreneur (Timeswap) acknowledged:
We plan to have a better documentation to show this behavior.
Downgrading to med risk, this isn’t an attack vector and is working as designed. Funds aren’t being lost or compromised in any way.
The issue is with the design, which could be potentially improved.
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 mint function automatically deploys a new pair contract when the pair does not exist, without warning the user about the high gas cost.
What the attacker needed
User initiates mint for non-existent pair; user pays gas for deployment
The fix
The contract should revert if the pair does not exist, leaving deployment as a separate, explicit user action.
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.
On Ethereum, creating a new smart contract costs a lot of gas, which translates to real money. This report says that if you try to add liquidity to a trading pair that hasn't been created yet, the system automatically creates it for you, and you foot the bill. That can be thousands of dollars, which is a nasty surprise.
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.