Capstone · Base Sepolia

Staking Lab

Connect MetaMask, point it at your deployed contract, and clear every checkpoint.

Guided checklist

Auto-detected from on-chain state and your actions this session.

0/8
complete

1 · Contract

.sol.abi

2 · Interact

Your stake
Pending rewards
Total staked
Contract balance

Hardhat setup

TypeScript / JavaScript workflow
Install & test
mkdir staking && cd staking && npm init -y
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
npx hardhat init  # choose 'Create a JavaScript project'
// Put SimpleStaking.sol in contracts/ and the test in test/
npx hardhat compile
npx hardhat test
Deploy to Base Sepolia
// hardhat.config.js — add Base Sepolia network
networks: { baseSepolia: { url: 'https://sepolia.base.org', accounts: [process.env.PRIVATE_KEY] } }
// scripts/deploy.js:
const s = await ethers.deployContract('SimpleStaking', [1_000_000_000n]);
await s.waitForDeployment(); console.log(await s.getAddress());
npx hardhat run scripts/deploy.js --network baseSepolia
Download SimpleStaking.test.js

Foundry setup

Fast native Solidity workflow
Install & test
curl -L https://foundry.paradigm.xyz | bash && foundryup
forge init staking && cd staking
// Put SimpleStaking.sol in src/ and the test in test/
forge build
forge test -vv
Deploy to Base Sepolia
export PRIVATE_KEY=0x…   # a test-only key with Base Sepolia ETH
forge create src/SimpleStaking.sol:SimpleStaking \
  --rpc-url https://sepolia.base.org \
  --private-key $PRIVATE_KEY \
  --constructor-args 1000000000
Download SimpleStaking.t.sol

Never paste a mainnet private key into a terminal or .env for lab work. Use a fresh MetaMask account funded only with Base Sepolia faucet ETH.