Smart Contracts

Q2T Contracts setup

Prerequisites

  1. 1.
    Nodejs environment
  2. 2.
    Yarn (or npm) installed
  3. 3.
    npx installed
  4. 4.
    Alchemy account (for forking, needed for Aave integration) for local deployment

Prepare environment

  1. 1.
    Clone contracts repo
    1
    git clone https://github.com/Q2T-Fund/Q2T-Fund-contracts
    Copied!
  2. 2.
    Go to cloned repo (cd Q2T-Fund-contracts) and install dependencies
    1
    yarn
    Copied!
  3. 3.
    Create .env file with the following variables:
    1
    # RPC for mainnet deploymnet
    2
    PROVIDER_URL_MAIN=
    3
    4
    # RPC for kovan deploymnet
    5
    PROVIDER_URL_KOVAN=
    6
    7
    # Alchemy RPC for mainnet forking for local deployment
    8
    ALCHEMY_URL=
    9
    10
    # Block number for cloning
    11
    ALCHEMY_BLOCK=11743420
    12
    13
    # Deployer private key for mainnet or kovan
    14
    PRIVATE_KEY=
    15
    16
    # Impersonate address for tests. Should have some DAI at ALCHEMY_BLOCK
    17
    IMPERSONATE=
    18
    19
    # Etherscan API for contact verification
    20
    ETHERSCAN_API=
    Copied!

Run tests

1
npx hardhat test
Copied!

Local deployment

  1. 1.
    Start Hardhat node
    1
    npx hardhat node
    Copied!
  2. 2.
    Deploy contracts
    1
    npx hardhat run --network localhost scripts/deploy_all.js
    Copied!
Last modified 8mo ago