id string | title string | date timestamp[ns] | author string | severity string | rarity null | quality null | categories sequence | tags sequence | description string | code string | recommendations string |
|---|---|---|---|---|---|---|---|---|---|---|---|
C-01 | Malicious token creator can block the token `buy/sells` | 2024-10-09T00:00:00 | Pashov Audit Group | HIGH | null | null | [] | [] | The `_sendFees` function includes a `revert` statement, located at lines `TokenFactory#L806-809`, that could be triggered by a token creator to intentionally fail the transaction.
This issue allows the token creator to control who can buy or sell tokens by strategically causing the transaction to fail, the token creat... | File: TokenFactory.sol
```solidity
490: function sellWithReferral(
491: address erc20Address,
492: uint256 tokenAmountToSell,
493: uint256 minEthReceivedAfterFees,
494: address referral
495: ) external nonReentrant validToken(erc20Address) {
...
536: // send fees
537: _sendFees(erc20Address, protocolFee, creato... | **OPTION 1:**
The `TokenFactory::_sendFees` function should be modified so that it does not revert when the `creatorFee` transfer fails:
```solidity
(bool creatorFeeSuccess,) = creatorFeeRecipients[erc20Address].call{value: creatorFee, gas: 100_000}("");
if (!creatorFeeSuccess) {
emit CreatorFeeTransferFailed(erc20... |
No dataset card yet
- Downloads last month
- 4