-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,81 @@ | ||||||||||||||||||||||||||||||
# Operators Contract on Sui | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
This document provides a step-by-step guide to deploy and use the Operators contract on the Sui network. | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Setup | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### 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 | ||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### Environment Configuration | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
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: | ||||||||||||||||||||||||||||||
Comment on lines
+26
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: use consistent numbering with
Suggested change
Context Used: Rule from |
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
```bash | ||||||||||||||||||||||||||||||
# Setup ENV | ||||||||||||||||||||||||||||||
ENV="testnet" | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
# Your Sui private key | ||||||||||||||||||||||||||||||
PRIVATE_KEY="suiprivkey1..." | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
# Signature scheme | ||||||||||||||||||||||||||||||
SIGNATURE_SCHEME="secp256k1" | ||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
### Synchronize Contracts | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
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 commentThe 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
|
||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## Deployment | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
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 commentThe 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
|
||||||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
## 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> | ||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: The actual storeCap command uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: parameter should be
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`. | ||||||||||||||||||||||||||||||
Comment on lines
+79
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Context Used: Rule from
Comment on lines
+61
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: documentation is incomplete. Missing operations: |
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 renumberingContext Used: Rule from
dashboard
- In documentation files, use consistent numbering (e.g.,1.
for all steps) with tab indentation for... (source)