Smart Contracts
Rankify's smart contract architecture is built on Arbitrum Sepolia testnet, utilizing a factory pattern for efficient deployment and management of decentralized organizations.
Contract Addresses (Arbitrum Sepolia)
The following are the primary contracts deployed on Arbitrum Sepolia testnet:
| Contract | Address | Description |
|---|---|---|
DAODistributor | 0x54c7cdAEDa35c3990892e3FC1F00163fb7020287 | Main factory contract for creating and managing DAOs and MAOs |
MAODistribution | 0xC7A131a0f9FdD50c9e45270a48151066E22f0b9A | Core distribution logic for Meritocratic Autonomous Organizations |
Rankify | 0x21C68Aa0be617ebE09138d185BF2ff804131A8da | Game logic and tournament management |
Governor | 0x068620258FC3a2696B455b6f2Cf6A5877779CAba | Governance contract for protocol decisions |
RankToken | 0xaFA443F9f965ed3Dd973189c43e2b23d06342c26 | ERC20 token for protocol governance and rewards |
Architecture Overview
Rankify uses a sophisticated factory pattern where the main contracts serve as templates for creating new instances.
Factory Pattern
The DAODistributor acts as the main factory, creating new MAO instances through the MAODistribution template. This ensures consistent deployment and reduces gas costs through OpenZeppelin's Clones library.
Instance Creation
Each new guild (MAO) gets its own set of contracts: governance tokens, access managers, governors, Rankify instances, and rank tokens. These are instantiated dynamically as needed.
Diamond Proxy Pattern
Rankify instances use the EIP-2535 Diamond pattern, allowing for modular functionality and upgrades through facets while maintaining a single proxy address.
Note: Additional contracts (like game instances, DAO instances, etc.) are created through factory patterns defined in MAODistribution and are instantiated dynamically as needed. These factory contracts handle the creation and management of individual game tournaments, expert guilds, and other protocol components.
Contract Interactions
Understanding how these contracts work together is crucial for developers building on Rankify.
DAODistributor → MAODistribution
The distributor calls MAODistribution's instantiate function with encoded parameters to deploy new guild instances.
Governance Integration
Governor contracts use governance tokens for voting, while access managers control token minting based on tournament results and contributions.
Rankify Game Engine
The Rankify diamond proxy manages tournaments and automatically mints/burns rank tokens based on performance and participation.