Skip to content

Commit

Permalink
something
Browse files Browse the repository at this point in the history
  • Loading branch information
anoushk1234 committed Dec 2, 2022
1 parent 12227d1 commit 084f07c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 48 deletions.
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

15 changes: 9 additions & 6 deletions contracts/MetaSupporters.sol → contracts/ZoAfterParty.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract MetaSupporters is ERC721URIStorage, Ownable {

constructor() ERC721("Metapass Early Supporters", "MES") {}
contract ZoAfterParty is ERC721URIStorage, Ownable {
constructor() ERC721("ZoAfterParty", "ZOZO") {}

using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;

function mintNFT(address _address, string memory _tokenData) onlyOwner public {
function mintNFT(address _address, string memory _tokenData)
public
onlyOwner
{
_safeMint(_address, _tokenIdCounter.current());
_setTokenURI(_tokenIdCounter.current(), _tokenData);
_tokenIdCounter.increment();
}
function getLastId() public view returns(uint256) {

function getLastId() public view returns (uint256) {
return _tokenIdCounter.current() - 1;
}
}
}
16 changes: 8 additions & 8 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
module.exports = {
solidity: "0.8.4",
networks: {
mumbai: {
url: process.env.ALCHEMY_URL,
accounts: [process.env.PRIVATE_KEY],
},
// mumbai: {
// url: process.env.ALCHEMY_URL,
// accounts: [process.env.PRIVATE_KEY],
// },
mainnet: {
url: process.env.ALCHEMY_MAINNET,
accounts: [process.env.MAINNET_KEY],
}
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_KEY,
},
etherscan:{
apiKey: process.env.ETHERSCAN_KEY
}
};
29 changes: 13 additions & 16 deletions scripts/airdrop.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
const hre = require("hardhat");
const address = require("../airdrop.json");
const axios = require("axios");
const { create, urlSource } = require("ipfs-http-client");
const { create } = require("ipfs-http-client");

async function main() {
const MetaSupporters = await hre.ethers.getContractFactory("MetaSupporters");
const metaSupportersContract = await MetaSupporters.deploy();
const ZoAfterParty = await hre.ethers.getContractFactory("ZoAfterParty");
const zoAfterPartyContract = await ZoAfterParty.deploy();

const ipfs = create({
host: "ipfs.infura.io",
port: 5001,
protocol: "https",
});

await metaSupportersContract.deployed();
await zoAfterPartyContract.deployed();

console.log("Contract deployed to:", metaSupportersContract.address);
console.log("Contract deployed to:", zoAfterPartyContract.address);

for (let i = 0; i < address.length; i++) {
let image = await axios.get(
`http://radiant-caverns-43873.herokuapp.com/voter/person=${
address[i].userName
}&ticket_no=${i + 1}`
);
// let image =
// "https://ipfs.io/ipfs/QmdRu4N8EQWnhPR5R3PmVi8dQTiqmYv7P1SR5SxZErjfZm";

const file = await ipfs.add(urlSource(image.data[0]));
// const file = await ipfs.add(image);

let cid = file.cid.toString();
let cid = "QmdRu4N8EQWnhPR5R3PmVi8dQTiqmYv7P1SR5SxZErjfZm";

let metadata = {
name: "Early supporter NFT for " + address[i].userName,
description: `${address[i].userName}, thank you for being a early supporter for Metapass. Here is a token of our appreciation.`,
name: "ZoWorld After Party Ticket",
description: `Use verify.metapasshq.xyz to check in with this NFT at the event.`,
image: `https://ipfs.io/ipfs/${cid}`,
properties: {
"Ticket Number": i + 1,
},
};

try {
let txn = await metaSupportersContract.mintNFT(
address[i].walletAddress,
let txn = await zoAfterPartyContract.mintNFT(
address[i].address,
JSON.stringify(metadata)
);

Expand Down
17 changes: 0 additions & 17 deletions scripts/deploy-metasupporters.js

This file was deleted.

17 changes: 17 additions & 0 deletions scripts/deploy-zoafterparty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const hre = require("hardhat");

async function main() {
const ZoAfterParty = await hre.ethers.getContractFactory("ZoAfterParty");
const zoAfterPartyContract = await ZoAfterParty.deploy();

await zoAfterPartyContract.deployed();

console.log("Contract deployed to:", zoAfterPartyContract.address);
}

main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit 084f07c

Please sign in to comment.