IINVMANAGER

Git Source

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

Name
Type
Description

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

scheduleUpgrade

Schedules an upgrade to a new implementation

Parameters

Name
Type
Description

newImplementation

address

Address of the new implementation

emergencyWithdrawToken

Executes an emergency withdrawal

Parameters

Name
Type
Description

token

address

Address of the token to withdraw (0xEeee... for ETH)

emergencyWithdrawEther

Executes an emergency withdrawal

createRound

Creates a new investment round

Parameters

Name
Type
Description

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

Name
Type
Description

<none>

uint32

ID of the created round

activateRound

Activates a pending round

Parameters

Name
Type
Description

roundId

uint32

ID of the round to activate

addInvestorAllocation

Adds an investor allocation to a round

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

roundId

uint32

ID of the round

investor

address

Address of the investor

cancelInvestment

Cancels an investment in a round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

finalizeRound

Finalizes a completed round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

cancelRound

Cancels a round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

claimRefund

Claims a refund for a cancelled round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

investEther

Invests ETH in a round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

upgradeTimelockRemaining

Returns the remaining time before a scheduled upgrade can be executed

Returns

Name
Type
Description

<none>

uint256

Time remaining in seconds

getRefundAmount

Gets the refund amount for an investor in a round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

investor

address

Address of the investor

Returns

Name
Type
Description

<none>

uint256

Refund amount

getInvestorDetails

Gets investor details for a round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

investor

address

Address of the investor

Returns

Name
Type
Description

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

Returns

Name
Type
Description

<none>

address

Address of the ecosystem token

getRoundInfo

Gets information about a round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

Returns

Name
Type
Description

<none>

Round

Round information

getRoundInvestors

Gets list of investors in a round

Parameters

Name
Type
Description

roundId

uint32

ID of the round

Returns

Name
Type
Description

<none>

address[]

Array of investor addresses

getCurrentRound

Gets the current active round

Returns

Name
Type
Description

<none>

uint32

ID of the current active round, or type(uint32).max if none

timelock

Gets the timelock controller address

Returns

Name
Type
Description

<none>

address

Address of the timelock controller

treasury

Gets the treasury address

Returns

Name
Type
Description

<none>

address

Address of the treasury

supply

Gets the total token supply managed by this contract

Returns

Name
Type
Description

<none>

uint256

Total supply

version

Gets the contract version

Returns

Name
Type
Description

<none>

uint32

Contract version

Events

Initialized

Emitted when the contract is initialized

Parameters

Name
Type
Description

initializer

address

Address that called initialize

UpgradeScheduled

Emitted when an upgrade is scheduled

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

canceller

address

The address that cancelled the upgrade

implementation

address

The implementation address that was cancelled

Upgraded

Emitted when contract implementation is upgraded

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

token

address

Address of the token withdrawn (ethereum constant for ETH)

amount

uint256

Amount withdrawn

CreateRound

Emitted when a new investment round is created

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

roundId

uint32

ID of the round

status

RoundStatus

New status

InvestorAllocated

Emitted when an investor is allocated in a round

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

roundId

uint32

ID of the round

investor

address

Address of the investor

amount

uint256

ETH amount returned

RoundFinalized

Emitted when a round is finalized

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

roundId

uint32

ID of the cancelled round

RefundClaimed

Emitted when a refund is claimed

Parameters

Name
Type
Description

roundId

uint32

ID of the round

investor

address

Address of the investor

amount

uint256

ETH amount refunded

Invest

Emitted when an investment is made

Parameters

Name
Type
Description

roundId

uint32

ID of the round

investor

address

Address of the investor

amount

uint256

ETH amount invested

RoundComplete

Emitted when a round is completed

Parameters

Name
Type
Description

roundId

uint32

ID of the completed round

DeployVesting

Emitted when a vesting contract is deployed

Parameters

Name
Type
Description

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

Parameters

Name
Type
Description

remainingTime

uint256

Time remaining until upgrade can be executed

UpgradeNotScheduled

Error thrown when trying to execute an upgrade that wasn't scheduled

