code-423n4 / 2022-02-concur-findings

2 stars 0 forks source link

QA Report #254

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

I assigned this issue a severity of low because I assume we can trust the owner not to exploit this :?

You should forbid recoverERC20 of rewardsToken, and may also allow transferring the surplus from _totalSupply of stakingToken. Usually, it is a good practice in such contracts to have an emergency withdrawal function, where users can get back their stake tokens but forfeit the rewards.

GalloDaSballo commented 2 years ago

Function recoverERC20 in StakingRewards allows an owner to transfer out any token except stakingToken. I see 2 problems with this: Dup of #69 (med)

A small loss in precision due to multiplication and division: Agree

Consider introducing a reasonable upper limit for the rewards[_pid] array in ConvexStakingWrapper, otherwise if it grows too large it may exceed the gas limit when performing the _checkpoint and there is no way to remove it once added. Valid but Low probability

ConvexStakingWrapper function addRewards fetches extraRewards and adds them to the list of rewards, but please note that extra rewards can change: Great find

You should use safe casts here: Great fix to the issue of overpaying Also, dup of #194 (Med)

I don't think this check in function provide of contract USDMPegRecovery is correct: in lack of POC cannot but downgrade to non-critical, ultimately it seems to just ensure the function is only called when there's a ton of liquid token and not much deposited

Consider introducing a withdrawal deadline to indicate when it is too late and the user has to requestWithdraw again. Non-critical

I think the comment and the actual code is misleading here: Non-critical

Pretty interesting report that suffers from mediocre formatting as well as lack of links making the findings a lot less actionable

GalloDaSballo commented 2 years ago

3++

GalloDaSballo commented 2 years ago

Bumped to 4- to be third best submission

JeeberC4 commented 2 years ago

@CloudEllie please create 2 new issue for the Med findings above.

CloudEllie commented 2 years ago

I've created separate issues for the following: