Closed sherlock-admin2 closed 1 year ago
2 comment(s) were left on this issue during the judging contest.
0xyPhilic commented:
invalid because this incentivises arbitrages in order to keep the gOHM price at 3k accross AMMs and it seems like a design choice
oot2k commented:
intended design
So the first buyers will get free money?
In my opinion this is a valid issue (at least Medium) as the price should be fixed at deployment time to the current trading price to avoid huge arbitrage to the detriment of the protocol. The protocol will loose funds if the contract is deployed when the gOHM price is < $3000.
Mlome
high
Clearinghouse
is giving away undercollateralized loans because of constant rateSummary
All the loans created by
Clearinghouse
have a fixed rate of3,000 DAI/gOHM
which is less than the current price (~$2900 as of August 2023). Hence,Clearinghouse
is giving away money!Vulnerability Detail
The
LOAN_TO_COLLATERAL
rate is hardcoded as aconstant
to3000e18
in theClearinghouse
contract. This means that all the loans created byClearinghouse
have a rate of3,000 DAI/gOHM
Proof of Concept
This test that can be added to
Clearing.t.sol
shows how requesting 3000 DAI (worth $3000) requires only 1e18 gOHM (worth ~$2900 at time of writing).Impact
Clearinghouse
is giving away undercollateralized loans as soon as the price ofgOHM
goes bellow$3000
. So, if the price ofgOHM
goes below$3000
(which is currently the case) the treasury can be drained (up toFUND_AMOUNT
, i.e. 18 million) by requesting undercollateralized loans.The protocol can be drained in on transaction by leveraging a flashloan:
FUND_AMOUNT
(18 million DAI)Code Snippet
https://github.com/ohmzeus/Cooler/blob/c6f2bbe1b51cdf3bb4d078875170177a1b8ba2a3/src/Clearinghouse.sol#L55
Tool used
Manual Review
Recommendation
LOAN_TO_COLLATERAL
should not be a constant and should be updatable by the governance.