@@ -39,7 +39,6 @@ import { Chain, ChainAddress, UniversalAddress, assertChain, signSendWait } from
3939import {
4040 createPublicClient ,
4141 http ,
42- EarnAuthority ,
4342 ETH_MERKLE_TREE_BUILDER ,
4443 ETH_MERKLE_TREE_BUILDER_DEVNET ,
4544 EvmCaller ,
@@ -48,15 +47,10 @@ import { createInitializeConfidentialTransferMintInstruction } from './confident
4847import { Program , BN } from '@coral-xyz/anchor' ;
4948import { anchorProvider , keysFromEnv , NttManager } from './utils' ;
5049import { MerkleTree } from '../../sdk/src/merkle' ;
51- import { EarnManager } from '../../sdk/src/earn_manager' ;
52- import { getProgram } from '../../sdk/src/idl' ;
5350import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes' ;
54- import { ExtSwap } from '../../tests/programs/ext_swap' ;
5551import { SolanaUnsignedTransaction } from '@wormhole-foundation/sdk-solana/dist/cjs' ;
5652import { Earn } from '../../target/types/earn' ;
5753const EARN_IDL = require ( '../../sdk/src/idl/earn.json' ) ;
58- const EXT_EARN_IDL = require ( '../../sdk/src/idl/ext_earn.json' ) ;
59- const SWAP_IDL = require ( '../../tests/programs/ext_swap.json' ) ;
6054
6155const PROGRAMS = {
6256 // program id the same for devnet and mainnet
@@ -224,15 +218,14 @@ async function main() {
224218 . command ( 'initialize-portal' )
225219 . description ( 'Initialize the portal program' )
226220 . action ( async ( ) => {
227- const [ owner , mint , multisig ] = keysFromEnv ( [ 'PAYER_KEYPAIR' , 'M_MINT_KEYPAIR' , 'MULTISIG_KEYPAIR '] ) ;
221+ const [ owner , mint ] = keysFromEnv ( [ 'PAYER_KEYPAIR' , 'M_MINT_KEYPAIR' ] ) ;
228222
229223 const { ctx, ntt, sender, signer } = NttManager ( connection , owner , mint . publicKey ) ;
230224
231225 const initTxs = ntt . initialize ( sender , {
232226 mint : mint . publicKey ,
233227 outboundLimit : RATE_LIMITS_24 . outbound ,
234228 mode : 'burning' ,
235- multisig : multisig . publicKey ,
236229 } ) ;
237230
238231 const initTx = ( await initTxs . next ( ) ) . value as SolanaUnsignedTransaction < 'Mainnet' , 'Solana' > ;
@@ -252,6 +245,10 @@ async function main() {
252245 console . log ( `LUT initialized: ${ ntt . pdas . lutAccount ( ) . toBase58 ( ) } ` ) ;
253246 } ) ;
254247
248+ program . command ( 'update-portal-mint' ) . action ( async ( ) => {
249+ const [ owner ] = keysFromEnv ( [ 'PAYER_KEYPAIR' ] ) ;
250+ } ) ;
251+
255252 program
256253 . command ( 'initialize-earn' )
257254 . description ( 'Initialize the earn program' )
@@ -362,6 +359,49 @@ async function main() {
362359 }
363360 } ) ;
364361
362+ program . command ( 'pause-bridging' ) . action ( async ( ) => {
363+ const [ payer , mint ] = keysFromEnv ( [ 'PAYER_KEYPAIR' , 'M_MINT_KEYPAIR' ] ) ;
364+ const { ntt, sender } = NttManager ( connection , payer , mint . publicKey ) ;
365+
366+ const pauseTxn = ( await ntt . pause ( sender ) . next ( ) ) . value as SolanaUnsignedTransaction < 'Mainnet' , 'Solana' > ;
367+ const tx = pauseTxn . transaction . transaction as Transaction ;
368+
369+ if ( process . env . SQUADS_MULTISIG ) {
370+ const b = tx . serialize ( { verifySignatures : false } ) ;
371+ console . log ( 'Transaction:' , {
372+ b64 : b . toString ( 'base64' ) ,
373+ b58 : bs58 . encode ( b ) ,
374+ } ) ;
375+ } else {
376+ const sig = await connection . sendTransaction ( tx , [ payer ] ) ;
377+ console . log ( `Paused: ${ sig } ` ) ;
378+ }
379+ } ) ;
380+
381+ program
382+ . command ( 'pause-bridging' )
383+ . option ( '-u, --unpause' , 'Unpause if already paused' )
384+ . action ( async ( { unpause } ) => {
385+ const [ payer , mint ] = keysFromEnv ( [ 'PAYER_KEYPAIR' , 'M_MINT_KEYPAIR' ] ) ;
386+ const { ntt, sender } = NttManager ( connection , payer , mint . publicKey ) ;
387+
388+ const cmd = unpause ? ntt . unpause : ntt . pause ;
389+
390+ const pauseTxn = ( await cmd ( sender ) . next ( ) ) . value as SolanaUnsignedTransaction < 'Mainnet' , 'Solana' > ;
391+ const tx = pauseTxn . transaction . transaction as Transaction ;
392+
393+ if ( process . env . SQUADS_MULTISIG ) {
394+ const b = tx . serialize ( { verifySignatures : false } ) ;
395+ console . log ( 'Transaction:' , {
396+ b64 : b . toString ( 'base64' ) ,
397+ b58 : bs58 . encode ( b ) ,
398+ } ) ;
399+ } else {
400+ const sig = await connection . sendTransaction ( tx , [ payer ] ) ;
401+ console . log ( `Paused ${ ! unpause } : ${ sig } ` ) ;
402+ }
403+ } ) ;
404+
365405 program
366406 . command ( 'add-registrar-earner' )
367407 . description ( 'Add earner that is in the earner merkle tree' )
0 commit comments