diff --git a/Cargo.toml b/Cargo.toml index dd570a21..a4c5d6fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,33 +1,30 @@ [workspace] members = [ - "contracts/analytics", - "contracts/token", - "contracts/shared", - "contracts/certificate", - "contracts/governance", - "contracts/credential_metadata", - "contracts/reputation", - "contracts/buyback", - "contracts/scholarship_fund", - "contracts/token_restrictions", - "contracts/liquidity_pool", - "contracts/grants", - "contracts/badges", - "contracts/nft", - "contracts/registry", - "contracts/market", - "contracts/dispute", + "stellar-contract", + "packages/contracts/contracts/market", ] -resolver = "2" + +[workspace.dependencies] +# Soroban SDK - latest stable +soroban-sdk = "20.0.0" +soroban-cli = "20.0.0" + +# Common dependencies +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +thiserror = "1.0" +anyhow = "1.0" [profile.release] opt-level = "z" overflow-checks = true -debug = 0 -strip = "symbols" -panic = "abort" +lto = true +debug = false +strip = true codegen-units = 1 +panic = "abort" -[profile.release-with-logs] -inherits = "release" -debug-assertions = true +[profile.dev] +opt-level = 0 +debug = true +overflow-checks = true diff --git a/README.md b/README.md index a598e13a..85c12d7d 100644 --- a/README.md +++ b/README.md @@ -287,3 +287,52 @@ MIT — see [LICENSE](./LICENSE) for details. --- *Built with ❤️ on the Stellar network. Inspired by [StrellerMinds](https://github.com/StarkMindsHQ) by StarkMindsHQ.* + +## Development Setup + +### Prerequisites + +- Rust stable (latest) +- Soroban SDK v20.0.0+ +- Stellar CLI v20.0.0+ + +### Installation + +```bash +# Install Rust +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + +# Install Soroban CLI +cargo install soroban-cli + +# Install wasm-opt (optional, for optimization) +# macOS +brew install binaryen + +# Ubuntu +sudo apt-get install binaryen +# Build all contracts +cargo build --target wasm32-unknown-unknown --release + +# Build specific contract +cd stellar-contract +cargo build --target wasm32-unknown-unknown --release +# Deploy contract +soroban contract deploy \ + --wasm target/wasm32-unknown-unknown/release/scavenger_contract.wasm \ + --network testnet \ + --source-account $DEPLOYER_SECRET + +# Initialize contract +soroban contract invoke \ + --id CONTRACT_ID \ + --network testnet \ + --source-account $DEPLOYER_SECRET \ + -- initialize \ + --admin $ADMIN_ADDRESS +# Deploy to mainnet +soroban contract deploy \ + --wasm target/wasm32-unknown-unknown/release/scavenger_contract.wasm \ + --network mainnet \ + --source-account $DEPLOYER_SECRET +git status diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..a9c63a63 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "stable" +targets = ["wasm32-unknown-unknown"] +profile = "default"