Skip to content
DoS Audit finding Intermediate

incompatible library used for Fee on Transfer tokens

The protocol uses an external settlement library that strictly checks that the received token balance matches the requested amount, so any token that deducts a transfer fee causes the check to fail and the transaction to revert. Users therefore cannot create positions with fee-on-transfer tokens even though the competition scope says such tokens should work.

CasinoCompiler Follow with VCeb, glitch-Hunter and 1 other

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-09-ammplify-judging/issues/315

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

CasinoCompiler, VCeb, glitch-Hunter, tedox

Summary

From the competition details:

However, we are not expected to have issues with: ... Transfer of less than amount ... The traits listed above are in scope and the contracts are expected to work correctly with them.

However, the protocol adopts the RFT library which is incompatible with tokens that have a fee on transfer.

Root Cause

The competition details explicitly states that "Transfer of less than amount" tokens are expected to work correctly but the protocol handles token transfers through an external library, RFTLib, for all its operations.

The issue is this library does not support Fee on Transfer tokens as their is a strict validation check within it:

Solidity
        actualDeltas = new int256[](tokens.length);
        for (uint256 i = 0; i < tokens.length; ++i) {
            address token = tokens[i];

            // Validate our balances.
            uint256 finalBalance = IERC20(token).balanceOf(address(this));
            actualDeltas[i] = U256Ops.sub(finalBalance, startBalances[i]);
            if (actualDeltas[i] < balanceChanges[i]) {
                revert InsufficientReceive(token, balanceChanges[i], actualDeltas[i]);
            }

When the library tries to transfer the tokens, the actual deltas will always be less than balanceChanges therefore the protocol will always revert for any fee on transfer token.

Internal Pre-conditions

  1. User needs to attempt creating a position with a fee-on-transfer token

External Pre-conditions

N/A

Attack Path

  1. User holds fee-on-transfer tokens that the protocol explicitly claims to support.
  2. User attempts to create a maker position by calling newMaker() or similar functions
  3. Protocol attempts to transfer tokens through RFTLib.settle()
  4. Fee-on-transfer token deducts transfer fee e.g. 2% of transfer amount
  5. Protocol receives less tokens than expected due to fee deduction
  6. RFTLib validation fails with InsufficientReceive error, reverting the transaction
  7. User cannot create any positions with fee-on-transfer tokens despite protocol's compatibility claims

Impact

Denial of service for any token that has a fee on transfer, a capability that should be possible based on the competition details.

DoS is medium severity according to Sherlock validity criterua

PoC

  • Sufficient evidence given in Root cause, PoC can be provided upon request.

Mitigation

Implement proper fee-on-transfer token handling in the settlement system or use a different library.

alternatively, do not allow fee on transfer tokens in the protocol.

The original report as published on Sherlock, by CasinoCompiler. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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 settlement library compares the actual balance increase against the requested amount and reverts when it is lower, which is always true for tokens that deduct a fee on transfer.

Impact

Any fee-on-transfer token is unusable for creating positions, causing a denial of service that the reporter rates as medium severity.

What the attacker needed

A fee-on-transfer token; protocol claims to support such tokens

The fix

The team acknowledged the issue but will not fix it now; a proper fix would handle fee-on-transfer tokens in settlement or explicitly disallow them.

How it was found

  1. Hold fee-on-transfer tokens that the protocol claims to support.
  2. Call a function such as newMaker() to create a maker position.
  3. The protocol moves the tokens through the settlement library.
  4. The token deducts its transfer fee, so less arrives than expected.
  5. The library's balance check fails and the transaction reverts.

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 take a small cut each time they are moved, so the receiver gets slightly less than the sender sent. This protocol's helper library insists on receiving exactly the amount it asked for, so it rejects the transfer and undoes the whole action. The result is that those tokens simply cannot be used, even though the rules said they should be supported.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Ammplify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.