skills/case-studies/level-finance/SKILL.md
Case study of the 2023 Level Finance exploit: referral code reentrancy draining ~$1.1M
npx skillsauth add apegurus/solidity-argus level-financeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
In May 2023, Level Finance, a decentralized perpetual exchange on BNB Chain, was exploited for approximately $1.1 million. The attacker exploited a reentrancy vulnerability in the protocol's referral contract, specifically within the claimMultiple function, allowing them to claim referral rewards multiple times in a single transaction.
The vulnerability was in the LevelReferralController contract. The claimMultiple function allowed users to claim rewards for multiple referral epochs. However, the function did not follow the Checks-Effects-Interactions pattern and lacked a reentrancy guard. The contract sent rewards to the user before updating the isClaimed status for the epoch, allowing the attacker to re-enter the function and claim the same rewards repeatedly.
claimMultiple function with a list of epoch IDs.claimMultiple with the same epoch IDs.isClaimed status was only updated after the loop finished, the second call (and subsequent recursive calls) succeeded.0xe18396571315154179da08573f38039c50f8c46653302f9c449e10ba575606f5nonReentrant modifier) on the claimMultiple function.isClaimed status for each epoch before sending the rewards.testing
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.