-
Notifications
You must be signed in to change notification settings - Fork 29
docs: add readme for sui operator contract #973
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
Store the `TreasuryCap` using the following command: | ||
|
||
```bash | ||
ts-node sui/operators storeCap --cap-id <treasury cap id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: The actual storeCap command uses --capId
not --cap-id
, and works with OperatorCap not TreasuryCap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Summary
Adds initial documentation for the Sui Operators contract, covering basic setup, deployment, and usage instructions.
Key Issues Found:
- Command syntax errors on lines 50, 58, and 76 that would prevent users from successfully executing the documented commands
- TODO section (lines 79-81) violates custom instruction to remove TODOs from documentation and create tickets instead
- Documentation is incomplete, missing several available operations (
collectGas
,refund
,removeCap
,remove
) - Inconsistent numbering format doesn't follow the established pattern from custom instructions
Note: While this documentation provides a good starting foundation, the syntax errors are critical and must be corrected before this can be safely used by developers. The storeCap command uses --capId
not --cap-id
, and the deploy-contract commands require the "deploy" positional argument before the contract name.
Confidence Score: 2/5
- This PR contains documentation-only changes but has multiple critical syntax errors that would prevent users from successfully following the guide
- Score reflects critical command syntax issues on lines 50, 58, and 76 that need immediate correction. While documentation changes carry no runtime risk, these errors would cause frustration and wasted time for developers trying to use this guide. Additionally, the TODO section violates established custom instructions.
- Pay close attention to sui/docs/operators.md - all command syntax must be corrected before merge
Important Files Changed
File Analysis
Filename | Score | Overview |
---|---|---|
sui/docs/operators.md | 2/5 | New documentation with command syntax errors and incomplete TODO section that violates custom instructions |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant CLI as sui/operators CLI
participant Contract as Operators Contract
participant GasService as Gas Service Contract
Note over Dev,GasService: Setup Phase
Dev->>CLI: deploy-contract deploy Operators
CLI->>Contract: Deploy Operators contract
Contract-->>CLI: OperatorCap, OwnerCap created
Note over Dev,GasService: Add Operator
Dev->>CLI: operators add <address>
CLI->>Contract: add_operator(OwnerCap, address)
Contract-->>CLI: Operator added
Note over Dev,GasService: Store Capability
Dev->>CLI: operators storeCap --capId <id>
CLI->>Contract: store_cap(OwnerCap, OperatorCap)
Contract-->>CLI: Capability stored
Note over Dev,GasService: Loan-Restore Pattern (Future)
Dev->>CLI: Custom operation (TODO)
CLI->>Contract: loan_cap(OperatorCap)
Contract-->>CLI: Return borrowed cap
CLI->>GasService: perform operation with cap
GasService-->>CLI: Operation complete
CLI->>Contract: restore_cap(cap, borrowObj)
Contract-->>CLI: Cap restored
1 file reviewed, 7 comments
Store the `TreasuryCap` using the following command: | ||
|
||
```bash | ||
ts-node sui/operators storeCap --cap-id <treasury cap id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: parameter should be --capId
(camelCase) not --cap-id
(kebab-case) per sui/operators.js:239
ts-node sui/operators storeCap --cap-id <treasury cap id> | |
ts-node sui/operators storeCap --capId <treasury cap id> |
## TODO | ||
|
||
Write a script to perform your desired operation / move calls, ensuring that the move call is executed within the same transaction between `loanCap` and `restoreCap`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: TODO section violates custom instruction ee7dd967. Remove TODO comments and create a ticket instead
## TODO | |
Write a script to perform your desired operation / move calls, ensuring that the move call is executed within the same transaction between `loanCap` and `restoreCap`. |
Context Used: Rule from dashboard
- Remove TODO comments from code and create tickets for the work instead of leaving TODOs in the codeb... (source)
Synchronize the various contract deployments by executing the Sui contracts sync command: | ||
|
||
```bash | ||
ts-node sui/deploy-contract sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: deploy-contract command uses positional argument format, not subcommand. Remove "sync" subcommand
ts-node sui/deploy-contract sync | |
ts-node sui/deploy-contract sync |
Deploy the Operators contract using the following command: | ||
|
||
```bash | ||
ts-node sui/deploy-contract Operators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: deploy-contract command uses positional argument "deploy" before contract name
ts-node sui/deploy-contract Operators | |
ts-node sui/deploy-contract deploy Operators |
### Prerequisites | ||
|
||
1. Fork and clone the [Axelar Contract Deployments](https://github.com/axelarnetwork/axelar-contract-deployments) repository | ||
|
||
2. Install dependencies and build the project | ||
|
||
```bash | ||
cd axelar-contract-deployments | ||
npm ci && npm run build | ||
``` | ||
|
||
3. Install [ts-node](https://www.npmjs.com/package/ts-node) globally | ||
|
||
```bash | ||
npm install -g ts-node | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: use consistent numbering with 1.
for all steps per custom instruction a4714931 to avoid manual renumbering
### Prerequisites | |
1. Fork and clone the [Axelar Contract Deployments](https://github.com/axelarnetwork/axelar-contract-deployments) repository | |
2. Install dependencies and build the project | |
```bash | |
cd axelar-contract-deployments | |
npm ci && npm run build | |
``` | |
3. Install [ts-node](https://www.npmjs.com/package/ts-node) globally | |
```bash | |
npm install -g ts-node | |
``` | |
### Prerequisites | |
1. Fork and clone the [Axelar Contract Deployments](https://github.com/axelarnetwork/axelar-contract-deployments) repository | |
1. Install dependencies and build the project | |
\`\`\`bash | |
cd axelar-contract-deployments | |
npm ci && npm run build | |
\`\`\` | |
1. Install [ts-node](https://www.npmjs.com/package/ts-node) globally | |
\`\`\`bash | |
npm install -g ts-node | |
\`\`\` |
Context Used: Rule from dashboard
- In documentation files, use consistent numbering (e.g., 1.
for all steps) with tab indentation for... (source)
1. Create an environment file and add your contract admin key information there | ||
|
||
```bash | ||
touch .env | ||
``` | ||
|
||
2. Add the following environment variables to the `.env` file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: use consistent numbering with 1.
for all steps per custom instruction a4714931
1. Create an environment file and add your contract admin key information there | |
```bash | |
touch .env | |
``` | |
2. Add the following environment variables to the `.env` file: | |
1. Create an environment file and add your contract admin key information there | |
\`\`\`bash | |
touch .env | |
\`\`\` | |
1. Add the following environment variables to the \`.env\` file: |
Context Used: Rule from dashboard
- In documentation files, use consistent numbering (e.g., 1.
for all steps) with tab indentation for... (source)
## Usage | ||
|
||
### Add Operators | ||
|
||
Add operators to your contract using the following command: | ||
|
||
```bash | ||
ts-node sui/operators add <sui address> | ||
``` | ||
|
||
### Store Treasury Cap | ||
|
||
Store the `TreasuryCap` using the following command: | ||
|
||
```bash | ||
ts-node sui/operators storeCap --cap-id <treasury cap id> | ||
``` | ||
|
||
## TODO | ||
|
||
Write a script to perform your desired operation / move calls, ensuring that the move call is executed within the same transaction between `loanCap` and `restoreCap`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: documentation is incomplete. Missing operations: collectGas
, refund
, removeCap
, and remove
(operator). Check sui/operators.js:205-264 for all available commands
Greptile Summary
This PR adds comprehensive documentation for the Sui Operators contract by creating a new markdown file at
sui/docs/operators.md
. The documentation provides step-by-step instructions for setting up, deploying, and using the Operators contract within the Axelar Network's Sui blockchain integration.The Operators contract appears to be a key component for managing operator permissions and capabilities within the Axelar ecosystem on Sui. The documentation follows the established pattern found in other files in the
sui/docs
directory, maintaining consistency with existing documentation structure. It covers essential topics including prerequisites, environment configuration, synchronization steps, deployment procedures, and basic usage examples.The documentation is structured to guide developers through the complete workflow from initial setup to contract deployment and operation. It includes sections for adding/removing operators, collecting gas, and managing capabilities through the operators CLI interface. This addition fills a documentation gap for the operators.js functionality that was previously undocumented but contained complex capability management features.
Important Files Changed
Files Changed
Confidence score: 2/5
Note
Adds
sui/docs/operators.md
with setup, deployment, and basic usage instructions for the Sui Operators contract.sui/docs/operators.md
:Operators
.TreasuryCap
.loanCap
andrestoreCap
.Written by Cursor Bugbot for commit 0555aa3. This will update automatically on new commits. Configure here.