Discover more of Etherscan's tools and services in one place.
Sponsored
Contract Source Code:
File 1 of 1 : xSushiExchangeRate
//SPDX-License-Identifier: Unlicense pragma solidity ^0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); } contract xSushiExchangeRate { IERC20 xSushi; IERC20 sushi; constructor(address _xSushi, address _sushi) { xSushi = IERC20(_xSushi); sushi = IERC20(_sushi); } function getExchangeRate() public view returns (uint256) { return sushi.balanceOf(address(xSushi))*(10**18) / xSushi.totalSupply(); } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.