function recoverContribution() public payable{
require(hasDeadlinePassed(), "deadline has not passed, contributions cannot be recovered rightnow");
require(!(address(this).balance >= minimumTarget), "target has been met, cannot recover contributions now");
require(contributors[msg.sender] != 0, "you have not contributed anything");
payable(msg.sender).transfer(contributors[msg.sender]);
contributors[msg.sender] = 0;
}
The above function is called by a contributor to recover his/her funds incase the target has not been met and the dead line has passed.
this function gives a reentrancy error and a gas cost infinite error.
this function is extremely simple why would this function exhibit such potential errors?