Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
test revert on selfdestruct
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Benfield committed Mar 28, 2024
1 parent aeaae5d commit 61add60
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mocks/Program.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import "@openzeppelin/contracts/utils/Strings.sol";
contract ProgramTest {
event Hash(bytes32 result);

function callSelfDestruct(address addr) external {
selfdestruct(payable(addr));
}

function callKeccak(address program, bytes calldata data) external {
// in keccak.rs
// the input is the # of hashings followed by a preimage
Expand Down
11 changes: 11 additions & 0 deletions src/mocks/SelfDestruct.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2022-2023, Offchain Labs, Inc.
// For license information, see https://github.com/nitro/blob/master/LICENSE
// SPDX-License-Identifier: BUSL-1.1

pragma solidity ^0.8.0;

contract SelfDestruct {
function callSelfDestruct(address addr) external {
selfdestruct(payable(addr));
}
}

0 comments on commit 61add60

Please sign in to comment.