2

So, I'm trying to compile in truffle some open zeppelin ERC20 contracts, but I get the following error:

Error: Error: Could not find import from any sources; imported from C:/Users/Angel/Documents/blockchain course/ethereum game/solidity/contracts/GameToken.sol at Object.compile (C:\Users\Angel\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\legacy\index.js:72:1)

Token file:enter image description here

Migration file: enter image description here

Any ideas? Thanks!

2 Answers2

1

Regarding the documentation, the correct imports are

import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721Mintable.sol";
Emmanuel Collin
  • 2,556
  • 2
  • 10
  • 17
  • When I switch the library from `openzeppelin-solidity` -> `@openzeppelin`, the only difference is the pat that the error complains about. Now getting `Could not find @openzeppelin/contracts/token/ERC20/ERC20Detailed.sol from any sources`. – quickshiftin Sep 12 '20 at 21:23
0

For those interested, asked the question on the openzeppelin forums and found a solution:

https://forum.openzeppelin.com/t/could-not-find-import-from-any-sources-error/2656/5