Setting Up
This guide will help you configure everything you need to successfully use the Hack The Chain platform for smart contract security challenges.
Prerequisites
Before you begin, you’ll need to set up a few things:
- A modern web browser (Chrome, Firefox, or Brave recommended)
- Metamask wallet extension
- Access to the Sepolia test network
- A small amount of Sepolia testnet ETH
Metamask Configuration
Installing Metamask
If you don’t already have Metamask installed:
- Visit metamask.io and download the browser extension
- Follow the setup instructions to create a new wallet
- Important: For security reasons, we strongly recommend creating a separate wallet specifically for development and testing purposes, rather than using your main wallet that holds real assets
Creating a Testing Wallet
Since Hack The Chain (like all third-party DApps) requires wallet connection:
graph LR A[Main Wallet] -->|NOT RECOMMENDED| B[Hack The Chain Platform] C[Dedicated Testing Wallet] -->|RECOMMENDED| B
- Click your account icon in Metamask
- Select “Create Account” or “Import Account”
- Name it something like “Testing Wallet” or “Dev Wallet”
- Use this wallet for all development and testing purposes
Connecting to Sepolia Network
Hack The Chain exclusively uses the Sepolia testnet for all smart contract interactions. You’ll need to:
- Open Metamask
- Click the network dropdown at the top (usually says “Ethereum Mainnet”)
- Select “Display test networks”
- Choose “Sepolia”
You can also add the network manually
- Select “Add Network” or “Custom RPC”
- Input the following details:
Setting | Value |
---|---|
Network Name | Sepolia Test Network |
New RPC URL | https://rpc.sepolia.org |
Chain ID | 11155111 |
Currency Symbol | ETH |
Block Explorer URL | https://sepolia.etherscan.io |
If you’re using The Hack Chain, when you launch an exercise, you’ll automatically be prompted to switch to Sepolia if you’re using another network.
Obtaining Sepolia Testnet ETH
You’ll need a small amount of Sepolia ETH (minimum 0.01 ETH) to deploy contracts and interact with the platform. You can get free testnet ETH from these faucets:
- Alchemy Sepolia Faucet - Requires Alchemy account
- Infura Sepolia Faucet - Requires Infura account
- Google Sepolia Faucet
- Sepolia PoW Faucet
How CodeAudit Works
Browser-Based Compilation
CodeAudit compiles smart contracts directly in your browser:
- The Solidity compiler (solc-js) is loaded as WebAssembly
- Compilation happens in a Web Worker to avoid browser memory limitations
- The compiled bytecode is then used with Metamask for deployment
- No contract code is sent to external servers for compilation
Deployment Process
sequenceDiagram participant User participant Browser participant Metamask participant Sepolia User->>Browser: Click "Deploy Contract" Browser->>Browser: Compile contract in Web Worker Browser->>Metamask: Request transaction signature Metamask->>User: Prompt for approval User->>Metamask: Approve transaction Metamask->>Sepolia: Send deployment transaction Sepolia->>Browser: Return contract address Browser->>User: Show deployed contract
Verification Process
When you attempt to exploit a vulnerability:
- Your solution is tested against the deployed contract on Sepolia
- The verification is performed through client-side JavaScript
- The test runs entirely in your browser using your wallet connection
- Results are processed locally and displayed immediately
Security Considerations
- Never use your main wallet containing real assets for educational platforms
- Always verify transaction details before confirming in Metamask
- Contract deployment and interaction will consume small amounts of testnet ETH
- No real funds are at risk, but practicing good security habits is important
With these steps completed, you’ll be ready to start learning and practicing smart contract security through interactive challenges on Hack The Chain!
Last updated 02 Apr 2025, 10:51 +0200 .