Source mirror · commit 369512f · 2026-10-26 · MIT · canonical repo: gitlab.com/jiapunk/upgrade-airlock
git clone https://upgrade-airlock.pages.dev/source/upgrade-airlock.git
upgrade-airlock / src / attack / EvilOwnerImpl.sol
src/attack/EvilOwnerImpl.sol13 lines · 424 bytes
1// SPDX-License-Identifier: MIT
2pragma solidity 0.8.37;
3
4import {DemoBTC} from "../DemoBTC.sol";
5
6/// @title EvilOwnerImpl (demo attack, threat T2)
7/// @notice Adds `claimOwner()` with no access control: anyone can take ownership.
8/// @dev Deliberately malicious demo code. Never deploy outside a demo.
9contract EvilOwnerImpl is DemoBTC {
10 function claimOwner() external {
11 _transferOwnership(msg.sender);
12 }
13}