@@ -57,12 +57,19 @@ export const builder = (y: typeof yargs) =>
57
57
"init-token-bridge" ,
58
58
"Init token bridge contract" ,
59
59
( yargs ) =>
60
- yargs . option ( "network" , NETWORK_OPTIONS ) . option ( "rpc" , RPC_OPTIONS ) ,
60
+ yargs
61
+ . option ( "network" , NETWORK_OPTIONS )
62
+ . option ( "rpc" , RPC_OPTIONS )
63
+ . option ( "contract-address" , {
64
+ describe : "Core contract address" ,
65
+ type : "string" ,
66
+ demandOption : false ,
67
+ } ) ,
61
68
async ( argv ) => {
62
69
const network = getNetwork ( argv . network ) ;
63
- const contract_address = evm_address (
64
- contracts . tokenBridge ( network , "Aptos" )
65
- ) ;
70
+ const contract_address =
71
+ argv [ "contract-address" ] ||
72
+ evm_address ( contracts . tokenBridge ( network , "Aptos" ) ) ;
66
73
const rpc = argv . rpc ?? NETWORKS [ network ] . Aptos . rpc ;
67
74
await callEntryFunc (
68
75
network ,
@@ -104,13 +111,18 @@ export const builder = (y: typeof yargs) =>
104
111
demandOption : true ,
105
112
describe : "Initial guardian's addresses (CSV)" ,
106
113
type : "string" ,
114
+ } )
115
+ . option ( "contract-address" , {
116
+ describe : "Core contract address" ,
117
+ type : "string" ,
118
+ demandOption : false ,
107
119
} ) ,
108
120
async ( argv ) => {
109
121
const network = getNetwork ( argv . network ) ;
110
122
111
- const contract_address = evm_address (
112
- contracts . coreBridge ( network , "Aptos" )
113
- ) ;
123
+ const contract_address =
124
+ argv [ "contract-address" ] ||
125
+ evm_address ( contracts . coreBridge ( network , "Aptos" ) ) ;
114
126
const guardian_addresses = argv [ "guardian-address" ]
115
127
. split ( "," )
116
128
. map ( ( address ) => evm_address ( address ) . substring ( 24 ) ) ;
@@ -196,11 +208,15 @@ export const builder = (y: typeof yargs) =>
196
208
const b = serializePackage ( p ) ;
197
209
const seed = Buffer . from ( argv [ "seed" ] , "ascii" ) ;
198
210
199
- let module_name = APTOS_DEPLOYER_ADDRESS_DEVNET + "::deployer" ;
200
- if ( network == "Testnet" || network == "Mainnet" ) {
201
- module_name =
202
- "0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::deployer" ;
211
+ let deployer = APTOS_DEPLOYER_ADDRESS_DEVNET ;
212
+ const addresses = argv [ "named-addresses" ] ?. split ( "," ) || [ ] ;
213
+ for ( const addressPair of addresses ) {
214
+ const [ name , address ] = addressPair . split ( "=" ) ;
215
+ if ( name === "deployer" ) {
216
+ deployer = address ;
217
+ }
203
218
}
219
+ const module_name = deployer + "::deployer" ;
204
220
const rpc = argv . rpc ?? NETWORKS [ network ] . Aptos . rpc ;
205
221
await callEntryFunc (
206
222
network ,
@@ -223,12 +239,19 @@ export const builder = (y: typeof yargs) =>
223
239
describe : "Message to send" ,
224
240
demandOption : true ,
225
241
} )
226
- . option ( "network" , NETWORK_OPTIONS ) ,
242
+ . option ( "network" , NETWORK_OPTIONS )
243
+ . option ( "rpc" , RPC_OPTIONS )
244
+ . option ( "sender" , {
245
+ describe : "Sender address" ,
246
+ type : "string" ,
247
+ demandOption : false ,
248
+ } ) ,
227
249
async ( argv ) => {
228
250
const network = getNetwork ( argv . network ) ;
229
- const rpc = NETWORKS [ network ] . Aptos . rpc ;
230
- let module_name = APTOS_DEPLOYER_ADDRESS_DEVNET + "::sender" ;
231
- if ( network == "Testnet" || network == "Mainnet" ) {
251
+ const rpc = argv . rpc ?? NETWORKS [ network ] . Aptos . rpc ;
252
+ let module_name =
253
+ ( argv . sender || APTOS_DEPLOYER_ADDRESS_DEVNET ) + "::sender" ;
254
+ if ( ! argv . sender && ( network == "Testnet" || network == "Mainnet" ) ) {
232
255
module_name =
233
256
"0x0108bc32f7de18a5f6e1e7d6ee7aff9f5fc858d0d87ac0da94dd8d2a5d267d6b::sender" ;
234
257
}
0 commit comments