Community VCS

CommunityVCS is a staking strategy that manages many CommunityVault contracts by tracking the balance of each and moving tokens in and out of them

View Functions

token

Returns the token this strategy supports

function token() external view returns (address)

Return Values

NameTypeDescription

token

address

Address of token

canDeposit

Returns the available deposit room for this strategy

function canDeposit() public view returns (uint256)

Return Values

NameTypeDescription

depositRoom

uint256

Amount that can be deposited

canWithdraw

Returns the available withdrawal room for this strategy

function canWithdraw() public view returns (uint256)

Return Values

NameTypeDescription

withdrawalRoom

uint256

Amount that can be withdrawn

pendingFees

Returns the total amount of fees that will be paid on the next call to updateDeposits

function pendingFees() external view returns (uint256)

Return Values

NameTypeDescription

totalFees

uint256

Amount of tokens to be paid as fees

getTotalDeposits

Returns the total amount of deposits in this strategy

function getTotalDeposits() public view returns (uint256)

Return Values

NameTypeDescription

totalDeposits

uint256

Total amount of tokens deposited

getMaxDeposits

Returns the maximum amount that can be deposited into this strategy

function getMaxDeposits() public view returns (uint256)

Return Values

NameTypeDescription

maxDeposits

uint256

Maximum token deposits

getMinDeposits

Returns the minimum amount that must remain in this strategy

function getMinDeposits() public view returns (uint256)

Return Values

NameTypeDescription

minDeposits

uint256

Minimum token deposits

checkUpkeep

Returns whether a new batch of vaults should be deployed

function checkUpkeep(bytes) external view returns (bool, bytes)

Return Values

NameTypeDescription

upkeepNeeded

bool

Whether a new batch of vaults should be deployed

getDepositChange

Returns the deposit change since the last call to updateDeposits (ignores stakes/withdraws)

function getDepositChange() public view returns (int256)

Return Values

NameTypeDescription

depositChange

int256

Change in total token deposits

getVaults

Returns a list of all vaults

function getVaults() external view returns (contract IVault[])

Return Values

NameTypeDescription

vaults

address[]

List of vault addresses

getVaultDepositLimits

Returns the vault deposit limits

function getVaultDepositLimits() public view returns (uint256, uint256)

Return Values

NameTypeDescription

minDeposits

uint256

minimum amount of deposits that a vault can hold

maxDeposits

uint256

maximum amount of deposits that a vault can hold

vaultImplementation

Returns the address of the vault implementation contract this strategy will use for new vaults

function vaultImplementation() external view returns (address)

Return Values

NameTypeDescription

vaultImplementation

address

Address of vault implementation contract

vaultDeploymentThreshold

Returns the minimum number of non-full vaults before a new batch is deployed

function vaultDeploymentThreshold() external view returns (uint256)

Return Values

NameTypeDescription

vaultDeploymentThreshold

uint256

Vault deployment threshold

vaultDeploymentAmount

Returns the amount of vaults to deploy when threshold is met

function vaultDeploymentAmount() external view returns (uint256)

Return Values

NameTypeDescription

vaultDeploymentAmount

uint256

number of vaults

getFees

Returns a list of all fees

function getFees() external view returns (struct VaultControllerStrategy.Fee[])

Return Values

NameTypeDescription

fees

struct VaultControllerStrategy.Fee[]

List of fees

Write Functions

deposit

Deposits tokens into this strategy

function deposit(uint256 _amount) external

Parameters

NameTypeDescription

_amount

uint256

Amount to deposit

performUpkeep

Deploys a new batch of vaults

function performUpkeep(bytes _performData) external

addVaults

Deploys a new batch of vaults

function addVaults(uint256 _numVaults) external

Parameters

NameTypeDescription

_numVaults

uint256

Number of vaults to deploy

updateDeposits

Updates the total deposit amount for reward distribution and calculates applicable fees

function updateDeposits() external returns (address[] receivers, uint256[] amounts)

Return Values

NameTypeDescription

receivers

address[]

List of fee receivers

amounts

uint256[]

List of fee amounts

upgradeVaults

Upgrades vaults to a new implementation contract

function upgradeVaults(uint256 _startIndex, uint256 _numVaults, bytes _data) external

Parameters

NameTypeDescription

_startIndex

uint256

Index of first vault to upgrade

_numVaults

uint256

Number of vaults to upgrade starting at _startIndex

_data

bytes

Optional encoded function call to be executed after upgrade

addFee

Adds a new fee

function addFee(address _receiver, uint256 _feeBasisPoints) external

Parameters

NameTypeDescription

_receiver

address

Address of fee receiver

_feeBasisPoints

uint256

Fee in basis points

updateFee

Updates an existing fee

function updateFee(uint256 _index, address _receiver, uint256 _feeBasisPoints) external

Parameters

NameTypeDescription

_index

uint256

Index of fee

_receiver

address

Address of fee receiver

_feeBasisPoints

uint256

Fee in basis points

setVaultDeploymentParams

Sets the vault deployment parameters

function setVaultDeploymentParams(uint256 _vaultDeploymentThreshold, uint256 _vaultDeploymentAmount) external

Parameters

NameTypeDescription

_vaultDeploymentThreshold

uint256

Minimum number of non-full vaults before a new batch is deployed

_vaultDeploymentAmount_

uint256

Amount of vaults to deploy when threshold is met

setVaultImplementation

Sets a new vault implementation contract to be used when deploying/upgrading vaults

function setVaultImplementation(address _vaultImplementation) external

Parameters

NameTypeDescription

_vaultImplementation

address

Address of implementation contract

setMaxDepositSizeBP

Sets the basis point amount of the remaing deposit room in the Chainlink staking contract that can be deposited at once

function setMaxDepositSizeBP(uint256 _maxDeposits) external

Parameters

NameTypeDescription

_maxDepositSizeBP

uint256

Maximum basis point deposit size

Last updated