Skip to content

Commit

Permalink
updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BkChoy committed Sep 11, 2023
1 parent dfe448b commit e32d881
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
7 changes: 4 additions & 3 deletions contracts/core/PriorityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ contract PriorityPool is UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeabl
}

/**
* @notice deposits queued tokens into the staking pool
* @notice deposits queued and/or unused tokens
* @param _queueDepositMin min amount of tokens required for deposit
* @param _queueDepositMax max amount of tokens that can be deposited at once
*/
Expand All @@ -351,7 +351,7 @@ contract PriorityPool is UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeabl
}

/**
* @notice deposits queued tokens into the staking pool
* @notice deposits queued and/or unused tokens
* @dev will revert if less than queueDepositMin tokens can be deposited
* @dev used by chainlink keepers
*/
Expand Down Expand Up @@ -533,7 +533,8 @@ contract PriorityPool is UUPSUpgradeable, OwnableUpgradeable, PausableUpgradeabl
}

/**
* @notice deposits queued tokens
* @notice deposits queued and/or unused tokens
* @dev will prioritize unused deposits sitting in staking pool before queued deposits in this pool
* @param _depositMin min amount of tokens required to deposit
**/
function _depositQueuedTokens(uint256 _depositMin, uint256 _depositMax) internal {
Expand Down
4 changes: 2 additions & 2 deletions contracts/core/StakingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ contract StakingPool is StakingRewardsPool {
}

/**
* @notice returns the amont of tokens sitting in the pool outside a strategy
* @dev these tokens earn no yield and should be deposited ASAP
* @notice returns the amont of tokens sitting in this pool outside a strategy
* @dev these tokens earn no yield and will be deposited ASAP
* @return amount of tokens outside a strategy
*/
function getUnusedDeposits() external view returns (uint256) {
Expand Down
24 changes: 22 additions & 2 deletions contracts/linkStaking/CommunityVCS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ contract CommunityVCS is VaultControllerStrategy {
_disableInitializers();
}

/**
* @notice initializes contract
* @param _token address of LINK token
* @param _stakingPool address of the staking pool that controls this strategy
* @param _stakeController address of Chainlink staking contract
* @param _vaultImplementation address of the implementation contract to use when deploying new vaults
* @param _fees list of fees to be paid on rewards
* @param _maxDepositSizeBP basis point amount of the remaing deposit room in the Chainlink staking contract
* that can be deposited at once
* @param _vaultDeploymentThreshold the min number of non-full vaults before a new batch is deployed
* @param _vaultDeploymentAmount amount of vaults to deploy when threshold is met
**/
function initialize(
address _token,
address _stakingPool,
Expand Down Expand Up @@ -61,27 +73,35 @@ contract CommunityVCS is VaultControllerStrategy {
}
}

/**
* @notice returns whether a new batch of vaults should be deployed
* @dev used by chainlink keepers
*/
function checkUpkeep(bytes calldata) external view returns (bool, bytes memory) {
return ((vaults.length - 1 - indexOfLastFullVault) < vaultDeploymentThreshold, bytes(""));
}

/**
* @notice deploys a new batch of vaults
* @dev will revert if the # of non-full vaults is not less than vaultDeploymentThreshold
* @dev will revert if the number of non-full vaults is not less than vaultDeploymentThreshold
* @dev used by chainlink keepers
*/
function performUpkeep(bytes calldata) external {
if ((vaults.length - 1 - indexOfLastFullVault) >= vaultDeploymentThreshold) revert VaultsAboveThreshold();
_deployVaults(vaultDeploymentAmount);
}

/**
* @notice deploys a new batch of vaults
* @param _numVaults number of vaults to deploy
*/
function addVaults(uint256 _numVaults) external onlyOwner {
_deployVaults(_numVaults);
}

/**
* @notice sets the vault deployment parameters
* @param _vaultDeploymentThreshold the min # of non-full vaults before a new batch is deployed
* @param _vaultDeploymentThreshold the min number of non-full vaults before a new batch is deployed
* @param _vaultDeploymentAmount amount of vaults to deploy when threshold is met
*/
function setVaultDeploymentParams(uint128 _vaultDeploymentThreshold, uint128 _vaultDeploymentAmount) external onlyOwner {
Expand Down

0 comments on commit e32d881

Please sign in to comment.