For our final prerequisite lesson before we get into arb trading, we create a test loan and a healthy Curve liquidity pool to ensure smooth liquidations.
To do so, we often need to interact with contracts that are not yet verified on Etherscan (or in this case, Arbiscan). Curve factories help devs in this process by providing verified implementation contracts. In this lesson we show how to use Titanoboa to quickly reuse these ABIs to load contracts.
We also introduce Titanoboa's prank
function, which allows you to spoof calls from any address
This Titanoboa object represents an ABI contract that has not been coupled with an address yet.
This is named Factory
instead of Deployer
because it doesn't actually do any contract deployment.
existing_contract = ABIContractFactory.from_abi_dict(abi, name=name).at(addr)
A context manager which temporarily sets eoa and resets it on exit.
>>> import boa
>>> boa.env.eoa
'0x0000000000000000000000000000000000000065'
>>> with boa.env.prank("0x00000000000000000000000000000000000000ff"):
... boa.env.eoa
...
'0x00000000000000000000000000000000000000ff'
>>> boa.env.eoa
'0x0000000000000000000000000000000000000065'
Contracts
Documentation