The Genesis Group Contract is responsible for launching Fei Protocol. It allows for pro-rata access to the first bonding curve transaction and includes a TRIBE distribution.
The user's Genesis balances are managed by an FGEN ERC-20 token. FGEN are a tokenized version of the committed ETH. FGEN tokens are fungible and can be transferred and even sold if secondary markets arise.
FGEN are used to account for the user's final outcome in Genesis.
At redemption time, users could have a combination of FGEN and converted-FGEN (cFGEN) tokens. cFGEN are not ERC-20 tokens and are only utilized during Genesis. The ratios of FGEN and cFGEN to the totals determine how much FEI and TRIBE each user receives. The TRIBE can be further split into "Genesis TRIBE" which are the additional allocation to the Genesis Group and "IDO TRIBE" which come from exchanging pre-converted FEI in the IDO.
Genesis allocation formulas:
Both the held FGEN and pre-converted balance are used to determine ownership of the Genesis TRIBE. Only the held FGEN is used for determining FEI ownership because the pre-converted FGEN FEI allocation is used to swap for TRIBE. Of the IDO TRIBE allocation, users get the pro-rata percentage of their pre-converted FGEN over all of the pre-converted FGEN.
A purchase into the Genesis Group
the address to send Fei Genesis share tokens (FGEN) to
the amount of ETH deposited
Pre-commit Genesis share tokens (FGEN) to buy TRIBE in IDO
account with the FGEN to commit
account to receive and redeem the rewards post-genesis
amount of FGEN committed
Redeem Fei Genesis share tokens (FGEN) for FEI and TRIBE
the address to send TRIBE and FEI to
amount of FGEN redeemed
amount of FEI received
amount of TRIBE received
The completion of the Genesis Group and launch of Fei Protocol. Only emitted once
the block timestamp of deployment
function getAmountOut(uint256 amountIn, bool inclusive)externalviewreturns (uint256 feiAmount, uint256 tribeAmount);
Returns the hypothetical
feiAmount of FEI and
tribeAmountof TRIBE that the user would receive if they have
amountIn FGEN and genesis were to launch immediately.
inclusive flag would signify that the
amounIn is already a part of the existing FGEN total supply, otherwise it is added on to simulate a purchase.
function getAmountsToRedeem(address to)externalviewreturns (uint256 feiAmount,uint256 genesisTribe,uint256 idoTribe)
For an address
to, returns how much FEI is available for redemption
feiAmount, how much TRIBE is available from the Genesis bonus
genesisTribe, and how much TRIBE is available from the IDO pre-commitment
idoTribe, if any.
function purchase(address to, uint256 value) external payable;
Purchase awards the user with an ERC-20 token 1:1 for their ETH called FGEN. This amount equals to
value. Only available during the Genesis Period.
function commit(address from,address to,uint256 amount) external;
amount of FGEN to have the associated Genesis FEI participate in the initial DEX offering of TRIBE on Uniswap. Burn FGEN from the
from address and grant the pre-commitment rewards to the
to address. This can only be done during the Genesis Period.
function redeem(address to) external;
Redeem FGEN and cFGEN from
to for a pro rata share of the FEI purchased on the bonding curve and the Genesis TRIBE allocation. Any contract can redeem on behalf of a user if they have FGEN approval. Redemptions must be for the entire held balance of FGEN and cFGEN.
function emergencyExit(address from, address payable to) external;
Redeem all FGEN and cFGEN held by the address
from for ETH 1:1, sending the ETH to address
to. This is intended only for the scenario where the launch functionality is bricked as a way for users to get their ETH back.
Only available 3 days AFTER the Genesis Period ends, if launch has not been called.
function launch() external;
Launching is only open at the end of the Genesis Period. The following actions happen at launch:
Mark Genesis Group as completed in Core (for other contracts to reference)
Initializing the BondingCurveOracle price for thawing
Making the first bonding curve purchase of FEI with all held ETH. (needs to happen after oracle init so the FEI is deployed at right ratio on Uniswap)
Allocate bonding curve ETH to the PCV deposit
Initialize the FEI/TRIBE staking pool
Deploy the IDO FEI/TRIBE funds to Uniswap.
Execute the swap of FEI for pre-swappingTRIBE on the IDO