What is the benefits from writing repetitive validation as functions instead of modifiers? The documentation clearly recommendations to use modifiers yet 'best practice' open source parties such as open zeppelin use functions some times to validate.
I found below in the general 'crowdsale.sol' contract by openZeppelin
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
The content of the function, why isn't it just moved to a modifier? is it cheaper to implement through function? what is the theory behind this decision.
Therefore, this could be one of the reasons OpenZeppelin prefers input validation via functions.
Can you give an example?
– Mirat Can Bayrak Dec 12 '21 at 10:21