Skip to main content

Hardhat Tasks

Augur Turbo takes advantage of Hardhat to handle smart contract development, and comes pre-packaged with a variety of useful tasks for interacting with the Augur contracts.

The source for these tasks are all available in the packages/smart/tasks directory.

Utilities

There are a variety of utility tasks available, for instance:

# Print the list of accounts
yarn hardhat accounts

# Print an account's balance
yarn hardhat --account [account address]

To get a complete list run:

yarn hardhat

Selecting a network

Default network settings are registered to allow you to select a network. These are defined in packages/smart/hardhat.config.ts. The --network argument can be used with hardhat tasks to direct the task to connect to a specific network.

yarn hardhat [task] --network [kovan|mumbai|arbitrum|...]

Specifying a private key

To deploy to anywhere but hardhat or localhost, you must provide a private key using an environment variable like so:

PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 yarn hardhat --network kovan deploy

Or you may export the environment variable into your shell's ENV list:

export PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
yarn hardhat --network kovan deploy

Canned Markets

A variety of test markets can be created by using the cannedMarkets task. This is useful for both local and testnet deploys, allowing you to start with a list of markets that is consistent.

yarn hardhat cannedMarkets

The Rundown

We are adding tasks to make it easy to fetch data from TheRunDown. In order to use these you will need a rundown api key from rapidapi.

yarn hardhat fetch-rundown-event --event [eventId] --key [rundownApiKey]

This task funds an address with 1 LINK. Call this task with a private key and network. Make sure that private key account has LINK.

yarn hardhat fundLink --contract [contractAddress]

Request score

This request the score for a match. Call this task with a private key and network. Fund TheRundownChainlink contract with LINK first. You can use the fundLink task for this.

yarn hardhat requestScore