Skip to content

Conversation

@gfournierPro
Copy link
Contributor

No description provided.

@gfournierPro gfournierPro self-assigned this Jul 8, 2025
Copy link
Contributor

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

This PR refines the LayerZero bridge configuration and ensures the Arbitrum→Ethereum send script actually broadcasts transactions.

  • Adjusts the number and values of enforced options in the IexecLayerZeroBridge setup.
  • Adds vm.startBroadcast() in the send script to enable real on‐chain execution.

Reviewed Changes

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

File Description
script/bridges/layerZero/IexecLayerZeroBridge.s.sol Expanded enforcedOptions array to two entries and updated their IDs.
script/SendFromArbitrumToEthereum.s.sol Inserted vm.startBroadcast() before calling send.

Comment on lines 77 to 78
enforcedOptions[0] = EnforcedOptionParam(targetParams.lzChainId, 1, _extraOptions);
enforcedOptions[1] = EnforcedOptionParam(targetParams.lzChainId, 2, _extraOptions);
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider replacing the hardcoded option type values 1 and 2 with named constants (e.g., OPTION_TYPE_PRIMARY, OPTION_TYPE_SECONDARY) to improve readability and reduce the risk of errors.

Suggested change
enforcedOptions[0] = EnforcedOptionParam(targetParams.lzChainId, 1, _extraOptions);
enforcedOptions[1] = EnforcedOptionParam(targetParams.lzChainId, 2, _extraOptions);
enforcedOptions[0] = EnforcedOptionParam(targetParams.lzChainId, OPTION_TYPE_PRIMARY, _extraOptions);
enforcedOptions[1] = EnforcedOptionParam(targetParams.lzChainId, OPTION_TYPE_SECONDARY, _extraOptions);

Copilot uses AI. Check for mistakes.
MessagingFee memory fee = iexecLayerZeroBridge.quoteSend(sendParam, false);
console.log("Fee amount: ", fee.nativeFee);

vm.startBroadcast();
Copy link

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

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

[nitpick] After broadcasting, consider calling vm.stopBroadcast() once the send call completes to clearly delimit the broadcast session and prevent unintended subsequent transactions.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.80%. Comparing base (1862ccc) to head (0790644).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #75   +/-   ##
=======================================
  Coverage   79.80%   79.80%           
=======================================
  Files           4        4           
  Lines         104      104           
  Branches        7        7           
=======================================
  Hits           83       83           
  Misses         20       20           
  Partials        1        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 77 to 78
enforcedOptions[0] = EnforcedOptionParam(targetParams.lzChainId, 1, _extraOptions);
enforcedOptions[1] = EnforcedOptionParam(targetParams.lzChainId, 2, _extraOptions);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need both ?

Copy link
Contributor Author

@gfournierPro gfournierPro Jul 8, 2025

Choose a reason for hiding this comment

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

I think we can remove the second line, but that was the initial deployment way.

uint16 internal constant SEND = 1; // a standard token transfer via lzReceive
uint16 internal constant SEND_AND_CALL = 2; // a token transfer, followed by a composable call via lzCompose

the second line could be usefull for later and saw that on other configuration repo

@gfournierPro gfournierPro merged commit 0d0c9e7 into main Jul 8, 2025
4 checks passed
@gfournierPro gfournierPro deleted the fix/configure-send-scripts branch July 8, 2025 13:19
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