Skip to content

Add USDT0 OFT adapter#183

Merged
lastperson merged 2 commits intomainfrom
feat/usdt0-adapter
Apr 8, 2026
Merged

Add USDT0 OFT adapter#183
lastperson merged 2 commits intomainfrom
feat/usdt0-adapter

Conversation

@lastperson
Copy link
Copy Markdown
Collaborator

Closes: #174

@lastperson lastperson requested a review from viatrix April 3, 2026 12:20
@lastperson lastperson self-assigned this Apr 3, 2026
viatrix
viatrix previously approved these changes Apr 6, 2026
@lastperson lastperson requested a review from mpetrunic April 7, 2026 06:41
mpetrunic
mpetrunic previously approved these changes Apr 7, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds USDT0 bridging support to the Repayer via a new LayerZero OFT-based adapter, including unit tests and fork tests, and updates deployment/upgrade scripts to pass the new configuration parameter.

Changes:

  • Introduce USDT0Adapter + IOFT/ILayerZero interfaces and add Provider.USDT0 routing in Repayer.
  • Refactor Stargate endpoint ID mapping into a shared LayerZeroHelper used by multiple adapters.
  • Add unit + fork tests and extend deployment/upgrade scripts/config to include USDT0OFT.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
contracts/Repayer.sol Adds USDT0Adapter inheritance and dispatch for Provider.USDT0.
contracts/utils/USDT0Adapter.sol New adapter to send USDT0 via LayerZero OFT.
contracts/utils/LayerZeroHelper.sol Centralizes LayerZero endpoint-id mapping.
contracts/utils/StargateAdapter.sol Switches to LayerZeroHelper mapping for dstEid.
contracts/interfaces/IOFT.sol New minimal OFT interface used by USDT0 adapter/tests.
contracts/interfaces/ILayerZero.sol New shared structs for LayerZero/OFT operations.
contracts/interfaces/IStargate.sol Reuses LayerZero structs via import instead of redefining.
contracts/interfaces/IRoute.sol Extends Provider enum with USDT0.
contracts/testing/TestUSDT0OFT.sol Adds test token + OFT adapter/native mocks for unit tests.
contracts/testing/TestRepayer.sol Updates constructor args to include usdt0Oft.
test/Repayer.ts Updates constructor arg count, renames endpoint getter, adds USDT0 unit tests.
specific-fork-test/ethereum/RepayerUSDT0.ts New Ethereum fork test for USDT→USDT0 OFT flow.
specific-fork-test/unichain/RepayerUSDT0.ts New Unichain fork test for USDT0 bridging.
specific-fork-test/arbitrum/RepayerUSDT0.ts New (skipped) Arbitrum fork test for USDT0 bridging.
specific-fork-test/polygon/RepayerUSDT0.ts New (skipped) Polygon fork test for USDT0 bridging.
specific-fork-test/gnosis/RepayerGnosisOmnibridge.ts Updates Repayer constructor arg list (adds ZERO_ADDRESS).
specific-fork-test/ethereum/RepayerGnosisOmnibridge.ts Updates Repayer constructor arg list (adds ZERO_ADDRESS).
specific-fork-test/ethereum/Repayer.ts Updates Repayer constructor arg list (adds ZERO_ADDRESS).
scripts/deploy.ts Passes USDT0OFT into Repayer deploy args and defaults to ZERO_ADDRESS.
scripts/deployRepayer.ts Passes USDT0OFT into Repayer deploy args and defaults to ZERO_ADDRESS.
scripts/deployStandaloneRepayer.ts Passes USDT0OFT into Repayer deploy args and defaults to ZERO_ADDRESS.
scripts/upgradeRepayer.ts Passes USDT0OFT into Repayer upgrade args and defaults to ZERO_ADDRESS.
scripts/common.ts Adds ProviderSolidity.USDT0 mapping.
network.config.ts Adds USDT0OFT addresses per-network.
package.json Adds fork-test scripts for Arbitrum/Polygon/Unichain.
.env.example Adds fork-test env vars for USDT/USDT0 holders.
coverage-baseline.json Updates stored coverage baseline values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread network.config.ts Outdated
Comment thread .env.example
Comment thread coverage-baseline.json
Comment thread contracts/testing/TestUSDT0OFT.sol
Comment thread contracts/testing/TestUSDT0OFT.sol
@lastperson lastperson dismissed stale reviews from mpetrunic and viatrix via e864740 April 7, 2026 10:33
@lastperson lastperson requested a review from viatrix April 7, 2026 10:44
@lastperson lastperson merged commit 350ec6d into main Apr 8, 2026
5 checks passed
@lastperson lastperson deleted the feat/usdt0-adapter branch April 8, 2026 06:25
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.

Support USDT0 bridge

4 participants