fwt-demo.mp4
You need run 3 app, using 3 terminals:
- Frontend
- Blockchain local (anvil)
- Deploy your smartcontracts into blockchain
- Install frontend
cd ui
npm install # or yarn or pnpm install- Run application
npm run dev # or yarn dev or pnpm devanvil -b 1 # Mining blocks every 1 secondcd smartcontracts
./deploy-on-local.sh├── smartcontracts/
│ ├── ...
│ ├── lib
│ ├── deploy-on-local.sh
│ ├── script
│ │ └── deploy.local.s.sol
│ ├── src
│ │ └── Counter.sol
│ └── test
│ ├── BaseSetup.t.sol
│ ├── Counter.t.sol
│ └── Utils.t.sol
└── ui/
├── ...
├── contracts
│ └── deployedContracts.ts
└── package.json
Explain:
- The contracts folder contains everything you need to build smartcontracts.
- The ui folder contains everything you need to interact with your smartcontract using frontend.
deploy-on-local.sh: just call it to deploy, it makes deployment simple without copying and pasting things.src/*: the folder where we will write our contracts.test/*: the folder where we will write our tests.lib/*: the folder where the foundry stores the libraries.script/deploy.local.s.sol: the solidity script responsible for actually doing the deployment.test/BaseSetup.t.sol: is the contract where we are going to configure the tests.
contracts/deployedContracts.ts: ABI of the contract that will be ‘auto-magically’ copied by thesmartcontracts/deploy.pyscript.package.json: list of dependencies and commands to run the frontend.