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

test revert on selfdestruct #33

Open
wants to merge 1 commit into
base: stylus
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
}
}
Loading