Submitted by Kenshin, also found by 0xNightRaven, Breeje, and totomanov
https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L33 https://github.com/code-423n4/2023-06-lybra/blob/7b73ef2fbb542b569e182d9abf79be643ca883ee/contracts/lybra/token/esLBR.sol#L40
The esLBR balance of users plays the most important role in staking reward calculation. Using a try-catch statement over refreshReward() in the esLBR.mint() and esLBR.burn() functions can have the following effects when refreshReward() becomes unavailable:
The following is the coded PoC using Foundry.
Note: This PoC creates a mock reward contract. It has the same logic as the real one, but with added setter functions that serve only to simplify the test flow.
The test should pass without errors.
Please follow this gist if you prefer my instructions on how I setup the audit repo with Foundry environment.
Manual review, Foundry
The refreshReward() function should be a mandatory action inside either the mint() or burn() functions. The try-catch statement should be removed.
LybraFinance confirmed
