contract ReentrancyGuard {
    // true while protected code is being executed, false otherwise
    bool private locked = false;

    /**
      * @dev ensures instantiation only by sub-contracts
    */
    constructor() internal {}

    // protects a function against reentrancy attacks
    modifier protected() {
        _protected();
        locked = true;
        _;
        locked = false;
    }

    // error message binary size optimization
    function _protected() internal view {
        require(!locked, "ERR_REENTRANCY");
    }
}
/**
 * @dev ReentrancyGuard
 *
 * The contract provides protection against re-entrancy - calling a function (directly or
 * indirectly) from within itself.
 */
function _protected() internal view {
    require(!locked, "ERR_REENTRANCY");
}

// error message binary size optimization