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
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
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).
decreaseDefaults() - Call when a default is resolved, decreases net defaults system-wide.
increaseDefaults() - Call when a default occurs, increases net defaults system-wide.
initializeGlobals() - Initialze state variables (perform after all contracts have been deployed).
proposeZVL() - Proposes ZVL access control to another account.
acceptZVL() - Accept transfer of ZVL access control.
updateIsDepositor() - Updates the depositor whitelist.
updateIsKeeper() - Updates the keeper whitelist.
updateIsLocker() - Modifies the locker whitelist.
updateStableCoinWhitelist() - Modifies the stablecoin whitelist.
Read Functions
adjustedSupplies()
adjustedSupplies()
Returns total circulating supply of zSTT and zJTT adjusted for defaults.
function adjustedSupplies() external view returns (
uint256 zSTTAdjustedSupply,
uint256 zJTTAdjustedSupply
);
Returns
uint256
zSTTAdjustedSupply
zSTT.totalSupply()
adjusted for defaults.
uint256
zJTTAdjustedSupply
zJTT.totalSupply()
adjusted for defaults.
standardize()
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);
uint256
amount
The amount of a given "asset".
address
asset
The asset (ERC-20) from which to standardize the amount to WEI.
Returns
uint256
standardizedAmount
The input "amount" standardized to 18 decimals.
Write Functions
decreaseDefaults()
decreaseDefaults()
Call when a default is resolved, decreases net defaults system-wide.
function decreaseDefaults(uint256 amount) external;
uint256
amount
The amount to decrease defaults.
Emits the DefaultsDecreased() event
increaseDefaults()
increaseDefaults()
Call when a default occurs, increases net defaults system-wide.
function increaseDefaults(uint256 amount) external;
uint256
amount
The amount to increase defaults.
Emits the DefaultsIncreased() event
initializeGlobals()
initializeGlobals()
Initialze state variables (perform after all contracts have been deployed).
function initializeGlobals(
address[] calldata globals,
address[] calldata stablecoins
) external onlyOwner;
address[]
globals
Array of addresses representing all core system contracts.
address[]
stablecoins
Array of stablecoins representing initial acceptable stablecoins.
Emits the TransferredZVL() event
proposeZVL()
proposeZVL()
Proposes ZVL access control to another account.
function proposeZVL(address _proposedZVL) external onlyZVL;
address
_propsedZVL
The proposed address for ZVL.
acceptZVL()
acceptZVL()
Accept transfer of ZVL access control.
function acceptZVL() external;
Emits the TransferredZVL() event
updateIsDepositor()
updateIsDepositor()
Updates the depositor whitelist.
function updateIsDepositor(address depositor, bool status) external onlyZVL;
address
keeper
The address of the depositor.
bool
status
The status to assign to the "depositor" (true = allowed, false = restricted).
Emits the UpdatedDepositorStatus()
updateIsKeeper()
updateIsKeeper()
Updates the keeper whitelist.
function updateIsKeeper(address keeper, bool status) external onlyZVL;
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()
updateIsLocker()
Modifies the locker whitelist.
function updateIsLocker(address locker, bool status) external onlyZVL;
address
locker
The locker to update.
bool
status
The status to assign to the "locker" (true = permitted, false = prohibited).
Emits the UpdatedLockerStatus() event
updateStableCoinWhitelist()
updateStableCoinWhitelist()
Modifies the stablecoin whitelist.
function updateStablecoinWhitelist(
address stablecoin,
bool allowed
) external onlyZVL;
address
stablecoin
The stablecoin to update.
bool
allowed
The value to assign (true = permitted, false = prohibited).
Emits the UpdatedStablecoinWhitelist() event
Events
DefaultsDecreased()
DefaultsDecreased()
Emitted during decreaseDefaults()
event DefaultsDecreased(
address indexed locker,
uint256 amount,
uint256 updatedDefaults
);
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()
DefaultsIncreased()
Emitted during increaseDefaults()
event DefaultsIncreased(
address indexed locker,
uint256 amount,
uint256 updatedDefaults
);
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()
TransferredZVL()
Emitted during initializeGlobals() and acceptZVL()
event TransferredZVL(address indexed controller);
address
True
controller
The address representing ZVL.
UpdatedDepositorStatus()
UpdatedDepositorStatus()
Emitted during updateIsDepositor()
event UpdatedDepositorStatus(address indexed depositor, bool status);
address
True
depositor
The address whose status as a despositor is being modified.
bool
False
status
The new status of "depositor".
UpdatedKeeperStatus()
UpdatedKeeperStatus()
Emitted during updateIsKeeper()
event UpdatedKeeperStatus(address indexed account, bool status);
address
True
account
The address whose status as a keeper is being modified.
bool
False
status
The new status of "account".
UpdatedLockerStatus()
UpdatedLockerStatus()
Emitted during updateIsLocker()
event UpdatedLockerStatus(address indexed locker, bool status);
address
True
locker
The locker whose status as a locker is being modified.
bool
False
status
The new status of "locker".
UpdatedStablecoinWhitelist()
UpdatedStablecoinWhitelist()
Emitted during updateStableCoinWhitelist()
event UpdatedStablecoinWhitelist(address indexed asset, bool allowed);
address
True
asset
The stablecoin to update.
bool
False
allowed
The boolean value to assign.
Last updated