ZivoeGlobals.sol

Global Variables for Zivoe Protocol

Introduction

This contract contains global variables for the Zivoe protocol.

This contract has the following responsibilities:

  • Maintain accounting of all defaults within the system in aggregate.

  • Handle ZVL AccessControl (switching to other wallets).

  • Whitelist management for "keepers" which are allowed to execute proposals within the TLC in advance.

  • Whitelist management for "lockers" which ZivoeDAO can push/pull to.

  • Whitelist management for "stablecoins" which are accepted in other Zivoe contracts.

  • View function for standardized ERC20 precision handling.

  • View function for adjusting the supplies of tranches (accounting purposes).

State Variables

TypeNameDescription

address

DAO

The ZivoeDAO contract.

address

ITO

The ZivoeITO contract.

address

stJTT

The ZivoeRewards ($stJTT) contract.

address

stSTT

The ZivoeRewards ($stSTT) contract.

address

stZVE

The ZivoeRewards ($stZVE) contract.

address

vestZVE

The ZivoeRewardsVesting ($vestZVE) vesting contract.

address

YDL

The ZivoeYDL contract.

address

zJTT

The ZivoeTrancheToken ($zJTT) contract.

address

zSTT

The ZivoeTrancheToken ($zSTT) contract.

address

ZVE

The ZivoeToken ($ZVE) contract.

address

ZVL

The Zivoe Laboratory.

address

ZVT

The ZivoeTranches contract.

address

GOV

The Governor contract.

address

TLC

The TimelockController contract.

address

proposedZVL

Interim contract for 2FA ZVL access control transfer.

uint256

defaults

Tracks net defaults in the system.

mapping(address => bool)

isDepositor

Whitelist for depositors, responsible for depositing rewards.

mapping(address => bool)

isKeeper

Whitelist for keepers, responsible for pre-initiating actions.

mapping(address => bool)

isLocker

Whitelist for lockers, for ZivoeDAO interactions and accounting accessibility.

mapping(address => bool)

stablecoinWhitelist

Whitelist for accepted stablecoins throughout Zivoe (e.g. ZVT or YDL).

Sections

Read Functions

  • adjustedSupplies() - Returns total circulating supply of zSTT and zJTT adjusted for defaults.

  • standardize() - Handles WEI standardization of a given asset amount (i.e. 6 decimal precision => 18 decimal precision).

Write Functions

Events

Read Functions

adjustedSupplies()

Returns total circulating supply of zSTT and zJTT adjusted for defaults.

function adjustedSupplies() external view returns (
    uint256 zSTTAdjustedSupply, 
    uint256 zJTTAdjustedSupply
);

Returns

TypeNameDescription

uint256

zSTTAdjustedSupply

zSTT.totalSupply() adjusted for defaults.

uint256

zJTTAdjustedSupply

zJTT.totalSupply() adjusted for defaults.

standardize()

Handles WEI standardization of a given asset amount (i.e. 6 decimal precision => 18 decimal precision).

function standardize(
    uint256 amount, 
    address asset
) external view returns (uint256 standardizedAmount);
TypeNameDescription

uint256

amount

The amount of a given "asset".

address

asset

The asset (ERC-20) from which to standardize the amount to WEI.

Returns

TypeNameDescription

uint256

standardizedAmount

The input "amount" standardized to 18 decimals.

Write Functions

decreaseDefaults()

Call when a default is resolved, decreases net defaults system-wide.

function decreaseDefaults(uint256 amount) external;
TypeNameDescription

uint256

amount

The amount to decrease defaults.

Emits the DefaultsDecreased() event

increaseDefaults()

Call when a default occurs, increases net defaults system-wide.

function increaseDefaults(uint256 amount) external;
TypeNameDescription

uint256

amount

The amount to increase defaults.

Emits the DefaultsIncreased() event

initializeGlobals()

Initialze state variables (perform after all contracts have been deployed).

function initializeGlobals(
    address[] calldata globals, 
    address[] calldata stablecoins
) external onlyOwner;
TypeNameDescription

