Fantom, BlackHole, uniclyNFT: Keys, Burns, and Reentrancy All Ove
The uniclyNFT PointFarm contract had a reentrancy flaw in its deposit() function where the user's reward debt was updated only after an external call, allowing the attacker to repeatedly mint rewards without settling their debt. The attacker used the rewards to purchase a LootRealms NFT and listed it for sale.
October 2023 saw more déjà vu in Web3 security. A Fantom employee’s hot wallets were drained across chains for $7M.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contract updated the user's reward debt only after making an external call, allowing reentrant calls to mint rewards multiple times.
Impact
The attacker obtained rewards and used them to purchase a LootRealms NFT, causing a $2K loss.
What the attacker needed
Access to the PointFarm contract; ability to deposit tokens
How it was found
- Deposit 3,528 uJENNY tokens into the PointFarm contract to accumulate rewards.
- Wait two days.
- Exploit the deposit() function to repeatedly mint rewards without settling the debt.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A reentrancy attack happens when a smart contract calls another contract before updating its own records. The attacker's contract can call back into the original function repeatedly, each time getting rewards without the contract noticing the debt. This let the attacker collect many rewards and buy an NFT.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.