-
Notifications
You must be signed in to change notification settings - Fork 644
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
docs: document struct coded and add examples #406
docs: document struct coded and add examples #406
Conversation
I think the struct encoding file needs to be in summary.md to be rendered |
moved to new |
the error does not make any sense to me.... |
Me neither, maybe it's because of the extra newline before the code block in the examples list? 🤔 |
was the line indent lol |
Can we also make it work so that people can copy/paste struct definitions in line? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got some structural nits/phrasing but also have one comment for one of the examples. Will just batch commit the nits except for the one I'm unsure about
src/reference/cast/cast-send.md
Outdated
Structs are encoded as tuples, See [struct encoding](./reference/common/struct-encoding.md) | ||
|
||
```sh | ||
cast send --ledger 0x... "myfunction((address,uint256))" 0x... 1 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Structs are encoded as tuples, See [struct encoding](./reference/common/struct-encoding.md) | |
```sh | |
cast send --ledger 0x... "myfunction((address,uint256))" 0x... 1 | |
``` | |
Structs are encoded as tuples (see [struct encoding](./reference/common/struct-encoding.md)) | |
```sh | |
cast send --ledger 0x... "myfunction((address,uint256))" 0x... 1 | |
``` |
Also, would this not be e.g. cast send "myfunction((address,uint256))" 0x... "(0x..., 1)"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USAGE:
cast send [OPTIONS] <TO> [ARGS]
ARGS:
<TO>
The destination of the transaction.
<SIG>
The signature of the function to call.
<ARGS>...
The arguments of the function to call.
so cast send <to> <sig> <args>
is correct here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ye but args in this case would be "(0x..., 1)". The current example is:
cast send --ledger 0x... "myfunction((address,uint256))" 0x... 1
In other words:
Send using Ledger addr 0x..., call "myfunction" at address 0x... with argument 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guess that makes sense, I only copy pasted the other example tbh
Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
Can merge when the base PR is merged |
document struct ABI codec and add examples to cast (sig, send)
ref foundry-rs/foundry#2151