Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBorisov committed Nov 12, 2024
1 parent 15d71cd commit 1fa9f85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/HydraDelegation/HydraDelegation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ contract HydraDelegation is
function _distributeTokens(address staker, address account, uint256 amount) internal virtual override {
VestingPosition memory position = vestedDelegationPositions[staker][msg.sender];
if (_isOpeningPosition(position)) {
uint256 debt = _calculatePostionDebt(amount, position.duration);
uint256 debt = _calculatePositionDebt(amount, position.duration);
liquidityDebts[account] -= debt.toInt256Safe(); // Add negative debt
amount -= debt;
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/HydraStaking/HydraStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ contract HydraStaking is
function _afterPenalizeStakerHook(address staker, uint256 unstakeAmount, uint256 leftForStaker) internal override {
// the unstake amount of liquid tokens must be paid at the time of withdrawal
// but only the leftForStaker will be automatically requested,
// so we have to set the unstake amount - leftForStaker as liquidity debt
// so we have to set the unstake amount - leftForStaker as liquidity debt that must be paid as well
liquidityDebts[staker] += (unstakeAmount - leftForStaker).toInt256Safe();
}

Expand Down Expand Up @@ -224,7 +224,7 @@ contract HydraStaking is
function _distributeTokens(address staker, uint256 amount) internal virtual override {
VestingPosition memory position = vestedStakingPositions[staker];
if (_isOpeningPosition(position)) {
uint256 debt = _calculatePostionDebt(amount, position.duration);
uint256 debt = _calculatePositionDebt(amount, position.duration);
liquidityDebts[staker] -= debt.toInt256Safe(); // Add negative debt
amount -= debt;
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/common/Vesting/Vesting.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ abstract contract Vesting is APRCalculatorConnector {
* @param duration The duration of the vesting position
* @return debt The debt of the vesting position
*/
function _calculatePostionDebt(uint256 amount, uint256 duration) internal view returns (uint256 debt) {
function _calculatePositionDebt(uint256 amount, uint256 duration) internal view returns (uint256 debt) {
uint256 positionDurationInWeeks = duration / 1 weeks;
debt = (amount * positionDurationInWeeks * vestingLiquidityDecreasePerWeek) / DENOMINATOR;
}
Expand Down

0 comments on commit 1fa9f85

Please sign in to comment.