When calling depositIntoVault
function, proportional amount of shares is minted to a msg.sender. However, internal contract state is not updated. More precisely, usersToStakes[msg.sender] and totalAmountStaked are not appropriately updated.
After depositing the ETH into the vault and converting it to WETH, the function does not update the usersToStakes
or totalAmountStaked
. This results in incorrect internal state accounting, since mentioned values are not reduced.
Place the following test into steaking-contracts/test/Steaking.t.sol
Lack of state updates allows malicious user to drain staked funds after depositing minimum stake amount. Scenario:
1. Bob, along with other users deposits, deposits min stake amount.
2. After 4 weeks, Bob repeatedly calls depositIntoVault() and recieve all the shares on behalf of other users deposits.
Manual Review
Ensure that usersToStakes
and totalAmountStaked
are updated to reflect the correct staked amounts after a successful deposit, maintaining accurate records and preventing potential issues with share issuance.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.