The prb library doesn't calculate correct broker fee for tokens with < 18 decimals.
The protocol uses the MAX_BROKER_FEE constant to limit brokers to charging only up to 10% of the total amount as a broker fee when creating streams. However, its value is hardcoded with 18 decimals. Because of this, the Helpers::checkAndCalculateBrokerFee function returns zero broker fee for tokens with < 18 decimals.
Brokers will get 0 fee for tokens with < 18 decimals.
Put this code in any file and run it using command bun run test --mt test_checkAndCalculateBrokerFee -vvv.
Manual Review, Foundry
Make sure the prb library performs correct calculations for tokens with < 18 decimals.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.