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

[Feature] Add a function that convert solidity function signature to selector #785

Closed
Confucian-e opened this issue Oct 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Confucian-e
Copy link
Contributor

Component

primitives

Describe the feature you would like

I've encountered an issue where I can't easily convert a function signature (type: &str) to a selector (type: Selector), like viem's toFunctionSelector or foundry's cast sig.

Additional context

Do you think it would be necessary to add this function? If so, I'd be willing to submit a PR.

@DaniPopes
Copy link
Member

You can already achieve this with alloy_json_abi::Function::parse("...").unwrap().selector(). Your proposed function would have to return a Result<> either way so I don't think it's worth having a separate function that does this.

@DaniPopes DaniPopes closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants
@Confucian-e @DaniPopes and others