ZivoeTranches.sol

Minting Tranche Tokens

Introduction

This contract will facilitate ongoing liquidity provision to Zivoe tranches - Junior, Senior.

This contract will be permissioned by $zJTT and $zSTT to call mint().

This contract will support a whitelist for stablecoins to provide as liquidity.

State Variables

TypeNameDescription

address

GBL

The ZivoeGlobals contract.

uint256

maxTrancheRatioBIPS

This ratio represents the maximum size allowed for junior tranche, relative to senior tranche. A value of 2,000 represent 20%, thus junior tranche at maximum can be 20% the size of senior tranche.

uint256

minZVEPerJTTMint

These two values control the min/max $ZVE minted per stablecoin deposited to ZivoeTranches.

uint256

maxZVEPerJTTMint

These two values control the min/max $ZVE minted per stablecoin deposited to ZivoeTranches.

uint256

lowerRatioIncentiveBIPS

Basis points ratio between zJTT.totalSupply():zSTT.totalSupply() for maximum rewards (affects above slope).

uint256

upperRatioIncentiveBIPS

Basis points ratio between zJTT.totalSupply():zSTT.totalSupply() for maximum rewards (affects above slope).

bool

tranchesUnlocked

Prevents contract from supporting functionality until unlocked.

bool

paused

Temporary mechanism for pausing deposits.

uint256

BIPS

Private constant, 10000

Sections

Read Functions

Write Functions

  • pushToLocker() - This pulls capital from the DAO, does any necessary pre-conversions, and escrows ZVE for incentives.

  • depositJunior() - Deposit stablecoins into the junior tranche. Mints Zivoe Junior Tranche ($zJTT) tokens in 1:1 ratio.

  • depositSenior() - Deposit stablecoins into the senior tranche. Mints Zivoe Senior Tranche ($zSTT) tokens in 1:1 ratio.

  • switchPause() - Pauses or unpauses the contract, enabling or disabling depositJunior() and depositSenior().

  • updateLowerRatioIncentiveBIPS() - Updates the lower ratio between tranches for minting incentivization model.

  • updateMaxTrancheRatio() - Updates the maximum size of junior tranche, relative to senior tranche.

  • updateMaxZVEPerJTTMint() - Updates the maximum $ZVE minted per stablecoin deposited to ZivoeTranches.

  • updateMinZVEPerJTTMint() - Updates the minimum $ZVE minted per stablecoin deposited to ZivoeTranches.

  • updateUpperRatioIncentiveBIPS() - Updates the upper ratio between tranches for minting incentivization model.

  • unlock() - Unlocks this contract for distributions, sets some initial variables.

Events

Read Functions

canPush()

Permission for owner to call pushToLocker(). See ZivoeLocker.sol

 function canPush() public override pure returns (bool) { return true; }

canPull()

Permission for owner to call pullFromLocker(). See ZivoeLocker.sol

function canPull() public override pure returns (bool) { return true; }

canPullPartial()

Permission for owner to call pullFromLockerPartial(). See ZivoeLocker.sol

function canPullPartial() public override pure returns (bool) { return true; }

isJuniorOpen()

Checks if stablecoins deposits into the Junior Tranche are open.

function isJuniorOpen(
    uint256 amount,
    address asset
) public view returns (bool open);
TypeNameDescription

uint256

amount

The amount to deposit.

address

asset

The asset (stablecoin) to deposit.

Returns

TypeNameDescription

bool

open

Will return "true" if deposits into the Junior Tranche are open.

rewardZVEJuniorDeposit()

Returns the total rewards in $ZVE for a certain junior tranche deposit amount.

function rewardZVEJuniorDeposit(
    uint256 deposit
) public view returns (uint256 reward);
TypeNameDescription

uint256

deposit

The amount supplied to the junior tranche.

Returns

TypeNameDescription

uint256

reward

The rewards in $ZVE to be received.

rewardZVESeniorDeposit()

Returns the total rewards in $ZVE for a certain senior tranche deposit amount.

function rewardZVESeniorDeposit(
    uint256 deposit
) public view returns (uint256 reward);
TypeNameDescription

uint256

deposit

The amount supplied to the senior tranche.

Returns

TypeNameDescription

uint256

reward

The rewards in $ZVE to be received.

Write Functions

pushToLocker()

This pulls capital from the DAO, does any necessary pre-conversions, and escrows ZVE for incentives.

function pushToLocker(
    address asset, 
    uint256 amount, 
    bytes calldata data
) external override onlyOwner;
TypeNameDescription

uint256

asset

The asset to pull from the DAO.

address

amount

The amount of asset to pull from the DAO.

bytes

data

Accompanying transaction data.

depositBoth()

Deposit stablecoins to both tranches simultaneously

function depositBoth(
    uint256 amountSenior, 
    address assetSenior, 
    uint256 amountJunior, 
    address assetJunior
) external;
TypeNameDescription

uint256

amountSenior

The amount to deposit to senior tranche

address

assetSenior

The asset to deposit to senior tranche

uint256

amountJunior

The amount to deposit to senior tranche

address

assetJunior

The asset to deposit to senior tranche

depositBothInverse()

Deposit stablecoins to both tranches simultaneously, inverse order

function depositBothInverse(
    uint256 amountSenior, 
    address assetSenior, 
    uint256 amountJunior, 
    address assetJunior
) external;
TypeNameDescription

uint256

