src/attack/EvilMintImpl.sol13 lines · 446 bytes
| 1 | // SPDX-License-Identifier: MIT |
| 2 | pragma solidity 0.8.37; |
| 3 | |
| 4 | import {DemoBTC} from "../DemoBTC.sol"; |
| 5 | |
| 6 | /// @title EvilMintImpl (demo attack, threat T1) |
| 7 | /// @notice Same selectors as DemoBTC v1, but `mint` has no access control: anyone can mint. |
| 8 | /// @dev Deliberately malicious demo code. Never deploy outside a demo. |
| 9 | contract EvilMintImpl is DemoBTC { |
| 10 | function mint(address to, uint256 amount) public override { |
| 11 | _mint(to, amount); |
| 12 | } |
| 13 | } |