Closed sherlock-admin3 closed 5 months ago
2 comment(s) were left on this issue during the judging contest.
0xmystery commented:
invalid because no hook is entailed and POC is deficient of actual/concrete proof
0xreadyplayer1 commented:
According to contest Readme
Any bridging related code is considered out of scope
and the issue is invalid.
d43mon
medium
Reentrancy in SophonFarming::bridgepool
Summary
Reentrancy in SophonFarming::bridgepool
Vulnerability Detail
There could be a possible reentrancy attack in SophonFarming::bridgepool() function.
In order to attack this function:
deposit()
function which could be attacked causing the deposit of unwanted lptokens in the farm leading to excessive amounts of funds flowing in the contract.Impact
The flow of excessive funds could lead to wrong calculation of userInfo rewards calcualtion. Due to increase in the tokens
lpsupply
increases which in turn leads to decrease in the accPointsPerShare. hence the users will receive less reward then the actual.pool.accPointsPerShare = pointReward/lpSupply + pool.accPointsPerShare;
Code Snippet
link to the code snippet :
https://github.com/sherlock-audit/2024-05-sophon/blob/main/farming-contracts/contracts/farm/SophonFarming.sol#L766
.Tool used
Manual Review
Recommendation
CEI should be applied
isBridgedisBridged[_pid] = true;
should be updated beforehand