creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "contracts/ReentrancyGuard.sol": {
        "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\n\npragma solidity ^0.8.0;\n\nabstract contract ReentrancyGuard {\n    uint256 private constant _NOT_ENTERED = 1;\n    uint256 private constant _ENTERED = 2;\n\n    uint256 private _status;\n\n    constructor() {\n        _status = _NOT_ENTERED;\n    }\n\n    /**\n     * @dev Prevents a contract from calling itself, directly or indirectly.\n     */\n    modifier nonReentrant() {\n        // On the first call to nonReentrant, _notEntered will be true\n        require(_status != _ENTERED, \"ReentrancyGuard: reentrant call\");\n\n        // Any calls to nonReentrant after this point will fail\n        _status = _ENTERED;\n\n        _;\n\n        // By storing the original value once again, a refund is triggered (see\n        // https://eips.ethereum.org/EIPS/eip-2200)\n        _status = _NOT_ENTERED;\n    }\n}\n"
      },
      "contracts/crowdfund.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.9;\n\nimport \"./ReentrancyGuard.sol\";\n\ncontract crowdfunding is ReentrancyGuard {\n    address private  immutable owner; \n    uint256 public minimumContribution;\n    uint256 public totalContribution;\n    uint256 public targetGoal;\n    bool private stopped = false;\n\n\n    mapping (address => uint256) public contributions;\n\n    event DonationReceived(address backer, uint256 amount);\n    event FundsWithdrawn(address owner, uint256 amount);\n\n\n    constructor(){\n       owner = msg.sender;\n        minimumContribution = 1000000000000000 wei;\n        targetGoal = 100 ether;\n    }\n\n    modifier onlyOwner(){\n        require(msg.sender == owner, \"only the owner can call this function\");\n        _;\n    }\n\n    modifier stopInEmergency { require(!stopped, \"Contract is stopped\"); _; }\n\n    \n\n\n   function donate() public payable nonReentrant  stopInEmergency{\n        require(msg.value >= minimumContribution, \"Donation below minimum standart contribution\");\n\n        contributions[msg.sender] += msg.value;\n        totalContribution += msg.value;\n\n        emit DonationReceived(msg.sender, msg.value);\n    }\n\n    function withdraw() public nonReentrant onlyOwner  {\n    uint256 amount = address(this).balance;\n    require(amount > 0, \"No funds to withdraw\");\n\n     emit FundsWithdrawn(owner, amount);\n\n    (bool sent, ) = owner.call{value: amount}(\"\");\n    require(sent, \"Failed to send Ether\");\n}\n   \n    function toggleCircuitBreaker() external onlyOwner {\n    stopped = !stopped;\n}\n}"
      }
    },
    "settings": {
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "evmVersion": "london",
      "remappings": [],
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      }
    }
  }}