Skip to content
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

feat: add ability to generate bindings for chosen contracts #465

Closed
Autoparallel opened this issue Aug 24, 2023 · 1 comment · Fixed by #533 or #535
Closed

feat: add ability to generate bindings for chosen contracts #465

Autoparallel opened this issue Aug 24, 2023 · 1 comment · Fixed by #533 or #535
Assignees
Labels
📝 needs more information issue is not well-defined enough to be solved

Comments

@Autoparallel
Copy link
Collaborator

Idea

Running forge bind may generate a lot of additional contracts that one does not want in their simulation crate. It would be helpful to provide a means via a arbiter.toml or even just an addition to foundry.toml that lists which contract bindings we want specifically.

Is your feature request related to a problem? Please describe.
When running something like forge bind or arbiter bind there can be a massive amount of contract bindings generated when we may only need, say, 5 or so contracts.

Solution

We can provide a typical bind interface and a config file of some sort where a user lists which specific bindings they want to keep. Upon running bind we can output files to a temporary location, grep for the contracts the user wants to keep, adjust the mod.rs file, then move this into the bindings/ module directory in their simulation crate.

Alternative approaches

We could propose changes to forge bind itself and attempt to get this changed at that level.

Additional context

Bug report #439 is very related.

@Autoparallel Autoparallel added arbiter v0.4.0 📝 needs more information issue is not well-defined enough to be solved labels Aug 24, 2023
@Alexangelj
Copy link
Contributor

We might be able to set a foundry environment variable to overwrite the "src" directory and then running forge bind will only build for the contracts in that directory, there's not very good "selection" of contracts in foundry's stuff, only filtering + directory choosing

Another possible way is to make all the contracts we want in the bindings end in ".a.sol" (like the .t.sol files), then we might be able to regex filter out every contract doesnt end in that

@0xJepsen 0xJepsen linked a pull request Sep 28, 2023 that will close this issue
@0xJepsen 0xJepsen self-assigned this Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📝 needs more information issue is not well-defined enough to be solved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants