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

Sol Type re-factoring #20

Merged
merged 5 commits into from
May 5, 2023
Merged

Sol Type re-factoring #20

merged 5 commits into from
May 5, 2023

Conversation

prestwich
Copy link
Member

This creates a new trait that distinguishes SolType from SolDataType

motivation:

  • structs and primtives can be struct properties, but errors and events cannot
  • capture above relationship in type system
  • do not implement eip712 for errors or events (As it is always incorrect behavior)
  • do not implement encodePacked for errors or events (same reason)

solution:

  • Introduce a new trait which describes data types and includes 712 and encodePacked
  • this trait is implemented for structs, udts, primitives, compound types

new type system

  • SolType
    • SolDataType
      • primitive types
      • UDTs
      • SolStruct
    • SolError
    • SolEvent (TODO)
    • SolCallArgs (TODO)

@prestwich prestwich requested a review from DaniPopes May 2, 2023 21:00
@prestwich prestwich self-assigned this May 2, 2023
abi/src/sol_types/sol_error.rs Outdated Show resolved Hide resolved
abi/src/sol_types/sol_error.rs Outdated Show resolved Hide resolved
@DaniPopes DaniPopes merged commit f9af426 into main May 5, 2023
@DaniPopes DaniPopes deleted the prestwich/sol_error.rs branch May 15, 2023 21:20
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