contracts-imtbl/deploy/12_deploy_simple_stake.ts
2025-01-15 13:26:15 +08:00

45 lines
1.4 KiB
TypeScript

import { HardhatRuntimeEnvironment } from "hardhat/types";
import { DeployFunction } from "hardhat-deploy/types";
import { deplayOne, updateArray } from "../scripts/utils"
import { expandDecimals } from "../test/shared/utilities";
const deployTokenMall: 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}`);
const {cec} = config.staking;
const startTime = Date.now() / 1000 | 0;
const endTime = startTime + 2 * 24 * 60 * 60;
// 正式的用如下代码
/**
let startDate = new Date()
startDate.setUTCFullYear(2025)
startDate.setUTCMonth(0)
startDate.setUTCDate(16)
startDate.setUTCHours(10, 0, 0, 0)
const startTime = startDate.getTime() / 1000 | 0;
let endDate = new Date()
endDate.setUTCFullYear(2025)
endDate.setUTCMonth(1)
endDate.setUTCDate(15)
endDate.setUTCHours(10, 0, 0, 0)
const endTime = endDate.getTime() / 1000 | 0;
*/
const simpleStake = await deplayOne({
hre,
name: "simpleStake",
type: "logic",
contractName: "SimpleStake",
args: [cec, startTime, endTime, expandDecimals(20000000, 18)],
verify: true,
});
};
deployTokenMall.tags = ["SimpleStake"];
export default deployTokenMall;