// File: @openzeppelin/contracts/interfaces/IERC1967.sol



// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1967.sol)

pragma solidity ^0.8.20;

/**
 * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
 */
interface IERC1967 {
    /**
     * @dev Emitted when the implementation is upgraded.
     */
    event Upgraded(address indexed implementation);

    /**
     * @dev Emitted when the admin account has changed.
     */
    event AdminChanged(address previousAdmin, address newAdmin);

    /**
     * @dev Emitted when the beacon is changed.
     */
    event BeaconUpgraded(address indexed beacon);
}

// File: contracts/ChangeAdmin.sol



// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "../contracts/interface/ITransparentUpgradeableProxy.sol";

contract ChangeAdmin {
    function executeChangeAdmin(
        address proxy,
        address newAdmin
    ) external {
        bytes memory data = abi.encodeWithSelector(
            ITransparentUpgradeableProxy.changeAdmin.selector,
            newAdmin
        );

        (bool success, ) = proxy.delegatecall(data);
        require(success, "changeAdmin failed");
    }
}
// File: contracts/interface/ITransparentUpgradeableProxy.sol



// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/interfaces/IERC1967.sol";

interface ITransparentUpgradeableProxy is IERC1967 {
    function changeAdmin(address) external;
}