Skip to content

Commit

Permalink
feat: deploy Operators contract
Browse files Browse the repository at this point in the history
  • Loading branch information
npty committed Jul 31, 2024
1 parent bdbbce9 commit 29b8bd1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions sui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ Deploy the test GMP package:
node sui/deploy-contract.js deploy Test
```

Deploy the Operators package:

```bash
node sui/deploy-contract.js deploy Operators
```

Call Contract:

```bash
Expand Down
16 changes: 15 additions & 1 deletion sui/deploy-contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const {
* 2. Ensure the corresponding folder exists in the specified path
*
*/
const PACKAGE_DIRS = ['gas_service', 'test', 'axelar_gateway'];
const PACKAGE_DIRS = ['gas_service', 'test', 'axelar_gateway', 'operators'];

/**
* Supported Move Packages
Expand Down Expand Up @@ -92,6 +92,17 @@ async function postDeployTest(published, config, chain, options) {
printInfo('Register transaction', registerTx.digest);
}

async function postDeployOperators(published, chain) {
const [operatorsObjectId, ownerCapObjectId] = getObjectIdsByObjectTypes(published.publishTxn, [
`${published.packageId}::operators::Operators`,
`${published.packageId}::operators::OwnerCap`,
]);
chain.contracts.Operators.objects = {
Operators: operatorsObjectId,
OwnerCap: ownerCapObjectId,
};
}

async function postDeployAxelarGateway(published, keypair, client, config, chain, options) {
const { packageId, publishTxn } = published;
const { minimumRotationDelay, policy, previousSigners } = options;
Expand Down Expand Up @@ -185,6 +196,9 @@ async function deploy(keypair, client, supportedContract, config, chain, options
case 'Test':
await postDeployTest(published, config, chain, options);
break;
case 'Operators':
await postDeployOperators(published, chain);
break;
default:
throw new Error(`${packageName} is not supported.`);
}
Expand Down
1 change: 1 addition & 0 deletions sui/deploy-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const addDeployOptions = (program) => {
getDeployGatewayOptions().forEach((option) => program.addOption(option));
break;
case 'GasService':
case 'Operators':
case 'Test':
break;
default:
Expand Down

0 comments on commit 29b8bd1

Please sign in to comment.