-
Notifications
You must be signed in to change notification settings - Fork 0
/
mint.js
28 lines (23 loc) · 935 Bytes
/
mint.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require('dotenv').config();
const PUBLIC_KEY = process.env.PUBLIC_KEY;
async function main() {
const accounts = await ethers.provider.listAccounts();
console.log("Configured accounts:", accounts);
// ENFT contract address deployed in rinkeby
const address = process.env.ENFT_ADDRESS;
const factory = await ethers.getContractFactory("ENFT");
const contract = factory.attach(address);
// mint token for flogo.json
await contract.mintNFT(PUBLIC_KEY, "https://ipfs.io/ipfs/QmUqfxdhwktSbuz8kc8rVmWDPP6xUgrwaBAEd3KrKtxfkZ");
// mint token for tibcolab.json
await contract.mintNFT(PUBLIC_KEY, "https://ipfs.io/ipfs/Qme3QJ9H43kVDDRNrVtbJXo5uUuzqWY2JJyfkqfEHRozf6");
// get total count
value = await contract.getCount();
console.log("ENFT count is", value.toString());
}
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});