Skip to content

Conversation

blockchainguyy
Copy link
Contributor

@blockchainguyy blockchainguyy commented Aug 28, 2025

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
Filename Score Overview
sui/docs/operators.md 2/5 Added comprehensive documentation for Sui Operators contract with setup and usage instructions, but contains multiple syntax errors and incomplete sections

Confidence score: 2/5

  • This PR contains documentation-only changes but has multiple syntax errors that would prevent users from successfully following the guide
  • Score reflects critical command syntax issues that need immediate correction before the documentation can be safely used by developers
  • Pay close attention to sui/docs/operators.md, specifically the deployment command syntax on lines 50 and 58, and clarify the incomplete TODO section

Note

Adds sui/docs/operators.md with setup, deployment, and basic usage instructions for the Sui Operators contract.

  • Docs:
    • New guide sui/docs/operators.md:
      • Setup: prerequisites and environment variables.
      • Synchronization: command to sync Sui contracts.
      • Deployment: command to deploy Operators.
      • Usage: add operators and store TreasuryCap.
      • TODO: script to perform move calls between loanCap and restoreCap.

Written by Cursor Bugbot for commit 0555aa3. This will update automatically on new commits. Configure here.

@blockchainguyy blockchainguyy requested a review from a team as a code owner August 28, 2025 12:46
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Bot Settings | Greptile

Store the `TreasuryCap` using the following command:

```bash
ts-node sui/operators storeCap --cap-id <treasury cap id>
Copy link
Contributor

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

@blockchainguyy blockchainguyy marked this pull request as draft August 28, 2025 13:04
@blockchainguyy blockchainguyy marked this pull request as ready for review October 13, 2025 12:53
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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
Loading

1 file reviewed, 7 comments

Edit Code Review Agent Settings | Greptile

Store the `TreasuryCap` using the following command:

```bash
ts-node sui/operators storeCap --cap-id <treasury cap id>
Copy link
Contributor

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

Suggested change
ts-node sui/operators storeCap --cap-id <treasury cap id>
ts-node sui/operators storeCap --capId <treasury cap id>

Comment on lines +79 to +81
## 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`.
Copy link
Contributor

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

Suggested change
## 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
Copy link
Contributor

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

Suggested change
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
Copy link
Contributor

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

Suggested change
ts-node sui/deploy-contract Operators
ts-node sui/deploy-contract deploy Operators

Comment on lines +7 to +22
### 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
```
Copy link
Contributor

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

Suggested change
### 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)

Comment on lines +26 to +32
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:
Copy link
Contributor

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

Suggested change
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)

Comment on lines +61 to +81
## 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`.
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant