Changing hat toggle address can lead to unexpected changes in status
Changing the toggle address should not change the current status unless intended to. However, in the event that a contract's toggle status hasn't been synced to local state, this change can accidentally toggle the hat back on when it isn't intended.\\nWhen an admin for a hat calls `changeHatToggle()`, the `toggle` address is updated to a new address they entered:\\n```\\nfunction changeHatToggle(uint256 _hatId, address _newToggle) external {\\n    if (_newToggle == address(0)) revert ZeroAddress();\\n\\n    _checkAdmin(_hatId);\\n    Hat storage hat = _hats[_hatId];\\n\\n    if (!_isMutable(hat)) {\\n        revert Immutable();\\n    }\\n\\n    hat.toggle = _newToggle;\\n\\n    emit HatToggleChanged(_hatId, _newToggle);\\n}\\n```\\n\\nToggle addresses can be either EOAs (who must call `setHatStatus()` to change the local config) or contracts (who must implement the `getHatStatus()` function and return the value).\\nThe challenge comes if a hat has a toggle address that is a contract. The contract changes its toggle value to `false` but is never checked (which would push the update to the local state). The admin thus expects that the hat is turned off.\\nThen, the toggle is changed to an EOA. One would expect that, until a change is made, the hat would remain in the same state, but in this case, the hat defaults back to its local storage state, which has not yet been updated and is therefore set to `true`.\\nEven in the event that the admin knows this and tries to immediately toggle the status back to `false`, it is possible for a malicious user to sandwich their transaction between the change to the EOA and the transaction to toggle the hat off, making use of a hat that should be off. This could have dramatic consequences when hats are used for purposes such as multisig signing.
The `changeHatToggle()` function needs to call `checkHatToggle()` before changing over to the new toggle address, to ensure that the latest status is synced up.
Hats may unexpectedly be toggled from `off` to `on` during toggle address transfer, reactivating hats that are intended to be turned `off`.
```\\nfunction changeHatToggle(uint256 _hatId, address _newToggle) external {\\n    if (_newToggle == address(0)) revert ZeroAddress();\\n\\n    _checkAdmin(_hatId);\\n    Hat storage hat = _hats[_hatId];\\n\\n    if (!_isMutable(hat)) {\\n        revert Immutable();\\n    }\\n\\n    hat.toggle = _newToggle;\\n\\n    emit HatToggleChanged(_hatId, _newToggle);\\n}\\n```\\n