/gld-vendor-ui

Simple app which allows you to buy and sell an ERC-20 token on goerli

Primary LanguageTypeScriptMIT LicenseMIT

🏵 GLD Vendor

About

This project is a set of smart contracts and a UI which enables a user to buy and sells ERC-20 tokens (GLDs).

I am leveraging eth-hooks, and using this design to style the page.

The smart contract logic is sourced from my submission to scaffold-eth challenge 2. The contract and out-of-the-box UI can be found on my buidlguidl profile.

You can watch the live coding session for this project here (starts at 34:00).

Quick Start

Commands to run the app

Running the app

  1. install your dependencies, open a new command prompt

    yarn install
  2. start a hardhat node

    yarn chain
  3. run the app, open a new command prompt

    # build hardhat & external contracts types
    yarn contracts:build
    # deploy your hardhat contracts
    yarn deploy
    # start the app (vite)
    yarn start
  4. If you'd like to run the nextjs app, open a new command prompt

    # start nextjs app
    yarn start:next
    
  5. other commands

    # rebuild all contracts, incase of inconsistent state
    yarn contracts:rebuild
    # run hardhat commands for the workspace, or see all tasks
    yarn hardhat 'xxx'
    # get eth for testing locally
    yarn hardhat faucet xxx

Environment Variables

Vite and NextJs app folders have .env files. To create local variables that overrride these, create a file called .env.local, or .env.development.local or .env.production.local and put your overrides in there.

You can set your TARGET_NETWORK with them.