How to use the @celo/contractkit.CeloContract.Validators function in @celo/contractkit

To help you get started, we’ve selected a few @celo/contractkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github celo-org / celo-monorepo / packages / celotool / src / cmds / deploy / upgrade / hotfix.ts View on Github external
console.info('Add keys to ContractKit')
    for (const key of keys) {
      kit.addAccount(key)
    }

    // Here you'll want to assert the current state
    // Example A: Update a var on a Celo Core Contract
    // const attestations = await kit.contracts.getAttestations()
    // const currentNumber = await attestations.attestationExpiryBlocks()
    // if (currentNumber !== 727) {
    //   throw new Error(`Expected current number to be 727, but was ${currentNumber}`)
    // }

    // Example B: Repoint a Celo Core Contract proxy
    const validatorsProxyAddress = await kit.registry.addressFor(CeloContract.Validators)
    const currentValidatorsImplementationAddress = await getImplementationOfProxy(
      kit.web3,
      validatorsProxyAddress
    )
    const desiredImplementationAddress = '0xd18620a5eBE0235023602bB4d490E1e96703EddD'
    console.info('Current Implementation Address: ', currentValidatorsImplementationAddress)

    console.info('\nBuild Proposal')

    const proposalBuilder = new ProposalBuilder(kit)

    // Example A
    // proposalBuilder.addJsonTx({
    //   contract: CeloContract.Attestations,
    //   function: 'setAttestationExpiryBlocks',
    //   // @ts-ignore