Skip to content

feat: support rebalancing via OFT #2133

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

Merged
merged 44 commits into from
May 21, 2025
Merged

feat: support rebalancing via OFT #2133

merged 44 commits into from
May 21, 2025

Conversation

grasphoper
Copy link
Contributor

@grasphoper grasphoper commented Mar 6, 2025

This PR introduces OFTBridge object, which supports sending any token from Ethereum to OFT-supported chain.

I've tested:

  • sending tokens L1 -> L2 in via running yarn relay with custom inventory config. tx
  • initiation deposit was found successfully and was part of vitrual reserves
  • finalization event was found and matched with initiation

P.S. This PR depends on another PR in contracts repo for some IOFT interfaces from typechain.

Closes ACX-3763, ACX-3764, ACX-3765

@grasphoper grasphoper changed the title OFT support for bots feat: support for rebalancing via OFT Mar 28, 2025
@grasphoper grasphoper marked this pull request as ready for review March 28, 2025 01:52
@grasphoper grasphoper changed the title feat: support for rebalancing via OFT feat: support rebalancing via OFT Mar 28, 2025
Signed-off-by: Ihor Farion <[email protected]>
pxrl
pxrl previously approved these changes May 14, 2025
@pxrl
Copy link
Contributor

pxrl commented May 14, 2025

Just to circle back to this:

it'd also be good to check on tests for this code. There are some pre-established tests for these bridge adapters under test/generic-adapters.

Discussed separately - the experience with the existing tests is that they require a lot of boilerplate, such that the ratio of test:implementation starts to become overweight test. It also debatable how useful some of the tests are, since they're typically being implemented against mocked implementations that may not match reality.

The adapter implementation itself is not super complicated; we should instead aim for a future improvement to narrow the scope of our tests for high leverage and low-maintenance testing.

@grasphoper
Copy link
Contributor Author

@pxrl @bmzig I've updated this PR and corrected the logic for tracking L1 -> L2 events. Previous if conditions made Hub -> Spoke event tracking incorrect. Please take a look. This is the change b3d65ac

✅ L1 -> L2 rebalance test: layerzero scan link

@grasphoper grasphoper requested a review from pxrl May 16, 2025 03:45
Signed-off-by: Ihor Farion <[email protected]>
Signed-off-by: Ihor Farion <[email protected]>
@grasphoper grasphoper requested a review from pxrl May 16, 2025 21:51
@grasphoper grasphoper merged commit 9727888 into master May 21, 2025
4 checks passed
@grasphoper grasphoper deleted the if/add-oft-support branch May 21, 2025 17:29
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.

4 participants