initial SELFDESTRUCT support (#400)

Note:
- The unstable interface in `v2509.0.0` of `polkadot-sdk` is required.
- The differential test fails against EVM in `v2509.0.0` of
`polkadot-sdk`.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-11-03 15:04:04 +01:00
committed by GitHub
parent c0cdde5a5a
commit 70037e1136
8 changed files with 97 additions and 31 deletions
@@ -98,26 +98,3 @@ contract ExternalCodeCopy {
build_solidity(sources(&[("test.sol", code)])).unwrap();
}
#[test]
#[should_panic(expected = "The `SELFDESTRUCT` instruction is not supported")]
fn selfdestruct_yul() {
let solidity = r#"
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MinimalDestructible {
address payable public owner;
constructor() {
owner = payable(msg.sender);
}
function destroy() public {
require(msg.sender == owner, "Only the owner can call this function.");
selfdestruct(owner);
}
}"#;
build_solidity(sources(&[("test.sol", solidity)])).unwrap();
}