forked from evmos/ethermint
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
164 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
contract EIP161Test { | ||
function selfDestructTo(address target) public { | ||
// This contract will self-destruct and send its balance to the target address | ||
selfdestruct(payable(target)); | ||
} | ||
|
||
function callAccount(address target) public payable returns (bytes memory) { | ||
(bool success, bytes memory data) = target.call{value: msg.value}(""); | ||
require(success, "Failed to call empty account with value"); | ||
|
||
return data; | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"abi": "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"callAccount\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"selfDestructTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", | ||
"bin": "608060405234801561001057600080fd5b506103bb806100206000396000f3fe6080604052600436106100295760003560e01c80636f43e2db1461002e578063a28bf7cc1461005e575b600080fd5b610048600480360381019061004391906101bd565b610087565b604051610055919061027a565b60405180910390f35b34801561006a57600080fd5b50610085600480360381019061008091906101bd565b610141565b005b60606000808373ffffffffffffffffffffffffffffffffffffffff16346040516100b0906102cd565b60006040518083038185875af1925050503d80600081146100ed576040519150601f19603f3d011682016040523d82523d6000602084013e6100f2565b606091505b509150915081610137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161012e90610365565b60405180910390fd5b8092505050919050565b8073ffffffffffffffffffffffffffffffffffffffff16ff5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061018a8261015f565b9050919050565b61019a8161017f565b81146101a557600080fd5b50565b6000813590506101b781610191565b92915050565b6000602082840312156101d3576101d261015a565b5b60006101e1848285016101a8565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610224578082015181840152602081019050610209565b60008484015250505050565b6000601f19601f8301169050919050565b600061024c826101ea565b61025681856101f5565b9350610266818560208601610206565b61026f81610230565b840191505092915050565b600060208201905081810360008301526102948184610241565b905092915050565b600081905092915050565b50565b60006102b760008361029c565b91506102c2826102a7565b600082019050919050565b60006102d8826102aa565b9150819050919050565b600082825260208201905092915050565b7f4661696c656420746f2063616c6c20656d707479206163636f756e742077697460008201527f682076616c756500000000000000000000000000000000000000000000000000602082015250565b600061034f6027836102e2565b915061035a826102f3565b604082019050919050565b6000602082019050818103600083015261037e81610342565b905091905056fea2646970667358221220cfb5ccd351026e6ecddfda020c8ce00e3714e0a5722fd897396563e259d8b1db64736f6c63430008180033" | ||
} |
This file contains 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
This file contains 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