becrypto/init_scripts/update_stake.js
2023-09-07 18:24:07 +08:00

31 lines
904 B
JavaScript

const stake = artifacts.require("market/ERC721Staking");
const config = require("../config/config");
const base = require("../scripts/base");
module.exports = async function main(callback) {
try {
const stakeInstance = await stake.deployed();
console.log("ERC721Staking successfully deployed.");
console.log("address: " + stakeInstance.address);
const DAYSECONDS = 24 * 60 * 60;
const periods = [
// 30 * DAYSECONDS, // 1 month 2592000
90 * DAYSECONDS, // 3 months 7862400
180 * DAYSECONDS, // 6 months 15724800
360 * DAYSECONDS, // 1 year 31536000
720 * DAYSECONDS, // 2 years 63072000
];
for (let i = 0; i < periods.length; i++) {
await stakeInstance.updatePeriods(periods[i], true);
console.log(`success add period ${periods[i]}`);
}
callback(0);
} catch (err) {
console.log(err);
callback(1);
}
};