Skip to content

Commit

Permalink
fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BkChoy committed Mar 19, 2024
1 parent 9222087 commit 447cd18
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
60 changes: 30 additions & 30 deletions contracts/metisStaking/SequencerVCS.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice initializes contract
* @notice Initializes contract
* @param _token address of METIS token
* @param _stakingPool address of the staking pool that controls this strategy
* @param _lockingInfo address of Metis locking info contract
Expand Down Expand Up @@ -96,23 +96,23 @@ contract SequencerVCS is Strategy {
}

/**
* @notice reverts if sender is not deposit controller
* @notice Reverts if sender is not deposit controller
**/
modifier onlyDepositController() {
if (msg.sender != depositController) revert SenderNotAuthorized();
_;
}

/**
* @notice reverts if sender is not CCIP controller
* @notice Reverts if sender is not CCIP controller
**/
modifier onlyCCIPController() {
if (msg.sender != ccipController) revert SenderNotAuthorized();
_;
}

/**
* @notice deposits tokens into this strategy from the staking pool
* @notice Deposits tokens into this strategy from the staking pool
* @param _amount amount to deposit
*/
function deposit(uint256 _amount) external onlyStakingPool {
Expand All @@ -121,14 +121,14 @@ contract SequencerVCS is Strategy {
}

/**
* @notice withdrawals are not yet implemented
* @notice Withdrawals are not yet implemented
*/
function withdraw(uint256) external view onlyStakingPool {
revert("withdrawals not yet implemented");
}

/**
* @notice returns a list of all vaults controlled by this contract
* @notice Returns a list of all vaults controlled by this contract
* @return list of vault addresses
*/
function getVaults() external view returns (ISequencerVault[] memory) {
Expand All @@ -148,7 +148,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns the total unclaimed operator rewards across all vaults
* @notice Returns the total unclaimed operator rewards across all vaults
* @return unclaimed operator rewards
* @return rewards available to withdraw
*/
Expand All @@ -157,7 +157,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice used by vaults to withdraw operator rewards
* @notice Used by vaults to withdraw operator rewards
* @param _receiver address to receive rewards
* @param _amount amount to withdraw
*/
Expand All @@ -175,15 +175,15 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns the total amount of queued tokens
* @notice Returns the total amount of queued tokens
* @return total queued tokens
*/
function getTotalQueuedTokens() external view returns (uint256) {
return token.balanceOf(address(this));
}

/**
* @notice deposits queued tokens into vaults
* @notice Deposits queued tokens into vaults
* @dev called by deposit controller bot once certain conditions are met as defined offchain
* @param _vaults list of vaults to deposit into
* @param _amounts amount to deposit into each vault
Expand All @@ -195,7 +195,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns the deposit change since deposits were last updated
* @notice Returns the deposit change since deposits were last updated
* @dev deposit change could be positive or negative depending on reward rate and whether
* any slashing occurred
* @return deposit change
Expand All @@ -209,7 +209,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns the total amount of fees that will be paid on the next call to updateDeposits()
* @notice Returns the total amount of fees that will be paid on the next call to updateDeposits()
* @return total fees
*/
function getPendingFees() external view override returns (uint256) {
Expand All @@ -230,7 +230,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice updates deposit accounting and calculates fees on newly earned rewards
* @notice Updates deposit accounting and calculates fees on newly earned rewards
* @param _data encoded minRewards (uint256) - min amount of rewards required to claim (set 0 to skip reward claiming)
* and l2Gas (uint32) - gas limit for reward bridging
* @return depositChange change in deposits since last update
Expand Down Expand Up @@ -293,7 +293,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice handles an incoming CCIP transfer of rewards from l2
* @notice Handles an incoming CCIP transfer of rewards from l2
* @param _amount amount received
*/
function handleIncomingL2Rewards(uint256 _amount) external onlyCCIPController {
Expand All @@ -305,31 +305,31 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns the total amount of deposits as tracked in this strategy
* @notice Returns the total amount of deposits as tracked in this strategy
* @return total deposits
*/
function getTotalDeposits() public view override returns (uint256) {
return totalDeposits + l2Rewards;
}

/**
* @notice returns the maximum that can be deposited into this strategy
* @notice Returns the maximum that can be deposited into this strategy
* @return maximum deposits
*/
function getMaxDeposits() public view override returns (uint256) {
return vaults.length * lockingInfo.maxLock();
}

/**
* @notice returns the minimum that must remain this strategy
* @notice Returns the minimum that must remain this strategy
* @return minimum deposits
*/
function getMinDeposits() public view virtual override returns (uint256) {
return getTotalDeposits();
}

/**
* @notice relocks sequencer rewards for a list of vaults
* @notice Relocks sequencer rewards for a list of vaults
* @param _vaults list of vaults
*/
function relockRewards(uint256[] calldata _vaults) external {
Expand All @@ -339,7 +339,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice deploys a new vault and adds it to this strategy
* @notice Deploys a new vault and adds it to this strategy
* @param _pubkey public key of sequencer
* @param _signer signer address of sequencer
* @param _rewardsReceiver address authorized to claim rewards for the vault
Expand Down Expand Up @@ -369,7 +369,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice upgrades vaults to a new implementation contract
* @notice Upgrades vaults to a new implementation contract
* @param _startIndex index of first vault to upgrade
* @param _numVaults number of vaults to upgrade starting at _startIndex
* @param _data optional encoded function call to be executed after upgrade
Expand All @@ -390,15 +390,15 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns a list of all fees and fee receivers
* @notice Returns a list of all fees and fee receivers
* @return list of fees
*/
function getFees() external view returns (Fee[] memory) {
return fees;
}

/**
* @notice adds a new fee
* @notice Adds a new fee
* @param _receiver receiver of fee
* @param _feeBasisPoints fee in basis points
**/
Expand All @@ -408,7 +408,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice updates an existing fee
* @notice Updates an existing fee
* @param _index index of fee
* @param _receiver receiver of fee
* @param _feeBasisPoints fee in basis points
Expand All @@ -430,7 +430,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice sets the basis point amount of an operator's earned rewards that they receive
* @notice Sets the basis point amount of an operator's earned rewards that they receive
* @dev stakingPool.updateStrategyRewards is called to credit all past operator rewards at
* the old rate before the reward percentage changes
* @param _operatorRewardPercentage basis point amount
Expand All @@ -445,7 +445,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice sets a new vault implementation contract to be used when deploying/upgrading vaults
* @notice Sets a new vault implementation contract to be used when deploying/upgrading vaults
* @param _vaultImplementation address of implementation contract
*/
function setVaultImplementation(address _vaultImplementation) external onlyOwner {
Expand All @@ -455,7 +455,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice sets the deposit controller
* @notice Sets the deposit controller
* @dev this address is authorized to deposit queued tokens
* @param _depositController address of deposit controller
*/
Expand All @@ -464,15 +464,15 @@ contract SequencerVCS is Strategy {
}

/**
* @notice sets the CCIP controller
* @notice Sets the CCIP controller
* @param _ccipController address of CCIP controller
*/
function setCCIPController(address _ccipController) external onlyOwner {
ccipController = _ccipController;
}

/**
* @notice updates rewards for all strategies controlled by the staking pool
* @notice Updates rewards for all strategies controlled by the staking pool
* @dev called before operatorRewardPercentage is changed to
* credit any past rewards at the old rate
*/
Expand All @@ -486,7 +486,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns the sum of all fees
* @notice Returns the sum of all fees
* @return sum of fees in basis points
**/
function _totalFeesBasisPoints() private view returns (uint256) {
Expand All @@ -498,7 +498,7 @@ contract SequencerVCS is Strategy {
}

/**
* @notice returns whether an address belongs to a contract
* @notice Returns whether an address belongs to a contract
* @param _address address to check
* @return true if address is contract, false otherwise
*/
Expand Down
24 changes: 12 additions & 12 deletions contracts/metisStaking/SequencerVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice initializes contract
* @notice Initializes contract
* @param _token address of METIS token
* @param _vaultController address of the strategy that controls this vault
* @param _lockingPool address of Metis locking pool contract
Expand Down Expand Up @@ -73,23 +73,23 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice reverts if sender is not vaultController
* @notice Reverts if sender is not vaultController
**/
modifier onlyVaultController() {
if (msg.sender != address(vaultController)) revert SenderNotAuthorized();
_;
}

/**
* @notice reverts if sender is not rewardsReceiver
* @notice Reverts if sender is not rewardsReceiver
**/
modifier onlyRewardsReceiver() {
if (msg.sender != rewardsReceiver) revert SenderNotAuthorized();
_;
}

/**
* @notice deposits tokens into the Metis locking pool
* @notice Deposits tokens into the Metis locking pool
* @param _amount amount to deposit
*/
function deposit(uint256 _amount) external onlyVaultController {
Expand All @@ -105,7 +105,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice returns the total balance of this sequencer in the Metis locking pool
* @notice Returns the total balance of this sequencer in the Metis locking pool
* @dev includes principal plus any rewards
* @return total balance
*/
Expand All @@ -114,7 +114,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice returns the principal balance of this sequencer in the Metis locking pool
* @notice Returns the principal balance of this sequencer in the Metis locking pool
* @return principal balance
*/
function getPrincipalDeposits() public view returns (uint256) {
Expand All @@ -123,7 +123,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice returns the claimable rewards balance of this sequencer in the Metis locking pool
* @notice Returns the claimable rewards balance of this sequencer in the Metis locking pool
* @return rewards balance
*/
function getRewards() public view returns (uint256) {
Expand All @@ -132,7 +132,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice withdraws the unclaimed operator rewards for this vault
* @notice Withdraws the unclaimed operator rewards for this vault
*/
function withdrawRewards() external onlyRewardsReceiver {
uint256 amountWithdrawn = vaultController.withdrawOperatorRewards(rewardsReceiver, unclaimedRewards);
Expand All @@ -142,7 +142,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice returns the amount of operator rewards that will be earned by this vault on the next update
* @notice Returns the amount of operator rewards that will be earned by this vault on the next update
* @return newly earned rewards
*/
function getPendingRewards() public view returns (uint256) {
Expand All @@ -156,7 +156,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice updates the deposit and reward accounting for this vault
* @notice Updates the deposit and reward accounting for this vault
* @dev will only pay out rewards if the vault is net positive when accounting for lost deposits
* @param _minRewards min amount of rewards to claim (set 0 to skip reward claiming)
* @param _l2Gas bridge reward to L2 gasLimit
Expand Down Expand Up @@ -197,7 +197,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice relocks sequencer rewards
* @notice Relocks sequencer rewards
* @dev will revert if there is insufficient space in sequencer to lock rewards
*/
function relockRewards() external {
Expand All @@ -206,7 +206,7 @@ contract SequencerVault is Initializable, UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice sets the rewards receiver
* @notice Sets the rewards receiver
* @dev this address is authorized to withdraw rewards for this vault and/or change the rewardsReceiver
* to a new a address
* @param _rewardsReceiver rewards receiver address
Expand Down
2 changes: 1 addition & 1 deletion contracts/metisStaking/ccip/SequencerRewardsCCIPSender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ contract SequencerRewardsCCIPSender is UUPSUpgradeable, OwnableUpgradeable {
}

/**
* @notice reverts if sender is not transfer initiator
* @notice Reverts if sender is not transfer initiator
**/
modifier onlyTransferInitiator() {
if (msg.sender != transferInitiator) revert SenderNotAuthorized();
Expand Down

0 comments on commit 447cd18

Please sign in to comment.