ZivoeITO.sol

ITO -> Initial Tranche Offering

Introduction

This contract will facilitate the Zivoe ITO ("Initial Tranche Offering").

This contract has the following responsibilities:

  • Permissioned by $zJTT and $zSTT to call mint() when an account deposits.

  • Escrow $zJTT and $zSTT until the ITO concludes.

  • Facilitate claiming of $zJTT and $zSTT when the ITO concludes.

  • Vest $ZVE simulatenously during claiming (based on $pZVE credits).

  • Migrate deposits to ZivoeDAO after the ITO concludes.

State Variables

TypeNameDescription

address

GBL

The ZivoeGlobals contract.

address[]

stablecoins

Stablecoin(s) allowed for juniorDeposit() or seniorDeposit().

uint256

end

The unix when the ITO ends (airdrop is claimable).

uint256

snapshotSTT

Snapshot of senior tranche token supply after migrateDeposits().

uint256

snapshotJTT

Snapshot of junior tranche token supply after migrateDeposits().

bool

migrated

Triggers (true) when ITO concludes and assets migrate to ZivoeDAO.

mapping(address => bool)

airdropClaimed

Tracks if an account has claimed their airdrop.

mapping(address => uint256)

juniorCredits

Tracks $pZVE (credits) from juniorDeposit().

mapping(address => uint256)

seniorCredits

Tracks $pZVE (credits) from seniorDeposit().

uint256

BIPS

Private constant, 10000

Sections

Write Functions

  • commence() - Starts the ITO.

  • claimAirdrop() - Claim $zSTT, $zJTT, and begin a vesting schedule for $ZVE.

  • depositJunior() - Deposit stablecoins, mint Zivoe Junior Tranche ($zJTT) tokens and increase airdrop credits.

  • depositSenior() - Deposit stablecoins, mint Zivoe Senior Tranche ($zSTT) tokens and increase airdrop credits.

  • migrateDeposits() - Migrate tokens to ZivoeDAO.

Events

Write Functions

commence()

Starts the ITO.

function commence() external;

Emits the ITOCommenced() event.

claimAirdrop()

Claim $zSTT, $zJTT, and begin a vesting schedule for $ZVE.

function claimAirdrop(address depositor) external returns (
    uint256 zSTTClaimed, 
    uint256 zJTTClaimed, 
    uint256 ZVEVested
);
TypeNameDescription

address

depositor

The address to claim for, generally _msgSender()

Returns

TypeNameDescription

uint256

zSTTClaimed

Amount of $zSTT airdropped.

uint256

zJTTClaimed

Amount of $zJTT airdropped.

uint256

ZVEVested

Amount of $ZVE vested.

Emits the AirdropClaimed() event.

depositJunior()

Deposit stablecoins, mint Zivoe Junior Tranche ($zJTT) tokens and increase airdrop credits.

function depositJunior(uint256 amount, address asset) external; 
TypeNameDescription

uint256

amount

The amount to deposit.

uint256

asset

The asset to deposit.

Emits the JuniorDeposit() event.

depositSenior()

Deposit stablecoins, mint Zivoe Senior Tranche ($zSTT) tokens and increase airdrop credits.

function depositSenior(uint256 amount, address asset) external;
TypeNameDescription

uint256

amount

The amount to deposit.

uint256

asset

The asset to deposit.

Emits the SeniorDeposit() event.

migrateDeposits()

Migrate tokens to ZivoeDAO.

function migrateDeposits() external;

Emits the DepositsMigrated() event.

Events

AirdropClaimed()

Emitted during claimAirdrop()

event AirdropClaimed(
    address indexed account, 
    uint256 zSTTClaimed, 
    uint256 zJTTClaimed, 
    uint256 ZVEVested
);
TypeIndexedNameDescription

address

True

account

The account claiming their airdrop.

uint256

False

zSTTClaimed

The amount of Zivoe Senior Tranche ($zSTT) tokens received.

uint256

False

zJTTClaimed

The amount of Zivoe Junior Tranche ($zJTT) tokens received.

uint256

False

ZVEVested

The amount of Zivoe ($ZVE) tokens received.

DepositsMigrated()

Emitted during migrateDeposits()

event DepositsMigrated(uint256 DAI, uint256 FRAX, uint256 USDC, uint256 USDT);
TypeIndexedNameDescription

uint256

False

DAI

Total amount of DAI migrated from the ITO to ZivoeDAO and ZVL.

uint256

False

FRAX

Total amount of FRAX migrated from the ITO to ZivoeDAO and ZVL.

uint256

False

USDC

Total amount of USDC migrated from the ITO to ZivoeDAO and ZVL.

uint256

False

USDT

Total amount of USDT migrated from the ITO to ZivoeDAO and ZVL.

ITOCommenced()

Emitted during commence()

event ITOCommenced(uint256 start, uint256 end);
TypeIndexedNameDescription

uint256

False

start

The unix when the ITO starts.

uint256

False

end

The unix when the ITO ends (airdrop is claimable).

JuniorDeposit()

Emitted during depositJunior()

event JuniorDeposit(
    address indexed account, 
    address indexed asset, 
    uint256 amount, 
    uint256 credits, 
    uint256 trancheTokens
);
TypeIndexedNameDescription

address

True

account

The account depositing stablecoins to senior tranche.

address

True

asset

The stablecoin deposited.

uint256

False

amount

The amount of stablecoins deposited.

uint256

False

credits

The amount of credits earned.

uint256

False

trancheTokens

The amount of Zivoe Junior Tranche ($zJTT) tokens minted.

SeniorDeposit()

Emitted during depositSenior()

event SeniorDeposit(
    address indexed account, 
    address indexed asset, 
    uint256 amount, 
    uint256 credits, 
    uint256 trancheTokens
);
TypeIndexedNameDescription

address

True

account

The account depositing stablecoins to senior tranche.

address

True

asset

The stablecoin deposited.

uint256

False

amount

The amount of stablecoins deposited.

uint256

False

credits

The amount of credits earned.

uint256

False

trancheTokens

The amount of Zivoe Senior Tranche ($zSTT) tokens minted.

Last updated

Zivoe Finance - Official Documentation