TempleGold

TempleDAO
Foundry
25,000 USDC
View results
Submission Details
Severity: medium
Invalid

In `TempleGoldStaking.sol::constructor` there is no check if `stakingToken` == `rewardToken`.

Summary

In the constructor there is no check. to make sure that the rewardToken should be the same as the stakingToken since templegold is used to stake and to reward

Vulnerability Details

constructor(
address _rescuer,
address _executor,
address _stakingToken,
address _rewardToken
) TempleElevatedAccess(_rescuer, _executor) {
//@audit no check if rewardToken is same as stakingToken.
stakingToken = IERC20(_stakingToken);
rewardToken = IERC20(_rewardToken);
}

Impact

In an incident where the staking token used is not the Temple Gold token.. temple gold tokens may be claimed in the rewarding. or vice versa. which is a great problem

Tools Used

foundry

Recommendations

  1. check if staking and reward token are the same and there not the zero address.

if (stakingToken == rewardToken && stakingToken != address(0){
stakingToken = IERC20(_stakingToken);
rewardToken = IERC20(_rewardToken);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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