Closed sherlock-admin closed 1 year ago
Unless I've misunderstood hah, I think youve misunderstood yieldspace tv a little bit
The sharesToken is not the the illuminate PT, fyToken
would be the illuminate PT.
sharesToken
is the yield bearing vault that the baseToken is deposited into, meaning the variance would depend on your choice of external yield bearing protocol (a 4626 vault, euler, compound, lido, etc.,), not on your protocol's Principal Token implementation.
Escalate for 1 USDC
Reminder @Evert0x
Escalate for 1 USDC
Reminder @Evert0x
You've created a valid escalation for 1 USDC!
To remove the escalation from consideration: Delete your comment. To change the amount you've staked on this escalation: Edit your comment (do not create a new comment).
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Escalate for 50 USDC See sponsor's comments. As per them and the source code seems like the issue is invalid, the 4626 functions are not being run on the 5095iPT.
Escalate for 50 USDC See sponsor's comments. As per them and the source code seems like the issue is invalid, the 4626 functions are not being run on the 5095iPT.
You've created a valid escalation for 50 USDC!
To remove the escalation from consideration: Delete your comment. To change the amount you've staked on this escalation: Edit your comment (do not create a new comment).
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Escalation accepted
Escalation accepted
This issue's escalations have been accepted!
Contestants' payouts and scores will be updated according to the changes made on this issue.
IllIllI
medium
No markets can be created since Illuminate PTs are not ERC-4626 tokens
Summary
No markets can be created since Illuminate PTs are not ERC-4626 tokens, and will cause pool creation to fail
Vulnerability Detail
I checked with the sponsor and they confirmed that the plan was to use yieldspace-tv pools to swap Illuminate PTs for underlying, and that they planned to deploy the existing pool contract, rather than writing a new special module. The existing
Pool
contract relies on the ERC-4626 interface to accomplish some of its tasks (and tokens that do not comply with it need to create new modules in order to override those functions). One such task is the fetching of the price, which relies onIERC4626.convertToAssets()
which does not exist in the EIP-5095 spec that the Illuminate PT follows. The fetching of the price is done in the pool constructor, and Illuminate PTs require the pool to already have been immutably set in the market before they're constructed, so therefore there is no way to create a market for any asset.In addition to not being able to construct the pools, there are other functions such as
asset()
, anddeposit()
(note the flipped args), which do not exist inERC5095
but are relied on by thePool
, so even if the constructor issue is addressed, things will fail later.Impact
Smart contract unable to operate due to lack of token funds
MarketPlace.createMarket()
can't be called with a valid pool, so nobody can use any feature of the Illuminate project.Code Snippet
Market creation unconditionally constructs Illuminate PTs:
https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/MarketPlace.sol#L150-L162
Illuminate PTs are EIP-5095 contracts, not EIP-4626 ones, and do not implement the
convertToAssets()
function:https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/tokens/ERC5095.sol#L13
The
immutable
pool is set in the constructor, and comes from theMarketPlace
:https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/tokens/ERC5095.sol#L37-L53
Pools must be set ahead of time, and cannot change once set:
https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/MarketPlace.sol#L259-L277
Yieldspace-tv
Pool
s rely on the function that does not exist in the Illuminate PT:https://github.com/yieldprotocol/yieldspace-tv/blob/8685abc2f57c2f3130165404a77620a3220fb182/src/Pool/Pool.sol#L1400-L1415
getC()
is called by the constructor, so pools cannot be constructed with Illuminate PTs:https://github.com/yieldprotocol/yieldspace-tv/blob/8685abc2f57c2f3130165404a77620a3220fb182/src/Pool/Pool.sol#L193
The existing fork tests mostly use the Yield USDC pool rather than creating an actual new pool.
Tool used
Manual Review
Recommendation
Implement a new yieldspace-tv module for EIP-5095 contracts