36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
import { DeployFunction } from "hardhat-deploy/types";
|
|
import { updateArray } from "../scripts/utils"
|
|
|
|
const deployNFTForGame: DeployFunction =
|
|
async function (hre: HardhatRuntimeEnvironment) {
|
|
const provider = hre.ethers.provider;
|
|
const from = await (await provider.getSigner()).getAddress();
|
|
const config = require(`../config/config_${hre.network.name}`);
|
|
console.log(config);
|
|
const owner = from;
|
|
const name = "CFHero";
|
|
const symbol = "CFH";
|
|
// testnet: 0x6b969FD89dE634d8DE3271EbE97734FEFfcd58eE
|
|
// mainnet: 0x5F5EBa8133f68ea22D712b0926e2803E78D89221
|
|
const { operatorAllowlist } = config.imtbl;
|
|
const { royaltyReceiver, feeNumerator, baseURI, contractURI } = config.token;
|
|
const ret = await hre.deployments.deploy("CFNFTGame", {
|
|
from,
|
|
args: [owner, name, symbol, baseURI, contractURI, operatorAllowlist, royaltyReceiver, feeNumerator],
|
|
log: true,
|
|
});
|
|
console.log("==CFNFTGame addr=", ret.address);
|
|
updateArray({
|
|
name: "CFHero",
|
|
type: "erc721",
|
|
json: "assets/contracts/CFNFTGame.json",
|
|
address: ret.address,
|
|
network: hre.network.name,
|
|
});
|
|
};
|
|
|
|
deployNFTForGame.tags = ["CFNFTGame"];
|
|
|
|
export default deployNFTForGame;
|