Deploy an Ante Test

Deploy a completed Ante Test to Mainnet

We've provided several methods to deploy your own Ante Test below, starting with our current preferred method using Hardhat.

As easier methods become available in the future, we'll link them here as we find them.

Ante's deploy script using Hardhat

Our team currently prefers to use Hardhat to deploy our smart contracts. Assuming that the Ante Test has already been written, we can easily deploy an Ante Test to a network of our choosing using our prepared script scripts/deploy_test.ts in the Ante Community Github.

Setup

First, make sure that the .env file is updated with the appropriate keys as per the readme section: Configure the app

Second, in scripts/deploy_test.ts, update the testName (Line 8) and arguments (Line 10) for the Ante Test you want to deploy.

import hre from 'hardhat';
import chalk from 'chalk';

const main = async () => {
  const [deployer] = await hre.ethers.getSigners();

  // name of the contract for Ante Test
  const testName = 'AnteEthDevRugTest';
  // array of constructor arguments for Ante Test
  const args = ['0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae'] as const;
// script/deploy_test.ts continues

Deployment

Once these two files have been properly set up, run either of the commands below to deploy the Ante Test:

  • npm run deploy-test -- --network [NETWORK_NAME]

    • npm run deploy-test is a user-defined command that we've set up to run the npx hardhat command below

  • npx hardhat run scripts/deploy_test.ts --network [NETWORK_NAME]

Verification

Right now, your Ante Test is only visible on Etherscan in bytecode form. In order to provide source code transparency for end users, you can verify the contract on Etherscan. Hardhat provides a plugin for doing this which you can use following the steps below:

First, make sure that the .env file is updated with your Etherscan key.

Next, run the command:

  • npx hardhat verify --network [NETWORK_NAME] [DEPLOYED_ANTE_TEST_ADDRESS] "Constructor argument 1"

If your Ante Test takes a more complex set of arguments, you can also use an arguments.js file and run the modified command:

  • npx hardhat verify --network [NETWORK_NAME] --constructor-args [ARGUMENTS_FILE] [DEPLOYED_ANTE_TEST_ADDRESS]

The Hardhat-Etherscan plugin documentation provides additional information on configuration options for the verify command.

Other deployment solutions

The Ethereum Foundation has outlined several methods for deploying smart contracts (and in this case, an Ante Test).

The main points for deployment would be needing access to an Ethereum node, either having your own node, access to a public node, or using services like Alchemy or Infura.

Additionally, there are other solutions that can be explored to deploy the Ante Test:

Alchemy: Hello World Smart Contract

Infura: Deploying Smart Contracts

Remix: Deploy & Run

After deploying your Ante Test

Make sure you record and remember the address that your Ante Test is deployed to! It will be needed to generate the Ante Pool that end users will interact with.

Once you've deployed your Ante Test, you can then create an Ante Pool (note: this will cost gas as well) to allow users to stake/challenge your test.

Last updated