11import { DeployFunction } from "hardhat-deploy/types" ;
22import { HardhatRuntimeEnvironment } from "hardhat/types" ;
33import { deployNewProxy , getSpokePoolDeploymentInfo } from "../utils/utils.hre" ;
4- import {
5- EXPECTED_SAFE_ADDRESS ,
6- FILL_DEADLINE_BUFFER ,
7- L2_ADDRESS_MAP ,
8- QUOTE_TIME_BUFFER ,
9- USDC ,
10- ZERO_ADDRESS ,
11- } from "./consts" ;
4+ import { FILL_DEADLINE_BUFFER , L2_ADDRESS_MAP , QUOTE_TIME_BUFFER , USDC , ZERO_ADDRESS } from "./consts" ;
125import { CHAIN_IDs , PRODUCTION_NETWORKS , TOKEN_SYMBOLS_MAP } from "../utils/constants" ;
13- import { getOftEid , toWei , predictedSafe } from "../utils/utils" ;
14- import { getNodeUrl } from "../utils" ;
6+ import { getOftEid , toWei } from "../utils/utils" ;
157import { getDeployedAddress } from "../src/DeploymentUtils" ;
168import "@nomiclabs/hardhat-ethers" ;
17- import Safe from "@safe-global/protocol-kit" ;
189
1910const func : DeployFunction = async function ( hre : HardhatRuntimeEnvironment ) {
2011 const { hubPool, hubChainId, spokeChainId } = await getSpokePoolDeploymentInfo ( hre ) ;
@@ -39,7 +30,12 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
3930
4031 const oftEid = getOftEid ( hubChainId ) ;
4132 // ! Notice. Deployed has to adjust this fee cap based on dst chain's native token. 4.4 BNB for BSC
42- const oftFeeCap = toWei ( 4.4 ) ; // ~1 ETH fee cap
33+ let oftFeeCap = toWei ( "1" ) ; // 1 ETH fee cap
34+ if ( spokeChainId == CHAIN_IDs . MONAD ) {
35+ oftFeeCap = toWei ( 78_000 ) ; // ~1 ETH fee cap
36+ } else if ( spokeChainId == CHAIN_IDs . BSC ) {
37+ oftFeeCap = toWei ( 4.4 ) ; // ~1 ETH fee cap
38+ }
4339
4440 const heliosAddress = getDeployedAddress ( "Helios" , spokeChainId ) ;
4541
@@ -56,7 +52,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5652 oftEid ,
5753 oftFeeCap ,
5854 ] ;
59- console . log ( `Deploying new Universal SpokePool on ${ spokeChainId } with args:` , constructorArgs ) ;
55+ console . log ( `Deploying new Universal SpokePool on ${ spokeChainId } with constructor arguments:` , constructorArgs ) ;
56+ console . log ( `Deploying implementation with initialization arguments:` , initArgs ) ;
6057
6158 // @dev Deploy on different address for each chain.
6259 // The Universal Adapter writes calldata to be relayed to L2 by associating it with the
@@ -69,32 +66,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
6966 return ;
7067 }
7168
72- const nodeUrl = getNodeUrl ( spokeChainId ) ;
73-
74- const protocolKit = await Safe . init ( {
75- provider : nodeUrl ,
76- predictedSafe,
77- } ) ;
78-
79- const existingProtocolKit = await protocolKit . connect ( {
80- safeAddress : EXPECTED_SAFE_ADDRESS ,
81- } ) ;
82- const isDeployed = await existingProtocolKit . isSafeDeployed ( ) ;
83-
84- if ( ! isDeployed ) {
85- throw new Error ( "Expected Safe address is not deployed, please deploy it first" ) ;
86- }
87-
88- const factory = await hre . ethers . getContractFactory ( "Universal_SpokePool" ) ;
89- const contract = factory . attach ( proxyAddress ) ;
90-
91- const owner = await contract . owner ( ) ;
92- if ( owner !== EXPECTED_SAFE_ADDRESS ) {
93- await ( await contract . transferOwnership ( EXPECTED_SAFE_ADDRESS ) ) . wait ( ) ;
94- console . log ( "Transferred ownership to Expected Safe address:" , await contract . owner ( ) ) ;
95- } else {
96- console . log ( "Expected Safe address is already the owner of the Universal SpokePool" ) ;
97- }
69+ console . log ( `Deployed Universal SpokePool at ${ proxyAddress } ! Remember to transfer ownership to the Gnosis Safe!` ) ;
9870} ;
9971module . exports = func ;
10072func . tags = [ "UniversalSpokePool" ] ;
0 commit comments