Skip to content

Conversation

@carlos-cow
Copy link
Contributor

General Changes

Added eth_simulateV1 before sending the order.
We override flashloan amount to the factory, min swap amount to the instance and execute both preHook and postHook through multicall3.

@vercel
Copy link

vercel bot commented Nov 21, 2025

@carlos-cow is attempting to deploy a commit to the Aave Team on Vercel.

A member of the Team first needs to authorize it.

@carlos-cow carlos-cow marked this pull request as draft November 21, 2025 12:57
@mgrabina mgrabina changed the base branch from main to feat/activate-l2s-cow-coll-swap November 21, 2025 18:34
@mgrabina mgrabina marked this pull request as ready for review November 21, 2025 18:35
@mgrabina mgrabina merged commit d02feb9 into aave:feat/activate-l2s-cow-coll-swap Nov 21, 2025
1 check failed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +220 to +224
method: 'eth_simulateV1',
params: [simulationPayload] as unknown[],
});
console.log('[CoW][CollateralSwap] PreHook simulation result', result);
return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Simulation always passes even when hooks would revert

The new eth_simulateV1 check never surfaces failures: the multicall is constructed with allowFailure: true (line 197), and in the try block the result is only logged before unconditionally returning true (lines 220-224). Because aggregate3 reports per-call failures via its success flag instead of throwing when allowFailure is true, any reverting pre/post hook will still return success here and the code proceeds to post the order even in simulation-only mode. This defeats the safety gate the simulation was meant to provide and lets invalid hook sequences be sent downstream.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants