link staking contracts
CommunityVault: Community LINK Staking Vault
CommunityVault is a vault contract used for depositing LINK into the Chainlink staking contract as a community staker.
View Functions
Section titled âView FunctionsâReturns the address of the staking token
function token() external view returns (address)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| token | address | address of token |
vaultController
Section titled âvaultControllerâReturns the address of the vault controller
function vaultController() external view returns (address)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| vaultController | address | address of vault controller |
stakeController
Section titled âstakeControllerâReturns the address of the Chainlink staking contract
function stakeController() external view returns (address)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| stakeController | address | address of staking contract |
rewardsController
Section titled ârewardsControllerâReturns the address of the Chainlink staking rewards contract
function rewardsController() external view returns (address)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| rewardsController | address | address of rewards contract |
delegateRegistry
Section titled âdelegateRegistryâReturns the address of the delegate registry
function delegateRegistry() external view returns (address)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| delegateRegistry | address | address of delegate registry |
getTotalDeposits
Section titled âgetTotalDepositsâReturns the total balance of this contract in the Chainlink staking contract
function getTotalDeposits() public view returns (uint256)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| totalDeposits | uint256 | Total deposit balance |
getPrincipalDeposits
Section titled âgetPrincipalDepositsâReturns the principal balance of this contract in the Chainlink staking contract
function getPrincipalDeposits() public view returns (uint256)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| principalDeposits | uint256 | Principal deposit balance |
getRewards
Section titled âgetRewardsâReturns the claimable rewards balance of this contract in the Chainlink staking rewards contract
function getRewards() public view returns (uint256)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| rewards | uint256 | Claimable rewards |
claimPeriodActive
Section titled âclaimPeriodActiveâReturns whether the claim period is active for this contract in the Chainlink staking contract
function claimPeriodActive() external view returns (bool)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| active | bool | true if active, false otherwise |
getDelegations
Section titled âgetDelegationsâReturns all enabled delegations this vault has given out
function getDelegations() external view returns (IDelegateRegistry.Delegation[] memory)Return Values
Section titled âReturn Valuesâ| Name | Type | Description |
|---|---|---|
| delegations | IDelegateRegistry.Delegation[] | list of delegations |
Write Functions
Section titled âWrite Functionsâdeposit
Section titled âdepositâDeposits tokens from the vaultController into the Chainlink staking contract
function deposit(uint256 _amount) externalParameters
Section titled âParametersâ| Name | Type | Description |
|---|---|---|
| _amount | uint256 | Amount to deposit |
withdraw
Section titled âwithdrawâWithdraws tokens from the Chainlink staking contract and sends them to the vault controller
function withdraw(uint256 _amount) externalParameters
Section titled âParametersâ| Name | Type | Description |
|---|---|---|
| _amount | uint256 | Amount to withdraw |
Unbonds tokens in the Chainlink staking contract
function unbond() externaldelegate
Section titled âdelegateâDelegates to an address for this vault
function delegate(address _to, bytes32 _rights, bool _enable) externalParameters
Section titled âParametersâ| Name | Type | Description |
|---|---|---|
| _to | address | address to delegate to |
| _rights | bytes32 | rights to grant |
| _enable | bool | whether to enable or revoke delegation |
withdrawTokenRewards
Section titled âwithdrawTokenRewardsâWithdraws any non-LINK token rewards sitting in this vault
function withdrawTokenRewards(address[] calldata _tokens) externalParameters
Section titled âParametersâ| Name | Type | Description |
|---|---|---|
| _tokens | address[] | list of tokens to withdraw |
setDelegateRegistry
Section titled âsetDelegateRegistryâSets the delegate registry
function setDelegateRegistry(address _delegateRegistry) externalParameters
Section titled âParametersâ| Name | Type | Description |
|---|---|---|
| _delegateRegistry | address | address of delegate registry |
claimRewards
Section titled âclaimRewardsâClaims rewards from the Chainlink staking contract
function claimRewards(uint256 _minRewards, address _rewardsReceiver) externalParameters
Section titled âParametersâ| Name | Type | Description |
|---|---|---|
| _minRewards | uint256 | Min amount of rewards to claim |
| _rewardsReceiver | address | Address to receive claimed rewards |