https://github.com/jeninsutradhar/azorion
Solana-based smart contract that enables users to complete tasks and earn SOL rewards dynamically based on demand-supply logic
https://github.com/jeninsutradhar/azorion
anchor anticheat blockchain decentralized decentralized-applications demand-supply-management play-to-earn smart-contracts solana solana-program
Last synced: 9 days ago
JSON representation
Solana-based smart contract that enables users to complete tasks and earn SOL rewards dynamically based on demand-supply logic
- Host: GitHub
- URL: https://github.com/jeninsutradhar/azorion
- Owner: JeninSutradhar
- Created: 2025-02-22T15:09:37.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2025-03-01T14:46:15.000Z (about 2 months ago)
- Last Synced: 2025-03-28T14:11:12.235Z (26 days ago)
- Topics: anchor, anticheat, blockchain, decentralized, decentralized-applications, demand-supply-management, play-to-earn, smart-contracts, solana, solana-program
- Language: TypeScript
- Homepage: https://azorion.netlify.app
- Size: 247 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Azorion - Dynamic Task-Based Reward System on Solana
[](https://www.repostatus.org/#wip) [](https://www.rust-lang.org/) [](https://www.anchor-lang.com/) [](https://solana.com/) [](https://opensource.org/licenses/MIT) [](https://your-test-results-url-here.com) [](https://azorion.netlify.com) 
Azorion is a **Solana smart contract** that powers a **task-driven reward system**, enabling users to earn **SOL dynamically** based on task availability and engagement levels. The system uses **real-time demand-supply mechanics** to adjust rewards, **prevent farming exploits**, and encourage **sustainable participation**.
![]()
## **πΉ Key Features**
| | |
|--------------------------------|--------------------------------------------------------------------------------|
| **Task-Based Rewards** | Users earn **SOL** by completing on-chain tasks. |
| **Dynamic Reward Adjustment** | Rewards **increase or decrease** (Β±20%/Β±10%) based on task availability. |
| **Secure PDA Storage** | Uses **Program Derived Addresses (PDA)** for tamper-proof tracking. |
| **Anti-Farming Protection** | **Reduces rewards** for repeated task claims; resets when switching tasks. |
| **Cooldown System** | **5-second delay** enforced between task completions to prevent spam. |
| **RNG Task Availability** | **Randomized task enable/disable** every **10 seconds** to enhance engagement. |At its core, Azorion establishes a demand-responsive incentive structure. Rewards are algorithmically increased during periods of high task availability and low user engagement, effectively incentivizing participation. Conversely, rewards are moderated when user activity exceeds available tasks, promoting system sustainability and preventing inflationary pressures.
## π οΈ Program Architecture

## **πΉ Use Cases**
Azorion's dynamic reward system supports:β **Play-to-Earn Games** β Task-based in-game incentives.
β **Educational Platforms** β Milestone-based rewards for learners.
β **Decentralized Work** β Demand-based compensation for freelancers.
β **Community Governance** β Rewarding proposal participation.
β **Loyalty Programs** β Engagement-driven incentives.## β Implementation Status
| Feature | Status |
| -------------------------------------------- | ----------- |
| **Task-Based Reward System** | β Completed |
| **Dynamic Reward Adjustment** | β Completed |
| **Program Derived Address (PDA) Storage** | β Completed |
| **Anti-Farming Mechanism** | β Completed |
| **Cooldown System** | β Completed |
| **RNG-Based Task Availability** | β Completed |
| **Security & Optimization** | β Completed |
| **Leaderboard (Top 5 Earners)** | β To be Implemented |
| **Automated Tests** | β Completed |## **πΉ Security Measures**
| **Security Aspect** | **Implementation** |
|--------------------------|------------------------------------------------------------------------------------|
| **Access Control** | **Authority-restricted program initialization** and **parameter management**. |
| **Anti-Farming** | Implements **progressive reward penalties** for repeated task farming. |
| **Data Integrity** | Utilizes **Solana PDAs** to ensure **on-chain secure storage**. |
| **Memory Safety** | Built with **Rust**, ensuring **safe and secure memory management**. |
| **Security Audits** | π§ **Planned periodic third-party audits** *(Required before production use).* |π‘ **Note:** *Azorion is currently under development. Deployment in production environments is not recommended until a formal audit is completed.*
---
## **πΉ Program API**
| **Instruction** | **Purpose** | **Arguments** |
|------------------|---------------------------------------------------------------|------------------------------------------------------------|
| `initialize` | Sets up **program state** (authority, SOL supply, task limits). | `initial_supply: u64`, `min_available_tasks: u8`, `max_available_tasks: u8` |
| `claim_reward` | Allows users to **claim SOL rewards** for completing tasks. | `activity_type: String` |
| `randomize_tasks`| Refreshes **task availability** based on randomization logic. | *(No Arguments)* |---
## **πΉ Deployment Instructions**
### **π Local Validator Deployment**
1οΈβ£ Start the local validator:
```sh
solana-test-validator
```
2οΈβ£ Deploy the program:
```sh
anchor deploy
```### **π Devnet Deployment**
1οΈβ£ Configure Solana to **Devnet**:
```sh
solana config set --url devnet
```
2οΈβ£ Get **free test SOL**:
```sh
solana airdrop 5
```
3οΈβ£ Deploy the program:
```sh
anchor deploy --provider.cluster devnet
```### **π Testnet/Mainnet Deployment**
1οΈβ£ Switch to **Testnet/Mainnet**:
```sh
solana config set --url testnet # For Testnet
solana config set --url mainnet-beta # For Mainnet
```
2οΈβ£ Ensure sufficient **SOL balance** for deployment.
3οΈβ£ Deploy the program:
```sh
anchor deploy --provider.cluster testnet # Use mainnet-beta for production
```---
## **πΉ Testing Overview**
Azorion undergoes **extensive testing** using **Mocha + Chai** for assertion-based validation.
| **Test Case** | **Coverage** |
|----------------------|-----------------------------------------------------------------------------|
| **Initialization** | Ensures correct **program setup, authority verification**. |
| **Reward Dynamics** | Simulates **demand-based reward increases/decreases**. |
| **Anti-Farming** | Tests **progressive penalties for repeated task claims**. |
| **Cooldowns** | Verifies **5-second delay enforcement between claims**. |
| **Security Checks** | **Rejects unauthorized transactions, overflow, and invalid inputs.** |---
## πΉ **Technology Stack:**
- **Blockchain:** Solana (Rust + Anchor)
- **Smart Contracts:** Rust, Anchor Framework
- **Testing & Deployment:** Solana Devnet, Anchor CLI, TypeScript (for tests)## β¬οΈ CHANGELOG
- **Numerical Task Identifiers (Enums):** Replaced string task names with ActivityType enums, significantly improving efficiency in storage and processing. Tasks are now represented and handled internally using numerical IDs, which are faster to compare and less error-prone than strings.
- **Improved RNG for Task Availability:** Modified the randomize_available_tasks function to use the block slot number from clock::Clock::get()?.slot as the source of randomness, making task availability less predictable and more resistant to potential manipulation compared to timestamp-based RNG.
- **Error Handling:** Incorporated custom error codes using the ErrorCode enum to provide more informative and specific error messages, aiding in debugging and user feedback.
- **Account Size Management:** Defined MAX_SIZE constants for ProgramState and User accounts and utilized them in #[account(space = ...)] to ensure rent exemption and prevent potential buffer overflow vulnerabilities.## πΊοΈ Roadmap and Future Work
![]()
* **Leaderboard Integration**
* **Frontend UI & SDK**
* **Regular Security Audits**