IMOSale
The IMOSale.sol
contract serves as the primary entry point for Initial Model Offerings (IMO), managing the fundraising process for AI model projects. It handles investment collection, investor tier management, token distribution, and coordinates with other IMO ecosystem contracts.
Key Features
Manages a time-limited funding period (default 14 days).
Handles USDT investments with tier-based access control.
Deploys and distributes ERC-7641 compliant IMO tokens.
Coordinates fund distribution between project wallet and escrow.
Implements emergency stop mechanism for security.
Supports upgradable token implementation.
Contract Details
Constants
Key State Variables
Functions
Core Investment Functions
invest(uint256 _amount)
Purpose: Enables direct USDT investment in the IMO.
Access: Public.
Usage: During the active funding period by eligible investors.
Input: USDT amount to invest.
Validation:
Funding period is active.
Emergency stop is not active.
Investor meets tier requirements.
Amount > 0.
investFor(address _investor, uint256 _amount)
Purpose: Enables investment through the
StablecoinRouter
for multiple stablecoin support.Access:
StablecoinRouter
only.Usage: Upon investing with non-USDT stablecoins.
Input: Investor address and USDT amount.
calculateTier(address _investor)
Purpose: Determines investor's tier based on their staking amount and duration. Requires Neura Staking contract for tier queries.
Returns: Tier level (0-3):
3: Gold.
2: Silver.
1: Bronze.
0: Not eligible.
Usage: Validating an investor's eligibility for participation based on their tier.
Funding Management
closeFunding()
Purpose: Finalizes funding period and initializes token distribution.
Access:
Owner
only.Process Flow:
Validates that the funding period has ended.
Transfers the initial deposit to the project wallet.
Moves the remaining funds to the
EscrowVesting
contract.Deploys IMO token.
Distributes tokens to investors.
Initializes related contracts.
deployIMOToken()
Purpose: Deploys an upgradeable ERC-7641 token contract.
Process Flow:
Deploys the implementation contract.
Sets up the proxy admin.
Deploys a transparent proxy.
Initializes token parameters.
distributeTokens()
Purpose: Mints and distributes IMO tokens to investors.
Process Flow: Converts USDT amounts to token amounts (18 decimals).
Token Distribution Ratio: 1 USDT (6 decimals) = 1 IMO Token (18 decimals).
Administrative Functions
setEmergencyStop(bool _stop)
Purpose: Halts all contract operations in the event of an emergency.
Access:
Owner
only.Usage: When security concerns arise.
adjustFundingPeriod(uint256 _newEndTime)
Purpose: Modifies funding period duration.
Access:
Owner
only.Restrictions: Can only be executed before the funding period closes.
updateTokenParameters(string _newName, string _newSymbol, uint256 _newClaimPoolPercentage)
Purpose: Updates the IMO token configuration.
Access:
Owner
only.Usage: Before the funding period closes.
Parameters:
Token name.
Token symbol.
Claim pool percentage.
setEscrowVesting(address _escrowVesting)
Purpose: Links the
EscrowVesting
contract.Access:
Owner
only.
setMilestoneChecker(address _milestoneChecker)
Purpose: Links
MilestoneChecker
contract.Access:
Owner
only.
View Functions
getInvestorTier(address _investor)
Purpose: Returns investor's tier level.
getInvestedAmount(address _investor)
Purpose: Returns investor's total investment amount.
getInvestorsCount()
Purpose: Returns total number of unique investors.
getImoTokenAddress()
Purpose: Returns deployed IMO token address.
getUSDTBalance()
Purpose: Returns contract's current USDT balance.
Events
Security Features
Access Control
Tiered investment system.
Owner-only administrative functions.
Fund Safety
Escrow mechanism for majority of funds.
Emergency stop functionality.
Reentrancy protection.
Investment Validation
Tier eligibility checks.
Zero amount prevention.
Transfer success verification.
Upgradability
Proxy pattern for IMO token.
Controlled upgrade mechanism.
Integration Points
Requires the initialized Neura Staking Contract for Tiers (
MockStaking
contract is being used currently).Integrates with
EscrowVesting
contract.Coordinates with
MilestoneChecker
.Optional
StablecoinRouter
integration for supporting IMO participation with multiple whitelisted ERC-20 tokens.
Last updated