Last active
May 16, 2022 02:03
-
-
Save a2468834/8ef14958acb0637617caea373a6cc254 to your computer and use it in GitHub Desktop.
2022-05-16 HSNL Paper Meeting
This file contains hidden or 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: 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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This contract has not been audited, so please be careful when you try to use it.