ETH Price: $3,174.18 (-2.78%)

Contract

0xEc6f4Cd64d28Ef32507e2dc399948aAe9Bbedd7e
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ExtendedGusdPriceProxy

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license
/**
 *Submitted for verification at Etherscan.io on 2021-01-11
*/

// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.7.6;

interface IExtendedAggregator {
  /**
   * @notice Return the address of the token of which this proxy provides the price of
   * @return address token
   */
  function getToken() external view returns (address);

  /**
   * @notice Return the numeric type of this proxy
   * @return uint256 type
   */
  function getTokenType() external view returns (uint256);

  /**
   * @notice Return the list of dependencies from where to check events on price updates
   * @return address[] addresses
   */
  function getSubTokens() external view returns (address[] memory);

  /**
   * @notice Returns the price
   * @return int256 price
   */
  function latestAnswer() external view returns (int256);

  /**
   * - 0: Invalid
   * - 1: Simple token
   * - 2: Complex token, with its price depending from other sources, for offchain tracking purposes
   */
  enum ProxyType {Invalid, Simple, Complex}
}

interface IChainlinkAggregator {
  function latestAnswer() external view returns (int256);
}

contract ExtendedGusdPriceProxy is IExtendedAggregator {
  IChainlinkAggregator public constant ETH_USD_CHAINLINK_PROXY = IChainlinkAggregator(
    0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419
  );
  int256 public constant NORMALIZATION = 1e8 * 1 ether; // 8 decimals to normalized the format on the ETH/USD pair and multiplying by 1 ether to get the price in wei
  address public constant ETH_USD_MOCK_ADDRESS = 0x10F7Fc1F91Ba351f9C629c5947AD69bD03C05b96;

  address internal constant GUSD = 0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd;
  ProxyType internal constant TYPE = ProxyType.Complex; // 2 = "Complex token", with its price depending from other sources, for offchain tracking purposes
  address[] internal _subTokens;

  event Setup(address indexed token, ProxyType proxyType, address[] subTokens);

  constructor() {
    _subTokens.push(ETH_USD_MOCK_ADDRESS);

    emit Setup(GUSD, TYPE, _subTokens);
  }

  function latestAnswer() external override view returns (int256) {
    int256 priceFromChainlink = ETH_USD_CHAINLINK_PROXY.latestAnswer();

    return (priceFromChainlink <= 0) ? 0 : NORMALIZATION / priceFromChainlink;
  }

  function getToken() external override pure returns (address) {
    return GUSD;
  }

  function getTokenType() external override pure returns (uint256) {
    return uint256(TYPE);
  }

  function getSubTokens() external override view returns (address[] memory) {
    return _subTokens;
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"enum IExtendedAggregator.ProxyType","name":"proxyType","type":"uint8"},{"indexed":false,"internalType":"address[]","name":"subTokens","type":"address[]"}],"name":"Setup","type":"event"},{"inputs":[],"name":"ETH_USD_CHAINLINK_PROXY","outputs":[{"internalType":"contract IChainlinkAggregator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETH_USD_MOCK_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NORMALIZATION","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSubTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTokenType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001810182558180527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5630180546001600160a01b0319167310f7fc1f91ba351f9c629c5947ad69bd03c05b9617905560405173056fd409e1d7a124bd7017459dfea2f387b6d5cd917f0e6f1b756ea40cd1921ec7c39c50a9c710cb5ac56ffe4d887bc7c3aa8d2522609160029190808381526020018060200182810382528381815481526020019150805480156100f557602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116100d7575b5050935050505060405180910390a26102d6806101136000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80636856867d1161005b5780636856867d146101185780637b534ce4146101205780639323e2d814610128578063fcab1819146101305761007d565b806321df0da71461008257806325f33d76146100a657806350d25bcd146100fe575b600080fd5b61008a610138565b604080516001600160a01b039092168252519081900360200190f35b6100ae610150565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156100ea5781810151838201526020016100d2565b505050509050019250505060405180910390f35b6101066101b2565b60408051918252519081900360200190f35b61008a61025c565b61008a610274565b61010661028c565b61010661029b565b73056fd409e1d7a124bd7017459dfea2f387b6d5cd90565b606060008054806020026020016040519081016040528092919081815260200182805480156101a857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161018a575b5050505050905090565b600080735f4ec3df9cbd43714fe2740f5e3616155c5b84196001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561020257600080fd5b505afa158015610216573d6000803e3d6000fd5b505050506040513d602081101561022c57600080fd5b50519050600081131561025357806a52b7d2dcc80cd2e40000008161024d57fe5b05610256565b60005b91505090565b7310f7fc1f91ba351f9c629c5947ad69bd03c05b9681565b735f4ec3df9cbd43714fe2740f5e3616155c5b841981565b6a52b7d2dcc80cd2e400000081565b60029056fea26469706673582212207770a24ccf99234f82cabcd0732dded3c04f53e6ed5def0690e2e7fd8b52acbc64736f6c63430007060033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80636856867d1161005b5780636856867d146101185780637b534ce4146101205780639323e2d814610128578063fcab1819146101305761007d565b806321df0da71461008257806325f33d76146100a657806350d25bcd146100fe575b600080fd5b61008a610138565b604080516001600160a01b039092168252519081900360200190f35b6100ae610150565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156100ea5781810151838201526020016100d2565b505050509050019250505060405180910390f35b6101066101b2565b60408051918252519081900360200190f35b61008a61025c565b61008a610274565b61010661028c565b61010661029b565b73056fd409e1d7a124bd7017459dfea2f387b6d5cd90565b606060008054806020026020016040519081016040528092919081815260200182805480156101a857602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161018a575b5050505050905090565b600080735f4ec3df9cbd43714fe2740f5e3616155c5b84196001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561020257600080fd5b505afa158015610216573d6000803e3d6000fd5b505050506040513d602081101561022c57600080fd5b50519050600081131561025357806a52b7d2dcc80cd2e40000008161024d57fe5b05610256565b60005b91505090565b7310f7fc1f91ba351f9c629c5947ad69bd03c05b9681565b735f4ec3df9cbd43714fe2740f5e3616155c5b841981565b6a52b7d2dcc80cd2e400000081565b60029056fea26469706673582212207770a24ccf99234f82cabcd0732dded3c04f53e6ed5def0690e2e7fd8b52acbc64736f6c63430007060033

Deployed Bytecode Sourcemap

1090:1467:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2255:85;;;:::i;:::-;;;;-1:-1:-1;;;;;2255:85:0;;;;;;;;;;;;;;2450:104;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2024:225;;;:::i;:::-;;;;;;;;;;;;;;;;1459:89;;;:::i;1150:137::-;;;:::i;1292:52::-;;;:::i;2346:98::-;;;:::i;2255:85::-;1588:42;2255:85;:::o;2450:104::-;2506:16;2538:10;2531:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2531:17:0;;;;;;;;;;;;;;;;;;;;;;;2450:104;:::o;2024:225::-;2080:6;2095:25;1240:42;-1:-1:-1;;;;;2123:36:0;;:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2123:38:0;;-1:-1:-1;2200:1:0;2178:23;;;2177:66;;2225:18;1331:13;2209:34;;;;;;2177:66;;;2205:1;2177:66;2170:73;;;2024:225;:::o;1459:89::-;1506:42;1459:89;:::o;1150:137::-;1240:42;1150:137;:::o;1292:52::-;1331:13;1292:52;:::o;2346:98::-;1670:17;;2346:98::o

Swarm Source

ipfs://7770a24ccf99234f82cabcd0732dded3c04f53e6ed5def0690e2e7fd8b52acbc

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.