In Ethernaut level 7, Force, the goal is to give a contract ETH even though it has no payable receive or fallback function. We'll use a Foundry helper in the SCH CTF Arena to send it one wei without executing its code.
Contract overview
The target intentionally has no state variables or external functions:
contract Force {
/* The goal is to make this contract's balance greater than zero. */
}
There is no receive() or payable fallback() to accept an ordinary ETH transfer. The verifier checks only that address(target).balance is greater than zero after the exploit.
Send ETH without calling the target
An ordinary call with value and empty calldata reverts when the recipient has neither a receive function nor a payable fallback. The EVM also has a balance-transfer path that does not execute recipient code: a contract can terminate with selfdestruct and designate Force as the beneficiary.
The helper below is funded at deployment. Its constructor immediately sends that balance to Force:
contract ForceSender {
constructor(address payable target) payable {
selfdestruct(target);
}
}
function run() external {
vm.startBroadcast(PLAYER_PRIVATE_KEY);
new ForceSender{value: 1 wei}(payable(address(forceInstance)));
vm.stopBroadcast();
}
The transfer does not invoke code on forceInstance. One wei is enough because the verifier requires a positive balance, not a particular amount.
Run and verify it
The Arena supplies forceInstance and the player key. Paste the snippet and select Check answer. The verifier checks the fresh target's balance.
The control transfer reverts and leaves the target empty. The helper constructor succeeds and sends one wei.
What selfdestruct does on current networks
EIP-6780 changed SELFDESTRUCT on Cancun-enabled networks. It still transfers the contract's ETH, but generally no longer deletes the code and storage of a contract that existed before the current transaction. The special deletion behavior remains when a contract is created and destroyed in the same transaction.
This helper uses selfdestruct in its constructor, so its balance transfer works under either behavior. The lesson does not depend on deleting a previously deployed contract.
For applications, do not treat address(this).balance as a complete deposit ledger. Forced ETH can make it exceed tracked deposits. Keep accounting in explicit state and define how excess balance is handled.
Watch the walkthrough
Watch on YouTube if the embedded player is unavailable.
Challenge source: OpenZeppelin Ethernaut Force. See EIP-6780 for the current SELFDESTRUCT semantics, or solve Force in the Arena.