-
Notifications
You must be signed in to change notification settings - Fork 29
feat: add aave hook dappid into hooks info app data #640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds a new public readonly mapping from Aave flash loan types to dApp IDs and updates order hook preparation so getOrderHooks derives the appropriate dappId and injects it into both pre-hook and post-hook call data during order processing. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant AaveCollateralSwapSdk
participant PreHook
participant PostHook
Note over AaveCollateralSwapSdk: getOrderHooks(flashLoanType, ...)
Caller->>AaveCollateralSwapSdk: request order hooks
AaveCollateralSwapSdk->>AaveCollateralSwapSdk: dappId = AAVE_DAPP_ID_PER_TYPE[flashLoanType]
AaveCollateralSwapSdk->>PreHook: call with callData { ..., dappId }
PreHook-->>AaveCollateralSwapSdk: pre-hook result
AaveCollateralSwapSdk->>PostHook: call with callData { ..., dappId }
PostHook-->>AaveCollateralSwapSdk: post-hook result
AaveCollateralSwapSdk-->>Caller: assembled hooks with injected dappId
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
anxolin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just the naming convention doesn't match the other ones
Co-authored-by: Anxo Rodriguez <[email protected]>
| dappId, | ||
| }, | ||
| ], | ||
| post: [ | ||
| { | ||
| target: expectedInstanceAddress, | ||
| callData: postHookCallData, | ||
| gasLimit: DEFAULT_HOOK_GAS_LIMIT.post.toString(), | ||
| dappId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for the same type of hook to be set for both pre and post hooks at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can u expand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess he meant, for the same "flow / app" to add both pre and post hook in the same order. And the answer is yes. These orders have the 2 hooks.
| ]) | ||
| } | ||
|
|
||
| readonly AAVE_DAPP_ID_PER_TYPE: Record<AaveFlashLoanType, string> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: it should be a static field or a const. No reason to make it an instance field
|
Reopened: #645 |
passing hooks dappid already added into registry -> aave://flashloans/v3/repay
Summary by CodeRabbit