Single tier swap path can stall core flows
The swap path builder in BelongCheckIn only checks a single configured Uniswap V3 fee tier and reverts with NoValidSwapPath if no pool exists at that tier. Because deposits, promoter payouts and fee buy-backs all rely on these swaps, a missing pool at the chosen tier blocks those flows until the owner updates the fee tier.
- Disclosed after under an hour
57595 sc low single tier swap path can stall core flows
Submitted on Oct 27th 2025 at 11:50:21 UTC by @koko7 for Audit Comp | Belong
- Report ID: #57595
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/platform/BelongCheckIn.sol
- Impacts:
- Permanent freezing of funds
Description
Brief / Intro
_buildPath in BelongCheckIn is hard-wired to one Uniswap-V3 fee tier. If liquidity migrates to another tier the function reverts with NoValidSwapPath, and every call that needs a swap fails. Deposits, promoter payouts and fee buy-backs all depend on these swaps, so a missing pool turns into a full protocol outage. The entire transaction reverts, so funds are safe, but the platform is effectively frozen until the fee tier is updated.
Vulnerability Details
The path builder only checks a single configured fee tier and reverts if no pool exists at that fee. Example from the code:
// contracts/v2/platform/BelongCheckIn.sol::_buildPath
function _buildPath(
PaymentsInfo memory _paymentsInfo,
address tokenIn,
address tokenOut
) internal view returns (bytes memory path) {
// Direct pool
if (
IV3Factory(_paymentsInfo.swapV3Factory).getPool(
tokenIn,
tokenOut,
_paymentsInfo.swapPoolFees
) != address(0)
) {
path = abi.encodePacked(
tokenIn,
_paymentsInfo.swapPoolFees,
tokenOut
);
}
// tokenIn -> W_NATIVE_CURRENCY -> tokenOut
else if (
IV3Factory(_paymentsInfo.swapV3Factory).getPool(
tokenIn,
_paymentsInfo.wNativeCurrency,
_paymentsInfo.swapPoolFees
) != address(0)
) {
// @note here
path = abi.encodePacked(
tokenIn,
_paymentsInfo.swapPoolFees,//@ same swap fees
_paymentsInfo.wNativeCurrency,
_paymentsInfo.swapPoolFees,//@ same swap fees
tokenOut
);
} else {
revert NoValidSwapPath();
}
}
Key points:
- Only checks one configured fee tier (
swapPoolFees). - No probing of alternative tiers (500, 3000, 10000) or per-leg fee combinations.
- All swaps flow through this builder via
_swapExact→ Quoter → Router; callers includevenueDeposit,distributePromoterPayments,payToVenue(AutoConvert), and_handleRevenue.
Impact
When the chosen fee tier has no pool, every USDC↔LONG swap reverts and the protocol grinds to a halt.
What breaks:
- Venue deposits (USDC → LONG for convenience/affiliate fees and buy-back).
- Promoter payouts (USDC → LONG fee burn; LONG payouts that start in USDC).
- Customer payments that auto-convert LONG → USDC.
Business effect: Operations pause until the owner updates the fee tier. Funds remain safe, but deposits, payouts, and burns are blocked—an outage, not a loss.
Severity: High.
References
- Code:
contracts/v2/platform/BelongCheckIn.sol_buildPath(single-tier discovery with hard revert)_swapUSDCtoLONG,_swapLONGtoUSDC,_swapExact- Callers:
venueDeposit,distributePromoterPayments,payToVenue,_handleRevenue
- Uniswap V3 fee tiers: 500 (0.05%), 3000 (0.3%), 10000 (1.0%)
Proof of Concept
<details> <summary>Test that triggers NoValidSwapPath by setting a non-standard fee tier</summary>Add this test to /home/jo/audit-comp-belong/test/v2/platform/belong-check-in-bsc-fork.test.ts and run:
LEDGER_ADDRESS=0x0000000000000000000000000000000000000001 PK=0x1000000000000000000000000000000000000000000000000000000000000001 npx hardhat test --grep "Inflexible swap path discovery" test/v2/platform/belong-check-in-bsc-fork.test.ts
describe('Security: Inflexible swap path discovery', () => {
it('reverts with NoValidSwapPath when configured fee tier has no pools for both direct and WBNB route', async () => {
const { belongCheckIn, admin, helper, signer, USDC, USDC_whale } = await loadFixture(fixture);
// Set an invalid/unavailable fee tier to force _buildPath to fail
const wrongFeeTier = 4242 as unknown as number; // non-standard tier
const paymentsInfoNew = {
slippageBps: paymentsInfo.slippageBps,
swapPoolFees: wrongFeeTier,
swapV3Factory: paymentsInfo.swapV3Factory,
swapV3Router: paymentsInfo.swapV3Router,
swapV3Quoter: paymentsInfo.swapV3Quoter,
wNativeCurrency: paymentsInfo.wNativeCurrency,
usdc: paymentsInfo.usdc,
long: paymentsInfo.long,
maxPriceFeedDelay: paymentsInfo.maxPriceFeedDelay,
} as BelongCheckIn.PaymentsInfoStruct;
await belongCheckIn.connect(admin).setParameters(paymentsInfoNew, fees, stakingRewards);
// Prepare a valid venue deposit that would trigger USDC->CAKE swap for convenience fee
const uri = 'no-path-expected';
const amount = await u(10, USDC);
const venue = USDC_whale.address;
const message = ethers.utils.solidityKeccak256(
['address', 'bytes32', 'string', 'uint256'],
[venue, ethers.constants.HashZero, uri, chainId],
);
const signature = EthCrypto.sign(signer.privateKey, message);
const venueInfo: VenueInfoStruct = {
rules: { paymentType: 1, bountyType: 1, longPaymentType: 0 } as VenueRulesStruct,
venue,
amount,
referralCode: ethers.constants.HashZero,
uri,
signature,
};
const willBeTaken = convenienceFeeAmount.add(amount);
await USDC.connect(USDC_whale).approve(belongCheckIn.address, willBeTaken);
await expect(belongCheckIn.connect(USDC_whale).venueDeposit(venueInfo)).to.be.revertedWithCustomError(
belongCheckIn,
'NoValidSwapPath',
);
});
});
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 path builder hard-codes a single configured fee tier and does not probe alternative tiers or per-leg fee combinations before reverting.
Impact
Deposits, promoter payouts and fee buy-backs that need a swap are blocked until the owner updates the fee tier; funds remain safe because the whole transaction reverts.
What the attacker needed
Owner sets a fee tier with no pool
The fix
The path builder should probe alternative fee tiers and per-leg fee combinations instead of reverting on a single configured tier.
How it was found
- Set the contract's swap fee tier to a non-standard value with no pools.
- Prepare a valid venue deposit that would trigger a token swap for the convenience fee.
- Call venueDeposit and observe the transaction revert with NoValidSwapPath.
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.
A smart contract here needs to swap one token for another and asks a decentralised exchange (Uniswap) where to do it. Uniswap pools are grouped by a 'fee tier', a small percentage charged per trade, and the contract only ever looks in one tier. If no pool exists at that one tier, the swap fails and the whole action is cancelled, so deposits and payouts stop working until an admin changes the setting.
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.