<!-- canonical: https://0xsimao.com/findings/nftperp-i-price-isn-valid-keeper -->

# PriceFeed: First owner isn't set as valid keeper

Low/Info · Three Sigma · NFT perpetuals · 2nd January, 2024

Finding 3S-NFTPerp-N03 of the Nftperp Exchange security review.

- Report: /reports/nftperp-i
- Source: https://cdn.sanity.io/files/qoqld077/production/c19530de75e234ad15694b4563edb1fc9d2a3fd8.pdf

---

### Description

When [changing contract owner](https://github.com/nftperp/NFTPerp-V2-Contracts/blob/1c16f2010a851ac23aec73822d55388901bbe5e7/src/PriceFeed.sol#L129-L139), the keeper permission of the previous owner is revoked,
and this permission is given to the new owner. The issue is that during initialization, the
initial owner isn't given this privilege, so they must then call setValidKeeper() to set
themselves (or some other address) as a valid keeper.

### Recommendation

Since the owner should have the power to directly perform keeper operations, and for
consistency with the function transferOwnership(), it is recommended that this
permission is given during ownership initialization, [line 45](https://github.com/nftperp/NFTPerp-V2-Contracts/blob/1c16f2010a851ac23aec73822d55388901bbe5e7/src/PriceFeed.sol#L45).

### Status

Acknowledged

---

Related findings:

- [Missing priceFeedDisabled event in RedStonePriceFeedBase](https://0xsimao.com/findings/felix-price-disabled-red-stone): Felix Price Feeds
- [Attacker can trigger temporary shutdown due to RedStonePriceFeedBase missing gas check](https://0xsimao.com/findings/felix-temporary-shutdown-price-gas): Felix Price Feeds
- [Any signature is valid before the issuer address is set](https://0xsimao.com/findings/districtone-signature-valid-issuer-address): DistrictOne
