generated from scaffold-eth/scaffold-eth-2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4effba
commit 4e327b1
Showing
4 changed files
with
84 additions
and
141 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
packages/hardhat/contracts/SpotifyWrappedNft/WrappedNFTBase.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
packages/hardhat/deploy/02_deploy__Wrapped_NFT_Contract.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]; |