get_linked_contract

Documentation for eth_defi.abi.get_linked_contract function.

get_linked_contract(web3, fname, hardhat_export_data=None)[source]

Create a Contract proxy class from our bundled contracts or filesystem and links it Solidity bytecode.

Needed when contracts contain references to libraries. The contract bytecode must be processed and placeholders must be replaced by the on-chain addresses of the deployed library contracts.

Example:

path = self.path.joinpath("artifacts/@aave/core-v3/contracts/mocks/tokens/MintableERC20.sol/MintableERC20.json")
return get_linked_contract(web3, path, get_aave_hardhard_export())

Note

If you do not need linking use get_contract() which is faster.

Parameters
Returns

Contract proxy class

Return type

Type[web3.contract.contract.Contract]