Smart Contracts

Q2T Contracts setup

Prerequisites

  1. Nodejs environment

  2. Yarn (or npm) installed

  3. npx installed

  4. Alchemy account (for forking, needed for Aave integration) for local deployment

Prepare environment

  1. Clone contracts repo

    git clone https://github.com/Q2T-Fund/Q2T-Fund-contracts
  2. Go to cloned repo (cd Q2T-Fund-contracts) and install dependencies

    yarn
  3. Create .env file with the following variables:

    # RPC for mainnet deploymnet
    PROVIDER_URL_MAIN=
    # RPC for kovan deploymnet
    PROVIDER_URL_KOVAN=
    # Alchemy RPC for mainnet forking for local deployment
    ALCHEMY_URL=
    # Block number for cloning
    ALCHEMY_BLOCK=11743420
    # Deployer private key for mainnet or kovan
    PRIVATE_KEY=
    # Impersonate address for tests. Should have some DAI at ALCHEMY_BLOCK
    IMPERSONATE=
    # Etherscan API for contact verification
    ETHERSCAN_API=

Run tests

npx hardhat test

Local deployment

  1. Start Hardhat node

    npx hardhat node
  2. Deploy contracts

    npx hardhat run --network localhost scripts/deploy_all.js