-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed: alias mapping public, owner -> Ownable
- Loading branch information
1 parent
965b1f1
commit f3c2cb2
Showing
9 changed files
with
207 additions
and
352 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import { ethers } from "hardhat"; | ||
import { ethers } from 'hardhat'; | ||
|
||
async function main() { | ||
const currentTimestampInSeconds = Math.round(Date.now() / 1000); | ||
const unlockTime = currentTimestampInSeconds + 60; | ||
const currentTimestampInSeconds = Math.round(Date.now() / 1000); | ||
const unlockTime = currentTimestampInSeconds + 60; | ||
|
||
const lockedAmount = ethers.parseEther("0.001"); | ||
const lockedAmount = ethers.parseEther('0.001'); | ||
|
||
const lock = await ethers.deployContract("Lock", [unlockTime], { | ||
value: lockedAmount, | ||
}); | ||
const lock = await ethers.deployContract('Lock', [unlockTime], { | ||
value: lockedAmount, | ||
}); | ||
|
||
await lock.waitForDeployment(); | ||
await lock.waitForDeployment(); | ||
|
||
console.log( | ||
`Lock with ${ethers.formatEther( | ||
lockedAmount | ||
)}ETH and unlock timestamp ${unlockTime} deployed to ${lock.target}` | ||
); | ||
console.log( | ||
`Lock with ${ethers.formatEther( | ||
lockedAmount, | ||
)}ETH and unlock timestamp ${unlockTime} deployed to ${lock.target}`, | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main().catch((error) => { | ||
console.error(error); | ||
process.exitCode = 1; | ||
console.error(error); | ||
process.exitCode = 1; | ||
}); |
Oops, something went wrong.