Skip to content

feat: LayerZero backport#594

Closed
wischli wants to merge 11 commits intorelease-v3.0.2from
backport_layer-zero
Closed

feat: LayerZero backport#594
wischli wants to merge 11 commits intorelease-v3.0.2from
backport_layer-zero

Conversation

@wischli
Copy link
Copy Markdown
Contributor

@wischli wischli commented Sep 1, 2025

Backports #577 to new release-v3.0.2 branch (direct child of release-v3.0.1) for mainnet deployment. Also includes some minor updates for fork tests and deployment addresses to be in sync with the live state.

TODO

  • Deployment script for LayerZero which sets safe as ward due to missing Guarding.wireLayerZero helper
  • Populate all env/*.json with actual data for layer zero adapter
  • Validate in testnet

Diff to main/origin

LayerZeroAdapter.sol

diff --git a/src/adapters/LayerZeroAdapter.sol b/src/common/adapters/LayerZeroAdapter.sol
index 54e01e36..1e627743 100644
--- a/src/adapters/LayerZeroAdapter.sol
+++ b/src/common/adapters/LayerZeroAdapter.sol
@@ -1,6 +1,11 @@
 // SPDX-License-Identifier: BUSL-1.1
 pragma solidity 0.8.28;
 
+import {Auth} from "../../misc/Auth.sol";
+import {CastLib} from "../../misc/libraries/CastLib.sol";
+import {MathLib} from "../../misc/libraries/MathLib.sol";
+
+import {IMessageHandler} from "../interfaces/IMessageHandler.sol";
 import {
     ILayerZeroAdapter,
     IAdapter,
@@ -12,13 +17,7 @@ import {
     Origin,
     LayerZeroSource,
     LayerZeroDestination
-} from "./interfaces/ILayerZeroAdapter.sol";
-
-import {Auth} from "../misc/Auth.sol";
-import {CastLib} from "../misc/libraries/CastLib.sol";
-import {MathLib} from "../misc/libraries/MathLib.sol";
-
-import {IMessageHandler} from "../common/interfaces/IMessageHandler.sol";
+} from "../interfaces/adapters/ILayerZeroAdapter.sol";
  1. File Path Changes
  • Main Branch: Located at src/adapters/LayerZeroAdapter.sol
  • Current Branch: Located at src/common/adapters/LayerZeroAdapter.sol
  1. Import Path Changes
  • Main Branch: Interface at src/adapters/interfaces/ILayerZeroAdapter.sol
  • Current Branch: Interface at src/common/interfaces/adapters/ILayerZeroAdapter.sol
  1. Import Order

ILayerZeroAdapter.sol

diff --git a/src/adapters/interfaces/ILayerZeroAdapter.sol b/src/common/interfaces/adapters/ILayerZeroAdapter.sol
index b60f3a12..ebf1ac06 100644
--- a/src/adapters/interfaces/ILayerZeroAdapter.sol
+++ b/src/common/interfaces/adapters/ILayerZeroAdapter.sol
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 pragma solidity >=0.5.0;
 
-import {IAdapter} from "../../common/interfaces/IAdapter.sol";
+import {IAdapter} from "../IAdapter.sol";

@wischli wischli requested a review from hieronx September 1, 2025 08:10
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 1, 2025

Coverage after merging backport_layer-zero into release-v3.0.2 will be

94.96%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src/common
   BaseValuation.sol100%100%100%100%
   GasService.sol80%50%100%97.65%101, 103, 105, 107, 109, 111, 113, 115, 117, 120, 122, 124, 127, 129, 131, 133, 135, 137, 139, 142, 85, 87, 89, 91, 93, 95, 97, 99
   Gateway.sol100%100%100%100%
   Guardian.sol90.12%64.29%100%93.88%152, 152–153, 50–54
   MessageDispatcher.sol97.40%92.59%100%99.12%63–67
   MessageProcessor.sol95.27%91.07%100%97.70%181, 50–54, 68
   PoolEscrow.sol100%100%100%100%
   Root.sol100%100%100%100%
   TokenRecoverer.sol100%100%100%100%
src/common/adapters
   AxelarAdapter.sol91.11%83.33%100%92.59%44–45, 54–55
   LayerZeroAdapter.sol87.50%100%80%86.84%80–82, 86–87
   MultiAdapter.sol100%100%100%100%
   WormholeAdapter.sol100%100%100%100%
src/common/factories
   PoolEscrowFactory.sol100%100%100%100%
src/common/libraries
   MessageLib.sol100%100%100%100%
   MessageProofLib.sol100%100%100%100%
   PricingLib.sol100%100%100%100%
   RequestCallbackMessageLib.sol89.58%50%100%100%106, 141, 38, 57, 77
   RequestMessageLib.sol89.74%50%100%100%37, 55, 72, 89
src/hooks
   FreelyTransferable.sol55.56%33.33%63.64%62.07%111, 114, 114, 114–117, 117, 117–120, 122, 127–128, 128, 128–129, 129, 129, 131–132, 134, 138–140, 142, 146, 151–153, 52, 74, 76, 80, 82
   FreezeOnly.sol70%66.67%66.67%71.79%106–108, 117–119, 121, 125–126, 77, 79, 96–99
   FullRestrictions.sol97.67%90%100%100%122, 146
   RedemptionRestrictions.sol51.72%25%63.64%58.93%106, 109, 109, 109–112, 112, 112–115, 117, 122–123, 123, 123–124, 124, 124, 126–127, 129, 133–135, 137, 141, 146–148, 52, 74, 76, 80, 82, 85, 87
src/hooks/libraries
   UpdateRestrictionMessageLib.sol90%50%100%100%40, 61, 82
src/hub
   Accounting.sol93.75%96%100%91.53%114–115, 118–119, 134, 137
   Holdings.sol97.46%88%100%100%116, 222, 82
   Hub.sol85.27%44.68%100%90.50%110, 290, 429–430, 433, 433–434, 452, 455, 455–456, 476, 493, 510, 537, 541, 571–572, 572, 572–573, 573, 573, 578, 583, 601, 611, 621, 621, 621, 623, 637, 644–646, 736, 79–80, 80–81, 81–82, 82–83, 83–85
   HubHelpers.sol88.46%87.50%90%88.54%155–157, 163–165, 215, 239, 244–247, 54–55
   HubRegistry.sol93.67%79.17%100%100%104, 110, 116, 33, 44
   ShareClassManager.sol100%100%100%100%
src/managers
   MerkleProofManager.sol79.45%61.11%88.89%84.78%104, 111, 130–131, 131, 131, 133–134, 136–137, 40–41, 44, 54
   OnOfframpManager.sol90.59%82.14%100%94%132, 52, 63, 67–68, 78, 84, 87
src/managers/decoders
   BaseDecoder.sol75%100%75%75%43–44
   CircleDecoder.sol0%100%0%0%11, 16, 20, 22
   VaultDecoder.sol0%100%0%0%10, 104, 110, 15–16, 22, 28, 34, 40, 46, 52, 58, 64, 69, 75, 80, 86, 9, 92, 98
src/misc
   Auth.sol100%100%100%100%
   ERC20.sol100%100%100%100%
   Escrow.sol56.25%33.33%100%66.67%15, 17, 21–22, 22, 22, 24
   IdentityValuation.sol100%100%100%100%
   Multicall.sol83.33%33.33%100%100%17, 17
   Recoverable.sol100%100%100%100%
   ReentrancyProtection.sol90%75%100%100%22
src/misc/libraries
   ArrayLib.sol95.83%75%100%100%26
   BitmapLib.sol100%100%100%100%
   BytesLib.sol90.09%54.17%100%100%109, 120, 131, 14, 142, 153, 16, 164, 175, 186, 87
   CastLib.sol95.24%66.67%100%100%31, 7
   EIP712Lib.sol100%100%100%100%
   MathLib.sol93%73.68%100%97.18%34–35, 44, 46, 48, 50, 52
   MerkleProofLib.sol100%100%100%100%
   SafeTransferLib.sol96.97%92.86%100%100%75
   SignatureLib.sol95.24%80%100%100%17
   StringLib.sol100%100%100%100%
   TransientArrayLib.sol100%100%100%100%
   TransientBytesLib.sol100%100%100%100%
   TransientStorageLib.sol100%100%100%100%
src/spoke
   BalanceSheet.sol99.45%96.55%100%100%59
   ContractUpdater.sol100%100%100%100%
   ShareToken.sol93.59%66.67%94.44%98.04%101, 113, 146, 33
   Spoke.sol90.86%74%94.87%97.42%124, 124–125, 125, 127, 154, 202, 210, 282, 302, 317, 330, 340–342, 361, 382, 405, 453, 467, 533, 533–534, 534, 534–535, 535, 535, 98, 98–99, 99
src/spoke/factories
   TokenFactory.sol92%50%100%94.74%24–25
src/spoke/libraries
   UpdateContractMessageLib.sol89.74%50%100%100%110, 40, 62, 86
src/vaults
   AsyncRequestManager.sol94.29%82.35%93.48%98.43%194, 197, 200, 203, 214, 226, 231, 250, 257, 290, 324, 438, 443, 482, 484, 76–77, 90–91
   AsyncVault.sol96.25%83.33%95%98.15%148, 49
   BaseVaults.sol92.61%80.77%95.35%94.03%126, 139, 246, 319–320, 406–407, 87–88, 88, 88–90
   SyncDepositVault.sol100%100%100%100%
   SyncManager.sol83.19%70%87.50%85.71%106–107, 109, 161, 181–182, 227–228, 59–61, 63, 63, 63, 65, 70, 75
   VaultRouter.sol91.16%53.85%100%98.97%105, 108–109, 122, 122–123, 123, 138–139, 158, 158, 175, 221
src/vaults/factories
   AsyncVaultFactory.sol88.89%50%100%92.86%36, 46
   SyncDepositVaultFactory.sol90.91%50%100%94.44%45, 58

@lemunozm
Copy link
Copy Markdown
Contributor

lemunozm commented Feb 4, 2026

Can we merge this? Or we no longer need this?

@wischli
Copy link
Copy Markdown
Contributor Author

wischli commented Mar 5, 2026

Closing as unnecessary

@wischli wischli closed this Mar 5, 2026
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.

2 participants