Help with ERC721 token etherscan verification

I'm trying to verify my test contract on etherscan and I am trying to flatten my solidity file.

:1234: Code to reproduce

truffle-flattener ./contracts/BlockHead.sol > Flat.sol

github link:


E:\Main Data\Project Files\web3\solidity\nft2>truffle-flattener ./contracts/BlockHead.sol > Flat.sol
Error: ENOENT: no such file or directory, open 'e:/Main%20Data/Project%20Files/web3/solidity/nft2/node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol'
at async getSortedFilePaths (C:\Users\Justin\AppData\Roaming\npm\node_modules\truffle-flattener\index.js:83:5)
    at async flatten (C:\Users\Justin\AppData\Roaming\npm\node_modules\truffle-flattener\index.js:188:23)
    at async main (C:\Users\Justin\AppData\Roaming\npm\node_modules\truffle-flattener\index.js:245:3) {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'e:/Main%20Data/Project%20Files/web3/solidity/nft2/node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol'

Contract Address: 0xd6ACa905E045c0A7c91493e16bD7728DF2B8C16d

:computer: Environment

Truffle v5.5.3
Solc 0.8.12


npm uninstall @openzeppelin/contracts
npm cache clean --force
npm cache verify
npm i @openzeppelin/contracts

Sorry not sure why this would fail. Have you tried other methods in our guide?

1 Like

Thank you for the link
This truffle plugin worked for me: