Token transfers do not verify that the tokens were successfully transferred
The smart contracts call ERC20 transfer and transferFrom without checking the boolean return value, so tokens that signal failure by returning false instead of reverting are treated as a successful payment. An attacker using such a token could buy sale tokens or NFTs without spending anything, and a user claiming vested tokens could lose them.
prePO contest
Originally disclosed on Code4rena
Some tokens (like zrx) do not revert the transaction when the transfer/transferfrom fails and return false, which requires us to check the return value after calling the transfer/transferfrom function.
In the purchase functions of MiniSales and TokenShop contracts, if _paymentToken is such a token, the user can purchase _saleToken and NFT without spending any tokens.
In the claim function of the Vesting contract, if _token is such a token, the user may lose his vested tokens.
Proof of Concept
Recommended Mitigation Steps
Use SafeERC20’s safeTransfer/safeTransferFrom functions
cccz (warden) commented:
Only security-compliant tokens such as USDC and PPO are currently planned to be used in the contracts.
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 contracts call the token's transfer and transferFrom functions directly and never inspect the returned boolean, assuming every token reverts on failure.
Impact
With a non-reverting token, a user could obtain sale tokens and NFTs for free, and a user claiming vested tokens could lose them; the warden notes only security-compliant tokens such as USDC and PPO are currently planned for use, which limits the risk in practice.
What the attacker needed
Payment token returns false instead of reverting; contract accepts such a token as payment
The fix
The contracts should use SafeERC20's safeTransfer and safeTransferFrom, which check the return value and revert on failure.
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.
Some tokens report a failed transfer by quietly returning 'false' rather than stopping with an error. The contracts ignored that answer and carried on as if the payment had worked, so someone could receive goods without paying. The fix is to use a helper that checks the answer and stops the transaction when it is false.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.