Skip to content

Commit

Permalink
fix: update file path
Browse files Browse the repository at this point in the history
  • Loading branch information
TomatoDroid committed Oct 24, 2024
1 parent a8ed1da commit 593d22f
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
67 changes: 67 additions & 0 deletions packages/hardhat/contracts/YourCollectible.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2; //Do not change the solidity version as it negatively impacts submission grading

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract YourCollectible is
ERC721,
ERC721Enumerable,
ERC721URIStorage,
Ownable
{
using Counters for Counters.Counter;

Counters.Counter public tokenIdCounter;

constructor() ERC721("YourCollectible", "YCB") {}

function _baseURI() internal pure override returns (string memory) {
return "https://ipfs.io/ipfs/";
}

function mintItem(address to, string memory uri) public returns (uint256) {
tokenIdCounter.increment();
uint256 tokenId = tokenIdCounter.current();
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
return tokenId;
}

// The following functions are overrides required by Solidity.

function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId,
uint256 quantity
) internal override(ERC721, ERC721Enumerable) {
super._beforeTokenTransfer(from, to, tokenId, quantity);
}

function _burn(
uint256 tokenId
) internal override(ERC721, ERC721URIStorage) {
super._burn(tokenId);
}

function tokenURI(
uint256 tokenId
) public view override(ERC721, ERC721URIStorage) returns (string memory) {
return super.tokenURI(tokenId);
}

function supportsInterface(
bytes4 interfaceId
)
public
view
override(ERC721, ERC721Enumerable, ERC721URIStorage)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}
2 changes: 1 addition & 1 deletion packages/hardhat/deploy/99_generateTsAbis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function getContractDataFromDeployments() {
*/
const generateTsAbis: DeployFunction = async function () {
// const TARGET_DIR = "../nextjs/contracts/";
const TARGET_DIR = "../../nuxt/contracts/";
const TARGET_DIR = "../nuxt/contracts/";
const allContractsData = getContractDataFromDeployments();

const fileContent = Object.entries(allContractsData).reduce((content, [chainId, chainConfig]) => {
Expand Down

0 comments on commit 593d22f

Please sign in to comment.