Uncollected fees from user's NFT position are stuck in `NFTManager` if `NFTManager.decomposeAndMint` function is used
When a user calls `NFTManager.decomposeAndMint`, uncollected fees from their Uniswap V3 position are sent to the `NFTManager` contract but never forwarded to the user. These fees remain stuck in `NFTManager` and later in `MakerFacet`, causing a loss for the user.
Source: https://github.com/sherlock-audit/2025-09-ammplify-judging/issues/238
Found by
0x37, 0xpinkman, JeRRy0422, KiroBrejka, SarveshLimaye, Slayer, blockace, panprog
Summary
NFTManager.decomposeAndMint converts user's Uniswap V3 NFT position into Ammplify's Maker liquidity. The issue is that any uncollected fees are stuck in the NFTManager contract. These fees are collected in the UniV3Decomposer and sent to NFTManager contract:
// After primary transfer, sweep any dust the contract may still hold for this token
uint256 residual = IERC20(token).balanceOf(address(this));
if (residual > 0) {
TransferHelper.safeTransfer(token, caller, residual);
}
Notice that the funds are sent to caller, which is set to msg.sender (e.g. NFTManager) in nonReentrant modifier of the decompose function:
modifier nonReentrant {
require(caller == address(0), ReentrancyAttempt());
caller = msg.sender;
_;
caller = msg.sender;
}
function decompose(
uint256 positionId,
bool isCompounding,
uint160 minSqrtPriceX96,
uint160 maxSqrtPriceX96,
bytes calldata rftData
) external nonReentrant returns (uint256 newAssetId) {
After receiving funds from the decomposer, NFTManager never sends these to the user:
_currentTokenRequester = msg.sender;
// Decompose the Uniswap V3 position
assetId = DECOMPOSER.decompose(positionId, isCompounding, minSqrtPriceX96, maxSqrtPriceX96, rftData);
// Clear the token requester context
_currentTokenRequester = address(0);
// Mint NFT for the decomposed asset
tokenId = _nextTokenId++;
assetToToken[assetId] = tokenId;
tokenToAsset[tokenId] = assetId;
_currentSupply++;
_safeMint(msg.sender, tokenId);
emit PositionDecomposedAndMinted(positionId, assetId, tokenId, msg.sender);
}
It might expect to receive these collected fees via the RFTPayer interface, but this interface is never used in this call:
- decomposer transfers funds to
NFTManagerdirectly, not viaRFTPayer. - even though decomposer specifies
msg.sender(NFTManager) as recepient forMakerposition, under the hood it usesRFTPayerinterface on its caller (i.e. decomposer) instead of therecepient.
The funds in NFTManager remain until the first mintNewMaker operation, which sends all residual token amounts to MakerFacet, meaning these funds are then stuck in the MakerFacet contract.
Root Cause
No funds are sent to user after DECOMPOSER.decompose call (and RFTPayer interface is not used):
https://github.com/sherlock-audit/2025-09-ammplify/blob/main/Ammplify/src/integrations/NFTManager.sol#L156-L173
Internal Pre-conditions
User calls NFTManager.decomposeAndMint with position with uncollected fees
External Pre-conditions
None.
Attack Path
Happens always when internal pre-condition is met.
Impact
User losses uncollected position fees
Mitigation
After decomposer mints Maker liquidity, send residual amounts of both tokens to msg.sender, or use RFTPayer interface from decomposer to NFTManager. If RFTPayer interface is not used, do not set _currentTokenRequester in decomposeAndMint function since the interface is not used in it.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/itos-finance/Ammplify/pull/38
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
The `decomposeAndMint` function does not transfer residual token amounts to the user after calling `DECOMPOSER.decompose`, and the `RFTPayer` interface is not used to route fees correctly.
Impact
The user permanently loses the uncollected fees from their position.
What the attacker needed
User calls decomposeAndMint; Position has uncollected fees
The fix
The protocol team fixed this issue in a pull request.
How it was found
- User calls `NFTManager.decomposeAndMint` with a position that has uncollected fees.
- The decomposer collects fees and sends them to `NFTManager`.
- `NFTManager` does not forward these fees to the user.
- The fees remain stuck in `NFTManager` until a later `mintNewMaker` operation moves them to `MakerFacet`.
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.
When you convert a Uniswap V3 NFT position into Ammplify liquidity, any fees you have earned but not yet collected are supposed to go to you. Instead, the code sends those fees to a middleman contract that never passes them on, so you lose them.
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.