Uniswap / v3-periphery

🦄 🦄 🦄 Peripheral smart contracts for interacting with Uniswap v3
https://uniswap.org
GNU General Public License v2.0
1.16k stars 1.08k forks source link

INonfungiblePositionManager import openzeppelin IERC721Metadata #335

Open Seesaem opened 1 year ago

Seesaem commented 1 year ago

The imports of openzeppelin IERC721Metadata and IERC721Enumerable into INonfungiblePositionManager is broken since OpenZeppelin moved these two interfaces into the extensions folder.

Error HH404: File @openzeppelin/contracts/token/ERC721/IERC721Metadata.sol, imported from @uniswap/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol, not found.

boris-lapouga commented 1 year ago

They have it in 0.8 branch, but never finished the migration I assume.

tiantianlikeu commented 1 year ago

What should I do?

ShivaliLN commented 11 months ago

Hi, did you find a solution for this problem? I am facing the same Thakn you

tiantianlikeu commented 11 months ago

Hi, did you find a solution for this problem? I am facing the same Thakn you

1.copy INonfungiblePositionManager.sol to you project,dont use @uniswap/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol

  1. you just need interface function and struct ,remove unwanted integrations and references
NotCoffee418 commented 1 week ago

It's because there's a mismatch between the open-zeppelin version that this project uses and our own (old) version.

import '@openzeppelin/contracts/token/ERC721/IERC721Metadata.sol';

Imports like this in the contract break because it tries to look at the package relative to your node-modules, while this project has it's own node_modules folder it tries to import from. Fix is upgrading open-zeppelin in this project to the latest version and adjusting imports, but I'm guessing there's a good reason that's not being done.

I guess we're left to patchwork imports together as needed.

EDIT: Doensn't look like there's a reason from looking through the issues. Just nobody has done it yet. See #377 for closest relevant issue.