mirror of
https://github.com/acid-info/Kurate.git
synced 2025-02-22 20:48:16 +00:00
28 lines
1.1 KiB
TypeScript
28 lines
1.1 KiB
TypeScript
|
import { task, types } from "hardhat/config"
|
||
|
|
||
|
task("deploy", "Deploy a GlobalAnonymousFeed contract")
|
||
|
.addOptionalParam("semaphore", "Semaphore contract address", undefined, types.string)
|
||
|
.addOptionalParam("group", "Group id", 42, types.int)
|
||
|
.addOptionalParam("logs", "Print the logs", true, types.boolean)
|
||
|
.setAction(async ({ logs, semaphore: semaphoreAddress, group: groupId }, { ethers, run }) => {
|
||
|
if (!semaphoreAddress) {
|
||
|
const { semaphore } = await run("deploy:semaphore", {
|
||
|
logs
|
||
|
})
|
||
|
|
||
|
semaphoreAddress = semaphore.address
|
||
|
}
|
||
|
|
||
|
const globalAnonymousFeedFactory = await ethers.getContractFactory("GlobalAnonymousFeed")
|
||
|
|
||
|
const globalAnonymousFeedContract = await globalAnonymousFeedFactory.deploy(semaphoreAddress, groupId)
|
||
|
|
||
|
await globalAnonymousFeedContract.deployed()
|
||
|
|
||
|
if (logs) {
|
||
|
console.info(`GlobalAnonymousFeedContract contract has been deployed to: ${globalAnonymousFeedContract.address}`)
|
||
|
}
|
||
|
|
||
|
return globalAnonymousFeedContract
|
||
|
})
|