function initialize(address _telAddress) public payable initializer {
tel = _telAddress;
// initialize OZ stuff
ReentrancyGuardUpgradeable.__ReentrancyGuard_init_unchained();
AccessControlEnumerableUpgradeable.__AccessControlEnumerable_init_unchained();
PausableUpgradeable.__Pausable_init_unchained();
// set deployer as ADMIN
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
Deivitto
low
Missing check of
0x0
in initialize fortel
Summary
Missing check of
0x0
in initialize fortel
Vulnerability Detail
Impact
Zero address should be checked for state variables.
A zero address can make the code where
tel
not work as expected and most likely fail.Code Snippet
https://github.com/sherlock-audit/2022-11-telcoin/blob/main/contracts/StakingModule.sol#L60-L61
Tool used
Manual Review
Recommendation
Check zero address before assigning or using it