ImplementationMismatch

Error thrown when trying to execute an upgrade with wrong implementation

Parameters

Name
Type
Description

expected

address

Expected implementation address

provided

address

Provided implementation address

InvalidRound

Error thrown when an invalid round ID is provided

Parameters

Name
Type
Description

roundId

uint32

The invalid round ID

RoundNotActive

Error thrown when a round is not in active status

Parameters

Name
Type
Description

roundId

uint32

The round ID

InvalidRoundStatus

Error thrown when a round is in the wrong status

Parameters

Name
Type
Description

roundId

uint32

The round ID

requiredStatus

RoundStatus

Required status

currentStatus

RoundStatus

Current status

ZeroAddressDetected

Error thrown when a zero address is provided

InvalidAmount

Error thrown when an invalid amount is provided

Parameters

Name
Type
Description

amount

uint256

The invalid amount

InvalidDuration

Error thrown when a duration is outside allowed range

Parameters

Name
Type
Description

provided

uint256

Provided duration

minimum

uint256

Minimum allowed duration

maximum

uint256

Maximum allowed duration

InvalidEthTarget

Error thrown when ETH target is invalid

InvalidTokenAllocation

Error thrown when token allocation is invalid

InvalidStartTime

Error thrown when start time is in the past

Parameters

Name
Type
Description

provided

uint64

Provided start time

current

uint256

Current time

InsufficientSupply

Error thrown when token supply is insufficient

Parameters

Name
Type
Description

required

uint256

Required amount

available

uint256

Available amount

RoundStartTimeNotReached

Error thrown when round start time hasn't been reached

Parameters

Name
Type
Description

currentTime

uint256

Current time

startTime

uint256

Start time of the round

RoundEndTimeReached

Error thrown when round end time has been reached

Parameters

Name
Type
Description

currentTime

uint256

Current time

endTime

uint256

End time of the round

InvalidInvestor

Error thrown when an invalid investor address is provided

InvalidEthAmount

Error thrown when ETH amount is invalid

InvalidTokenAmount

Error thrown when token amount is invalid

AllocationExists

Error thrown when allocation already exists for an investor

Parameters

Name
Type
Description

investor

address

Address of the investor

ExceedsRoundAllocation

Error thrown when allocation exceeds round allocation

Parameters

Name
Type
Description

requested

uint256

Requested allocation

available

uint256

Available allocation

NoAllocationExists

Error thrown when no allocation exists for an investor

Parameters

Name
Type
Description

investor

address

Address of the investor

InvestorHasActivePosition

Error thrown when investor already has an active position

Parameters

Name
Type
Description

investor

address

Address of the investor

NoInvestment

Error thrown when investor has no investment

Parameters

Name
Type
Description

investor

address

Address of the investor

RoundNotCancelled

Error thrown when a round is not cancelled

Parameters

Name
Type
Description

roundId

uint32

ID of the round

NoRefundAvailable

Error thrown when no refund is available

Parameters

Name
Type
Description

investor

address

Address of the investor

InvalidStatusTransition

Error thrown when status transition is invalid

Parameters

Name
Type
Description

current

RoundStatus

Current status

new_

RoundStatus

New status

NoActiveRound

Error thrown when no active round exists

RoundEnded

Error thrown when a round has ended

Parameters

Name
Type
Description

roundId

uint32

ID of the round

RoundOversubscribed

Error thrown when a round is oversubscribed

Parameters

Name
Type
Description

roundId

uint32

ID of the round

NoAllocation

Error thrown when investor has no allocation

Parameters

Name
Type
Description

investor

address

Address of the investor

AmountAllocationMismatch

Error thrown when amount doesn't match allocation

Parameters

Name
Type
Description

provided

uint256

Provided amount

required

uint256

Required amount

ZeroBalance

Error thrown when attempting operations with zero balance

Structs

Allocation

Investor allocation details

Tracks individual investor allocations within a round

Properties

Name
Type
Description

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

Properties

Name
Type
Description

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

Properties

Name
Type
Description

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

Last updated