The Hawk High School smart contract (LevelOne) implements student enrollment functionality that fatally mishandles the token transfer process. The contract attempts to transfer USDC tokens from users without verifying they have granted approval for the transfer. This flawed implementation violates the ERC20 token standard's two-phase transfer requirement, rendering the core enrollment functionality completely non-operational for users who haven't separately approved the contract to spend their tokens.
ERC20 token transfers from a user's address to another address (via a third party) require a mandatory two-step process:
The token holder must first call approve()
on the token contract to grant permission to a spender address
Only after approval can the spender address successfully call transferFrom()
to move tokens
The issue manifests in the following sequence:
The function verifies the caller isn't a teacher or principal
It checks the caller isn't already a student
It immediately attempts to transfer tokens without checking for allowance
The transfer will fail for any user who hasn't separately approved the contract
When a user attempts to enroll:
Technical Execution Path:
User calls enroll()
Contract calls usdc.safeTransferFrom()
USDC token contract checks if address(this)
has sufficient allowance from msg.sender
Without prior approval, this check fails
The token contract reverts the transaction
The enrollment function never reaches the state-changing logic
Calldata Analysis:
Token State Interrogation:
Systemic Functionality:
100% of enrollment attempts will fail without manual off-chain approval
Prevents core operational capability of the educational system
Blocks bursary accumulation and thus downstream payment functionality
Financial Implications:
Users lose gas costs on failed transactions
Contract deployment resources are wasted on non-functional code
Educational ecosystem cannot receive payments or operate
Protocol Analysis:
Circular dependency created: Users can't participate without understanding technical details not expressed in the contract
Hidden prerequisites undermine contract transparency
Breaks the operational promise of the smart contract
UX Consequences:
Opaque error messages ("SafeERC20: low-level call failed") confuse users
Multiple transaction requirement increases friction (approve, then enroll)
Forces users to understand low-level ERC20 mechanics
This is not an exploitable vulnerability but a fundamental operational failure with 100% certainty of occurrence for any user who hasn't separately performed token approval. The likelihood is classified as "Guaranteed" because there is no path through which the function can succeed without prior manual intervention.
ERC20 Compliance Violation: The contract fails to respect the token standard's design requirements for third-party transfers.
Educational System Integrity: The non-functional enrollment process prevents students from joining the system, undermining the entire educational platform.
Architectural Pattern Weakness: The contract uses a direct-transfer pattern for payments rather than a more robust pull-payment pattern.
Transparency Principle Violation: The contract creates implicit requirements not documented within the contract itself.
The missing allowance verification in the enrollment function represents a critical functional failure that renders the contract's primary purpose inoperable. This issue has a 100% likelihood of occurrence for any user who hasn't performed separate approval steps. While not an exploitable security vulnerability in the traditional sense, it represents a fundamental design flaw that completely blocks the intended functionality of the contract.
The remediation is straightforward but essential - implement proper validation of token allowances before attempting transfers, or restructure the enrollment process to better guide users through the required steps.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.