This repository contains source codes for experimentation with Foundry and Vue.js
Courses used in the repository
contracts
folder contain Cryptozombies smart contracts and dapp
folder contain a Vue.js frontend
curl -L https://foundry.paradigm.xyz | bash
source ~/.bashrc
foundryup
Creating a new foundry project
forge init
Install OpenZeppelin
forge install OpenZeppelin/openzeppelin-contracts --no-commit
forge install smartcontractkit/chainlink-brownie-contracts@0.8.0 --no-commit
If needed, to init remappings use forge remappings > remappings.txt
cast wallet import defaultKey --interactive
then add the password in contracts/.password
file and PUBLIC_KEY_LOCAL
public key in .env
- https://book.getfoundry.sh/config/vscode
- https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity
The frontend in dapp
has been created with vitejs and vitest for unit testing
Run tests on contracts
task contracts-test
or
forge test --fork-url <URL>
Test call with cast for Cryptozombies
cast call 0x... "getZombiesByOwner(address _owner)" "0x..."
Create a gas usage snapshot file .gas-snapshot
with forge snapshot
Launch a local testnet node, see Anvil doc
anvil
Build and deploy contracts
task contracts-build contracts-deploy
Launch frontend
task frontend-build frontend-run