Omniscia Nexera Audit

PropWrappedAssetsFeeCollectorFacet Manual Review Findings

PropWrappedAssetsFeeCollectorFacet Manual Review Findings

PWA-01M: Invalid Function Requirement Documentation

Description:

The referenced function requirement that is documented is not actually enforced by the PropWrappedAssetsFeeCollectorFacetStorage::initWrappedAssetsFeeCollectorFacet function.

Example:

packages/contracts/contracts/privateFacets/preFractionsFacets/PropWrappedAssetsFeeCollectorFacet.sol
47/**
48 * @notice Initializes the `PropWrappedAssetsFeeCollectorFacetStorage` by registering the eligible fee collector and the fee rate
49 * to be applied to campaigns' wrapped assets.
50 *
51 * @dev For example, if the `feeRate` is set to 10%, then a campaign wrapping 100 ERC20 $token will result in 10 $token
52 * being transferred to the `feeCollector` when the campaign is created.
53 *
54 * IMPORTANT:
55 * - Rates and percentages are represented with a base of 10^6 (e.g., 0.1 -> 10% is `100000`).
56 * - `feeCollector` cannot be set to the zero address.
57 *
58 * Emits a {PreFractionFeeSchemaInitialized} event.
59 *
60 * This function can only be called by the Admin (see `AccessControlFacet.sol`).
61 *
62 * @param initWrappedAssetsFeeCollectorData ABI-encoded data containing:
63 * - `feeCollector`: The eligible address that will be receiving the fees (if any).
64 * - `feeRate`: The rate defining what portion of a campaign’s wrapped assets is charged as a fee.
65 */
66function initWrappedAssetsFeeCollectorFacet(bytes calldata initWrappedAssetsFeeCollectorData) external onlyExternalDelegateCall {
67 address account = ERC2771RecipientStorage.layout()._msgSender();
68 if (!AccessControlFacetStorage.layout().hasRole(AccessControlFacetStorage.ADMIN_ROLE, account))
69 revert UnauthorizedInitialization(account);
70
71 (address feeCollector_, uint256 feeProportion_) = PropWrappedAssetsFeeCollectorFacetStorage
72 .layout()
73 .initWrappedAssetsFeeCollectorFacet(initWrappedAssetsFeeCollectorData);
74
75 emit PreFractionFeeSchemaInitialized(feeCollector_, feeProportion_);
76}

Recommendation:

We advise either the documentation or the code to be updated, either of which we consider acceptable.

Alleviation (d682057ecb0e254069773d64f32c068cedb71e2a):

The documentation of the function has been corrected to match its implementation, addressing this exhibit.