This special version of scaffold-eth-typescript has a few things:
- Hardhat deploy scripts for minting nfts and publishing data on IPFS
- regular scaffold-eth react frontend to query the blockchain for your NFT data and also IPFS data.
- An integration which sends that data to unity webgl
- A Unity scene where you can see the NFTs you own
This is the typescript repo of scaffold-eth and it uses hardhat
and vite
to run scaffold-eth-typescript. There is also a nextjs version. The directories that you'll use are:
packages/vite-app-ts/
packages/hardhat-ts/
packages/next-app-ts/
- Get an IPFS infura project from infura.io, copy your project id and api key secret
- Create the file
packages/vite-app-ts/.env.local
and override your Infura project ID and api key. You can see the format inpackages/vite-app-ts/.env
(the file you override by creatingpackages/vite-app-ts/.env.local
) - Go to
packages/hardhat-ts/deploy/01_deploy_your_NFT.ts
and find the line with thetoAddress
variable. Here you want to put in your wallet address that you have in your browser. If you don't know which wallet address you will get due to using burner wallets or similar. Make a note of launching the app (yarn start
beforeyarn deploy
) once before deploying your NFTs. so you can copy your address from the browser and add it here.
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 # run any subgraph commands for the workspace yarn subgraph 'xxx'
Other folders
# for subgraph packages/advanced/subgraph/ packages/advanced/services/
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.
Everything you need to build on Ethereum! π Quickly experiment with Solidity using a frontend that adapts to your smart contract:
- π Edit your smart contract
YourContract.sol
inpackages/hardhat-ts/contracts
- π Edit your frontend
MainPage.tsx
inpackages/vite-app-ts/src
- πΌ Edit your deployment scripts in
packages/hardhat-ts/deploy
- π± Open http://localhost:3000 to see the app
- π·π½ββοΈ run
yarn hardhat
to get a list of all the tasks. Runyarn hardhat taskname
to run the task.
- Check out eth-hooks docs for example of how to use hooks
Register as a builder here and start on some of the challenges and build a portfolio.
π Make sure to click on the typescript tab!
Documentation, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io
Eth-hooks documentation is here. Learn how to use the contexts here.
Join the telegram support chat π¬ to ask questions and find others building with π scaffold-eth!
Check out
- Typescript challenges
- Typescript examples
- Vanilla JS active branches
- Join/fund the π° BuidlGuidl!
- Follow the full Ethereum Speed Run
Read the docs: https://docs.soliditylang.org
Go through each topic from solidity by example editing YourContract.sol
in π scaffold-eth
Please check out our Gitcoin grant too!
You need an RPC and API keys for testnets and production deployments, create an Alchemy account and replace the value of ALCHEMY_KEY = xxx
in packages/vite-app-ts/.env
or packages/next-app-ts/.env
with your new keys.