F-2025-0010·interface-mismatch

Bera_Module::bera_kodiakv3_swap broken due to deadline parameter mismatch

Fixedvaultetfstrategyd2-contracts
TL;DR

bera_kodiakv3_swap passes a deadline field inside IKodiakV3.ExactInputParams, but the actual struct does not declare a deadline. The ABI mismatch causes every Kodiak V3 swap routed through the strategy to revert.

Severity
MEDIUM
Impact
MEDIUM
Likelihood
HIGH
Method
MManual review
CAT.
Complexity
LOW
Exploitability
HIGH
02Section · Description

Description

Bera_Module::bera_kodiakv3_swap calls Kodiak's SwapRouter02::exactInput (similar to Uniswap V3) to execute a swap:

solidity
function bera_kodiakv3_swap(address token, uint amount, uint amountMin, bytes calldata path) external
onlyRole(EXECUTOR_ROLE) nonReentrant {
validateToken(token);
IERC20(token).approve(address(kodiakv3swap), amount);
kodiakv3swap.exactInput(IKodiakV3.ExactInputParams({
path: path,
recipient: address(this),
deadline: type(uint256).max,
amountIn: amount,
amountOutMinimum: amountMin
}));
}

The deadline field is included in the strategy's call but is not present in the actual SwapRouter02.ExactInputParams struct deployed on Berachain (Kodiak's V3 router omits deadline from the struct, unlike Uniswap V3 which includes it):

solidity
struct ExactInputParams {
bytes path;
address recipient;
uint256 amountIn;
uint256 amountOutMinimum;
}

The ABI encoding therefore does not match, and every call to bera_kodiakv3_swap reverts.

The audit included a Foundry PoC (test_bera_kodiakv3_swap) that demonstrates the revert.

03Section · Impact

Impact

  • Swaps executed through Kodiak V3 always revert.
  • The strategy cannot use Kodiak V3 liquidity on Berachain at all.
04Section · Recommendation

Recommendation

Remove deadline from IKodiakV3.ExactInputParams. Add a separate uint256 deadline parameter to bera_kodiakv3_swap and enforce it with a require(block.timestamp <= deadline, "Expired") check before the swap call (related to the wider "Improper deadline handling" finding).

05Section · Resolution

Resolution

D2: Fixed in 84dbcf9.

Cyfrin: Verified.

Status
Fixed
Fix commit
84dbcf9
F-2025-0010