-
Notifications
You must be signed in to change notification settings - Fork 0
fix: configure send scripts #75
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
Conversation
… cross-chain bridge configuration
…rt multiple parameters
There was a problem hiding this 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
IexecLayerZeroBridgesetup. - 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. |
| enforcedOptions[0] = EnforcedOptionParam(targetParams.lzChainId, 1, _extraOptions); | ||
| enforcedOptions[1] = EnforcedOptionParam(targetParams.lzChainId, 2, _extraOptions); |
Copilot
AI
Jul 8, 2025
There was a problem hiding this comment.
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.
| 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); |
| MessagingFee memory fee = iexecLayerZeroBridge.quoteSend(sendParam, false); | ||
| console.log("Fee amount: ", fee.nativeFee); | ||
|
|
||
| vm.startBroadcast(); |
Copilot
AI
Jul 8, 2025
There was a problem hiding this comment.
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
| enforcedOptions[0] = EnforcedOptionParam(targetParams.lzChainId, 1, _extraOptions); | ||
| enforcedOptions[1] = EnforcedOptionParam(targetParams.lzChainId, 2, _extraOptions); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
Co-authored-by: Zied Guesmi <[email protected]>
No description provided.