![]() Diego Barquero |
![]() Sebástian Salazar |
![]() Matias Aguilar |
![]() Brandon Fernández |
- 🔧 Prerequisites
- ⚙️ Environment Setup
- 💰 Wallet Configuration
- 🛠️ Build & Deployment
- ✅ Testing & Execution
- 📌 Example
- ❓ Troubleshooting
Before starting, make sure you have the following dependencies installed:
-
For Linux/macOS:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
For Windows:
Download and install Rust from rust-lang.org. -
Add WebAssembly Target:
rustup target add wasm32-unknown-unknown
-
Using Cargo:
cargo install --locked soroban-cli
-
Using Homebrew (macOS, Linux):
brew install soroban-cli
-
Clone the repository
git clone https://github.com/your-user/your-repo.git cd your-repo/packages/soroban
-
Build the contract
soroban build
-
Run tests
cargo test
- Install a Stellar wallet (e.g., Freighter Wallet).
- Create a new wallet and securely store your secret keys.
- Connect the wallet to the Stellar testnet.
-
Compile the contract in release mode
cargo build --release --target wasm32-unknown-unknown
-
Deploy the contract using Soroban CLI
soroban contract deploy --wasm target/wasm32-unknown-unknown/release/your_contract.wasm
Run unit tests:
cargo test
Interact with the deployed contract using Soroban CLI or supported wallet tools.
For a practical example of how to interact with these contracts, check out Stellar’s official documentation on Smart Contracts.
- Follow Rust best practices
- Ensure all tests pass
- Document your changes
- Add test cases
- Submit a PR
- Use the Soroban CLI for local development
- Test thoroughly on testnet before mainnet
- Keep contract size optimized
- Monitor gas usage
- Use events for contract state changes
If you encounter any issues, try these solutions:
- Compilation Errors: Ensure all dependencies are installed and updated.
- Deployment Issues: Verify you’re connected to the correct network (testnet or mainnet) and that your wallet is properly set up.
- Test Failures: Check detailed error messages from
cargo test
to debug the issue.
This README is based on Stellar’s official documentation .
🚀 Happy coding!