IINVMANAGER
Interface for the contract that manages investment rounds and token vesting
Defines external functions and events for the InvestmentManager contract
Functions
initialize
Initializes the contract
function initialize(address token, address timelock_, address treasury_) external;
Parameters
token
address
Address of the ecosystem token
timelock_
address
Address of the timelock controller
treasury_
address
Address of the treasury
pause
Pauses the contract
function pause() external;
unpause
Unpauses the contract
function unpause() external;
scheduleUpgrade
Schedules an upgrade to a new implementation
function scheduleUpgrade(address newImplementation) external;
Parameters
newImplementation
address
Address of the new implementation
emergencyWithdrawToken
Executes an emergency withdrawal
function emergencyWithdrawToken(address token) external;
Parameters
token
address
Address of the token to withdraw (0xEeee... for ETH)
emergencyWithdrawEther
Executes an emergency withdrawal
function emergencyWithdrawEther() external;
createRound
Creates a new investment round
function createRound(
uint64 start,
uint64 duration,
uint256 ethTarget,
uint256 tokenAlloc,
uint64 vestingCliff,
uint64 vestingDuration
) external returns (uint32);
Parameters
start
uint64
Start timestamp of the round
duration
uint64
Duration in seconds
ethTarget
uint256
Target ETH amount
tokenAlloc
uint256
Total token allocation
vestingCliff
uint64
Cliff period for vesting in seconds
vestingDuration
uint64
Duration for vesting in seconds
Returns
<none>
uint32
ID of the created round
activateRound
Activates a pending round
function activateRound(uint32 roundId) external;
Parameters
roundId
uint32
ID of the round to activate
addInvestorAllocation
Adds an investor allocation to a round
function addInvestorAllocation(uint32 roundId, address investor, uint256 ethAmount, uint256 tokenAmount) external;
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
ethAmount
uint256
ETH allocation amount
tokenAmount
uint256
Token allocation amount
removeInvestorAllocation
Removes an investor allocation from a round
function removeInvestorAllocation(uint32 roundId, address investor) external;
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
cancelInvestment
Cancels an investment in a round
function cancelInvestment(uint32 roundId) external;
Parameters
roundId
uint32
ID of the round
finalizeRound
Finalizes a completed round
function finalizeRound(uint32 roundId) external;
Parameters
roundId
uint32
ID of the round
cancelRound
Cancels a round
function cancelRound(uint32 roundId) external;
Parameters
roundId
uint32
ID of the round
claimRefund
Claims a refund for a cancelled round
function claimRefund(uint32 roundId) external;
Parameters
roundId
uint32
ID of the round
investEther
Invests ETH in a round
function investEther(uint32 roundId) external payable;
Parameters
roundId
uint32
ID of the round
upgradeTimelockRemaining
Returns the remaining time before a scheduled upgrade can be executed
function upgradeTimelockRemaining() external view returns (uint256);
Returns
<none>
uint256
Time remaining in seconds
getRefundAmount
Gets the refund amount for an investor in a round
function getRefundAmount(uint32 roundId, address investor) external view returns (uint256);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
Returns
<none>
uint256
Refund amount
getInvestorDetails
Gets investor details for a round
function getInvestorDetails(uint32 roundId, address investor)
external
view
returns (uint256 etherAmount, uint256 tokenAmount, uint256 invested, address vestingContract);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
Returns
etherAmount
uint256
ETH allocation amount
tokenAmount
uint256
Token allocation amount
invested
uint256
Amount invested
vestingContract
address
Address of the vesting contract
getEcosystemToken
Gets the address of the ecosystem token
function getEcosystemToken() external view returns (address);
Returns
<none>
address
Address of the ecosystem token
getRoundInfo
Gets information about a round
function getRoundInfo(uint32 roundId) external view returns (Round memory);
Parameters
roundId
uint32
ID of the round
Returns
<none>
Round
Round information
getRoundInvestors
Gets list of investors in a round
function getRoundInvestors(uint32 roundId) external view returns (address[] memory);
Parameters
roundId
uint32
ID of the round
Returns
<none>
address[]
Array of investor addresses
getCurrentRound
Gets the current active round
function getCurrentRound() external view returns (uint32);
Returns
<none>
uint32
ID of the current active round, or type(uint32).max if none
timelock
Gets the timelock controller address
function timelock() external view returns (address);
Returns
<none>
address
Address of the timelock controller
treasury
Gets the treasury address
function treasury() external view returns (address);
Returns
<none>
address
Address of the treasury
supply
Gets the total token supply managed by this contract
function supply() external view returns (uint256);
Returns
<none>
uint256
Total supply
version
Gets the contract version
function version() external view returns (uint32);
Returns
<none>
uint32
Contract version
Events
Initialized
Emitted when the contract is initialized
event Initialized(address indexed initializer);
Parameters
initializer
address
Address that called initialize
UpgradeScheduled
Emitted when an upgrade is scheduled
event UpgradeScheduled(
address indexed sender, address indexed implementation, uint64 scheduledTime, uint64 effectiveTime
);
Parameters
sender
address
Address that scheduled the upgrade
implementation
address
New implementation address
scheduledTime
uint64
Time when upgrade was scheduled
effectiveTime
uint64
Time when upgrade can be executed
UpgradeCancelled
Emitted when a scheduled upgrade is cancelled
event UpgradeCancelled(address indexed canceller, address indexed implementation);
Parameters
canceller
address
The address that cancelled the upgrade
implementation
address
The implementation address that was cancelled
Upgraded
Emitted when contract implementation is upgraded
event Upgraded(address indexed upgrader, address indexed implementation, uint32 version);
Parameters
upgrader
address
Address that performed the upgrade
implementation
address
New implementation address
version
uint32
New version number
EmergencyWithdrawal
Emitted when an emergency withdrawal is executed
event EmergencyWithdrawal(address indexed token, uint256 amount);
Parameters
token
address
Address of the token withdrawn (ethereum constant for ETH)
amount
uint256
Amount withdrawn
CreateRound
Emitted when a new investment round is created
event CreateRound(
uint32 indexed roundId, uint64 startTime, uint64 duration, uint256 etherTarget, uint256 tokenAllocation
);
Parameters
roundId
uint32
ID of the created round
startTime
uint64
Start timestamp of the round
duration
uint64
Duration in seconds
etherTarget
uint256
Target ETH amount
tokenAllocation
uint256
Total token allocation
RoundStatusUpdated
Emitted when a round's status is updated
event RoundStatusUpdated(uint32 indexed roundId, RoundStatus status);
Parameters
roundId
uint32
ID of the round
status
RoundStatus
New status
InvestorAllocated
Emitted when an investor is allocated in a round
event InvestorAllocated(uint32 indexed roundId, address indexed investor, uint256 etherAmount, uint256 tokenAmount);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
etherAmount
uint256
ETH allocation amount
tokenAmount
uint256
Token allocation amount
InvestorAllocationRemoved
Emitted when an investor's allocation is removed
event InvestorAllocationRemoved(
uint32 indexed roundId, address indexed investor, uint256 etherAmount, uint256 tokenAmount
);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
etherAmount
uint256
ETH allocation amount removed
tokenAmount
uint256
Token allocation amount removed
CancelInvestment
Emitted when an investment is cancelled
event CancelInvestment(uint32 indexed roundId, address indexed investor, uint256 amount);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
amount
uint256
ETH amount returned
RoundFinalized
Emitted when a round is finalized
event RoundFinalized(address indexed finalizer, uint32 indexed roundId, uint256 ethAmount, uint256 tokenAmount);
Parameters
finalizer
address
Address that finalized the round
roundId
uint32
ID of the round
ethAmount
uint256
Total ETH raised
tokenAmount
uint256
Total tokens distributed
RoundCancelled
Emitted when a round is cancelled
event RoundCancelled(uint32 indexed roundId);
Parameters
roundId
uint32
ID of the cancelled round
RefundClaimed
Emitted when a refund is claimed
event RefundClaimed(uint32 indexed roundId, address indexed investor, uint256 amount);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
amount
uint256
ETH amount refunded
Invest
Emitted when an investment is made
event Invest(uint32 indexed roundId, address indexed investor, uint256 amount);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
amount
uint256
ETH amount invested
RoundComplete
Emitted when a round is completed
event RoundComplete(uint32 indexed roundId);
Parameters
roundId
uint32
ID of the completed round
DeployVesting
Emitted when a vesting contract is deployed
event DeployVesting(
uint32 indexed roundId, address indexed investor, address indexed vestingContract, uint256 allocation
);
Parameters
roundId
uint32
ID of the round
investor
address
Address of the investor
vestingContract
address
Address of the vesting contract
allocation
uint256
Token allocation amount
Errors
UpgradeTimelockActive
Error thrown when trying to execute an upgrade before timelock expires
error UpgradeTimelockActive(uint256 remainingTime);
Parameters
remainingTime
uint256
Time remaining until upgrade can be executed
UpgradeNotScheduled
Error thrown when trying to execute an upgrade that wasn't scheduled
error UpgradeNotScheduled();
ImplementationMismatch
Error thrown when trying to execute an upgrade with wrong implementation
error ImplementationMismatch(address expected, address provided);
Parameters
expected
address
Expected implementation address
provided
address
Provided implementation address
InvalidRound
Error thrown when an invalid round ID is provided
error InvalidRound(uint32 roundId);
Parameters
roundId
uint32
The invalid round ID
RoundNotActive
Error thrown when a round is not in active status
error RoundNotActive(uint32 roundId);
Parameters
roundId
uint32
The round ID
InvalidRoundStatus
Error thrown when a round is in the wrong status
error InvalidRoundStatus(uint32 roundId, RoundStatus requiredStatus, RoundStatus currentStatus);
Parameters
roundId
uint32
The round ID
requiredStatus
RoundStatus
Required status
currentStatus
RoundStatus
Current status
ZeroAddressDetected
Error thrown when a zero address is provided
error ZeroAddressDetected();
InvalidAmount
Error thrown when an invalid amount is provided
error InvalidAmount(uint256 amount);
Parameters
amount
uint256
The invalid amount
InvalidDuration
Error thrown when a duration is outside allowed range
error InvalidDuration(uint256 provided, uint256 minimum, uint256 maximum);
Parameters
provided
uint256
Provided duration
minimum
uint256
Minimum allowed duration
maximum
uint256
Maximum allowed duration
InvalidEthTarget
Error thrown when ETH target is invalid
error InvalidEthTarget();
InvalidTokenAllocation
Error thrown when token allocation is invalid
error InvalidTokenAllocation();
InvalidStartTime
Error thrown when start time is in the past
error InvalidStartTime(uint64 provided, uint256 current);
Parameters
provided
uint64
Provided start time
current
uint256
Current time
InsufficientSupply
Error thrown when token supply is insufficient
error InsufficientSupply(uint256 required, uint256 available);
Parameters
required
uint256
Required amount
available
uint256
Available amount
RoundStartTimeNotReached
Error thrown when round start time hasn't been reached
error RoundStartTimeNotReached(uint256 currentTime, uint256 startTime);
Parameters
currentTime
uint256
Current time
startTime
uint256
Start time of the round
RoundEndTimeReached
Error thrown when round end time has been reached
error RoundEndTimeReached(uint256 currentTime, uint256 endTime);
Parameters
currentTime
uint256
Current time
endTime
uint256
End time of the round
InvalidInvestor
Error thrown when an invalid investor address is provided
error InvalidInvestor();
InvalidEthAmount
Error thrown when ETH amount is invalid
error InvalidEthAmount();
InvalidTokenAmount
Error thrown when token amount is invalid
error InvalidTokenAmount();
AllocationExists
Error thrown when allocation already exists for an investor
error AllocationExists(address investor);
Parameters
investor
address
Address of the investor
ExceedsRoundAllocation
Error thrown when allocation exceeds round allocation
error ExceedsRoundAllocation(uint256 requested, uint256 available);
Parameters
requested
uint256
Requested allocation
available
uint256
Available allocation
NoAllocationExists
Error thrown when no allocation exists for an investor
error NoAllocationExists(address investor);
Parameters
investor
address
Address of the investor
InvestorHasActivePosition
Error thrown when investor already has an active position
error InvestorHasActivePosition(address investor);
Parameters
investor
address
Address of the investor
NoInvestment
Error thrown when investor has no investment
error NoInvestment(address investor);
Parameters
investor
address
Address of the investor
RoundNotCancelled
Error thrown when a round is not cancelled
error RoundNotCancelled(uint32 roundId);
Parameters
roundId
uint32
ID of the round
NoRefundAvailable
Error thrown when no refund is available
error NoRefundAvailable(address investor);
Parameters
investor
address
Address of the investor
InvalidStatusTransition
Error thrown when status transition is invalid
error InvalidStatusTransition(RoundStatus current, RoundStatus new_);
Parameters
current
RoundStatus
Current status
new_
RoundStatus
New status
NoActiveRound
Error thrown when no active round exists
error NoActiveRound();
RoundEnded
Error thrown when a round has ended
error RoundEnded(uint32 roundId);
Parameters
roundId
uint32
ID of the round
RoundOversubscribed
Error thrown when a round is oversubscribed
error RoundOversubscribed(uint32 roundId);
Parameters
roundId
uint32
ID of the round
NoAllocation
Error thrown when investor has no allocation
error NoAllocation(address investor);
Parameters
investor
address
Address of the investor
AmountAllocationMismatch
Error thrown when amount doesn't match allocation
error AmountAllocationMismatch(uint256 provided, uint256 required);
Parameters
provided
uint256
Provided amount
required
uint256
Required amount
ZeroBalance
Error thrown when attempting operations with zero balance
error ZeroBalance();
Structs
Allocation
Investor allocation details
Tracks individual investor allocations within a round
struct Allocation {
uint256 etherAmount;
uint256 tokenAmount;
}
Properties
etherAmount
uint256
Maximum ETH that can be invested
tokenAmount
uint256
Tokens to be received for full allocation
Round
Investment round details
Contains all parameters and current state of an investment round
struct Round {
uint256 etherTarget;
uint256 etherInvested;
uint256 tokenAllocation;
uint256 tokenDistributed;
uint64 startTime;
uint64 endTime;
uint64 vestingCliff;
uint64 vestingDuration;
uint32 participants;
RoundStatus status;
}
Properties
etherTarget
uint256
Total ETH to be raised
etherInvested
uint256
Current amount of ETH invested
tokenAllocation
uint256
Total tokens allocated to the round
tokenDistributed
uint256
Tokens that have been distributed to vesting contracts
startTime
uint64
Round opening timestamp
endTime
uint64
Round closing timestamp
vestingCliff
uint64
Time before vesting begins
vestingDuration
uint64
Total vesting period length
participants
uint32
Number of investors in the round
status
RoundStatus
Current state of the round
UpgradeRequest
Upgrade request details
Tracks pending contract upgrades with timelock
struct UpgradeRequest {
address implementation;
uint64 scheduledTime;
bool exists;
}
Properties
implementation
address
New implementation contract address
scheduledTime
uint64
When the upgrade was requested
exists
bool
Whether this upgrade request is active
Enums
RoundStatus
Enum representing the status of an investment round
enum RoundStatus {
PENDING,
ACTIVE,
COMPLETED,
CANCELLED,
FINALIZED
}
Last updated