In MyStrategy contract, there are 2 functions (manualProcessExpiredLocks and performUpkeep) basically do the same thing which is call processExpiredLocks() on LOCKER. Function manualProcessExpiredLocks() has whenNotPaused modifier but performUpkeep doesn’t.
1. Inconsistent usage of
whenNotPaused
modifierIn
MyStrategy
contract, there are 2 functions (manualProcessExpiredLocks
andperformUpkeep
) basically do the same thing which is callprocessExpiredLocks()
on LOCKER. FunctionmanualProcessExpiredLocks()
haswhenNotPaused
modifier butperformUpkeep
doesn’t.Proof of concept
https://github.com/Badger-Finance/vested-aura/blob/b6abb069431518962e1e0b3e516daa46ae3bdd9b/contracts/MyStrategy.sol#L372
https://github.com/Badger-Finance/vested-aura/blob/b6abb069431518962e1e0b3e516daa46ae3bdd9b/contracts/MyStrategy.sol#L391
Recommended Migitation Steps
Add or remove
whenNotPaused
for both functions to keep consistency2. Should use
balanceOfWant()
consistentlyIn
MyStrategy
contract, functionbalanceOfWant()
simply return balance ofwant
token in this strategy.But instead of using it, this code do call
balanceOf
manuallyProof of concept
https://github.com/Badger-Finance/vested-aura/blob/b6abb069431518962e1e0b3e516daa46ae3bdd9b/contracts/MyStrategy.sol#L362
Recommended Mitigation Steps
Should change to use
balanceOfWant()
function.