Starter kit
On this page
The starter kit is a small, working project for GullyChain Testnet: contracts you can test and deploy in minutes, and a web app that reads and writes them. It is the fastest way through step 3 of the quickstart. MIT licensed; the repo is gully-labs/gully-chain-starter (private while we polish it: email [email protected] your GitHub username and we add you).
#What is inside
| Path | What it is |
|---|---|
contracts/ |
Foundry project: Counter, StarterToken (ERC-20 with permit, OpenZeppelin Contracts 5.7.0), tests, and script/Deploy.s.sol |
contracts/foundry.toml |
solc 0.8.28 and an rpc_endpoints.gully_testnet entry for chain 485590 |
app/ |
Vite + React + TypeScript + viem: connect a wallet, add or switch to GullyChain Testnet, read the Counter, send an increment and open it on the explorer |
.github/workflows/ |
forge test and the app build on every push |
#Walkthrough
You need Foundry (opens in a new tab), Node.js 20 or newer and a browser wallet.
#1. Clone
git clone https://github.com/gully-labs/gully-chain-starter.git
cd gully-chain-starter
git submodule update --init#2. Get testnet ETH
Sign in to the faucet with Gully ID (free test ETH once a day) or bridge from Arbitrum Sepolia. Deploying both starter contracts costs about 0.0003 ETH at today's base fee.
#3. Build and test
cd contracts
forge build
forge testCounter.t.sol and StarterToken.t.sol cover the increment, the permit flow and the deploy script's output.
#4. Deploy
Use an encrypted Foundry keystore so your key never sits in a file or your shell history. Leave out --broadcast to simulate first.
# once: store a testnet key encrypted
cast wallet import dev --interactive
forge script script/Deploy.s.sol --rpc-url gully_testnet --account dev --broadcastThe script prints both addresses. It also accepts a PRIVATE_KEY environment variable for throwaway testnet keys. Never commit a key.
#5. Verify
forge verify-contract <counter-address> src/Counter.sol:Counter \
--chain-id 485590 --verifier sourcify --verifier-url https://verify.gullychain.xyz/Details and the Hardhat variant: Verify a contract.
#6. Run the app
cd ../app
cp .env.example .env.local # set VITE_COUNTER_ADDRESS to your Counter
npm install
npm run devConnect your wallet, press Add / switch to GullyChain Testnet, then Increment. Every transaction links to the explorer.
#Using a Gully RPC key
The public RPC https://testnet-rpc.gullychain.xyz works without a key. For your own metered endpoint, create a key at Gully RPC (opens in a new tab); the endpoint has the form https://rpc.gullyrpc.xyz/<project>/evm/485590.
export GULLY_RPC_URL=https://rpc.gullyrpc.xyz/<project>/evm/485590
forge script script/Deploy.s.sol --rpc-url gully_rpc --account dev --broadcastIn the app, set VITE_RPC_URL in app/.env.local. Anything prefixed VITE_ ends up in the browser bundle, so never put a private key there.
#Check the connection
cast block-number --rpc-url https://testnet-rpc.gullychain.xyz
cast chain-id --rpc-url https://testnet-rpc.gullychain.xyz # 485590#Next steps
- The developer portal quickstart checks your progress live.
- Read events from the indexer once your contract emits them.
- Contract addresses for WETH, Permit2, the EntryPoints and Gully Core.