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

Type
Name
Description

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

canPull()

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

canPullPartial()

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

isJuniorOpen()

Checks if stablecoins deposits into the Junior Tranche are open.

Type
Name
Description

uint256

amount

The amount to deposit.

address

asset

The asset (stablecoin) to deposit.

Returns

Type
Name
Description

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.

Type
Name
Description

uint256

deposit

The amount supplied to the junior tranche.

Returns

Type
Name
Description

uint256

reward

The rewards in $ZVE to be received.

rewardZVESeniorDeposit()

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

Type
Name
Description

uint256

deposit

The amount supplied to the senior tranche.

Returns

Type
Name
Description

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.

Type
Name
Description

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

Type
Name
Description

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

Type
Name
Description

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.

Type
Name
Description

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.

Type
Name
Description

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().

updateLowerRatioIncentiveBIPS()

Updates the lower ratio between tranches for minting incentivization model.

Type
Name
Description

uint256

_lowerRatioIncentiveBIPS

The lower ratio to incentivize minting.

Emits the UpdatedLowerRatioIncentiveBIPS() event

updateMaxTrancheRatio()

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

Type
Name
Description

uint256

ratio

The new ratio value.

Emits the UpdatedMaxTrancheRatioBIPS() event

updateMaxZVEPerJTTMint()

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

Type
Name
Description

uint256

max

Maximum $ZVE minted per stablecoin.

Emits the UpdatedMaxZVEPerJTTMint()

updateMinZVEPerJTTMint()

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

Type
Name
Description

uint256

min

Minimum $ZVE minted per stablecoin.

Emits the UpdatedMinZVEPerJTTMint() event

updateUpperRatioIncentiveBIPS()

Updates the upper ratio between tranches for minting incentivization model.

Type
Name
Description

uint256

_upperRatioIncentivBIPS

The upper ratio to incentivize minting.

Emits the UpdatedUpperRatioIncentiveBIPS() event

unlock()

Unlocks this contract for distributions, sets some initial variables.

Events

JuniorDeposit()

Emitted during depositJunior()

Type
Indexed
Name
Description

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()

Type
Indexed
Name
Description

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()

Type
Indexed
Name
Description

uint256

False

oldValue

The old value of lowerRatioJTT.

uint256

False

newValue

The new value of lowerRatioJTT.

UpdatedMaxTrancheRatioBIPS()

Emitted during updateMaxTrancheRatio()

Type
Indexed
Name
Description

uint256

False

oldValue

The old value of maxTrancheRatioBIPS.

uint256

False

newValue

The new value of maxTrancheRatioBIPS.

UpdatedMaxZVEPerJTTMint()

Emitted during updateMaxZVEPerJTTMint()

Type
Indexed
Name
Description

uint256

False

oldValue

The old value of maxZVEPerJTTMint.

uint256

False

newValue

The new value of maxZVEPerJTTMint.

UpdatedMinZVEPerJTTMint()

Emitted during updateMinZVEPerJTTMint()

Type
Indexed
Name
Description

uint256

False

oldValue

The old value of minZVEPerJTTMint.

uint256

False

newValue

The new value of minZVEPerJTTMint.

UpdatedUpperRatioIncentiveBIPS()

Emitted during updateUpperRatioIncentiveBIPS()

Type
Indexed
Name
Description

uint256

False

oldValue

The old value of upperRatioJTT.

uint256

False

newValue

The new value of upperRatioJTT.

Last updated