RevenueTracker
The RevenueTracker
contract serves as an intermediary that manages and tracks project revenue deposits, ensuring a transparent revenue flow from project teams to IMO token holders. It records all revenue deposits and forwards them to the IMO token contract for distribution.
Key Features
Secure revenue deposits handling.
Complete revenue history tracking.
Automated forwarding to the IMO token contract.
Project wallet management.
Detailed revenue reporting.
Contract Details
State Variables
Functions
Core Operations
depositRevenue(uint256 amount)
Purpose: Processes revenue deposits made by the project team.
Access:
Project wallet
only.Requirements:
IMO token address to be set.
Amount > 0.
Overflow protection is in place.
Process Flow:
Transfers revenue tokens from the project wallet.
Updates the total revenue counter.
Records the deposit in revenue history.
Forwards tokens to the IMO token contract.
Events Triggered:
RevenueDeposited
.RevenueTransferredToIMOToken
.
Error Cases:
IMO token address is not set.
Zero amount provided.
Transfer has failed.
Overflow protection mechanism has triggered.
Administrative Functions
constructor(address _projectWallet, address _revenueToken)
Purpose: Initializes the contract with core addresses.
Parameters:
_projectWallet
: The address of the project wallet for revenue deposits._revenueToken
: The address of the revenue token.
Validation:
Requires both addresses to be non-zero.
Addresses are immutable once set.
setIMOToken(address _imoToken)
Purpose: Sets the IMO token contract address.
Access:
Owner
only.Restrictions:
One-time setting.
Cannot be zero address.
Events Triggered:
IMOTokenSet
.
updateProjectWallet(address _newProjectWallet)
Purpose: Updates the authorized project wallet address for deposits.
Access:
Owner
only.Validation: Non-zero address.
Events Triggered:
ProjectWalletUpdated
.
View Functions
getRevenueData()
Purpose: Retrieves the complete history of revenue deposits.
Returns:
totalRevenueAmount
: Total deposits made.revenueEntries
: An array of all deposit records.
Usage: Milestone verification and auditing.
Events
Access Control
Modifiers
Authorization Levels
Owner:
Set the IMO token address.
Update the project wallet address.
Perform contract administration.
Project Wallet:
Deposit revenue into the contract.
Act as the primary operational user for revenue handling.
Public:
View functions only.
Security Features
Reentrancy Protection
NonReentrant
modifier on deposit function.Secure transfer pattern for token handling.
Overflow Protection
Safe math operations.
Explicit overflow checks.
Access Controls
Role-based access.
Restricted access for administrative functions.
Integration Points
IMO Token Contract
Revenue forwarding destination.
Must be ERC-7641 compliant.
Revenue Token
Either USDT or the project's native token.
Standard ERC-20 interface.
MilestoneChecker
Uses revenue data for verification.
Tracks project performance.
Common Workflows
Revenue Depositing Process
The project wallet approves revenue tokens.
Calls
depositRevenue
, specifying amount.The Contract logs in the deposit details.
Forwards tokens to the IMO contract.
Emits appropriate events.
Revenue Verification
MilestoneChecker
requests revenue data.Analyzes deposit history.
Verifies deposit data against milestones.
Authorizes escrow releases.
Last updated