In the VaultImplementation, function commitToLien is called for lifecycle of new loan origination.
which calls:
which calls:
which calls:
If the feeTo address is set, the code will query the protocol fee and deduct from the amount.
which calls ROUTER().getProtocolFee(amount)
note that the s.protocolFeeNumerator and s.protocolFeeDenominator is not set in the init function of the AstariaRouter.sol, so if the feeTo address is set, transaction of commitToLien revert in division by zero error because s.protocolFeeDenominator is 0.
In fact, if we look into getLiquidatorFee and getBuyoutFee
If the s.buyoutFeeDenominator and s.liquidationFeeDenominator is 0, the divison by zero error can also occur, but these parameter is set in the init function of the AstariaRouter.sol
but s.protocolFeeNumerator and s.protocolFeeDenominator is not set in the init function of the AstariaRouter.sol is not set in the init function of the AstariaRouter.sol
We recommend the protocol set the feeTo address and s.protocolFeeNumerator and s.protocolFeeDenominator together.
Also validate the buyout fee, liqudatior fee and protocol fees dominator are not 0 to avoid division by zero error.
