Welcome to the entry test! You have 3 hours to complete the entire assessment.
Important
You must complete BOTH PART 1 (Skills Marketplace) and PART 2 (Secure Lottery) for all parts of this assessment.
- Duration: 3 Hours
- Submission: Fork this repo, commit regularly (every 15-30 mins), and push to your fork.
Ensure you have:
- Node.js (v20+) & npm
- Git configured (
git config user.name "Your Name") - VS Code (Solidity extension by Juan Blanco recommended)
- A GitLab/GitHub account to host your fork
- Fork this repository to your own namespace.
- Clone your forked repo:
git clone [YOUR_FORK_URL] cd blockchain_dev_entry_test
# Install dependencies (Hardhat + Toolbox)
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
# Initialize Hardhat (if not already initialized)
npx hardhat
# Choose: Create an empty hardhat.config.js- Answer ALL questions for BOTH PART 1 and PART 2.
- Provide clear reasoning for your choices.
You are provided with two contract skeletons in contracts/:
SkillsMarketplace.sol(PART 1)SecureLottery.sol(PART 2)
Your Tasks for BOTH contracts:
- Implementation: Complete the
TODOsections in both.solfiles. - Design Documentation: Fill in
PartB_Design.mddetailing your architectural choices, security measures, and trade-offs. - Test Planning: Fill in
PartB_Tests.mdwith your test scenarios. - Test Implementation: Create a
test/directory and implement automated tests for both contracts using Hardhat.- Example:
test/SkillsMarketplace.test.jsandtest/SecureLottery.test.js - Run tests with:
npx hardhat test
- Example:
- Worker Management: Implementation of
registerWorkerwith input validation and duplicate prevention. - Gig Workflow: Implementation of
postGig(accepting payments),applyForGig, andsubmitWork. - Payment & Security: Implementation of
approveAndPayusing the Checks-Effects-Interactions pattern to prevent reentrancy attacks. - Events: Proper emission of events for all state-changing operations.
- Participation: Implementation of
enterwith minimum entry requirements and multi-entry support. - Winner Selection: A
selectWinnerfunction that calculates a "winner" from total entries and distributes the pot (90% to winner, 10% to owner). - Randomness Challenge: Application of a secure randomness mechanism (e.g., using block data or VDF concepts).
- Safety: Implementation of an emergency circuit breaker (pause/unpause) and reentrancy protection.
blockchain_dev_entry_test/
├── contracts/
│ ├── SkillsMarketplace.sol # Complete this (Scenario 1)
│ └── SecureLottery.sol # Complete this (Scenario 2)
├── test/ # [NEW] Create your tests here
├── PartA_MCQ_Answers.md # Complete ALL questions
├── PartB_Design.md # Document BOTH designs
├── PartB_Tests.md # Describe BOTH test plans
└── docs/ # Reference materials
- Security Matters: We check for Reentrancy, Access Control, and Integer Handling.
- Gas is Money: Mention gas optimization strategies in your design document.
- Commit History: We look at your commit frequency to understand your workflow.
All the best!