Skip to content

Instantly share code, notes, and snippets.

@a2468834
Last active May 16, 2022 02:03
Show Gist options
  • Save a2468834/8ef14958acb0637617caea373a6cc254 to your computer and use it in GitHub Desktop.
Save a2468834/8ef14958acb0637617caea373a6cc254 to your computer and use it in GitHub Desktop.
2022-05-16 HSNL Paper Meeting
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.13;
contract A {
uint256 public x;
function foo() public payable {
x++;
}
function bar() public {
selfdestruct(payable(msg.sender));
}
}
contract B {
uint256 public x;
function foo() public payable {
x++;
}
function bar(address c) public {
(bool success, ) = c.delegatecall(abi.encodeWithSignature("bar()"));
require(success);
}
}
@a2468834
Copy link
Author

This contract has not been audited, so please be careful when you try to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment