Platform: Code4rena
Start Date: 21/06/2022
Pot Size: $55,000 USDC
Total HM: 29
Participants: 88
Period: 5 days
Judge: gzeon
Total Solo HM: 7
Id: 134
League: ETH
Rank: 14/88
Findings: 7
Award: $994.00
🌟 Selected for report: 2
🚀 Solo Findings: 0
🌟 Selected for report: kenzo
Also found by: Metatron, WatchPug, cccz, unforgiven
Will result in either failure to lend or loss of funds for the lender
illuminateToken.balanceOf(address(this))
#0 - KenzoAgada
2022-06-28T10:33:24Z
Duplicate of #222
29.8781 USDC - $29.88
Attacker can steal funds and inflate or break the system
u
and maturity m
.ISense
interface, returning the maturity m
on .maturity()
(to pass L504 if) and returning an arbitrary big value on .swapUnderlyingForPTs(..)
a
and address to his malicious contract as x
.x
is actually a trustable AMM for sense contracts (I don't know sense enough to point how to do so)#0 - sourabhmarathe
2022-06-29T12:34:53Z
Duplicate of #349.
🌟 Selected for report: Metatron
Also found by: 0x52, WatchPug, auditor0517, cccz, datapunk, hansfriese, hyh, kenzo, kirk-baird, shenwilly, unforgiven
98.9071 USDC - $98.91
https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L247-L305 https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L317-L367 https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L192-L235
Using any of the lend
function mentioned, will result in loss of funds to the lender - as the funds are transferred from them but no iPTs are sent back to them!
Basically making lending via these external PTs unusable.
There is no minting of iPTs to the lender (or at all) in the 2 lend
functions below:
https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L247-L305
https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L317-L367
Corresponding to lending of (respectively): swivel element
Furthermore, in: https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L227-L234 Comment says "Purchase illuminate PTs directly to msg.sender", but this is not happening. sending yield PTs at best.
Mint the appropriate amount of iPTs to the lender - like in the rest of the lend functions.
🌟 Selected for report: kenzo
Also found by: 0x52, 0xkowloon, GalloDaSballo, Metatron, WatchPug, cccz, hansfriese, kirk-baird
Wrong accounting calculation may result in malfunctioning and loss of funds for the project.
https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L281-L283 https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L297
lend
functions the accounting is done as I described, the opposite of the current code.I recommend doing the accounting like this:
uint256 amount = a[i]; lent += amount; uint256 fee = calculateFee(amount); a[i] -= fee // correct the amount vector amountToMint += a[i] // amount minus the fee
Then
transferFrom
with corrected lent
(including the fees)initiate
swivel with the corrected amounts vector a
mint
only amountToMint
to the lender (sum of amounts minus the fees)#0 - KenzoAgada
2022-06-28T08:15:21Z
Duplicate of #201
🌟 Selected for report: Kumpa
Also found by: Metatron, cccz, cryptphi, hansfriese, jah, kenzo, kirk-baird, pashov, poirots
a
is transferFrom
lender on L215amount - fee
is invested on L219 and L229.lend
function, this one is missing crediting the project with the fees they entitled to.withdrawFee
or otherwise.Adding these lines:
uint256 fee = calculateFee(amount); fees[u] += fee;
Before the if
at L217,
And can use calculated fee fee
at L219 and L229 instead of calculating again.
#0 - KenzoAgada
2022-06-28T06:44:21Z
Duplicate of #208
206.7901 USDC - $206.79
Assuming admin decides to pause an external principle when it's dangerous, malicious or unprofitable, Bypassing the admins decision can result in loss of funds for the project.
p
is only used for unpaused(p)
modifier, and to emit an event.unpaused(p)
modifier check by simply passing an enum of another principle that is not paused.pause
is simple ignored.Add this check at the beginning of the function (just like in similar functions of this solution)
if (p != uint8(MarketPlace.Principals.Swivel)) { revert Invalid('principal'); }
🌟 Selected for report: defsec
Also found by: 0x1f8b, 0x29A, 0xDjango, 0xNazgul, 0xNineDec, 0xf15ers, 0xkowloon, 0xmint, Bnke0x0, BowTiedWardens, Chom, ElKu, Funen, GalloDaSballo, GimelSec, IllIllI, JC, Kenshin, Kulk0, Lambda, Limbooo, MadWookie, Metatron, Picodes, Soosh, StErMi, TomJ, WatchPug, Waze, Yiko, _Adam, ak1, asutorufos, aysha, bardamu, catchup, datapunk, delfin454000, dipp, fatherOfBlocks, grGred, hake, hansfriese, hyh, joestakey, kebabsec, kenzo, kirk-baird, oyc_109, pashov, poirots, rfa, robee, saian, sashik_eth, shenwilly, simon135, slywaters, z3s, zeesaw, zer0dot
63.8877 USDC - $63.89
[L-01] duplicated comment https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L313
[L-02] Change revert string to "principal already been set" https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/marketplace/MarketPlace.sol#L100