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

Nested Struct encoding example #1129

Merged
merged 4 commits into from
Feb 27, 2024
Merged

Nested Struct encoding example #1129

merged 4 commits into from
Feb 27, 2024

Conversation

kamuik16
Copy link
Contributor

Closes #1095

@kamuik16
Copy link
Contributor Author

Ignore the cast balance commit. It already got merged in another PR #1128.

"type": "function"
}
```
which reads: The function `f` takes 1 input of type tuple with three components: a string, a uint256, and another tuple representing the nested struct with components addr of type address and amount of type uint256.
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add an example of what this looks like when invoked? otherwise lgtm

Choose a reason for hiding this comment

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

can we add an example of what this looks like when invoked? otherwise lgtm

Like how? adding a transaction example having MyStruct?

Copy link
Collaborator

Choose a reason for hiding this comment

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

like how you would pass it to e.g. constructor args for forge create, or for abi encoding with cast abi-encode

Copy link
Contributor Author

@kamuik16 kamuik16 Feb 26, 2024

Choose a reason for hiding this comment

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

like how you would pass it to e.g. constructor args for forge create, or for abi encoding with cast abi-encode

added examples for both forge create and cast abi-encode, accidentally replied from my another acc on the above comment.

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

lgtm, pending @onbjerg

@Evalir Evalir requested a review from onbjerg February 26, 2024 17:35
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm, thank u !

@onbjerg onbjerg merged commit 1d87947 into foundry-rs:master Feb 27, 2024
1 check passed
@kamuik16 kamuik16 deleted the nested-encoding-example branch February 27, 2024 14:49
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.

feat(docs): Add more complex/nested encoding examples
4 participants