Discover more of SonicScan Block Explorer's tools and services in one place.
Contract Source Code:
File 1 of 1 : CryptoFromOracleAndRedstone
# @version 0.3.10 """ @title CryptoFromOracleAndRedstone @author Curve.Fi @license MIT """ interface Oracle: def price() -> uint256: view def price_w() -> uint256: nonpayable interface Redstone: def latestAnswer() -> uint256: view def decimals() -> uint256: view ORACLE: public(immutable(Oracle)) REDSTONE: public(immutable(Redstone)) DECIMAL_MULTIPLIER: public(immutable(uint256)) @external def __init__( oracle: Oracle, redstone: Redstone ): ORACLE = oracle REDSTONE = redstone DECIMAL_MULTIPLIER = 10**(18 - redstone.decimals()) @external @view def price() -> uint256: p1: uint256 = ORACLE.price() p2: uint256 = REDSTONE.latestAnswer() assert p2 > 0 return p1 * p2 * DECIMAL_MULTIPLIER / 10**18 @external def price_w() -> uint256: p1: uint256 = ORACLE.price_w() p2: uint256 = REDSTONE.latestAnswer() assert p2 > 0 return p1 * p2 * DECIMAL_MULTIPLIER / 10**18
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.