The contract LevelOne{}
is not approved to spend the msg.sender
(student)'s USDC tokens in the enroll() function.
The usdc.safeTransferFrom(msg.sender, address(this), schoolFees);
call that is called by LevelOne{}
will always revert due to the contract not being an approved spender of the USDC balance of Student being msg.sender
in the enroll()
function, therefore students cannot enroll and the protocol does not get to function because there will be no students to review. LevelOne{}
must have an approved allowance to be able to successfully call usdc.safeTransferFrom(msg.sender, address(this), schoolFees);
.
The Invariants of the protocol are broken. As students are unable to enroll, no school fees are paid and the principal and teachers do not get paid because there are no students to review.
The test below will pass because without explicitly giving approval for the USDC tokens to be spent, the enroll()
function will always revert with an ERC20InsufficientAllowance()
error.
Manual review
Add an approval in the enroll()
function as seen in line 8 of the code snippet below
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.