Operator VCS
OperatorVCS
is a staking strategy that manages many OperatorVault
contracts by tracking the balance of each and moving tokens in and out of them.
View Functions
token
Returns the token this strategy supports
Return Values
Name | Type | Description |
---|---|---|
token | address | Address of token |
canDeposit
Returns the available deposit room for this strategy
Return Values
Name | Type | Description |
---|---|---|
depositRoom | uint256 | Amount that can be deposited |
canWithdraw
Returns the available withdrawal room for this strategy
Return Values
Name | Type | Description |
---|---|---|
withdrawalRoom | uint256 | Amount that can be withdrawn |
pendingFees
Returns the total amount of fees that will be paid on the next call to updateDeposits
Return Values
Name | Type | Description |
---|---|---|
totalFees | uint256 | Amount of tokens to be paid as fees |
getTotalDeposits
Returns the total amount of deposits in this strategy
Return Values
Name | Type | Description |
---|---|---|
totalDeposits | uint256 | Total amount of tokens deposited |
getMaxDeposits
Returns the maximum amount of tokens this strategy can hold
Accounts for total current deposits + current additional vault space + current space in the Chainlink
Return Values
Name | Type | Description |
---|---|---|
maxDeposits | uint256 | Maximum token deposits |
getMinDeposits
Returns the minimum amount of tokens that must remain in this strategy
Return Values
Name | Type | Description |
---|---|---|
minDeposits | uint256 | Minimum token deposits |
getDepositChange
Returns the deposit change since the last call to updateDeposits
(ignores stakes/withdraws)
Return Values
Name | Type | Description |
---|---|---|
depositChange | int256 | Change in total token deposits |
getVaults
Returns a list of all vaults
Return Values
Name | Type | Description |
---|---|---|
vaults | address[] | List of vault addresses |
getVaultDepositLimits
Returns the vault deposit limits
Return Values
Name | Type | Description |
---|---|---|
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
Return Values
Name | Type | Description |
---|---|---|
vaultImplementation | address | Address of vault implementation contract |
getFees
Returns a list of all fees
Return Values
Name | Type | Description |
---|---|---|
fees | struct VaultControllerStrategy.Fee[] | List of fees |
operatorRewardPercentage
Returns the basis point amount of an operator's earned rewards that they receive
Return Values
Name | Type | Description |
---|---|---|
operatorRewardPercentage | uint256 | Basis point operator reward percentage |
getOperatorRewards
Returns the total unclaimed operator rewards
Return Values
Name | Type | Description |
---|---|---|
unclaimedOperatorRewards | uint256 | Total unclaimed operator rewards |
availableRewards | uint256 | Total available operator rewards |
getVaultRemovalQueue
Returns a list of all vaults queued for removal
Return Values
Name | Type | Description |
---|---|---|
queue | address[] | List of vaults queued for removal |
Write Functions
deposit
Deposits tokens from the staking pool into vaults
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount to deposit |
_data | bytes | Encoded vault deposit order |
withdraw
Withdraws tokens from vaults and sends them to the staking pool
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount to withdraw |
_data | bytes | Encoded vault withdrawal order |
onTokenTransfer
ERC677 implementation to receive operator rewards
withdrawOperatorRewards
Used by vaults to withdraw operator rewards
Parameters
Name | Type | Description |
---|---|---|
_receiver | address | Address to receive rewards |
_amount | uint256 | Amount to withdraw |
updateDeposits
Updates deposit accounting and calculates fees on newly earned rewards
Parameters
Name | Type | Description |
---|---|---|
_data | bytes | Encoded min amount of rewards required to claim (set 0 to skip reward claiming) |
Return Values
Name | Type | Description |
---|---|---|
depositChange | uint256 | change in deposits since last update |
receivers | address[] | List of fee receivers |
amounts | uint256[] | List of fee amounts |
updateVaultGroups
Executes a vault group update
Re-unbonds all vaults in the current vault group and increments the current vault group
Parameters
Name | Type | Description |
---|---|---|
_curGroupVaultsToUnbond | uint256[] | list of vaults to unbond in current vault group |
_curGroupTotalDepositRoom | uint256[] | total deposit room across all vaults in current vault group |
_nextGroup | uint256[] | index of next vault group |
_nextGroupTotalUnbonded | uint256[] | total unbonded across all vaults in next vault group |
upgradeVaults
Upgrades vaults to a new implementation contract
Parameters
Name | Type | Description |
---|---|---|
_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 |
setWithdrawalIndexes
Manually sets the withdrawal index for each vault group
Parameters
Name | Type | Description |
---|---|---|
_withdrawalIndexes | uint64[] | list of withdrawal indexes for each vault group |
addFee
Adds a new fee
Parameters
Name | Type | Description |
---|---|---|
_receiver | address | Address of fee receiver |
_feeBasisPoints | uint256 | Fee in basis points |
updateFee
Updates an existing fee
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | Index of fee |
_receiver | address | Address of fee receiver |
_feeBasisPoints | uint256 | Fee in basis points |
setVaultImplementation
Sets a new vault implementation contract to be used when deploying/upgrading vaults
Parameters
Name | Type | Description |
---|---|---|
_vaultImplementation | address | Address of implementation contract |
addVault
Deploys a new vault
Parameters
Name | Type | Description |
---|---|---|
_operator | address | Address of operator that the vault represents |
queueVaultRemoval
Queues a vault for removal
A vault can only be queued for removal if the operator has been removed from the Chainlink staking contract
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | Index of vault |
removeVault
Removes a vault that has been queued for removal
Parameters
Name | Type | Description |
---|---|---|
_queueIndex | uint256 | Index of vault in removal queue |
updateVaultGroupAccounting
Updates accounting for any number of vault groups
Used to correct minor accounting errors that result from the removal or slashing of operators in the Chainlink staking contract
Parameters
Name | Type | Description |
---|---|---|
_vaultGroups | uint256[] | list of vault groups to update |
_totalDepositRoom | uint256[] | list of totalDepositRoom corresponding to list of vault groups |
_totalUnbonded | uint256 | total amount currently unbonded |
_vaultMaxDeposits | uint256 | vault deposit limit as defined in Chainlink staking contract |
setOperator
Sets a vault's operator address
Parameters
Name | Type | Description |
---|---|---|
_index | uint256 | Index of vault |
_operator | address | Address of operator that the vault represents |
setRewardsReceiver
Sets the address authorized to claim rewards for a vault
Parameters
Name | Type | Description |
---|---|---|
_operator | address | Address of rewards receiver for vault |
setOperatorRewardPercentage
Sets the basis point amount of an operator's earned rewards that they receive
Parameters
Name | Type | Description |
---|---|---|
_operatorRewardPercentage | uint256 | Basis point operator reward percentage |
Last updated