code-423n4 / 2022-01-yield-findings

1 stars 0 forks source link

`ConvexStakingWrapper.sol#earned()` Implementation can be simpler and save some gas #118

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

WatchPug

Vulnerability details

https://github.com/code-423n4/2022-01-yield/blob/e946f40239b33812e54fafc700eb2298df1a2579/contracts/ConvexStakingWrapper.sol#L321-L322

uint256 d_reward = bal - reward.reward_remaining;
d_reward = d_reward + IRewardStaking(reward.reward_pool).earned(address(this));

Can be changed to:

uint256 d_reward = bal - reward.reward_remaining + IRewardStaking(reward.reward_pool).earned(address(this));
iamsahu commented 2 years ago

From readme:

GalloDaSballo commented 2 years ago

Per the sponsor requirements, Invalid