Skip to content

fix(json-abi): fallback to tuple types for nested params in to_sol #354

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

Merged
merged 2 commits into from
Oct 9, 2023

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Oct 9, 2023

Motivation

Fixes #349

Solution

When the param type is tuple or tuple[N?]..., emit a tuple type (T, U, V, ...) instead of just the word "tuple" which trips up syn-solidity.

This can only happen in Solc 0.4.X ABI.

This is not actually valid Solidity, but it works in sol! and with other more lenient parser like in forge fmt.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@DaniPopes DaniPopes requested a review from prestwich as a code owner October 9, 2023 04:40
@DaniPopes DaniPopes changed the title fix(json-abi): emit inline tuple types for params in to_sol fix(json-abi): fallback to tuple types for nested params in to_sol Oct 9, 2023
@DaniPopes DaniPopes force-pushed the dani/json-tuple-types branch from 362ea4b to 7a55e0a Compare October 9, 2023 04:57
@DaniPopes DaniPopes merged commit 23bffbf into main Oct 9, 2023
@DaniPopes DaniPopes deleted the dani/json-tuple-types branch October 9, 2023 05:31
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.

[Bug] Expected Parenthesizes
1 participant