Documentation ¶
Overview ¶
Package abisPkg handles the chifra abis command. It The tool retrieves one or more ABI files for the given address(es). It searches for ABIs, sequentially, in the following locations: - the current working folder, - the TrueBlocks local cache, - Etherscan, - (in the future) ENS and Sourcify. While this tool may be used from the command line, its primary purpose is in support of the --articulate option for tools such as chifra export and chifra logs. If possible, the tool will follow proxied addresses searching for the ABI, but that does not always work. In that case, you may use the --proxy_for option. The --known option prints a list of semi-standard function signatures such as the ERC20 standard, ERC 721 standard, various functions from OpenZeppelin, various Uniswap functions, etc. As an optimization, the known signatures are searched first during articulation. The --encode option generates a 32-byte encoding for a given cannonical function or event signature. For functions, you may manually extract the first four bytes of the hash. The --find option is experimental. Please see the notes below for more information.
Index ¶
- func ResetOptions(testMode bool)
- func RunAbis(cmd *cobra.Command, args []string) error
- func ServeAbis(w http.ResponseWriter, r *http.Request) error
- type AbisOptions
- func (opts *AbisOptions) AbisInternal() error
- func (opts *AbisOptions) HandleAbiFind() error
- func (opts *AbisOptions) HandleDecache() error
- func (opts *AbisOptions) HandleEncode() error
- func (opts *AbisOptions) HandleMany() (err error)
- func (opts *AbisOptions) HandleShow() (err error)
- func (opts *AbisOptions) String() string
- type CFunctionArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResetOptions ¶
func ResetOptions(testMode bool)
Types ¶
type AbisOptions ¶
type AbisOptions struct { Addrs []string `json:"addrs,omitempty"` // A list of one or more smart contracts whose ABIs to display Known bool `json:"known,omitempty"` // Load common 'known' ABIs from cache ProxyFor string `json:"proxyFor,omitempty"` // Redirects the query to this implementation Find []string `json:"find,omitempty"` // Search for function or event declarations given a four- or 32-byte code(s) Hint []string `json:"hint,omitempty"` // For the --find option only, provide hints to speed up the search Encode string `json:"encode,omitempty"` // Generate the 32-byte encoding for a given cannonical function or event signature Globals globals.GlobalOptions `json:"globals,omitempty"` // The global options Conn *rpc.Connection `json:"conn,omitempty"` // The connection to the RPC server BadFlag error `json:"badFlag,omitempty"` // An error flag if needed // EXISTING_CODE ProxyForAddr base.Address `json:"-"` }
AbisOptions provides all command options for the chifra abis command.
func GetAbisOptions ¶
func GetAbisOptions(args []string, g *globals.GlobalOptions) *AbisOptions
GetAbisOptions returns the options for this tool so other tools may use it.
func GetOptions ¶
func GetOptions() *AbisOptions
func (*AbisOptions) AbisInternal ¶
func (opts *AbisOptions) AbisInternal() error
AbisInternal handles the internal workings of the abis command. Returns an error.
func (*AbisOptions) HandleAbiFind ¶
func (opts *AbisOptions) HandleAbiFind() error
func (*AbisOptions) HandleDecache ¶
func (opts *AbisOptions) HandleDecache() error
func (*AbisOptions) HandleEncode ¶
func (opts *AbisOptions) HandleEncode() error
func (*AbisOptions) HandleMany ¶
func (opts *AbisOptions) HandleMany() (err error)
func (*AbisOptions) HandleShow ¶
func (opts *AbisOptions) HandleShow() (err error)
func (*AbisOptions) String ¶
func (opts *AbisOptions) String() string
String implements the Stringer interface
type CFunctionArray ¶
type CFunctionArray []types.SimpleFunction