Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing Events for executeSwapExactInputSingle::DexSwapStrategy

Summary

The DexSwapStrategy library lacks event emissions for swap executions in the executeSwapExactInputSingle function. This omission makes it difficult to track and monitor DEX swap transactions off-chain.

Vulnerability Details

In DexSwapStrategy.sol, the executeSwapExactInputSingle function executes critical DEX swaps but does not emit any events to log these operations:

function executeSwapExactInputSingle(
Data storage self,
SwapExactInputSinglePayload memory swapCallData
) internal returns (uint256 amountOut) {
IDexAdapter dexAdapter = IDexAdapter(self.dexAdapter);
return dexAdapter.executeSwapExactInputSingle(swapCallData);
}

Impact

  • No on-chain logging of swap executions

  • Difficulty in tracking individual swap operations

  • Limited ability to monitor swap amounts and tokens involved

  • Challenges in building effective swap monitoring tools and dashboards

  • Reduced transparency for auditing purposes

The function performs a critical swap operation through a DEX adapter:

  1. Takes a SwapExactInputSinglePayload with swap parameters

  • Executes the swap through the DEX adapter

  • Returns the output amount

  • No events are emitted to track this operation

Tools Used

Manual review

Recommendations

Add an event to track swap executions:

event SwapSingleExecuted(
address dexAdapter,
uint256 amountIn,
uint256 amountOut
);
function executeSwapExactInputSingle(
Data storage self,
SwapExactInputSinglePayload memory swapCallData
)
internal
returns (uint256 amountOut)
{
IDexAdapter dexAdapter = IDexAdapter(self.dexAdapter);
amountOut = dexAdapter.executeSwapExactInputSingle(swapCallData);
emit SwapSingleExecuted(
self.dexAdapter,
swapCallData.amountIn,
amountOut
);
return amountOut;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.