@@ -31,7 +31,6 @@ import type { EvmChains } from "@wormhole-foundation/sdk-evm";
31
31
import { getAvailableVersions , getGitTagName } from "./tag" ;
32
32
import * as configuration from "./configuration" ;
33
33
34
- // TODO: pauser (evm)
35
34
// TODO: contract upgrades on solana
36
35
// TODO: set special relaying?
37
36
// TODO: currently, we just default all evm chains to standard relaying. should we not do that? what's a good way to configure this?
@@ -66,6 +65,7 @@ export type ChainConfig = {
66
65
mode : Ntt . Mode ,
67
66
paused : boolean ,
68
67
owner : string ,
68
+ pauser ?: string ,
69
69
manager : string ,
70
70
token : string ,
71
71
transceivers : {
@@ -1217,14 +1217,19 @@ async function pushDeployment<C extends Chain>(deployment: Deployment<C>, signer
1217
1217
const signer = await getSigner ( ctx , signerType ) ;
1218
1218
1219
1219
let txs = [ ] ;
1220
+ // we perform this last to make sure we don't accidentally lock ourselves out
1221
+ let updateOwner : ReturnType < typeof deployment . ntt . setOwner > | undefined = undefined ;
1220
1222
let managerUpgrade : { from : string , to : string } | undefined ;
1221
1223
for ( const k of Object . keys ( diff ) ) {
1222
1224
if ( k === "version" ) {
1223
1225
// TODO: check against existing version, and make sure no major version changes
1224
1226
managerUpgrade = { from : diff [ k ] ! . pull ! , to : diff [ k ] ! . push ! } ;
1225
1227
} else if ( k === "owner" ) {
1226
1228
const address : AccountAddress < C > = toUniversal ( deployment . manager . chain , diff [ k ] ?. push ! ) ;
1227
- txs . push ( deployment . ntt . setOwner ( address , signer . address . address ) ) ;
1229
+ updateOwner = deployment . ntt . setOwner ( address , signer . address . address ) ;
1230
+ } else if ( k === "pauser" ) {
1231
+ const address : AccountAddress < C > = toUniversal ( deployment . manager . chain , diff [ k ] ?. push ! ) ;
1232
+ txs . push ( deployment . ntt . setPauser ( address , signer . address . address ) ) ;
1228
1233
} else if ( k === "paused" ) {
1229
1234
if ( diff [ k ] ?. push === true ) {
1230
1235
txs . push ( deployment . ntt . pause ( signer . address . address ) ) ;
@@ -1262,6 +1267,9 @@ async function pushDeployment<C extends Chain>(deployment: Deployment<C>, signer
1262
1267
for ( const tx of txs ) {
1263
1268
await signSendWait ( ctx , tx , signer . signer )
1264
1269
}
1270
+ if ( updateOwner ) {
1271
+ await signSendWait ( ctx , updateOwner , signer . signer )
1272
+ }
1265
1273
}
1266
1274
1267
1275
async function pullDeployments ( deployments : Config , network : Network , verbose : boolean ) : Promise < Partial < { [ C in Chain ] : Deployment < Chain > } > > {
@@ -1336,6 +1344,7 @@ async function pullChainConfig<N extends Network, C extends Chain>(
1336
1344
1337
1345
const paused = await ntt . isPaused ( ) ;
1338
1346
const owner = await ntt . getOwner ( ) ;
1347
+ const pauser = await ntt . getPauser ( ) ;
1339
1348
1340
1349
const version = getVersion ( manager . chain , ntt ) ;
1341
1350
@@ -1355,6 +1364,9 @@ async function pullChainConfig<N extends Network, C extends Chain>(
1355
1364
inbound : { } ,
1356
1365
} ,
1357
1366
} ;
1367
+ if ( pauser ) {
1368
+ config . pauser = pauser . toString ( ) ;
1369
+ }
1358
1370
return [ config , ch , ntt , decimals ] ;
1359
1371
}
1360
1372
0 commit comments