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
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
canPush() - Permission for owner to call
pushToLocker()
. See ZivoeLocker.solcanPull() - Permission for owner to call
pullFromLocker()
. See ZivoeLocker.solcanPullPartial() - Permission for owner to call
pullFromLockerPartial()
. See ZivoeLocker.solisJuniorOpen() - Checks if stablecoins deposits into the Junior Tranche are open.
rewardZVEJuniorDeposit() - Returns the total rewards in $ZVE for a certain junior tranche deposit amount.
rewardZVESeniorDeposit() - Returns the total rewards in $ZVE for a certain senior tranche deposit amount.
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.
Read Functions
canPush()
canPush()
Permission for owner to call pushToLocker()
. See ZivoeLocker.sol
function canPush() public override pure returns (bool) { return true; }
canPull()
canPull()
Permission for owner to call pullFromLocker()
. See ZivoeLocker.sol
function canPull() public override pure returns (bool) { return true; }
canPullPartial()
canPullPartial()
Permission for owner to call pullFromLockerPartial()
. See ZivoeLocker.sol
function canPullPartial() public override pure returns (bool) { return true; }
isJuniorOpen()
isJuniorOpen()
Checks if stablecoins deposits into the Junior Tranche are open.
function isJuniorOpen(
uint256 amount,
address asset
) public view returns (bool open);
uint256
amount
The amount to deposit.
address
asset
The asset (stablecoin) to deposit.
Returns
bool
open
Will return "true" if deposits into the Junior Tranche are open.
rewardZVEJuniorDeposit()
rewardZVEJuniorDeposit()
Returns the total rewards in $ZVE for a certain junior tranche deposit amount.
function rewardZVEJuniorDeposit(
uint256 deposit
) public view returns (uint256 reward);
uint256
deposit
The amount supplied to the junior tranche.
Returns
uint256
reward
The rewards in $ZVE to be received.
rewardZVESeniorDeposit()
rewardZVESeniorDeposit()
Returns the total rewards in $ZVE for a certain senior tranche deposit amount.
function rewardZVESeniorDeposit(
uint256 deposit
) public view returns (uint256 reward);
uint256
deposit
The amount supplied to the senior tranche.
Returns
uint256
reward
The rewards in $ZVE to be received.
Write Functions
pushToLocker()
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;
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()
depositBoth()
Deposit stablecoins to both tranches simultaneously
function depositBoth(
uint256 amountSenior,
address assetSenior,
uint256 amountJunior,
address assetJunior
) external;
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()
depositBothInverse()
Deposit stablecoins to both tranches simultaneously, inverse order
function depositBothInverse(
uint256 amountSenior,
address assetSenior,
uint256 amountJunior,
address assetJunior
) external;
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()
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;
uint256
amount
The amount to deposit.
address
asset
The asset (stablecoin) to deposit.
Emits the JuniorDeposit() event
depositSenior()
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;
uint256
amount
The amount to deposit.
asset
asset
The asset (stablecoin) to deposit.
Emits the SeniorDeposit() event
switchPause()
switchPause()
Pauses or unpauses the contract, enabling or disabling depositJunior() and depositSenior().
function switchPause() external;
updateLowerRatioIncentiveBIPS()
updateLowerRatioIncentiveBIPS()
Updates the lower ratio between tranches for minting incentivization model.
function updateLowerRatioIncentiveBIPS(
uint256 _lowerRatioIncentiveBIPS
) external onlyGovernance;
uint256
_lowerRatioIncentiveBIPS
The lower ratio to incentivize minting.
Emits the UpdatedLowerRatioIncentiveBIPS() event
updateMaxTrancheRatio()
updateMaxTrancheRatio()
Updates the maximum size of junior tranche, relative to senior tranche.
function updateMaxTrancheRatio(uint256 ratio) external onlyGovernance;
uint256
ratio
The new ratio value.
Emits the UpdatedMaxTrancheRatioBIPS() event
updateMaxZVEPerJTTMint()
updateMaxZVEPerJTTMint()
Updates the maximum $ZVE minted per stablecoin deposited to ZivoeTranches.
function updateMaxZVEPerJTTMint(uint256 max) external onlyGovernance;
uint256
max
Maximum $ZVE minted per stablecoin.
Emits the UpdatedMaxZVEPerJTTMint()
updateMinZVEPerJTTMint()
updateMinZVEPerJTTMint()
Updates the minimum $ZVE minted per stablecoin deposited to ZivoeTranches.
function updateMinZVEPerJTTMint(uint256 min) external onlyGovernance;
uint256
min
Minimum $ZVE minted per stablecoin.
Emits the UpdatedMinZVEPerJTTMint() event
updateUpperRatioIncentiveBIPS()
updateUpperRatioIncentiveBIPS()
Updates the upper ratio between tranches for minting incentivization model.
function updateUpperRatioIncentiveBIPS(
uint256 _upperRatioIncentiveBIPS
) external onlyGovernance;
uint256
_upperRatioIncentivBIPS
The upper ratio to incentivize minting.
Emits the UpdatedUpperRatioIncentiveBIPS() event
unlock()
unlock()
Unlocks this contract for distributions, sets some initial variables.
function unlock() external;
Events
JuniorDeposit()
JuniorDeposit()
Emitted during depositJunior()
event JuniorDeposit(
address indexed account,
address indexed asset,
uint256 amount,
uint256 incentives
);
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()
SeniorDeposit()
Emitted during depositSenior()
event SeniorDeposit(
address indexed account,
address indexed asset,
uint256 amount,
uint256 incentives
);
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()
UpdatedLowerRatioIncentiveBIPS()
Emitted during updateLowerRatioIncentiveBIPS()
event UpdatedLowerRatioIncentiveBIPS(uint256 oldValue, uint256 newValue);
uint256
False
oldValue
The old value of lowerRatioJTT.
uint256
False
newValue
The new value of lowerRatioJTT.
UpdatedMaxTrancheRatioBIPS()
UpdatedMaxTrancheRatioBIPS()
Emitted during updateMaxTrancheRatio()
event UpdatedMaxTrancheRatioBIPS(uint256 oldValue, uint256 newValue);
uint256
False
oldValue
The old value of maxTrancheRatioBIPS.
uint256
False
newValue
The new value of maxTrancheRatioBIPS.
UpdatedMaxZVEPerJTTMint()
UpdatedMaxZVEPerJTTMint()
Emitted during updateMaxZVEPerJTTMint()
event UpdatedMaxZVEPerJTTMint(uint256 oldValue, uint256 newValue);
uint256
False
oldValue
The old value of maxZVEPerJTTMint.
uint256
False
newValue
The new value of maxZVEPerJTTMint.
UpdatedMinZVEPerJTTMint()
UpdatedMinZVEPerJTTMint()
Emitted during updateMinZVEPerJTTMint()
event UpdatedMinZVEPerJTTMint(uint256 oldValue, uint256 newValue);
uint256
False
oldValue
The old value of minZVEPerJTTMint.
uint256
False
newValue
The new value of minZVEPerJTTMint.
UpdatedUpperRatioIncentiveBIPS()
UpdatedUpperRatioIncentiveBIPS()
Emitted during updateUpperRatioIncentiveBIPS()
event UpdatedUpperRatioIncentiveBIPS(uint256 oldValue, uint256 newValue);
uint256
False
oldValue
The old value of upperRatioJTT.
uint256
False
newValue
The new value of upperRatioJTT.
Last updated