Fast Khaki Raccoon
Medium
Incorrect modifier results in the inability to set a staked user restriction
Upon calling StakingPoolToken.setStakeUserRestriction()
to set a user restriction, we use this modifier:
modifier onlyRestricted() {
require(_msgSender() == stakeUserRestriction, "R");
_;
}
The issue is that if a restriction hasn't been set in the first place or has been removed, then this will always revert as the msg.sender
can not be address(0)
which is the stakeUserRestriction
value if it hasn't been set.
No response
No response
- The staked user restriction is removed or hasn't been set in the first place
- There is no way to ever set it again in the future, resulting in a completely broken functionality
Broken functionality rendering the staked user restriction mechanism completely useless. If a restriction must be set, then it will be impossible.
No response
Change the modifier to a different one, possibly add the ability for the owner to set it