delegating token in daos #2221
-
We must delegate tokens to the commuinity also right to hold to authority to vote ? why are delegating only to owner import { HardhatRuntimeEnvironment } from "hardhat/types"
import { DeployFunction } from "hardhat-deploy/types"
import verify from "../helper-functions"
import { networkConfig, developmentChains } from "../helper-hardhat-config"
import { ethers } from "hardhat"
const deployGovernanceToken: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
// @ts-ignore
const { getNamedAccounts, deployments, network } = hre
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
log("----------------------------------------------------")
log("Deploying GovernanceToken and waiting for confirmations...")
const governanceToken = await deploy("GovernanceToken", {
from: deployer,
args: [],
log: true,
// we need to wait if on a live network so we can verify properly
waitConfirmations: networkConfig[network.name].blockConfirmations || 1,
})
log(`GovernanceToken at ${governanceToken.address}`)
if (!developmentChains.includes(network.name) && process.env.ETHERSCAN_API_KEY) {
await verify(governanceToken.address, [])
}
log(`Delegating to ${deployer}`)
await delegate(governanceToken.address, deployer)
log("Delegated!")
}
const delegate = async (governanceTokenAddress: string, delegatedAccount: string) => {
const governanceToken = await ethers.getContractAt("GovernanceToken", governanceTokenAddress)
const transactionResponse = await governanceToken.delegate(delegatedAccount)
await transactionResponse.wait(1)
console.log(`Checkpoints: ${await governanceToken.numCheckpoints(delegatedAccount)}`)
}
export default deployGovernanceToken
deployGovernanceToken.tags = ["all", "governor"] |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Aug 31, 2022
Replies: 1 comment 14 replies
-
@sadath-12 Do not understand your question. |
Beta Was this translation helpful? Give feedback.
14 replies
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sadath-12 Do not understand your question.