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

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

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

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

operatorRewardPercentage

Returns the basis point amount of an operator's earned rewards that they receive

function operatorRewardPercentage() external view

Return Values

NameTypeDescription

operatorRewardPercentage

uint256

Basis point operator reward percentage

getOperatorRewards

Returns the total unclaimed operator rewards

function getOperatorRewards() external view returns (uint256, uint256)

Return Values

NameTypeDescription

unclaimedOperatorRewards

uint256

Total unclaimed operator rewards

availableRewards

uint256

Total available operator rewards

Write Functions

deposit

Deposits tokens into this strategy

function deposit(uint256 _amount) external

Parameters

NameTypeDescription

_amount

uint256

Amount to deposit

onTokenTransfer

ERC677 implementation to receive operator rewards

function onTokenTransfer(address, uint256, bytes) external

withdrawOperatorRewards

Used by vaults to withdraw operator rewards

function withdrawOperatorRewards(address _receiver, uint256 _amount) external

Parameters

NameTypeDescription

_receiver

address

Address to receive rewards

_amount

uint256

Amount to withdraw

updateDeposits

Updates deposit accounting and calculates fees on newly earned rewards

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

Parameters

NameTypeDescription

_data

bytes

Encoded min amount of rewards required to claim (set 0 to skip reward claiming)

Return Values

NameTypeDescription

depositChange

uint256

change in deposits since last update

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

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

addVault

Deploys a new vault

function addVault(address _operator) external

Parameters

NameTypeDescription

_operator

address

Address of operator that the vault represents

setOperator

Sets a vault's operator address

function setOperator(uint256 _index, address _operator) external

Parameters

NameTypeDescription

_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

function setRewardsReceiver(address _rewardsReceiver) external

Parameters

NameTypeDescription

_operator

address

Address of rewards receiver for vault

setOperatorRewardPercentage

Sets the basis point amount of an operator's earned rewards that they receive

function setOperatorRewardPercentage(uint256 _operatorRewardPercentage) external

Parameters

NameTypeDescription

_operatorRewardPercentage

uint256

Basis point operator reward percentage

Last updated