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
web3 (web3.main.Web3) – Web3 instance
fname (str | pathlib.Path) –
Solidity compiler artifact.
Use slash prefixed path for absolute lookups.
hardhat_export_data (Optional[dict]) –
Hardhat deployment export data to link bytecode.
A JSON file generated by hardhat deploy –export command.
- Returns
Contract proxy class
- Return type
Type[web3.contract.contract.Contract]