Greetings to all, i amnew to this so please bare with me. i have this issue with ERC1155 smart contract. i went to the wizard and input all my selections but it keeps telling Error: not found .deps/npm/@openzeppelin/contracts.token/ERC115/ERC115;.sol
im not understand what i did wrong
here is my contract to see for yourself.. thank you in advance. btw ive had such a good time with this i might want to actually do this more so please help me..
</>Preformatted text
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NFT is ERC1155, Ownable {
constructor()
ERC1155("")
{}
function setURI(string memory newuri) public onlyOwner {
_setURI(newuri);
}
function mint(address account, uint256 id, uint256 amount, bytes memory data)
public
onlyOwner
{
_mint(account, id, amount, data);
}
function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
public
onlyOwner
{
_mintBatch(to, ids, amounts, data);
}
}
</>Preformatted text
I edited my info out but this is the build. someone please instruct me what to do
hi
i still don't get it what your problem is. i never have any problem with the contract wizard so far.
i try mimicking your selections (plus URI) and here's the result:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract NFT is ERC1155, Ownable {
constructor() ERC1155("ipfs://CID/{id}.json") {}
function setURI(string memory newuri) public onlyOwner {
_setURI(newuri);
}
function mint(address account, uint256 id, uint256 amount, bytes memory data)
public
onlyOwner
{
_mint(account, id, amount, data);
}
function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data)
public
onlyOwner
{
_mintBatch(to, ids, amounts, data);
}
}
and it works fine on remix.
its telling me this
Error: not found .deps/npm/@openzeppelin/contracts.token/ERC115/ERC115;.sol
idk what to do even when i posted the one from above it still gives me the same error. what do it do?
i did the same thing with yours on contract wizard and then opened and compiled it on Remix.
but here's my assumptions based on your sentences:
after you create on the contract wizard:
-
you copy paste (c/p) the code and create new .sol file on your contracts folder on your hardhat project directory and try to compile the file. if yes, most likely you forgot to install the openzeppelin contracts dependency
-
you c/p the code and create new.sol file on an empty folder on your IDE without any dependencies. it will give a warning:
Source "@openzeppelin/contracts/token/ERC1155/ERC1155.sol" not found: File import callback not supported
hope it helps.
Well I think i figured out that problem. The only issue now is when I go to deploy my contract in remix it tells me the contract is abstract and now im trying to figure out what all this means.
most likely you choose the wrong contract to deploy (i.e Ownable.sol). make sure u choose the child/customize contract (your contract file from the wizard).