src/PausedImpl.sol17 lines · 658 bytes
| 1 | // SPDX-License-Identifier: MIT |
| 2 | pragma solidity 0.8.37; |
| 3 | |
| 4 | import {DemoBTC} from "./DemoBTC.sol"; |
| 5 | |
| 6 | /// @title PausedImpl |
| 7 | /// @notice Break-glass target. Same storage layout as DemoBTC; views keep working, every balance |
| 8 | /// change (transfer, transferFrom, mint, burn) reverts with TokenPaused(). |
| 9 | contract PausedImpl is DemoBTC { |
| 10 | error TokenPaused(); |
| 11 | |
| 12 | function _update(address from, address to, uint256 value) internal override { |
| 13 | // ERC20 never calls _update with both ends zero, so this always reverts in practice. |
| 14 | if (from != address(0) || to != address(0)) revert TokenPaused(); |
| 15 | super._update(from, to, value); |
| 16 | } |
| 17 | } |