🗞️ foundry scripts for LayerZero - #1334
Merged
Merged
Conversation
shankars99
commented
Mar 3, 2025
Contributor
|
Question I have is should we change the lower level scripts structure to make them more easily callable at the top level via this import? |
Contributor
|
I think this is the best way to go, we should prioritize implementing this package. |
St0rmBr3w
reviewed
Mar 6, 2025
shankars99
marked this pull request as ready for review
March 7, 2025 20:46
shankars99
marked this pull request as draft
March 28, 2025 15:47
…-foundry-tooling Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
…ride it in foundry.toml Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
Signed-off-by: shankar <shankar@layerzerolabs.org>
ravinagill15
force-pushed
the
feat/foundry-scripts
branch
from
July 7, 2025 21:28
5ccd540 to
c0efbc7
Compare
ravinagill15
marked this pull request as ready for review
July 8, 2025 18:14
ravinagill15
reviewed
Jul 8, 2025
ravinagill15
reviewed
Jul 8, 2025
ItsAdel
approved these changes
Jul 10, 2025
ItsAdel
left a comment
Contributor
There was a problem hiding this comment.
minor nit, but everything looks good to me
shankars99
added a commit
that referenced
this pull request
Jul 20, 2025
Signed-off-by: shankar <shankar@layerzerolabs.org> Co-authored-by: ravinagill15 <ravina@layerzerolabs.org>
mattsse
pushed a commit
to mattsse/devtools
that referenced
this pull request
Aug 12, 2025
Signed-off-by: shankar <shankar@layerzerolabs.org> Co-authored-by: ravinagill15 <ravina@layerzerolabs.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scripting in foundry
Across LayerZero we have a bunch of scripts -
Krak's Gas Profiling - https://github.com/LayerZero-Labs/devtools/tree/main/examples/oft/scripts
Dan's lzReceive Simulate - https://github.com/DanL0/integrations-foundry-tooling
Some of these scripts are baked into examples or are stand alone repositories. This PR aims to fix that by:
@layerzerolabs/script-devtools-evm-foundrylocated at/packages/script-devtools-evm-foundry(following what we do withTestHelper)LZScriptsthat exports scripts internal to itGasProfileandSimulateReceive) these actually implement the foundry script.Doing this not only gives developers the ability to import these helpful scripts into their packages
But also run them from the terminal due to the compilation of
script/LZScript.s.solgenerating theartifactsfor all the Scripts with arun()function.$ forge script SimulateReceive [⠊] Compiling... No files changed, compilation skipped Traces: [1406766] → new SimulateReceive@0x9f7cF1d1F558E57ef88a59ac3D47214eF25B6A06 └─ ← [Return] 6916 bytes of code [6585] SimulateReceive::run() ├─ [0] VM::ffi(["curl", "-X", "GET", "https://scan.layerzero-api.com/v1/messages/tx/0x88a79d59222628aba22c5c616580212c80beae353aaa8ffbd3976dd5aa5d12f8", "-H 'accept: application/json'"]) │ └─ ← [Revert] vm.ffi: FFI is disabled; add the `--ffi` flag to allow tests to call external commands └─ ← [Revert] vm.ffi: FFI is disabled; add the `--ffi` flag to allow tests to call external commands Gas used: 27649 Error: script failed: vm.ffi: FFI is disabled; add the `--ffi` flag to allow tests to call external commands(This fails because I didn't use the right flags)
Note: This works for scripts that have
run()implemented. So if it is a custom implementation like Gas Profiler you should be creating a new script underscript/