56841 sc high sudden addition of rewards will be frontrun with deposits just to steal part of reward
Description
Brief / Intro
Vulnerability Details
File: Staking.sol
/// @notice Adds rewards to the vault, increasing the asset backing per share.
/// @dev Caller must approve this contract to pull `amount` LONG beforehand.
/// @param amount Amount of LONG to transfer in as rewards (must be > 0).
function distributeRewards(uint256 amount) external onlyOwner {
if (amount == 0) revert ZeroReward();
LONG.safeTransferFrom(msg.sender, address(this), amount);
emit RewardsDistributed(amount);
}Impact Details
Recommendation
Proof of Concept
Previous57515 sc high cross token accounting is brokenNext57586 sc high calculating slippage for swap onchain does not prevent slippage loss
Was this helpful?