How to use the @chainlink/test-helpers.contract.LinkTokenFactory 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 / sendRunlogTransaction.ts View on Github external
async function sendRunlogTransaction({
  runLogAddress,
  linkTokenAddress,
  chainlinkUrl,
  echoServerUrl,
}: Args) {
  const provider = createProvider()
  const signer = provider.getSigner(DEVNET_ADDRESS)

  const runLogFactory = new RunLogFactory(signer)
  const linkTokenFactory = new contract.LinkTokenFactory(signer)
  const runLog = runLogFactory.attach(runLogAddress)
  const linkToken = linkTokenFactory.attach(linkTokenAddress)

  // transfer link to runlog address
  const linkAmount = ethers.utils.parseEther('1000')
  try {
    await linkToken.transfer(runLog.address, linkAmount, {
      gasLimit: 100000,
    })
  } catch (error) {
    console.error('Error transferring link to RunLog')
    throw Error(error)
  }

  console.log(`Transferred ${linkAmount} to RunLog at: ${runLog.address}`)

@chainlink/test-helpers

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

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis

Similar packages