chainlib-eth

Ethereum implementation of the chainlib interface
Log | Files | Refs | README | LICENSE

commit 2f906037a968a78c6d357b8395198523e3c34be3
parent 1362c9aac698c85739e5a89226579469ce31d3e2
Author: lash <dev@holbrook.no>
Date:   Thu, 24 Feb 2022 20:05:38 +0000

Add more detail on examples

Diffstat:
Mman/eth-encode.custom.groff | 13+++++++++++++
Mman/eth-encode.examples.groff | 21+++++++++++++++++++--
Mman/eth-encode.head.groff | 4++--
Mman/eth-encode.overrides | 2+-
4 files changed, 35 insertions(+), 5 deletions(-)

diff --git 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 @@ -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 -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 -$ eth-encode -y <\fIkey_file_path\fP> -e <\fItoken_address\fP> --signature transfer a:00000000000000000000000000000000DeaDBeef u:1024 +\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 @@ -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 @@ -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