amountSenior

The amount to deposit to senior tranche

address

assetSenior

The asset to deposit to senior tranche

uint256

amountJunior

The amount to deposit to senior tranche

address

assetJunior

The asset to deposit to senior tranche

depositJunior()

Deposit stablecoins into the junior tranche. Mints Zivoe Junior Tranche ($zJTT) tokens in 1:1 ratio.

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

uint256

amount

The amount to deposit.

address

asset

The asset (stablecoin) to deposit.

Emits the JuniorDeposit() event

depositSenior()

Deposit stablecoins into the senior tranche. Mints Zivoe Senior Tranche ($zSTT) tokens in 1:1 ratio.

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

uint256

amount

The amount to deposit.

asset

asset

The asset (stablecoin) to deposit.

Emits the SeniorDeposit() event

switchPause()

Pauses or unpauses the contract, enabling or disabling depositJunior() and depositSenior().

function switchPause() external;

updateLowerRatioIncentiveBIPS()

Updates the lower ratio between tranches for minting incentivization model.

function updateLowerRatioIncentiveBIPS(
    uint256 _lowerRatioIncentiveBIPS
) external onlyGovernance;
TypeNameDescription

uint256

_lowerRatioIncentiveBIPS

The lower ratio to incentivize minting.

Emits the UpdatedLowerRatioIncentiveBIPS() event

updateMaxTrancheRatio()

Updates the maximum size of junior tranche, relative to senior tranche.

function updateMaxTrancheRatio(uint256 ratio) external onlyGovernance;
TypeNameDescription

uint256

ratio

The new ratio value.

Emits the UpdatedMaxTrancheRatioBIPS() event

updateMaxZVEPerJTTMint()

Updates the maximum $ZVE minted per stablecoin deposited to ZivoeTranches.

function updateMaxZVEPerJTTMint(uint256 max) external onlyGovernance;
TypeNameDescription

uint256

max

Maximum $ZVE minted per stablecoin.

Emits the UpdatedMaxZVEPerJTTMint()

updateMinZVEPerJTTMint()

Updates the minimum $ZVE minted per stablecoin deposited to ZivoeTranches.

function updateMinZVEPerJTTMint(uint256 min) external onlyGovernance;
TypeNameDescription

uint256

min

Minimum $ZVE minted per stablecoin.

Emits the UpdatedMinZVEPerJTTMint() event

updateUpperRatioIncentiveBIPS()

Updates the upper ratio between tranches for minting incentivization model.

function updateUpperRatioIncentiveBIPS(
    uint256 _upperRatioIncentiveBIPS
) external onlyGovernance;
TypeNameDescription

uint256

_upperRatioIncentivBIPS

The upper ratio to incentivize minting.

Emits the UpdatedUpperRatioIncentiveBIPS() event

unlock()

Unlocks this contract for distributions, sets some initial variables.

function unlock() external;

Events

JuniorDeposit()

Emitted during depositJunior()

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

address

True

account

The account depositing stablecoins to junior tranche.

address

True

asset

The stablecoind deposited.

uint256

False

amount

The amount of stablecoins deposited.

uint256

False

incentives

The amount of incentives ($ZVE) distributed.

SeniorDeposit()

Emitted during depositSenior()

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

address

True

account

The account depositing stablecoins to senior tranche.

address

True

asset

The stablecoind deposited.

uint256

False

amount

The amount of stablecoins deposited.

uint256

False

incentives

The amount of incentives ($ZVE) distributed.

UpdatedLowerRatioIncentiveBIPS()

Emitted during updateLowerRatioIncentiveBIPS()

event UpdatedLowerRatioIncentiveBIPS(uint256 oldValue, uint256 newValue);
TypeIndexedNameDescription

uint256

False

oldValue

The old value of lowerRatioJTT.

uint256

False

newValue

The new value of lowerRatioJTT.

UpdatedMaxTrancheRatioBIPS()

Emitted during updateMaxTrancheRatio()

event UpdatedMaxTrancheRatioBIPS(uint256 oldValue, uint256 newValue);
TypeIndexedNameDescription

uint256

False

oldValue

The old value of maxTrancheRatioBIPS.

uint256

False

newValue

The new value of maxTrancheRatioBIPS.

UpdatedMaxZVEPerJTTMint()

Emitted during updateMaxZVEPerJTTMint()

event UpdatedMaxZVEPerJTTMint(uint256 oldValue, uint256 newValue);
TypeIndexedNameDescription

uint256

False

oldValue

The old value of maxZVEPerJTTMint.

uint256

False

newValue

The new value of maxZVEPerJTTMint.

UpdatedMinZVEPerJTTMint()

Emitted during updateMinZVEPerJTTMint()

event UpdatedMinZVEPerJTTMint(uint256 oldValue, uint256 newValue);
TypeIndexedNameDescription

uint256

False

oldValue

The old value of minZVEPerJTTMint.

uint256

False

newValue

The new value of minZVEPerJTTMint.

UpdatedUpperRatioIncentiveBIPS()

Emitted during updateUpperRatioIncentiveBIPS()

event UpdatedUpperRatioIncentiveBIPS(uint256 oldValue, uint256 newValue);
TypeIndexedNameDescription

uint256

False

oldValue

The old value of upperRatioJTT.

uint256

False

newValue

The new value of upperRatioJTT.

Last updated

Zivoe Finance - Official Documentation