Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const proposalBuilder = new ProposalBuilder(kit)
// Example A
// proposalBuilder.addJsonTx({
// contract: CeloContract.Attestations,
// function: 'setAttestationExpiryBlocks',
// // @ts-ignore
// args: [728],
// value: '0',
// })
// Example B
proposalBuilder.addProxyRepointingTx(validatorsProxyAddress, desiredImplementationAddress)
const proposal = await proposalBuilder.build()
const proposalHash = proposalToHash(kit, proposal)
// If your proposal is just made of ContractKit methods, you can print it out
// console.info('Proposal: ', await proposalToJSON(kit, proposal))
console.info(`Proposal Hash: ${proposalHash.toString('hex')}`)
console.info('\nWhitelist the hotfix')
await concurrentMap(25, addresses, async (address, index) => {
try {
await governance.whitelistHotfix(proposalHash).sendAndWaitForReceipt({ from: address })
} catch (error) {
console.error(`Error whitelisting for validator ${index} (${address}): ${error}`)
}
})
let hotfixRecord = await governance.getHotfixRecord(proposalHash)