Skip to content
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

Final Version Of BeamOFT and BeamOFTAdapter Bridge Build #2

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

fabriziogianni7
Copy link
Collaborator

@fabriziogianni7 fabriziogianni7 commented Nov 28, 2024

Description

In this PR, there is the final version of OFT and OFTAdapter contracts, needed to deploy layerzero v2 contracts with a low effort.

Help To The Hero Reviewing This

Important to review:

Contracts

  • BaseBeamBridge: It's a base contract containig common logic for BeamOFT and BeamOFTAdapter
  • BeamOFTAdapter: It's the contract inheriting from BaseBeamBridge and lz OFTAdapter. it applies its logic for custom fees.
  • BeamOFT: It's the contract inheriting from BaseBeamBridge and lz OFT. it applies its logic for custom fees.

Deploy Scripts

Deploy scripts are important and can hide some security issue. have a review to DeployBeamOFT.sol and DeployBeamOFTAdapter.sol

Tests

Have a look to BeamBridgeTest to see how the tests are made and if they make sense

Custom Fees Calculation

I would like to bring the attention of the reviewer toBeamOFT::_debit, BeamOFT::_debitView, BeamOFTAdapter::_debit, BeamOFTAdapter::_debitView since it can hide some bug in the fee calculation. Please, check the tests to validate the fee calculation

Run Tests

to run test:

forge test

Coverage

to run test coverage:

make coverage

current coverage is 100% 🧨🧨🧨:

File % Lines % Statements % Branches % Funcs
contracts/ERC20/BeamOFT.sol 100.00% (14/14) 100.00% (16/16) 100.00% (5/5) 100.00% (3/3)
contracts/ERC20/BeamOFTAdapter.sol 100.00% (14/14) 100.00% (16/16) 100.00% (5/5) 100.00% (3/3)
contracts/ERC20/base/BaseBeamBridge.sol 100.00% (7/7) 100.00% (8/8) 100.00% (1/1) 100.00% (3/3)
Total 100.00% (35/35) 100.00% (40/40) 100.00% (11/11) 100.00% (9/9)

Other Stuff

Some example transaction

sending LINK back and forth from sepolia to beam

@fabriziogianni7 fabriziogianni7 changed the title Final Version Of OFT and OFT adapter Bridge Build Final Version Of BeamOFT and BeamOFTAdapter Bridge Build Nov 28, 2024
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