Let say contract A
inherits PausableUpgradeable
, if contract deployed without calling the __Pausable_init, is it safe to assume that the contract is defaulted to $._paused = false;
since solidity default Boolean value is false, why is there a need to call __Pausable_init()
?
Will the _pause
still be callable? and modifier whenNotPaused
check correctly?
// contracts/utils/PausableUpgradeable.sol
/**
* @dev Initializes the contract in unpaused state.
*/
function __Pausable_init() internal onlyInitializing {
__Pausable_init_unchained();
}
function __Pausable_init_unchained() internal onlyInitializing {
PausableStorage storage $ = _getPausableStorage();
$._paused = false;
}
function _pause() internal virtual whenNotPaused {
PausableStorage storage $ = _getPausableStorage();
$._paused = true;
emit Paused(_msgSender());
}
Im not too sure what happens for other contracts such as ReentrancyGuardUpgradeable
, will there be any similar issues occurring as stated above?
// contracts/utils/ReentrancyGuardUpgradeable.sol
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}