Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sneaky Zinc Narwhal - some variable have to be update before in the unstake function #572

Open
sherlock-admin4 opened this issue Feb 17, 2025 · 0 comments

Comments

@sherlock-admin4
Copy link

Sneaky Zinc Narwhal

High

some variable have to be update before in the unstake function

Summary

in the contract VotingPool function unstake should have to first update _stake.stakedToOutputDenomenator) _stake.stakedToOutputFactor; before calculating _amtStakeToRemove in line 51 to get the real time burn amount

  uint256 _amtStakeToRemove = (_amount * _stake.stakedToOutputDenomenator) / _stake.stakedToOutputFactor;
        _stake.amtStaked -= _amtStakeToRemove;

https://github.com/sherlock-audit/2025-01-peapods-finance/blob/main/contracts/contracts/voting/VotingPool.sol#L51

Root Cause

in VotingPool the _stake.stakedToOutputDenomenator) _stake.stakedToOutputFactor; arent updated

Internal Pre-conditions

nothing

External Pre-conditions

nothing

Attack Path

nothing

Impact

WRONG VALUE WILL BE BURNED

PoC

No response

Mitigation

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant