diff --git a/init_scripts/update_stake.js b/init_scripts/update_stake.js new file mode 100644 index 0000000..1bdd205 --- /dev/null +++ b/init_scripts/update_stake.js @@ -0,0 +1,30 @@ +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); + } +}; diff --git a/package.json b/package.json index 5e32c79..f73535c 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "candy_deploy:test": "truffle migrate --network arbitrum_testnet -f 17 --to 17 --compile-none", "candy_deploy:one": "truffle migrate --network arbitrum_one -f 17 --to 17 --compile-none", "stake_deploy:one": "truffle migrate --network arbitrum_one -f 9 --to 9 --compile-none", + "update:stake": "npx truffle exec --network arbitrum_one ./init_scripts/update_stake.js", "size": "truffle run contract-size" }, "author": "",