- Rust 1.70.0 or higher
- Soroban CLI v21.5.0 or higher
- Node.js 18+ (for example helpers, optional)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envcargo install soroban-clirustup target add wasm32-unknown-unknowngit clone https://github.com/FoxAIhelper/astraport-contracts.git
cd astraport-contracts
cargo buildcargo buildsoroban contract build --package astraport-rebalancing
soroban contract build --package astraport-events
soroban contract build --package astraport-stakingcargo build --releasecargo testcargo test -p astraport-rebalancing
cargo test -p astraport-events
cargo test -p astraport-stakingcargo test -- --nocaptureastraport-contracts/
├── Cargo.toml # Workspace configuration
├── contracts/
│ ├── rebalancing/ # Rebalancing contract
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ ├── events/ # Events contract
│ │ ├── Cargo.toml
│ │ └── src/
│ │ └── lib.rs
│ └── staking/ # Staking contract
│ ├── Cargo.toml
│ └── src/
│ └── lib.rs
├── docs/ # Documentation
│ ├── ARCHITECTURE.md
│ └── DEVELOPMENT.md
├── examples/ # Example implementations
├── tests/ # Integration tests
└── README.md
- Follow Rust naming conventions (snake_case for functions/variables, CamelCase for types)
- Use meaningful variable names
- Add documentation comments to public functions
- Format code with
cargo fmt - Check for linting issues with
cargo clippy
# Set your test account (requires Soroban CLI setup)
soroban contract build --package astraport-rebalancing
soroban contract deploy --wasm target/wasm32-unknown-unknown/release/astraport_rebalancing.wasm \
--source testuser \
--network testnetsoroban contract build --package astraport-rebalancing
soroban contract deploy --wasm target/wasm32-unknown-unknown/release/astraport_rebalancing.wasm \
--source mainuser \
--network mainnetrustup target add wasm32-unknown-unknownEnsure you have the latest Soroban CLI:
cargo install --force soroban-cliClear the build cache if encountering stale test issues:
cargo clean
cargo test