UpdateWeightRunner.sol uses a bitmask for poolRuleSettings which authorize actions such as setWeightsManually. As a bitmask, both the MASK_POOL_OWNER_UPDATES and MASK_POOL_QUANTAMM_ADMIN_UPDATES may be enabled at the same time. It seems like allowing both would be desirable.
However the implementations checking authorization will only consider the poolManager when MASK_POOL_OWNER_UPDATES:
Source: UpdateWeightRunner.sol#L317-L321 (plus 2 other instances)
Recommendation: Update these checks to allow calls from either the poolManager or quantammAdmin when both flags are enabled. e.g.
UpdateWeightRunner inherits Ownable2Step but does not use ownerUpdateWeightRunner.sol inherits Ownable2Step however it does not grant the owner account any permissions. Instead a different variable is used: quantammAdmin.
Recommendation: Either remove Ownable2Step to avoid confusion or merge the variables so they use the same data slot (effectively just branding the "owner" to a more meaninful name), e.g.:
setQuantAMMSwapFeeTake and setQuantAMMUpliftFeeTake impact the same data slotUpdateWeightRunner.sol has 2 functions which sound like they offer granular control over fees - however they share the same variable. So changing the "uplift fee" also changes the "swap fee" and vice versa. The functions and the events emitted imply separate configurations.
Recommendation: Either collapse into a single setQuantAMMFeeTake (for both swap and uplift) to avoid confusion, or change the implementation to use separate data slots for each, e.g.:
nftPool is not deleted after remove liquidityTests for UpliftOnlyExample.sol include the following assertion after removing liquidity:
Source UpliftExample.t.sol#L518 (plus an additional 4 tests with the same assertion).
However the tests are invalid due to an incorrect tokenId. The NFT tokenIds start with 1 (tokenID 0 is not valid).
Source UpliftExample.t.sol#L455 (& others)
If you fix the tokenId (uint256 nftTokenId = 1;), tests will fail.
Recommendation: It is trivial to add the logic this is testing for, and doing so would reduce gas costs as well:
QuantAMMStorage.sol#L214-L222 has a for loop which can be collapsed into a single line for better readability and lower gas costs: nonStickySourceLength = _sourceArray.length - (_sourceArray.length % 8);
QuantAMMWeightedPoolFactory.sol#L60 _poolVersion cannot be changed and therefor can be made immutable.
Spelling errors appear in the external interface. I recommend using CSpell which you can configure to target just .sol files and after adding a few custom terms such as quantamm it can become a required step in CI. Example spelling errors: event OracleRemved and error TransferUpdateTokenIDInvaid
Likelyhood: High, calling setters or getters Impact: Low/Medium, both getters return `quantAMMSwapFeeTake` and `setQuantAMMUpliftFeeTake` modify `quantAMMUplfitFeeTake`. Real impact: those 2 values will be always the same.
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.