Skip to content

mdantis-dev/SOLIDITY-referral-system

Repository files navigation

ReferralSystem + AccountManager – On-Chain Referral Contracts

This repository contains a suite of Solidity smart contracts implementing an on-chain referral and commission distribution system deployed on Base Sepolia.


🎮 Project Overview

This project showcases a simple yet robust referral system for tracking referrals, paying fixed commissions, and allowing referrers to claim their rewards in ETH.

It includes contracts for:

  • Tracking referees and their referrers.
  • Crediting fixed commissions per referral.
  • Allowing referrers to claim accrued commissions securely.
  • Managing which accounts can register users and issue referrals.

👨‍💻 Implementation

This project was developed as a portfolio demonstration of an on-chain referral and commission distribution system.

The repository includes:

  • ReferralSystem: Core contract managing referrer/referee relationships, commission accrual, contract funding, and reward claims.
  • AccountManager: Contract responsible for user registration and interaction with the referral system.
  • Deployment and verification scripts.
  • Test scripts simulating the full lifecycle: funding, user registration, earning commissions, and claiming rewards.

🔨 Contracts Included

Contract Description
ReferralSystem.sol Core contract tracking referrals, managing commissions, allowing claims & funding.
AccountManager.sol Handles user registration and interacts with ReferralSystem for recording referrals.

🧠 Key Features

✅ Transparent referral tracking on-chain.
✅ Fixed commission amount per referral.
✅ Supports only authorized registration managers.
✅ ETH-based funding & payouts with safety checks.
✅ Fully verified on Base Sepolia block explorer.
✅ Uses OpenZeppelin security primitives (Ownable, AccessControl, ReentrancyGuard).


🚀 Use Cases

Although this implementation is demonstrated with simple account registration, the ReferralSystem + AccountManager architecture is flexible and can be integrated into various on-chain and hybrid systems, such as:

  • 📈 Token sales & ICOs — reward users who refer others to buy tokens.
  • 🛒 NFT marketplaces — reward referrers when someone they invite purchases an NFT.
  • 🎮 Web3 games — reward players for bringing in new players or guild members.
  • 🏦 DeFi platforms — reward users who onboard liquidity providers or stakers.
  • 👨‍🏫 Learning platforms — reward learners who refer classmates or colleagues.
  • 🧩 Any dApp — where incentivized growth via referrals makes sense.

You can adapt the commission mechanism, referral tracking, and claiming logic to fit specific business needs — supporting ERC20, ERC721, ERC1155, or even off-chain actions that are validated on-chain.


🌐 Deployments

🧪 Testnet – Base Sepolia

Contracts Owner:
0xB94503C6a717BDD677ad9dAB7B450AF86d3Aa3F5

Contract Address
ReferralSystem 0xD12454843f6662BD1Cd27fB2DEA526f911c133a8
AccountManager 0x22430042749Bb0eb036d1e009E60EcE8fc9353aE

🏗️ Built For

Personal portfolio project demonstrating decentralized referral and commission mechanics on an EVM Layer 2 test network.


🧑‍💻 Author

Dantis Minurland Constantin
Full-Stack Software Developer

🌐 https://mdantis.dev
✉️ hello@mdantis.dev


📄 License

This repository is licensed under the MIT License.


⭐ Usage

If you are interested in similar smart contract development or blockchain integrations, feel free to get in touch.


About

Solidity smart contracts implementing an on-chain referral and commission distribution system deployed on Base Sepolia.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors