CELO Price: $0.86 (-1.35%)
Gas: 5 GWei

Contract

0x00005c39A418F364ace58a1c83b285C28EA4b978

Overview

CELO Balance

Celo Chain LogoCelo Chain LogoCelo Chain Logo0 CELO

CELO Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value

There are no matching entries

Please try again later

Latest 1 internal transaction

Parent Transaction Hash Block From To Value
101938742021-12-03 16:01:50871 days ago1638547310  Contract Creation0 CELO
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0xe138cea3...2e8A884Cc
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
PriceFeed

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion, MIT license
File 1 of 3 : PriceFeed.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
import './ISlidingWindowOracle.sol';


interface IERC20 {
    function decimals() external view returns(uint8);
}


contract PriceFeed {
    address public immutable tokenIn;
    address public immutable tokenOut;
    uint public immutable oneToken;
    ISlidingWindowOracle public immutable slidingWindowOracle;

    constructor(address _tokenIn, address _tokenOut, ISlidingWindowOracle _slidingWindowOracle) {
        tokenIn = _tokenIn;
        tokenOut = _tokenOut;
        slidingWindowOracle = _slidingWindowOracle;
        oneToken = uint(10)**(IERC20(tokenIn).decimals());
    }

    function consult() external view returns (uint) {
        return slidingWindowOracle.consult(tokenIn, oneToken, tokenOut);
    }
}

File 1 of 3 : IUniswapV2Pair.sol
pragma solidity >=0.5.0;

interface IUniswapV2Pair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 1 of 3 : ISlidingWindowOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;


interface ISlidingWindowOracle {
    function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut);
    function update(address tokenA, address tokenB) external;
    function periodSize() external view returns (uint);
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"contract ISlidingWindowOracle","name":"_slidingWindowOracle","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"consult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oneToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slidingWindowOracle","outputs":[{"internalType":"contract ISlidingWindowOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIn","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenOut","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100675760003560e01c8063a27eccc111610050578063a27eccc1146100d3578063c8d5cd6a146100fa578063d0202d3b1461012157600080fd5b80636daf390b1461006c5780637eeda703146100bd575b600080fd5b6100937f000000000000000000000000452ef5a4bd00796e62e5e5758548e0da6e8ccdf381565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6100c5610148565b6040519081526020016100b4565b6100c57f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b6100937f00000000000000000000000007703c297310da365c22facaabe5b5bc6ecba51081565b6100937f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a81565b6040517f8c86f1e400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000452ef5a4bd00796e62e5e5758548e0da6e8ccdf3811660048301527f0000000000000000000000000000000000000000000000000de0b6b3a764000060248301527f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a811660448301526000917f00000000000000000000000007703c297310da365c22facaabe5b5bc6ecba51090911690638c86f1e49060640160206040518083038186803b15801561024257600080fd5b505afa158015610256573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027a919061027f565b905090565b60006020828403121561029157600080fd5b505191905056fea264697066735822122026dd96b88b5870a3e31739e017a07c2ba18ebc877bbe9c3394f89cf78e88daf964736f6c63430008090033

Block Transaction 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
[ Download: CSV Export  ]

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.