Severity: High
Likelihood: High
Impact: Critical
The LevelOne contract's enroll()
function attempts to transfer USDC tokens from the user to the contract using safeTransferFrom()
without verifying if the contract has received approval to spend the user's tokens. This violates ERC20 token standards and will cause all enrollment attempts to fail unless users have separately approved the contract beforehand.
ERC20 Transfer Requirements:
The ERC20 standard requires a two-step process for third-party transfers:
The token owner must call approve()
to authorize a spender
Only then can the spender call transferFrom()
to move tokens
Current Implementation Issues:
The contract makes an unchecked assumption that users have approved it to spend their USDC
No mechanisms exist to guide users through the approval process
Users encountering failed transactions will see generic error messages like "SafeERC20: low-level call failed"
Transaction Flow Analysis:
User calls enroll()
Contract attempts safeTransferFrom()
If no approval exists, the call reverts
User receives a failed transaction with minimal explanation
The enrollment process cannot proceed
Functional Breakdown:
The primary function of the contract (enrolling students) is non-operational by default
100% of users will experience transaction failures unless they've separately performed an approval
User Experience Implications:
Creates an invisible prerequisite step not documented in the contract
Results in gas costs for failed transactions
Leads to confusion and potential abandonment of the platform
System Reliability:
Fundamentally undermines the reliability of the enrollment process
May create misconceptions that the contract is completely broken
High Severity: This issue completely breaks the core functionality of the contract
High Likelihood: Affects all users who haven't manually approved the contract
Critical Impact: Prevents new students from enrolling, effectively halting the primary purpose of the system
Implement one of the following solutions:
Option 1: Add Explicit Allowance Check
Option 2: Add Helper Functions for Approval
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.