@@ -19,25 +19,42 @@ const argv = yargs(hideBin(process.argv))
1919 . option ( "initNumbDeposits" , { type : "string" , demandOption : true , describe : "Init numb of deposits" } )
2020 . option ( "chainId" , { type : "string" , demandOption : true , describe : "Chain ID" } )
2121 . option ( "remoteDomain" , { type : "number" , demandOption : true , describe : "CCTP domain for Mainnet Ethereum" } )
22- . option ( "crossDomainAdmin" , { type : "string" , demandOption : true , describe : "HubPool on Mainnet Ethereum" } ) . argv ;
22+ . option ( "crossDomainAdmin" , { type : "string" , demandOption : true , describe : "HubPool on Mainnet Ethereum" } )
23+ . option ( "depositQuoteTimeBuffer" , {
24+ type : "number" ,
25+ demandOption : false ,
26+ default : 3600 ,
27+ describe : "Deposit quote time buffer" ,
28+ } )
29+ . option ( "fillDeadlineBuffer" , {
30+ type : "number" ,
31+ demandOption : false ,
32+ default : 3600 * 4 ,
33+ describe : "Fill deadline buffer" ,
34+ } ) . argv ;
2335
24- const seed = new BN ( argv . seed ) ;
25- const initialNumberOfDeposits = new BN ( argv . initNumbDeposits ) ;
26- const chainId = new BN ( argv . chainId ) ;
27- const remoteDomain = argv . remoteDomain ;
28- const crossDomainAdmin = evmAddressToPublicKey ( argv . crossDomainAdmin ) ; // Use the function to cast the value
29- const testableMode = false ; // Hardcode testableMode to false
36+ async function initialize ( ) : Promise < void > {
37+ const resolvedArgv = await argv ;
38+ const seed = new BN ( resolvedArgv . seed ) ;
39+ const initialNumberOfDeposits = new BN ( resolvedArgv . initNumbDeposits ) ;
40+ const chainId = new BN ( resolvedArgv . chainId ) ;
41+ const remoteDomain = resolvedArgv . remoteDomain ;
42+ const crossDomainAdmin = evmAddressToPublicKey ( resolvedArgv . crossDomainAdmin ) ; // Use the function to cast the value
43+ const testableMode = false ; // Hardcode testableMode to false
44+ const depositQuoteTimeBuffer = resolvedArgv . depositQuoteTimeBuffer ;
45+ const fillDeadlineBuffer = resolvedArgv . fillDeadlineBuffer ;
3046
31- // Define the state account PDA
32- const [ statePda , _ ] = PublicKey . findProgramAddressSync (
33- [ Buffer . from ( "state" ) , seed . toArrayLike ( Buffer , "le" , 8 ) ] ,
34- programId
35- ) ;
47+ // Define the state account PDA
48+ console . log ( "Seed:" , seed . toString ( ) ) ;
49+ console . log ( "seed.toArrayLike(Buffer" , new BN ( seed ) . toArrayLike ( Buffer , "le" , 8 ) ) ;
50+ const [ statePda , _ ] = PublicKey . findProgramAddressSync (
51+ [ Buffer . from ( "state" ) , new BN ( seed ) . toArrayLike ( Buffer , "le" , 8 ) ] ,
52+ programId
53+ ) ;
3654
37- // Define the signer (replace with your actual signer)
38- const signer = provider . wallet . publicKey ;
55+ // Define the signer (replace with your actual signer)
56+ const signer = provider . wallet . publicKey ;
3957
40- async function initialize ( ) : Promise < void > {
4158 console . log ( "Initializing..." ) ;
4259 console . table ( [
4360 { Property : "seed" , Value : seed . toString ( ) } ,
@@ -49,16 +66,20 @@ async function initialize(): Promise<void> {
4966 { Property : "remoteDomain" , Value : remoteDomain . toString ( ) } ,
5067 { Property : "crossDomainAdmin" , Value : crossDomainAdmin . toString ( ) } ,
5168 { Property : "testableMode" , Value : testableMode . toString ( ) } ,
69+ { Property : "depositQuoteTimeBuffer" , Value : depositQuoteTimeBuffer . toString ( ) } ,
70+ { Property : "fillDeadlineBuffer" , Value : fillDeadlineBuffer . toString ( ) } ,
5271 ] ) ;
5372
5473 const tx = await (
5574 program . methods . initialize (
5675 seed ,
57- initialNumberOfDeposits ,
76+ initialNumberOfDeposits . toNumber ( ) ,
5877 chainId ,
5978 remoteDomain ,
6079 crossDomainAdmin ,
61- testableMode
80+ testableMode ,
81+ depositQuoteTimeBuffer ,
82+ fillDeadlineBuffer
6283 ) as any
6384 )
6485 . accounts ( {
0 commit comments