Darknet Contracts

darknet.sol

The provided Solidity file defines a smart contract named Darknet. This contract serves as an oracle that retrieves prices for different types of Ethereum-based tokens, referred to as LSDs in the comments. The contract has predefined addresses for each type of LSD and uses specific interfaces to interact with each LSD's smart contract to retrieve the price per share, exchange rate, or other pricing information. It has a single public function, checkPrice, which takes in the address of an LSD and returns the current price for that LSD.

Darknet

A contract that serves as an oracle for retrieving prices for different types of Ethereum-based tokens, referred to as LSDs.

checkPrice

function checkPrice(address) public view returns (uint256)

Retrieves the current price for the provided LSD address. The price is retrieved from the LSD's smart contract.

Parameters

  • lsd address: The address of the LSD for which to retrieve the price.

Return Values

  • uint256: The current price for the provided LSD.

Errors

  • revert: If the provided LSD address does not match any of the predefined LSD addresses, the function reverts.
Previous
unshETH.sol