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 constructorCall to sol! #493

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

leruaa
Copy link
Contributor

@leruaa leruaa commented Jan 22, 2024

Motivation

I needed to encode constructor args to create a contract creation tx, and saw #482.

Solution

In sol-types

  • Adding SolConstructor trait
  • Handle constructor in function::expand() (creating a constructorCall struct that impl SolConstructor)

In json-abi

  • impl ToSol for Constructor
  • Adding AbiFunctionKw::Constructor variant
  • Update fixtures in "tests/abi"

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

crates/json-abi/src/to_sol.rs Outdated Show resolved Hide resolved
crates/sol-macro/src/expand/function.rs Outdated Show resolved Hide resolved
crates/sol-types/src/types/function.rs Outdated Show resolved Hide resolved
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@DaniPopes DaniPopes merged commit a315b0d into alloy-rs:main Jan 23, 2024
20 of 21 checks passed
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