Part 2

Zaros
PerpetualsDEXFoundrySolidity
70,000 USDC
View results
Submission Details
Severity: low
Invalid

Inconsistent implementation of ERC-7201 Namespaced Storage locations

Summary

Currently, UsdTokenSwapKeeper.sol and FeeConversionKeeper.sol does not follow the NatSpec tag specification that should be annotated to the contract's struct for ERC-7201. The UsdTokenSwapKeeperStorage namespace tag is @custom:storage-location erc7201:fi.zaros.external.chainlink.UsdTokenSwapKeeper and has the formula keccak256(abi.encode(uint256(keccak256("fi.zaros.external.chainlink.keepers.UsdTokenSwapKeeper")) - 1)) & ~bytes32(uint256(0xff));. This is incorrect according to ERC-7201:

A namespace in a contract should be implemented as a struct type. These structs should be annotated with the NatSpec tag @custom:storage-location <FORMULA_ID>:<NAMESPACE_ID>, where <FORMULA_ID> identifies a formula used to compute the storage location where the namespace is rooted, based on the namespace id.

Recommended Mitigation

Consider changing the namespace tag to @custom:storage-location erc7201:fi.zaros.external.chainlink.keepers.UsdTokenSwapKeeper to properly follow the ERC-7201 specification. Same thing goes for FeeConversionKeeper.sol

[src/external/chainlink/keepers/usd-token-swap-keeper/UsdTokenSwapKeeper.sol]
13 /// @notice ERC7201 storage location.
14 bytes32 internal constant USDZ_SWAP_KEEPER_LOCATION = keccak256(
15 abi.encode(uint256(keccak256("fi.zaros.external.chainlink.keepers.UsdTokenSwapKeeper")) - 1)
16 ) & ~bytes32(uint256(0xff));
17
18 string public constant DATA_STREAMS_FEED_LABEL = "feedIDs";
19 string public constant DATA_STREAMS_QUERY_LABEL = "timestamp";
20
- 21 /// @custom:storage-location erc7201:fi.zaros.external.chainlink.UsdTokenSwapKeeper
+ 21 /// @custom:storage-location erc7201:fi.zaros.external.chainlink.keepers.UsdTokenSwapKeeper
22 /// @param marketMakingEngine The address of the MarketMakingEngine contract.
23 /// @param streamId The Chainlink Data Streams stream id.
24 struct UsdTokenSwapKeeperStorage {
25 IMarketMakingEngine marketMakingEngine;
26 address asset;
27 string streamId;
28 }
[src/external/chainlink/keepers/fee-conversion-keeper/FeeConversionKeeper.sol]
17 /// @notice ERC7201 storage location.
18 bytes32 internal constant FEE_CONVERSION_KEEPER_LOCATION = keccak256(
19 abi.encode(uint256(keccak256("fi.zaros.external.chainlink.keepers.FeeConversionKeeper")) - 1)
20 ) & ~bytes32(uint256(0xff));
21
- 22 /// @custom:storage-location erc7201:fi.zaros.external.chainlink.FeeConversionKeeper
+ 22 /// @custom:storage-location erc7201:fi.zaros.external.chainlink.keepers.FeeConversionKeeper
23 /// @param marketMakingEngine The address of the MarketMakingEngine contract.
24 struct FeeConversionKeeperStorage {
25 IMarketMakingEngine marketMakingEngine;
26 uint128 dexSwapStrategyId;
27 uint128 minFeeDistributionValueUsd;
28 }

Similar finding acknowledged as Low

Updates

Lead Judging Commences

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.