Skip to content

Instantly share code, notes, and snippets.

@Shashank-In
Last active August 3, 2022 11:23
Show Gist options
  • Save Shashank-In/6501ded4100603c01e5eba272ecc8e99 to your computer and use it in GitHub Desktop.
Save Shashank-In/6501ded4100603c01e5eba272ecc8e99 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
contract Delegate {
address public owner;
constructor(address _owner) public {
owner = _owner;
}
function pwn() public {
owner = msg.sender;
}
}
contract Delegation {
address public owner;
Delegate delegate;
constructor(address _delegateAddress) public {
delegate = Delegate(_delegateAddress);
owner = msg.sender;
}
fallback() external {
(bool result,) = address(delegate).delegatecall(msg.data);
if (result) {
this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment