get_contract
Documentation for eth_defi.abi.get_contract function.
- get_contract(web3, fname, bytecode=None)[source]
Create a Contract proxy class from our bundled contracts or filesystem..
See Web3.py documentation on Contract instances.
Any results are cached. Web3 connection is part of the cache key.
Note
This function cannot do linking. See
get_linked_contract()
if the bytecode contains link markers.Example:
pass
- Parameters
web3 (web3.main.Web3) – Web3 instance
bytecode (Optional[str]) – Override bytecode payload for the contract
fname (str | pathlib.Path) –
Solidity compiler artifact.
Use slash prefixed path for absolute lookups.
- Returns
Contract proxy class
- Return type
Type[web3.contract.contract.Contract]