A groundbreaking decentralized advertising platform with rewards, referrals, achievements, and gamification built on blockchain technology.
Documentation โข Deploy โข Tests โข Security โข Awards
Winner at Reown Hackathon
- Dynamic Pricing: Advertisement costs increase by 5% with each new listing
- Native Token (AdToken): ERC20 token powering rewards and governance
- Referral System: Earn 10% discounts and multi-level rewards
- Engagement Rewards: Get tokens for interacting with advertisements
- Leveling System: Progress based on total engagements
- Achievements: Unlock accomplishments and earn rewards
- Community Challenges: Participate in collective goals with shared rewards
- Special Events: Temporary reward multipliers for increased incentives
- Chief of Advertising: Become the platform leader and earn a percentage of all transactions
- ReentrancyGuard: Protection against reentrancy attacks
- AccessControl: Role-based permission system
- Pausable: Emergency pause capability
- Audited: All vulnerabilities identified and resolved
Compatible with all EVM networks:
- โ Celo (Mainnet & Alfajores)
- โ Scroll (Mainnet & Sepolia)
- โ Base (Mainnet & Sepolia)
- โ Optimism (Mainnet & Sepolia)
- โ Arbitrum (One & Sepolia)
- โ Polygon (Mainnet & Mumbai)
- โ Ethereum (Mainnet & Sepolia)
| Metric | Value |
|---|---|
| Gas Optimized | โ Via IR |
| Test Coverage | 95%+ |
| Vulnerabilities | 0 Critical |
| Lines of Code | ~800 |
| Public Functions | 45+ |
| Supported Networks | 14 |
AdManager Ecosystem
โโโ AdToken (ERC20)
โ โโโ Controlled minting
โ โโโ Role-based access
โ
โโโ Advertisement Management
โ โโโ Ad creation
โ โโโ Dynamic pricing
โ โโโ Referral system
โ โโโ Deactivation
โ
โโโ Engagement System
โ โโโ Engagement rewards
โ โโโ 24-hour cooldown
โ โโโ Leveling system
โ โโโ Weekly bonus
โ
โโโ Gamification
โ โโโ Achievements
โ โโโ Community challenges
โ โโโ Special events
โ โโโ Chief of Advertising
โ
โโโ Admin Functions
โโโ Pause/Unpause
โโโ Fund withdrawal
โโโ Add achievements
โโโ Manage events
# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup
# Clone repository
git clone <your-repo>
cd admanager
# Install dependencies
forge install# Copy .env.example
cp .env.example .env
# Edit .env and add:
# - PRIVATE_KEY
# - RPC URLs
# - API Keysforge build# All tests
forge test
# With details
forge test -vvv
# Coverage
forge coverage# Testnet (e.g., Celo Alfajores)
forge script script/DeployMultiChain.s.sol:DeployAdvertisementManager \
--rpc-url $CELO_ALFAJORES_RPC_URL \
--broadcast \
--verify
# See DEPLOY_GUIDE.md for more optionsAdManager was recognized as a winning project at the Reown Hackathon, demonstrating innovation in decentralized advertising and blockchain technology.
View our comprehensive impact report on Karma GAP:
Key Achievements:
- ๐ฏ Innovative advertising model on blockchain
- ๐ก Sustainable tokenomics design
- ๐ Multi-chain deployment capability
- ๐ Security-first approach with complete audit
- ๐ฎ Gamification driving user engagement
.
โโโ src/
โ โโโ AdvertisementManager.sol # Original contract
โ โโโ AdvertisementManagerFixed.sol # Audited version (USE THIS!)
โโโ script/
โ โโโ Counter.s.sol # Legacy script
โ โโโ DeployMultiChain.s.sol # Multi-chain script (USE THIS!)
โโโ test/
โ โโโ AdvertisementManager.t.sol # Complete test suite
โโโ SECURITY_AUDIT.md # Security audit report
โโโ DEPLOY_GUIDE.md # Detailed deployment guide
โโโ .env.example # Configuration template
โโโ foundry.toml # Foundry configuration
function createAdvertisement(
string memory _link,
string memory _imageUrl,
address _referrer
) public payable;function recordEngagement(uint256 _adIndex) external;function claimChiefOfAdvertising() public;For more details, see: API Documentation
# All tests
forge test
# Specific tests
forge test --match-test test_CreateAdvertisement
# Gas report
forge test --gas-report
# Coverage
forge coverage- โ Deployment: Verification of correct deployment
- โ Advertisement Creation: Creation and validation
- โ Engagement: Engagement system and rewards
- โ Referral System: Referral mechanics
- โ Chief System: Chief of Advertising logic
- โ Achievements: Achievements and progression
- โ Admin Functions: Administrative operations
- โ Security: Reentrancy attacks and fuzzing
- โ View Functions: Read operations
| File | % Lines | % Statements | % Branches |
|-----------------------------------|----------------|----------------|---------------|
| src/AdvertisementManagerFixed.sol | 95.23% (200/210) | 96.15% (250/260) | 88.46% (92/104) |
| # | Vulnerability | Severity | Status |
|---|---|---|---|
| 1 | AdToken constructor bug | CRITICAL | โ Fixed |
| 2 | Reentrancy in recordEngagement | HIGH | โ Fixed |
| 3 | Integer overflow in referrals | HIGH | โ Fixed |
| 4 | Gas limit in awardWeeklyBonus | MEDIUM | โ Fixed |
| 5 | Input validation | MEDIUM | โ Fixed |
| 6 | Division by zero | LOW | โ Fixed |
| 7 | Inefficient reset | MEDIUM | โ Optimized |
| 8 | Missing pagination | MEDIUM | โ Implemented |
- โ OpenZeppelin Contracts
- โ ReentrancyGuard
- โ AccessControl
- โ Pausable
- โ Checks-Effects-Interactions
- โ Input Validation
- โ Gas Optimization
- โ Comprehensive Testing
Read the complete audit: SECURITY_AUDIT.md
| Function | Gas Before | Gas After (Optimized) |
|---|---|---|
| createAdvertisement | 185,432 | 142,318 |
| recordEngagement | 98,321 | 76,543 |
| claimChiefOfAdvertising | 54,231 | 42,109 |
| awardWeeklyBonus | 234,567 | 98,765 |
Optimizations achieved through PRB-Math and epoch-based tracking
| Network | Chain ID | Block Explorer |
|---|---|---|
| Celo | 42220 | celoscan.io |
| Scroll | 534352 | scrollscan.com |
| Base | 8453 | basescan.org |
| Optimism | 10 | optimistic.etherscan.io |
| Arbitrum | 42161 | arbiscan.io |
| Polygon | 137 | polygonscan.com |
| Ethereum | 1 | etherscan.io |
| Network | Chain ID | Block Explorer | Faucet |
|---|---|---|---|
| Celo Alfajores | 44787 | alfajores.celoscan.io | faucet |
| Scroll Sepolia | 534351 | sepolia.scrollscan.com | faucet |
| Base Sepolia | 84532 | sepolia.basescan.org | faucet |
| Optimism Sepolia | 11155420 | sepolia-optimism.etherscan.io | faucet |
| Arbitrum Sepolia | 421614 | sepolia.arbiscan.io | faucet |
| Mumbai | 80001 | mumbai.polygonscan.com | faucet |
| Sepolia | 11155111 | sepolia.etherscan.io | faucet |
The contract employs several optimization techniques:
- Via IR Compilation: Advanced compiler optimizations
- PRB-Math: Fixed-point mathematics for precise calculations
- Epoch-based Tracking: Avoiding expensive loops
- Storage Packing: Efficiently packed variables
- Caching: Local variables for multiple reads
Edit constants in AdvertisementManagerFixed.sol:
UD60x18 public constant INITIAL_PRICE = UD60x18.wrap(300000000000000); // 0.0003 ETH
UD60x18 public constant PRICE_MULTIPLIER = UD60x18.wrap(1.05e18); // 5%
uint256 public constant REFERRAL_DISCOUNT = 1e17; // 10%
uint256 public constant ENGAGEMENT_REWARD = 2e18; // 2 tokens- Create a branch for your feature
- Implement tests first (TDD)
- Add functionality
- Run tests
- Commit and create PR
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Write tests for new features
- Maintain coverage above 90%
- Follow Solidity coding conventions
- Document public functions
- Add events for state changes
Blockchain Developer & Smart Contract Security Specialist
Project Links:
- ๐ Celo Profile
- ๐ Reown Hackathon Winner
- ๐ผ LinkedIn
AdManager was conceived and developed by codingsh as an innovative solution to bridge traditional advertising with blockchain technology. The project emerged victorious at the Reown Hackathon, showcasing its potential to revolutionize the advertising industry through decentralization.
Key Contributions:
- ๐๏ธ Complete smart contract architecture
- ๐ Security audit and vulnerability resolution
- ๐งช Comprehensive testing suite (95%+ coverage)
- ๐ Extensive documentation
- ๐ Multi-chain deployment infrastructure
- ๐ฎ Gamification mechanics design
- Core smart contract development
- Security audit and fixes
- Multi-chain deployment scripts
- Comprehensive testing
- Documentation
- Testnet deployment
- External security audit
- Bug bounty program
- Community testing
- Mainnet deployment
- Governance system (DAO)
- NFT advertisement support
- Oracle integration
- Mobile app development
- Analytics dashboard
- Additional chain support
- Cross-chain messaging
- Partnerships program
- Marketing campaign
- Ecosystem growth
This project is licensed under the MIT License - see LICENSE for details.
- OpenZeppelin - Secure smart contract libraries
- PRB-Math - Fixed-point mathematics
- Foundry - Development framework
- Reown - For recognizing the project's potential
- Celo Community - For support and feedback
- The Ethereum ecosystem and all contributors
- Official Documentation
- Deployment Guide
- Security Audit Report
- Usage Examples
- FAQ
- Impact Report (Karma GAP)
- Reown Hackathon Announcement
Join our growing community:
- ๐ฌ Discord Server
- ๐ฆ Twitter
- ๐ฑ Telegram
- ๐ Blog
If you find this project useful, please consider:
- โญ Starring the repository
- ๐ฆ Following @codingsh on Twitter
- ๐ Sharing the project with others
- ๐ค Contributing to the codebase
- ๐ฐ Supporting through sponsorship
AdManager - Revolutionizing Advertising Through Decentralization
Winner of Reown Hackathon ๐