TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: low
Valid

Lack of `whenNotPaused` modifier in `withdraw()` and `delegate()` function in `TempleGoldStaking`

Summary

Critical modifier whenNotPausedis lacked in withdraw() and delegate() function.

Vulnerability Details

In **TempleGoldStaking**contract, it implement Pausableto pause critical function in emergency mode. whenNotPausedmodifier is implemented in stakeForfunction, but function withdraw()and delegete()aren't:

Function withdraw():

function withdraw(uint256 amount, uint256 index, bool claim) external override {
StakeInfo storage _stakeInfo = _stakeInfos[msg.sender][index];
_withdrawFor(_stakeInfo, msg.sender, msg.sender, index, amount, claim, msg.sender);
}

Function delegate():

function delegate(address delegatee) external override {
return _delegate(msg.sender, delegatee);
}

Impact

Unable to pause these function in case of emergency mode.

Tools Used

Manual review

Recommendations

Add whenNotPaused modifier in withdraw() and delegate() functions.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Only migrator should be able to perform actions when contract is paused.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.