Summary
On FeeCollector::_initializeFeeTypes#L388C1-L393C12, feeTypes[7] is been set.
But it will get the wrong values on deployment.
Vulnerability Details
when the BASIS_POINTS is 10_000,
The values are set totally wrong.
FeeCollector::_initializeFeeTypes#L388C1-L393C12
* @dev Initializes default fee types according to protocol rules
*/
function _initializeFeeTypes() internal {
feeTypes[0] = FeeType({
veRAACShare: 8000,
burnShare: 0,
repairShare: 0,
treasuryShare: 2000
});
388:: feeTypes[7] = FeeType({
veRAACShare: 500,
burnShare: 0,
repairShare: 1000,
treasuryShare: 500
393:: });
}
Impact
The feeType will get the wrong state on deployment. As this will be used in the calculation, it will be a loss of funds.
Tools Used
Manual review
Recommendations
2% total which should be 200.
The 0.5% should be 50 when the BASIS_POINTS is 10_000.
The 1% should be 100
```Solidity
/**
* @dev Initializes default fee types according to protocol rules
*/
function _initializeFeeTypes() internal {
// Protocol Fees: 80% to veRAAC holders, 20% to treasury
feeTypes[0] = FeeType({
veRAACShare: 8000, // 80%
burnShare: 0,
repairShare: 0,
treasuryShare: 2000 // 20%
});
// ...OTHER_CODES...
// NFT Royalty Fees (2% total)
388:: feeTypes[7] = FeeType({ // @audit wrong value
- veRAACShare: 500, // 0.5%
+ veRAACShare: 50, // 0.5%
burnShare: 0,
- repairShare: 1000, // 1.0%
+ repairShare: 100, // 1.0%
- treasuryShare: 500 // 0.5%
+ treasuryShare: 50 // 0.5%
393:: });
// ..OTHER_CODES...
}