address[]

globals

Array of addresses representing all core system contracts.

address[]

stablecoins

Array of stablecoins representing initial acceptable stablecoins.

Emits the TransferredZVL() event

proposeZVL()

Proposes ZVL access control to another account.

function proposeZVL(address _proposedZVL) external onlyZVL;
TypeNameDescription

address

_propsedZVL

The proposed address for ZVL.

acceptZVL()

Accept transfer of ZVL access control.

function acceptZVL() external;

Emits the TransferredZVL() event

updateIsDepositor()

Updates the depositor whitelist.

function updateIsDepositor(address depositor, bool status) external onlyZVL;
TypeNameDescription

address

keeper

The address of the depositor.

bool

status

The status to assign to the "depositor" (true = allowed, false = restricted).

Emits the UpdatedDepositorStatus()

updateIsKeeper()

Updates the keeper whitelist.

function updateIsKeeper(address keeper, bool status) external onlyZVL;
TypeNameDescription

address

keeper

The address of the keeper.

bool

status

The status to assign to the "keeper" (true = allowed, false = restricted).

Emits the UpdatedKeeperStatus() event

updateIsLocker()

Modifies the locker whitelist.

function updateIsLocker(address locker, bool status) external onlyZVL;
TypeNameDescription

address

locker

The locker to update.

bool

status

The status to assign to the "locker" (true = permitted, false = prohibited).

Emits the UpdatedLockerStatus() event

updateStableCoinWhitelist()

Modifies the stablecoin whitelist.

function updateStablecoinWhitelist(
    address stablecoin, 
    bool allowed
) external onlyZVL;
TypeNameDescription

address

stablecoin

The stablecoin to update.

bool

allowed

The value to assign (true = permitted, false = prohibited).

Emits the UpdatedStablecoinWhitelist() event

Events

DefaultsDecreased()

Emitted during decreaseDefaults()

event DefaultsDecreased(
    address indexed locker, 
    uint256 amount, 
    uint256 updatedDefaults
);
TypeIndexedNameDescription

address

True

locker

The locker updating the default amount.

uint256

False

amount

Amount of defaults decreased.

uint256

False

updatedDefaults

Total default(s) in system after event.

DefaultsIncreased()

Emitted during increaseDefaults()

event DefaultsIncreased(
    address indexed locker, 
    uint256 amount, 
    uint256 updatedDefaults
);
TypeIndexedNameDescription

address

True

locker

The locker updating the default amount.

uint256

False

amount

Amount of defaults increased.

uint256

False

updatedDefaults

Total default(s) in system after event.

TransferredZVL()

Emitted during initializeGlobals() and acceptZVL()

event TransferredZVL(address indexed controller);
TypeIndexedNameDescription

address

True

controller

The address representing ZVL.

UpdatedDepositorStatus()

Emitted during updateIsDepositor()

event UpdatedDepositorStatus(address indexed depositor, bool status);
TypeIndexedNameDescription

address

True

depositor

The address whose status as a despositor is being modified.

bool

False

status

The new status of "depositor".

UpdatedKeeperStatus()

Emitted during updateIsKeeper()

event UpdatedKeeperStatus(address indexed account, bool status);
TypeIndexedNameDescription

address

True

account

The address whose status as a keeper is being modified.

bool

False

status

The new status of "account".

UpdatedLockerStatus()

Emitted during updateIsLocker()

event UpdatedLockerStatus(address indexed locker, bool status);
TypeIndexedNameDescription

address

True

locker

The locker whose status as a locker is being modified.

bool

False

status

The new status of "locker".

UpdatedStablecoinWhitelist()

Emitted during updateStableCoinWhitelist()

event UpdatedStablecoinWhitelist(address indexed asset, bool allowed);
TypeIndexedNameDescription

address

True

asset

The stablecoin to update.

bool

False

allowed

The boolean value to assign.

Last updated

Zivoe Finance - Official Documentation