Skip to content

Commit

Permalink
WIP: natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
apbendi committed Feb 8, 2024
1 parent c2ce4cc commit 4d0b321
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/UniStaker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,20 @@ contract UniStaker is INotifiableRewardReceiver, ReentrancyGuard, Multicall, EIP
_depositId = _stake(msg.sender, _amount, _delegatee, _beneficiary);
}

/// @notice Method to stake tokens to a new deposit. The caller must approve the staking
/// contract to spend at least the would-be staked amount of the token via a signature which is
/// is also provided, and is passed to the token contract's permit method before the staking
/// operation occurs.
/// @param _amount Quantity of the staking token to stake.
/// @param _delegatee Address to assign the governance voting weight of the staked tokens.
/// @param _beneficiary Address that will accrue rewards for this stake.
/// @param _deadline The timestamp at which the permit signature should expire.
/// @param _v ECDSA signature component: Parity of the `y` coordinate of point `R`
/// @param _r ECDSA signature component: x-coordinate of `R`
/// @param _s ECDSA signature component: `s` value of the signature
/// @return _depositId Unique identifier for this deposit.
/// @dev Neither the delegatee nor the beneficiary may be the zero address. The deposit will be
/// owned by the message sender.
function permitAndStake(
uint256 _amount,
address _delegatee,
Expand Down Expand Up @@ -331,6 +345,18 @@ contract UniStaker is INotifiableRewardReceiver, ReentrancyGuard, Multicall, EIP
_stakeMore(deposit, _depositId, _amount);
}

/// @notice Add more staking tokens to an existing deposit. A staker should call this method when
/// they have an existing deposit, and wish to stake more while retaining the same delegatee and
/// beneficiary. The caller must approve the staking contract to spend at least the would-be
/// staked amount of the token via a signature which is is also provided, and is passed to the
/// token contract's permit method before the staking operation occurs.
/// @param _depositId Unique identifier of the deposit to which stake will be added.
/// @param _amount Quantity of stake to be added.
/// @param _deadline The timestamp at which the permit signature should expire.
/// @param _v ECDSA signature component: Parity of the `y` coordinate of point `R`
/// @param _r ECDSA signature component: x-coordinate of `R`
/// @param _s ECDSA signature component: `s` value of the signature
/// @dev The message sender must be the owner of the deposit.
function permitAndStakeMore(
DepositIdentifier _depositId,
uint256 _amount,
Expand Down

0 comments on commit 4d0b321

Please sign in to comment.