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

Type
Name
Description

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.

Returns

Type
Name
Description

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

Type
Name
Description

uint256

amount

The amount of a given "asset".

address

asset

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

Returns

Type
Name
Description

uint256

standardizedAmount

The input "amount" standardized to 18 decimals.

Write Functions

decreaseDefaults()

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

Type
Name
Description

uint256

amount

The amount to decrease defaults.

Emits the DefaultsDecreased() event

increaseDefaults()

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

Type
Name
Description

uint256

amount

The amount to increase defaults.

Emits the DefaultsIncreased() event

initializeGlobals()

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

Type
Name
Description

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.

Type
Name
Description

address

_propsedZVL

The proposed address for ZVL.

acceptZVL()

Accept transfer of ZVL access control.

Emits the TransferredZVL() event

updateIsDepositor()

Updates the depositor whitelist.

Type
Name
Description

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.

Type
Name
Description

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.

Type
Name
Description

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.

Type
Name
Description

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

Type
Indexed
Name
Description

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

Type
Indexed
Name
Description

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

Type
Indexed
Name
Description

address

True

controller

The address representing ZVL.

UpdatedDepositorStatus()

Emitted during updateIsDepositor()

Type
Indexed
Name
Description

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

Type
Indexed
Name
Description

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

Type
Indexed
Name
Description

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

Type
Indexed
Name
Description

address

True

asset

The stablecoin to update.

bool

False

allowed

The boolean value to assign.

Last updated