-
Notifications
You must be signed in to change notification settings - Fork 347
feat: add ens crate from foundry #2376
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
base: main
Are you sure you want to change the base?
Conversation
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.
can we include this in the provider crate instead, I dont think we need an additional crate for this feature
problem is that the ens file needs the |
@mattsse hey! what do you think? |
alloy-contract.workspace = true | ||
alloy-primitives.workspace = true | ||
alloy-provider.workspace = true | ||
alloy-sol-types.workspace = true | ||
async-trait.workspace = true | ||
thiserror.workspace = true |
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.
we can feature gate the async/provider/contract functionality to allow importing just for the utility functions like namehash
the feature should also be re-exported in the meta crate
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.
let's add this to the meta crate crates/alloy
#![cfg_attr(not(test), warn(unused_crate_dependencies))] | ||
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] | ||
|
||
pub mod ens; |
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.
this is unnecessary, we can move everything into lib.rs
Motivation
while working with ENS related stuff, you need utilities like namehash calculation, forward & reverse lookups. these utilities are part of
foundry-common
crate. developers using alloy-rs as a result require importingfoundry-common
crate alongside alloy-rs which doesn't make sense since foundry in turn uses alloy-rs as a dependency. (#2372)Solution
we need to provide ENS utilities to developers using alloy-rs by copying the ens crate from foundry with little modifications:
EnsResolverInstance
type to reflect the latest version (foundry uses old version ofalloy-sol-types
crate)inspect_err
call because it in turn callssh_eprintln
which belongs to the foundry-common crate.PR Checklist