How to use the @chainlink/test-helpers.contract.LinkToken__factory function in @chainlink/test-helpers

To help you get started, we’ve selected a few @chainlink/test-helpers 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 smartcontractkit / chainlink / integration-scripts / src / deployLinkTokenContract.ts View on Github external
export async function deployLinkTokenContract(): Promise<
  contract.Instance
> {
  const provider = createProvider()
  const signer = provider.getSigner(DEVNET_ADDRESS)
  if (process.env.LINK_TOKEN_ADDRESS) {
    console.log(
      `LinkToken already deployed at: ${process.env.LINK_TOKEN_ADDRESS}, fetching contract...`,
    )
    const factory = new contract.LinkToken__factory(signer)
    const linkToken = factory.attach(process.env.LINK_TOKEN_ADDRESS)
    console.log(`Deployed LinkToken at: ${linkToken.address}`)

    return linkToken
  }

  const linkToken = await deployContract({
    Factory: contract.LinkToken__factory,
    name: 'LinkToken',
    signer,
  })

  return linkToken
}

@chainlink/test-helpers

A collection of test helpers to facilitate testing chainlink's smart contracts

MIT
Latest version published 3 years ago

Package Health Score

61 / 100
Full package analysis

Similar packages