I have a factory contract, that in a transaction:
- Deploys a contract
- Emits an event with the address of the contract it deployed
I want to be able to use the address returned to interface with the contract that was deployed. EX:
from brownie import AstroSwapExchange, AstroSwapFactory [...] tokenExchangeAddress = forgeTx.events["TokenExchangeAdded"]["tokenExchange"] return tokenExchangeAddress tokenExchangeAddress = deploy_new_exchange(factory, erc20) CREATE A CONTRACT OBJECT HERE factory = exchange.factory()
What functions could I use to take advantage of the returned address and turn it into a Contract object to interact with it like any other contract that I deploy myself?