def factory(w3, exchange_template): deploy = create_contract(w3, 'build/contracts/UniswapFactory.json') tx_hash = deploy.constructor().transact() tx_receipt = w3.eth.getTransactionReceipt(tx_hash) contract = ConciseContract( w3.eth.contract(address=tx_receipt.contractAddress, abi=deploy.abi)) contract.initializeFactory(exchange_template.address, transact={}) return contract
def exchange_factory(w3, exchange_template): deploy = create_contract(w3, 'contracts/uniswap_factory.vy') tx_hash = deploy.constructor().transact() tx_receipt = w3.eth.getTransactionReceipt(tx_hash) factory_contract = ConciseContract( w3.eth.contract(address=tx_receipt.contractAddress, abi=deploy.abi)) factory_contract.initializeFactory(exchange_template.address, transact={}) return factory_contract