@@ -6,7 +6,7 @@ const { abi: EndpoingV2ABI } = require("@layerzerolabs/lz-evm-protocol-v2/artifa
66
77// run as "npx hardhat --network arbitrumSepolia lz-set-config --dest baseSepolia"
88task ( "lz-set-config" , "Set config for LZ network to dest network" )
9- . addParam ( "dest" , "destination network" )
9+ . addOptionalParam ( "dest" , "destination network" )
1010 . setAction ( async ( taskArgs , hre ) => {
1111 if ( hre . network . name === "hardhat" ) {
1212 console . warn (
@@ -77,8 +77,8 @@ task("lz-set-config", "Set config for LZ network to dest network")
7777 const values = [ ]
7878 for ( let i = 0 ; i < lzPeers . length ; i ++ ) {
7979 const peerNetwork = lzPeers [ i ]
80- if ( network . name != peerNetwork ) {
81-
80+ const setNetwork = taskArgs . dest == peerNetwork || ( ! taskArgs . dest && network . name != peerNetwork )
81+ if ( setNetwork ) {
8282 const peerCfg = networkConfig [ peerNetwork ]
8383 const destEid = Number ( peerCfg . lzEid || "0" ) ;
8484 if ( destEid == 0 ) continue ;
@@ -199,7 +199,7 @@ task("lz-set-config", "Set config for LZ network to dest network")
199199 if ( tx && tx . transactionHash ) {
200200 console . log ( "execute batch setConfig() at" , tx . transactionHash )
201201 }
202- console . log ( "----------------------------------------------------" ) /**/
202+ console . log ( "----------------------------------------------------" )
203203 }
204204) ;
205205
0 commit comments