Skip to content

Latest commit

 

History

History
98 lines (70 loc) · 2.68 KB

File metadata and controls

98 lines (70 loc) · 2.68 KB

Xtask

Task automation tool for the Axelar-Starknet bridge project. This tool provides convenient commands for building, deploying, and managing contracts.

Prerequisites

  • Rust toolchain
  • starkli CLI tool
  • scarb (Cairo/Starknet build tool)
  • jq (JSON processor)
  • Configured Starknet wallet

Usage

View all available commands:

cargo xtask --help

Available Commands

Gas Service Contract

# Build gas service contract (builds and extracts ABI)
cargo xtask build-gas-service

# Build and deploy gas service contract (initial deployment)
cargo xtask build-gas-service --deploy
# or use the short flag
cargo xtask build-gas-service -d

# Build and upgrade existing gas service contract
cargo xtask build-gas-service --upgrade
# or use the short flag
cargo xtask build-gas-service -u

Operators Contract

# Build operators contract (builds and extracts ABI)
cargo xtask build-operators

# Build and deploy operators contract (initial deployment)
cargo xtask build-operators --deploy
# or use the short flag
cargo xtask build-operators -d

# Build and upgrade existing operators contract
cargo xtask build-operators --upgrade
# or use the short flag
cargo xtask build-operators -u

Other Commands

# Send a dummy transfer
cargo xtask send-transfer

# Send GMP gas payment AFTER call contract transaction
cargo xtask pay-gas-after-tx --tx-hash 0x029c50eb1b065f6fb67c6f7a958a174a9025bceae9d386384fb5bdeba8566697

# Collect gas
cargo xtask collect-gas --wallet <WALLET> --wallet-private-key <KEY>

# Approve tokens
cargo xtask approve-tokens <SPENDER_ADDRESS> [AMOUNT]

Deploy vs Upgrade

  • Deploy (--deploy/-d): Use this flag for initial contract deployment. This will:

    1. Declare the contract class
    2. Deploy a new instance of the contract
    3. You'll need to update the contract address in relayer-config-example.toml after deployment
  • Upgrade (--upgrade/-u): Use this flag to upgrade an existing contract. This will:

    1. Declare the new contract class
    2. Call the upgrade function on the existing contract to update its implementation
    3. The contract address remains the same

Both commands will always build the contract and extract the ABI, regardless of flags.

Configuration

The tool reads contract addresses from relayer-config-example.toml. Ensure this file contains up-to-date:

  • gateway_address
  • gas_service_address
  • operators_address

Notes

  • Most operations will prompt for your keystore password
  • Use --watch flag to monitor transaction completion
  • The pay-gas-after-tx command allows you to send a GMP (General Message Passing) gas payment after a call contract transaction has been executed