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

refactor: automate libraries linkage and remove precompiles #1158

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

smol-ninja
Copy link
Member

@smol-ninja smol-ninja commented Jan 22, 2025

While working on docs for custom deployment docs, I found that its very complicated to make custom deployment if foundry.toml contains hard coded libraries' addresses. So I investigated and found a solution to remove them from the foundry.toml and automatically replace placeholders with deployed addresses of libraries.

This now looks neat to me, but may have an issue that I could not think of, so feedbacks are welcome.

Also, lets review and merge it before merging release PR.


Closes #1160.

@smol-ninja

This comment was marked as resolved.

@smol-ninja smol-ninja marked this pull request as draft January 22, 2025 23:38
@smol-ninja smol-ninja marked this pull request as ready for review January 23, 2025 12:50
@smol-ninja smol-ninja requested a review from PaulRBerg January 24, 2025 11:10
@smol-ninja
Copy link
Member Author

@andreivladbrg this PR is now ready for your review. I also added the changelog.

@smol-ninja smol-ninja changed the title build: replace placeholder with deployed libraries refactor: automate libraries linkage and remove precompiles Jan 24, 2025
Copy link
Member

@andreivladbrg andreivladbrg left a comment

Choose a reason for hiding this comment

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

lgtm👍

the code is cleaner now

tests/utils/DeployOptimized.sol Show resolved Hide resolved
@andreivladbrg
Copy link
Member

andreivladbrg commented Jan 24, 2025

gj, with the libraryPlaceholder function it is better organized and aligns with how it actually works behind

@smol-ninja smol-ninja merged commit db3ecfc into staging Jan 24, 2025
9 checks passed
@smol-ninja smol-ninja deleted the build/automate-libraries-linkage branch January 24, 2025 15:04
andreivladbrg added a commit that referenced this pull request Jan 27, 2025
* build: replace placeholder with deployed libraries

* update deploy optimised code

* refactor: remove precompiles

* docs: add explanatory comment in deployOptimizedLockup

* test: generate placeholders from library name

---------

Co-authored-by: Andrei Vlad Birgaoanu <[email protected]>
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