From 2f906037a968a78c6d357b8395198523e3c34be3 Mon Sep 17 00:00:00 2001 From: lash Date: Thu, 24 Feb 2022 20:05:38 +0000 Subject: [PATCH] Add more detail on examples --- man/eth-encode.custom.groff | 13 +++++++++++++ man/eth-encode.examples.groff | 23 ++++++++++++++++++++--- man/eth-encode.head.groff | 4 ++-- man/eth-encode.overrides | 2 +- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/man/eth-encode.custom.groff b/man/eth-encode.custom.groff index ca6e569..f81958d 100644 --- a/man/eth-encode.custom.groff +++ b/man/eth-encode.custom.groff @@ -1,3 +1,16 @@ +.SH MODES + +The modes parameter specifies what kind of operaion the encoding should be generated for. There are three valid modes: + +.SS tx +Generates a transaction that changes state. Used with \fB--format\fP \fIrpc\fP it will generate an \fIeth_sendRawTransaction\fP jsonrpc object. Used with \fB--format\fP \fIbin\fP it outputs signed RLP only in hexdecimal. + +.SS call +Generates a query that reads state. Used with \fB--format\fP \fIrpc\fP it will generate a \fIeth_call\fP jsonrpc object with applicable fields filled out from environment, arguments and/or rpc retrieval. \fB--format\fP \fIbin\fP is not valid for this mode. + +.SS arg +Encodes the argument part only, optionally with a method signature. \fB--format\fP \fIrpc\fP is not valid for this mode. + .SH SPECIFYING VALUES Dynamic value types are not yet supported. diff --git a/man/eth-encode.examples.groff b/man/eth-encode.examples.groff index 5e86f43..f9de7ae 100644 --- a/man/eth-encode.examples.groff +++ b/man/eth-encode.examples.groff @@ -1,5 +1,22 @@ -.SS Build a signed ERC20 transfer - +.SS Build a signed ERC20 transfer in wire format, setting nonce and fee details manually. .EX -$ eth-encode -y <\fIkey_file_path\fP> -e <\fItoken_address\fP> --signature transfer a:00000000000000000000000000000000DeaDBeef u:1024 +$ eth-encode -f bin -y <\fIkey_file_path\fP> -e <\fItoken_address\fP> --fee-price 1000000000 --fee-limit 100000 --nonce 42 --signature transfer a:00000000000000000000000000000000DeaDBeef u:1024 +.EE + +.SS Build Smart contract call with method signature, retrieving fee and nonce settings from rpc + +\fBeth-encode\fP --mode call -f rpc -e <\fItoken_address\fP> --signature balanceOf -p <\fIrpc_endpoint\fP> a:deadbeef + +.SS Build smart contract ERC20 transfer argument with signature +.EX +\fBeth-encode\fP --mode arg --signature transfer a:00000000000000000000000000000000DeaDBeef u:1024 +.TP Outupt +a9059cbb00000000000000000000000000000000000000000000000000000000deadbeef0000000000000000000000000000000000000000000000000000000000000400 +.EE + +.SS Build smart contract ERC20 transfer argument types without signature +.EX +\fBeth-encode\fP --mode arg a:00000000000000000000000000000000DeaDBeef u:1024 +.TP Output +00000000000000000000000000000000000000000000000000000000deadbeef0000000000000000000000000000000000000000000000000000000000000400 .EE diff --git a/man/eth-encode.head.groff b/man/eth-encode.head.groff index 0f00480..aa337c9 100644 --- a/man/eth-encode.head.groff +++ b/man/eth-encode.head.groff @@ -4,13 +4,13 @@ eth-encode \- Encode arbitrary contract calls and transactions .SH SYNOPSIS -\fBeth-encode\fP [ -p \fIrpc_provider\fP ] [ -i \fIchain_Spec\fP] [ -s ] [ -w ] [ -e \fIsmart_contract_address\fP ] --signature \fIcontract_method_name\fP [ \fIvalue_specifiers\fP ... ] +\fBeth-encode\fP [ --mode \fImode\fP ] [ -f \fIformat\fP ] [ -p \fIrpc_provider\fP ] [ -i \fIchain_Spec\fP] [ -s ] [ -w ] [ -e \fIsmart_contract_address\fP ] --signature \fIcontract_method_name\fP [ \fIvalue_specifiers\fP ... ] .SH DESCRIPTION Generate wire-format or rpc query any EVM smart contract call or transaction by specifying method and arguments. -The resulting call or transaction can either be stored offline for future use, or directly sent to the network using the \fB-s\fP flag. +The resulting call or transaction can either be stored offline for later use, or directly sent to the network using the \fB-s\fP option. A description of value formatting is given in the \fBSPECIFYING VALUES\fP section below. Usage is demonstrated in the \fBEXAMPLES\fP section. diff --git a/man/eth-encode.overrides b/man/eth-encode.overrides index 965f677..48ed7e3 100644 --- a/man/eth-encode.overrides +++ b/man/eth-encode.overrides @@ -1 +1 @@ -mode Operation mode. --mode mode +mode Mode of operation encoding is for. Must be one of "tx," "call," or "arg." See \fBMODES\fP below. --mode mode