While poking around a web service of one of the most popular DeFi projects in the space, you get a somewhat strange response from their server. Here’s a snippet:
A related on-chain exchange is selling (absurdly overpriced) collectibles called “DVNFT”, now at 999 ETH each.
This price is fetched from an on-chain oracle, based on 3 trusted reporters: 0xA732...A105,0xe924...9D15 and 0x81A5...850c.
Starting with just 0.1 ETH in balance, pass the challenge by obtaining all ETH available in the exchange.
TL;DR
There are two trusted EOA addresses that can set NFT price. The private key can be obtained from the HTTP request in the challenge description, so we can impersonate the trusted EOA and set NFT price to 0 when we buy it and set the price super high when we sell it.
Code Audit
Exchange.buyOne():
The price is fetched from oracle.getMedianPrice():
Ok so the price is essentially set by "source". What is this "source"?
So "sources" are just some trusted EOA addresses. Essentially the logic is storing prices from all sources in an array and taking the median as the final price. Sounds like we can steal the private key somehow and manipulate the price.
Recall that there is a HTTP request in challenge description: