Open code423n4 opened 2 years ago
All in all this report is the classic "No safeApprove". But with an actual idea of a POC Ultimately the risk is contingent on the specific reward.token being a nonRevertingOnError
For that reason, I believe Medium Severity to be more appropriate
Lines of code
https://github.com/code-423n4/2022-02-concur/blob/72b5216bfeaa7c52983060ebfc56e72e0aa8e3b0/contracts/StakingRewards.sol#L126
Vulnerability details
Impact
If the transfer of the reward token fails to the treasury (due to insufficient funds for example), the function
_calcRewardIntegral
will still update accounting and cause devastating accounting discrepancies in the contract.Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
Tools Used
Recommended Mitigation Steps
require(IERC20(reward.token).transfer(treasury, d_reward / 5), "ERROR_MESSAGE");