change deployement to FavNb

This commit is contained in:
Clement 2023-08-14 15:47:13 +02:00
parent 285cca664a
commit 4e0cd86bd4

View File

@ -4,21 +4,29 @@
// You can also run a script with `npx hardhat run <script>`. If you do that, Hardhat // You can also run a script with `npx hardhat run <script>`. If you do that, Hardhat
// will compile your contracts, add the Hardhat Runtime Environment's members to the // will compile your contracts, add the Hardhat Runtime Environment's members to the
// global scope, and execute the script. // global scope, and execute the script.
import hre from "hardhat"; import hre from "hardhat";
const currentTimestampInSeconds = Math.round(Date.now() / 1000); const FavoriteNumber = await hre.ethers.getContractFactory("FavoriteNumber");
const unlockTime = currentTimestampInSeconds + 60; const favoriteNumber = await FavoriteNumber.deploy();
const lockedAmount = hre.ethers.parseEther("0.001"); await favoriteNumber.deployed();
const lock = await ethers.deployContract("Lock", [unlockTime], { console.log("FavoriteNumber deployed to:", favoriteNumber.address);
value: lockedAmount,
});
await lock.waitForDeployment(); // const currentTimestampInSeconds = Math.round(Date.now() / 1000);
// const unlockTime = currentTimestampInSeconds + 60;
console.log( // const lockedAmount = hre.ethers.parseEther("0.001");
`Lock with ${ethers.formatEther(
lockedAmount // const lock = await ethers.deployContract("Lock", [unlockTime], {
)}ETH and unlock timestamp ${unlockTime} deployed to ${lock.target}` // value: lockedAmount,
); // });
// await lock.waitForDeployment();
// console.log(
// `Lock with ${ethers.formatEther(
// lockedAmount
// )}ETH and unlock timestamp ${unlockTime} deployed to ${lock.target}`
// );