hoelee b68818e00a
Some checks failed
CI / Foundry project (push) Has been cancelled
README: add learning-project note & remote job footer
2026-08-19 20:00:23 +08:00
2024-08-13 04:13:15 +08:00
2024-08-16 09:52:26 +08:00
2024-08-13 04:13:15 +08:00
2024-08-15 16:45:28 +08:00
2024-08-17 12:19:13 +08:00
bug
2024-08-16 08:43:04 +08:00
2024-08-17 01:50:54 +08:00
2024-08-11 07:38:17 +08:00
2024-08-16 12:41:38 +08:00
2024-08-17 12:19:13 +08:00
2024-08-15 16:45:28 +08:00
2024-08-08 03:56:57 +08:00
2024-08-08 03:23:14 +08:00
2024-08-15 16:45:28 +08:00
2024-08-17 01:50:54 +08:00
2024-08-15 16:45:28 +08:00
2024-08-17 12:19:13 +08:00
2024-08-14 01:01:18 +08:00
2024-08-16 12:41:38 +08:00
2024-08-16 12:41:38 +08:00
2024-08-17 01:50:54 +08:00
2024-08-17 12:19:13 +08:00
2024-08-17 12:19:13 +08:00

Hoelee Smart Contract - Automate Lottery

📚 A Learning Project

Note from Hoelee 👋 — This is part of my journey exploring Web 3.0 / blockchain development. I'm a hands-on self-taught developer learning Solidity and smart-contract engineering by building real, working projects — not just following tutorials. This lottery contract is one of my practice builds: it walks through the full modern Web3 stack end-to-end, from writing the contract, to testing it (Hardhat and Foundry), to deploying and verifying on a public testnet with Chainlink automation. Consider it my learning project note — documenting what I'm studying, how I build, and the standards I hold myself to. It grows as I learn. 🚀

Grand Porject Overview

This Project Smart Contract Created With

  1. Solidity Contract + Hardhat + node.js for Test
  2. Solidity Contract & Test + Foundry

Hardhat Project

A fully functional Smart Contract wrriten with solidity, node.js and using Hardhat to show usage of all kinds of standard development features, including:

  • running blockchain node in localhost - hardhat & ganache
  • solidity prettier code beautifier setup
  • standard of developing Smart Contract with solidity
  • standard of developing node.js script to use hardhat library efficiently
  • check gas fee & gas price in real-time, with usage of coverage
  • auto verify contract on Etherscan.io
  • creating automate test cases - unit test & staging test
  • creating tasks etc.
  • refactor codes to reduce gas fee
  • write code in best practice, with usage of solhint
  • prettier solidity & node.js code
  • gitea version control

This project mainly to keep as a reference for future Web 3.0 Developments.

Read More in Hardhat Project's Note Page.


Foundry Project

Same Lottery Project, Use Of Solidity to test smart contract, ensure high coverage of function correctness. Feature included:

  • Modular Enable Test In Multiple Networks With Different Conditions
  • Local Network Using Of Anvil + Mock VRF (Verifiable Randomness Function)
  • Testnet Use of Latest V2.5 Chainlink VRF Subscription With Consumer Subscription
  • Use of Custom LinkToken on Sepolia Testnet
  • Smart Contract Test With High Coverage To Ensure Correctness
  • Private Key Encrypted With Keystore, Safer Usage With Password
  • Smart Contract Layer-2 Ready (ZKsync)

Read More In Foundry Project's Note Page.

Success Deploy & Verified Smart Contract In Sepolia Testnet

0xc2022b56eBC140B5FebCf9FBaB14c17db4C315C4 https://sepolia.etherscan.io/address/0xc2022b56eBC140B5FebCf9FBaB14c17db4C315C4#code Via deploy.js https://sepolia.etherscan.io/address/0x3a827C119e1D746bb3C7bcbbf95c55246C8CcBdd#code Via yarn hardhat deploy --network sepolia

Public Reported Hacked Code References:

This website is records of all kind previous hacked smart contract:

https://rekt.news/leaderboard/

1. Understanding Of Known Vulnerabilities

  • Reentrancy Attack
    • Locked with modifier while running withdraw function
    • Update variable immediately before call external function
  • Integer Overflow / Underflow
    • Use compiler version >0.8.0 have check in place
  • Front-Running
    • Use average gas fee / off peak times
    • Use commit-reveal schema
    • Use submarine send

2. Other Explored Features

  1. Generate Random Words
  2. New Time Based Trigger Automation Through Chainlink UpKeep
    • Same As VRF Subscription, V2.5 Optional Reduced Steps
    • Setup At https://automation.chain.link/
    • After Subscription Created, Funded, & Setup Interval:
      • VRFCoordinator will call checkUpkeep(bytes memory checkData)
      • checkUpkeep true will call internal contract performUpkeep(bytes calldata performData)

3. Looking Web 3.0 Developer For Your Project?

👨💻 About Hoelee — I'm actively exploring Web 3.0 and blockchain development while continuing my work in web development and self-hosting. I'm a dedicated, self-motivated learner who picks projects apart, understands how they work, and ships real code — not just concepts.

Mr Hoelee is welcoming a 💼 Web 3.0 / blockchain Remote Job — especially entry/junior roles, internships, or a learning-oriented opportunity where I can grow and contribute. Let's talk! Contact me immediately via WhatsApp +601****5290

Or you can email me@hoelee.com now. Thanks.

Check out my portfolio at hoelee.com to see more of what I build.

4. Like this project?

If you are feeling generous, buy me a coffee! - buymeacoffee.com/hoelee

Description
Learning project: An automated lottery smart contract built with Solidity — tested with Hardhat & Foundry, deploying with Chainlink VRF + Upkeep on the Sepolia testnet.
https://www.hoelee.com Readme 2.2 MiB
Languages
JavaScript 90.7%
Makefile 4.5%
HTML 4%
Solidity 0.8%