get_abi_by_filename

Documentation for eth_defi.abi.get_abi_by_filename function.

get_abi_by_filename(fname)[source]

Reads a embedded ABI file and returns it.

Example:

abi = get_abi_by_filename("ERC20Mock.json")

You are most likely interested in the keys abi and bytecode of the JSON file.

Loaded ABI files are cache in in-process memory to speed up future loading.

Any results are cached.

Parameters
Returns

Full contract interface, including bytecode.

Return type

dict