Skip to content

Conversation

@Orland0x
Copy link
Contributor

@Orland0x Orland0x commented Nov 28, 2025

Summary by CodeRabbit

Release Notes

  • New Features

    • Added affiliate fee support for cross-chain transactions, enabling new revenue-sharing capabilities for ecosystem partners.
  • Chores

    • Updated infrastructure configuration to enhance cross-chain service reliability and optimize fee handling accuracy.

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Nov 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
bob-docs Ready Ready Preview Comment Nov 28, 2025 11:06am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Walkthrough

The LayerZero gateway integration in the SDK has been updated with a new OFFRAMP_COMPOSER address and revised ABI encoding for compose messages. The destination compose message now includes satSolverFeeMax, satAffiliateFee, and affiliateFeeRecipient fields, replacing the previous satFeesMax field.

Changes

Cohort / File(s) Change Summary
LayerZero Gateway Configuration
sdk/src/gateway/layerzero.ts
Updated OFFRAMP_COMPOSER address from 0xaffBF9ECC4a23adfFe887FB859654B8B780CCed0 to 0x7E6E65FaeB4ef08557928F78d71fa089a409299F; added descriptive comment for LAYERZERO_STRATEGY; refactored ABI encoding for LayerZero destination compose messages to include new fee fields (satSolverFeeMax, satAffiliateFee) and affiliateFeeRecipient, replacing satFeesMax; updated data mappings for both bitcoin-to-L0 and L0-to-L0 paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the new OFFRAMP_COMPOSER address is correct and corresponds to the updated contract
  • Confirm ABI encoding for the new fee and recipient fields matches the LayerZero compose interface specification
  • Ensure fee field mappings (overallFeeSatssatSolverFeeMax, affiliateFeeSatssatAffiliateFee) are applied consistently in both code paths

Possibly related PRs

Suggested reviewers

  • gregdhill
  • nakul1010

Poem

🐰 A hop and a skip through LayerZero's lane,
New fees and recipients dance in the chain,
Composer addresses gleam fresh and bright,
ABI encodings aligned just right! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'allow affiliate fee with offramp from layerzero chains' accurately reflects the main change: adding affiliate fee support in the LayerZero offramp ABI encoding.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/use-v2-orders-in-offramp-composer

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ab33ad7 and f7351a5.

📒 Files selected for processing (1)
  • sdk/src/gateway/layerzero.ts (2 hunks)
⏰ 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). (1)
  • GitHub Check: test
🔇 Additional comments (2)
sdk/src/gateway/layerzero.ts (2)

617-631: I'll help you verify the data properties and ABI structure in this LayerZero integration. Let me search for the type definitions and validate that all required properties exist.
<function_calls>

#!/bin/bash

Search for feeBreakdown type definition and usage

echo "=== Searching for feeBreakdown type definition ==="
rg -n "feeBreakdown" --type ts -A 3 -B 2 | head -50

echo ""
echo "=== Searching for affiliateFeeRecipient ==="
rg -n "affiliateFeeRecipient" --type ts -A 2 -B 2 | head -50

echo ""
echo "=== Searching for overallFeeSats ==="
rg -n "overallFeeSats" --type ts -A 2 -B 2 | head -50


</function_calls>

<function_calls>

#!/bin/bash

Check the layerzero.ts file to understand the context around line 617

echo "=== Viewing context around lines 610-635 in layerzero.ts ==="
sed -n '610,635p' sdk/src/gateway/layerzero.ts


</function_calls>


54-59: Contract address verified and deployed. Code changes are correct.

The new OFFRAMP_COMPOSER address (0x7E6E65FaeB4ef08557928F78d71fa089a409299F) is confirmed deployed on BOB chain with valid bytecode. The ABI encoding changes (lines 617-624) properly map the updated fee structure fields (satSolverFeeMax, satAffiliateFee, affiliateFeeRecipient) with corresponding data sources. All changes are cohesive and ready to merge.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Orland0x, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the SDK to integrate with the latest version of the OfframpComposer contract. The core changes involve updating the contract address and modifying the ABI for offramp order creation to support detailed affiliate fee parameters. This ensures the SDK remains compatible with the updated contract logic, allowing for more precise control and transparency over fee distribution in cross-chain transactions.

Highlights

  • Offramp Composer Contract Address Update: The OFFRAMP_COMPOSER constant in the SDK has been updated to point to a new contract address, reflecting an upgrade to the latest version of the OfframpComposer.
  • Offramp Order ABI Parameter Changes: The composeMsg function's ABI has been modified to support more granular fee handling. Specifically, satFeesMax was replaced by satSolverFeeMax, and new parameters satAffiliateFee and affiliateFeeRecipient were introduced to explicitly manage affiliate fees during offramp order creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Orland0x Orland0x changed the title feat: update abi and contract address in sdk to use latest OfframpComposer feat: allow affiliate fee with offramp from layerzero chains Nov 28, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the OFFRAMP_COMPOSER contract address and modifies the ABI for creating cross-chain offramp orders to support affiliate fees. The changes are consistent and correctly implement the new parameters for the composeMsg. I've added one suggestion to improve the readability of the long ABI string.

@nakul1010 nakul1010 merged commit 279b982 into master Nov 28, 2025
8 checks passed
@nakul1010 nakul1010 deleted the feat/use-v2-orders-in-offramp-composer branch November 28, 2025 11:49
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.

3 participants