diff --git a/stellar/README.md b/stellar/README.md index 839d41e6..97ee6671 100644 --- a/stellar/README.md +++ b/stellar/README.md @@ -88,6 +88,7 @@ node stellar/deploy-contract.js deploy axelar_gas_service --chain-name --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/interchain_token.optimized.wasm node stellar/deploy-contract.js deploy interchain_token_service --chain-name --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/interchain_token_service.optimized.wasm @@ -100,6 +101,7 @@ node stellar/deploy-contract.js deploy example --chain-name --wasm- ``` ### Contract upgrades + To facilitate contract upgrades, the `upgrader` contract needs to be deployed first. ```bash @@ -112,8 +114,7 @@ After the `upgrader` is deployed, any other instantiated contract can be upgrade node stellar/deploy-contract.js upgrade --chain-name --wasm-path ../axelar-cgp-soroban/target/wasm32-unknown-unknown/release/.optimized.wasm --new-version --migration-data ``` -where `` is the name of the contract to be upgraded and `--wasm-path` points to the upgraded bytecode. As a sanity check, `` must match the version number defined by the provided bytecode, so upgrading to the wrong version can be prevented. `` is the json encoded data that will be passed to the contract's `migrate` function. - +where `` is the name of the contract to be upgraded and `--wasm-path` points to the upgraded bytecode. As a sanity check, `` must match the version number defined by the provided bytecode, so upgrading to the wrong version can be prevented. `` is the json encoded data that will be passed to the contract's `migrate` function. If the flag is not provided, the default value `()` will be used, meaning that the migration data is of type `void`. The easiest way to generate the json data for complex types is to instantiate the rust type the contract expects and then use `serde_json::to_string` to convert it to json. ## Generate bindings diff --git a/stellar/deploy-contract.js b/stellar/deploy-contract.js index 998a29f5..8134da0e 100644 --- a/stellar/deploy-contract.js +++ b/stellar/deploy-contract.js @@ -233,7 +233,7 @@ function main() { .argument('', 'contract name to deploy') .addOption(new Option('--wasm-path ', 'path to the WASM file')) .addOption(new Option('--new-version ', 'new version of the contract')) - .addOption(new Option('--migration-data ', 'migration data')) + .addOption(new Option('--migration-data ', 'migration data').default('()')) .action((contractName, options) => { mainProcessor(options, upgrade, contractName); });