address-manager.ts 579 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/* External Imports */
import { ethers } from 'hardhat'
import { Contract } from 'ethers'

export const setProxyTarget = async (
  AddressManager: Contract,
  name: string,
  target: Contract
): Promise<void> => {
  const SimpleProxy: Contract = await (
    await ethers.getContractFactory('Helper_SimpleProxy')
  ).deploy()

  await SimpleProxy.setTarget(target.address)
  await AddressManager.setAddress(name, SimpleProxy.address)
}

export const makeAddressManager = async (): Promise<Contract> => {
  return (await ethers.getContractFactory('Lib_AddressManager')).deploy()
}