Skip to content

Commit

Permalink
deployWrapped Nft File and contract
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifechukwudaniel committed Dec 14, 2023
1 parent a4effba commit 4e327b1
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 141 deletions.
63 changes: 0 additions & 63 deletions packages/hardhat/contracts/APIconsumer.sol

This file was deleted.

43 changes: 43 additions & 0 deletions packages/hardhat/contracts/SpotifyWrappedNft/WrappedNFTBase.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

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/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";



contract WrappedNFTBase is ERC721, ERC721URIStorage, ERC721Burnable, Ownable {
uint256 private _nextTokenId;

constructor(string memory _name, string memory _symbol)
ERC721(_name, _symbol)
Ownable(msg.sender)
{}

function safeMint(address to, string memory uri) public onlyOwner {
uint256 tokenId = _nextTokenId++;
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
}

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

function supportsInterface(bytes4 interfaceId)
public
view
override(ERC721, ERC721URIStorage)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}
78 changes: 0 additions & 78 deletions packages/hardhat/contracts/YourContract.sol

This file was deleted.

41 changes: 41 additions & 0 deletions packages/hardhat/deploy/02_deploy__Wrapped_NFT_Contract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";

const deployERC721FactoryContract: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployer } = await hre.getNamedAccounts();
const { deploy } = hre.deployments;

await deploy("WrappedNFTBase", {
from: deployer,
args: ["Spotify Wrapped 2023", "WRAP2023"],
log: true,
autoMine: true,
});

await deploy("WrappedNFTBase", {
from: deployer,
args: ["Spotify Wrapped Song", "SONGWRAP2023"],
log: true,
autoMine: true,
});

await deploy("WrappedNFTBase", {
from: deployer,
args: ["Spotify Wrapped Artist", "ARTWRAP2023"],
log: true,
autoMine: true,
});

await deploy("WrappedNFTBase", {
from: deployer,
args: ["Spotify Wrapped Genre", "GENWRAP2023"],
log: true,
autoMine: true,
});
};

export default deployERC721FactoryContract;

// Tags are useful if you have multiple deploy files and only want to run one of them.
// e.g. yarn deploy --tags YourContract
deployERC721FactoryContract.tags = ["WrappedNFTContract"];

0 comments on commit 4e327b1

Please sign in to comment.