Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sui): new operators script #272

Merged
merged 29 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
07f22c3
feat(sui): new operators script
re1ro Jun 17, 2024
d6c5659
feat(sui): adding gas service commands to the operators script
re1ro Jun 18, 2024
44f7480
feat: add addOperator and removeOperator commands
npty Jul 31, 2024
2d1b83d
chore: add operators struct
npty Aug 1, 2024
4aa1ac0
Merge branch 'main' into feat/sui-operators
npty Aug 2, 2024
17617fb
chore: update collectGas
npty Aug 4, 2024
144d15a
Merge branch 'feat/sui-operators' of github.com:axelarnetwork/axelar-…
npty Aug 4, 2024
a7e8b7d
chore: fix collectGas arg passing
npty Aug 4, 2024
24020e1
chore: extract id finding to utils
npty Aug 5, 2024
8953edb
feat: add missing commands with todo items
npty Aug 5, 2024
6f05570
chore: prettier
npty Aug 5, 2024
7454af1
chore: fix remove cap error
npty Aug 6, 2024
9a1001b
chore: fix `collectGas` function
npty Aug 13, 2024
f0b651f
chore: fix `refund` function
npty Aug 13, 2024
a80eb97
Merge branch 'main' into feat/sui-operators
npty Aug 13, 2024
7cd97c9
chore: rename chain to contractConfig
npty Aug 13, 2024
a77d601
Merge branch 'feat/sui-operators' of github.com:axelarnetwork/axelar-…
npty Aug 13, 2024
a5ecd3f
chore: wrap new command inside program.addCommand
npty Aug 13, 2024
1d42774
chore: pass in gas service config as args
npty Aug 13, 2024
46cff96
chore: add collectGas readme
npty Aug 13, 2024
1a619ba
chore: fix README.md
npty Aug 15, 2024
6513f8c
chore: use printError
npty Aug 15, 2024
44a1ebf
chore: update axelar-cgp-sui to 0.4.0
npty Aug 15, 2024
b4e1965
chore: wrap hot potato pattern into a helper function
npty Aug 15, 2024
4f2e03f
chore: remove unused function
npty Aug 15, 2024
27f1db3
chore: remove adding option to the base program
npty Aug 16, 2024
8a2e3c3
chore: improve collectGas readme
npty Aug 16, 2024
87aa86e
chore: modify existing tx instead
npty Aug 16, 2024
4fbb078
Merge branch 'main' into feat/sui-operators
npty Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 38 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"homepage": "https://github.com/axelarnetwork/axelar-contract-deployments#readme",
"dependencies": {
"@axelar-network/axelar-cgp-solidity": "6.3.1",
"@axelar-network/axelar-cgp-sui": "0.3.0",
"@axelar-network/axelar-cgp-sui": "^0.0.0-snapshot.218635e",
"@axelar-network/axelar-gmp-sdk-solidity": "5.10.0",
"@axelar-network/interchain-token-service": "1.2.4",
"@cosmjs/cosmwasm-stargate": "^0.32.1",
Expand Down
18 changes: 18 additions & 0 deletions sui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,24 @@ The syntax is `node sui/gas-service.js payGas --amount <amount> <destinationChai
node sui/gas-service.js payGas --amount 0.1 ethereum 0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05 0xba76c6980428A0b10CFC5d8ccb61949677A61233 0x1234
```

Collect gas:

Conditions:
- The `GasCollectorCap` object id is read from the chain config, under gas service objects.
```bash
# store GasCollectorCap to the Operators contract
node sui/operators.js storeCap
```
- The sender must be a whitelisted operator and hold the `OperatorCap` capability.
```bash
# execute the following command from the owner account
node sui/operators add <operator address>
```

```bash
node sui/gas-service.js collectGas --amount 0.1 --receiver <receiver address>
```

Approve messages:

If the gateway was deployed using the wallet, you can submit a message approval with it
Expand Down
2 changes: 0 additions & 2 deletions sui/cli-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ const addOptionsToCommands = (program, optionMethod, options) => {
optionMethod(command, options);
});
}

optionMethod(program, options);
};

// Custom option processing for amount. https://github.com/tj/commander.js?tab=readme-ov-file#custom-option-processing
Expand Down
2 changes: 1 addition & 1 deletion sui/gas-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ if (require.main === module) {
.description('Pay gas for the new contract call.')
.option('--refundAddress <refundAddress>', 'Refund address. Default is the sender address.')
.requiredOption('--amount <amount>', 'Amount to pay gas', parseSuiUnitAmount)
.option('--params <params>', 'Params. Default is empty.')
.option('--params <params>', 'Params. Default is empty.', '0x')
.action((destinationChain, destinationAddress, channelId, payload, options) => {
mainProcessor(options, [destinationChain, destinationAddress, channelId, payload], processCommand, payGas);
});
Expand Down
Loading
Loading