import { HardhatRuntimeEnvironment } from "hardhat/types" ; import { DeployFunction } from "hardhat-deploy/types" ; import { ethers , upgrades } from "hardhat" ; import { AuthTokenAdapter__factory } from "../../../../../typechain" ; import { ConfigEntity } from "../../../../entities" ; import { formatBytes32String } from "@ethersproject/strings" ; const func = async function ( hre ) { const config = ConfigEntity . getConfig ( ) ; const COLLATERAL_POOL_ID = formatBytes32String ( "BUSD-STABLE" ) ; const TOKEN_ADDR = "0xe9e7cea3dedca5984780bafc599bd69add087d56" ; console . log ( ">> Deploying an upgradable AuthTokenAdapter contract" ) ; const AuthTokenAdapter = ( await ethers . getContractFactory ( "AuthTokenAdapter" , ( await ethers . getSigners ( ) ) [ 0 ] ) ) as AuthTokenAdapter__factory ; const authTokenAdapter = await upgrades . deployProxy ( AuthTokenAdapter , [ config . BookKeeper . address , COLLATERAL_POOL_ID , TOKEN_ADDR , ] ) ; await authTokenAdapter . deployed ( ) ; console . log ( `>> Deployed at ${ authTokenAdapter . address }` ) ; const tx = await authTokenAdapter . deployTransaction . wait ( ) ; console . log ( `>> Deploy block ${ tx . blockNumber }` ) ; } ; export default func ; func . tags = [ "DeployAuthTokenAdapter" ] ;