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).
Running the app
-
install your dependencies,
open a new command prompt
yarn install
-
start a hardhat node
yarn chain
-
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
-
If you'd like to run the nextjs app,
open a new command prompt
# start nextjs app yarn start:next
-
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
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.