This repo is the starter template for the in-person session. The main branch will stay lightweight and only contain the template skeleton. The full working codebase lives on the complete branch.
If you want to follow along live, stay on main. If you want the finished reference implementation, switch to complete.
Fork this repository to your own GitHub account, then clone your fork locally.
git clone https://github.com/<your-username>/gamified_ledger.git
cd gamified_ledgerIf you already cloned the repo, make sure you are on the branch you want to work from:
git checkout mainIf Foundry is not installed yet, run:
curl -L https://foundry.paradigm.xyz | bash
foundryupAfter installation, verify the tools are available:
forge --version
cast --version
anvil --versionCreate a local .env file at the root of the project and add your deployment values.
touch .envExample .env values:
AVALANCHE_FUJI_RPC_URL=https://api.avax-test.network/ext/bc/C/rpc
PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HEREUse the private key setup instructions in this deck before adding your wallet key:
Load the variables into your shell before running Forge commands:
source .envforge build
forge test
forge fmtThis contract has no constructor arguments, so deployment is straightforward.
source .env
forge create \
--rpc-url "$AVALANCHE_FUJI_RPC_URL" \
--private-key "$PRIVATE_KEY" \
src/LoyaltyPoints.sol:LoyaltyPointsIf you prefer a scripted deployment, use the included Forge script with the same AVALANCHE_FUJI_RPC_URL and PRIVATE_KEY values.
source .env
forge script \
--rpc-url "$AVALANCHE_FUJI_RPC_URL" \
--broadcast \
script/LoyaltyPoints.s.sol:LoyaltyPointsScriptMake sure the wallet you use for deployment has test AVAX on Fuji. If not, use the Avalanche Fuji faucet before running the deployment command.
mainis the template skeleton only.completecontains the full codebase.- We will write the main code together during the session.
forge build
forge test
forge fmt
forge create --rpc-url "$AVALANCHE_FUJI_RPC_URL" --private-key "$PRIVATE_KEY" src/LoyaltyPoints.sol:LoyaltyPoints
forge script --rpc-url "$AVALANCHE_FUJI_RPC_URL" --broadcast script/LoyaltyPoints.s.sol:LoyaltyPointsScript