Contract 0xf955a6694c6f5629f5ecd514094b3bd450b59000

Txn Hash Method
Block
From
To
Value [Txn Fee]
0xf9097809f56d7d003e5eb16235ed6618bf3a242af3f2df2e3ccd41500e5f93c10x60806040194472312022-09-02 14:29:5487 days 17 mins ago0x6b4020dc274283afc240feccc27eff3a1f0f44f4 IN  Create: JLPWAVAXUSDCOracle0 AVAX0.0504628575
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
JLPWAVAXUSDCOracle

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 2 : JLPWAVAXUSDCOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "../interfaces/IOracle.sol";

// Chainlink Aggregator

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

interface IJoePair {
    function getReserves() external view returns ( uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
    function totalSupply() external view returns (uint256);
}

contract JLPWAVAXUSDCOracle is IOracle {
    IJoePair constant public joePair = IJoePair(0xf4003F4efBE8691B60249E6afbD307aBE7758adb);
    IAggregator constant public AVAX = IAggregator(0x0A77230d17318075983913bC2145DB16C7366156);
    IAggregator constant public USDC = IAggregator(0xF096872672F44d6EBA71458D74fe67F9a77a23B9);

    function _get() internal view returns (uint256) {

        uint256 usdcPrice = uint256(USDC.latestAnswer());
        uint256 avaxPrice = uint256(AVAX.latestAnswer());
        (uint112 wavaxReserve, uint112 usdcReserve, ) = joePair.getReserves();

        uint256 price = (wavaxReserve * avaxPrice + usdcReserve * usdcPrice * 1e12) / uint256(joePair.totalSupply());

        return 1e26 / price;
    }

    // Get the latest exchange rate
    /// @inheritdoc IOracle
    function get(bytes calldata) public view override returns (bool, uint256) {
        return (true, _get());
    }

    // Check the last exchange rate without any state changes
    /// @inheritdoc IOracle
    function peek(bytes calldata) public view override returns (bool, uint256) {
        return (true, _get());
    }

    // Check the current spot exchange rate without any state changes
    /// @inheritdoc IOracle
    function peekSpot(bytes calldata data) external view override returns (uint256 rate) {
        (, rate) = peek(data);
    }

    /// @inheritdoc IOracle
    function name(bytes calldata) public pure override returns (string memory) {
        return "Chainlink WAVAX-USDC JLP";
    }

    /// @inheritdoc IOracle
    function symbol(bytes calldata) public pure override returns (string memory) {
        return "WAVAX-USDC JLP/USD";
    }
}

File 2 of 2 : IOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity >= 0.6.12;

interface IOracle {
    /// @notice Get the latest exchange rate.
    /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
    /// For example:
    /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
    /// @return success if no valid (recent) rate is available, return false else true.
    /// @return rate The rate of the requested asset / pair / pool.
    function get(bytes calldata data) external returns (bool success, uint256 rate);

    /// @notice Check the last exchange rate without any state changes.
    /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
    /// For example:
    /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
    /// @return success if no valid (recent) rate is available, return false else true.
    /// @return rate The rate of the requested asset / pair / pool.
    function peek(bytes calldata data) external view returns (bool success, uint256 rate);

    /// @notice Check the current spot exchange rate without any state changes. For oracles like TWAP this will be different from peek().
    /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
    /// For example:
    /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
    /// @return rate The rate of the requested asset / pair / pool.
    function peekSpot(bytes calldata data) external view returns (uint256 rate);

    /// @notice Returns a human readable (short) name about this oracle.
    /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
    /// For example:
    /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
    /// @return (string) A human readable symbol name about this oracle.
    function symbol(bytes calldata data) external view returns (string memory);

    /// @notice Returns a human readable name about this oracle.
    /// @param data Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle.
    /// For example:
    /// (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));
    /// @return (string) A human readable name about this oracle.
    function name(bytes calldata data) external view returns (string memory);
}

Settings
{
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"name":"AVAX","outputs":[{"internalType":"contract IAggregator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"contract IAggregator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"get","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"joePair","outputs":[{"internalType":"contract IJoePair","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"peek","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"peekSpot","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b50610b3b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063d39bbef01161005b578063d39bbef014610117578063d568866c14610147578063d6d7d52514610177578063eeb8a8d3146101a857610088565b80636bca89cb1461008d57806389a30271146100ab578063b59f091e146100c9578063c699c4d6146100e7575b600080fd5b6100956101d9565b6040516100a29190610800565b60405180910390f35b6100b36101f1565b6040516100c091906107e5565b60405180910390f35b6100d1610209565b6040516100de91906107e5565b60405180910390f35b61010160048036038101906100fc9190610661565b610221565b60405161010e919061081b565b60405180910390f35b610131600480360381019061012c9190610661565b610261565b60405161013e919061083d565b60405180910390f35b610161600480360381019061015c9190610661565b610279565b60405161016e919061081b565b60405180910390f35b610191600480360381019061018c9190610661565b6102b9565b60405161019f9291906107bc565b60405180910390f35b6101c260048036038101906101bd9190610661565b6102d1565b6040516101d09291906107bc565b60405180910390f35b73f4003f4efbe8691b60249e6afbd307abe7758adb81565b73f096872672f44d6eba71458d74fe67f9a77a23b981565b730a77230d17318075983913bc2145db16c736615681565b60606040518060400160405280601281526020017f57415641582d55534443204a4c502f5553440000000000000000000000000000815250905092915050565b600061026d83836102d1565b90508091505092915050565b60606040518060400160405280601881526020017f436861696e6c696e6b2057415641582d55534443204a4c500000000000000000815250905092915050565b60008060016102c66102e9565b915091509250929050565b60008060016102de6102e9565b915091509250929050565b60008073f096872672f44d6eba71458d74fe67f9a77a23b973ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561034657600080fd5b505afa15801561035a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037e91906106a6565b90506000730a77230d17318075983913bc2145db16c736615673ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103dc57600080fd5b505afa1580156103f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041491906106a6565b905060008073f4003f4efbe8691b60249e6afbd307abe7758adb73ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561047357600080fd5b505afa158015610487573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ab91906106cf565b5091509150600073f4003f4efbe8691b60249e6afbd307abe7758adb73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561050c57600080fd5b505afa158015610520573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610544919061071e565b64e8d4a5100086846dffffffffffffffffffffffffffff1661056691906108fb565b61057091906108fb565b85856dffffffffffffffffffffffffffff1661058c91906108fb565b6105969190610874565b6105a091906108ca565b9050806a52b7d2dcc80cd2e40000006105b991906108ca565b9550505050505090565b60008083601f8401126105d557600080fd5b8235905067ffffffffffffffff8111156105ee57600080fd5b60208301915083600182028301111561060657600080fd5b9250929050565b60008151905061061c81610aa9565b92915050565b60008151905061063181610ac0565b92915050565b60008151905061064681610ad7565b92915050565b60008151905061065b81610aee565b92915050565b6000806020838503121561067457600080fd5b600083013567ffffffffffffffff81111561068e57600080fd5b61069a858286016105c3565b92509250509250929050565b6000602082840312156106b857600080fd5b60006106c68482850161060d565b91505092915050565b6000806000606084860312156106e457600080fd5b60006106f286828701610622565b935050602061070386828701610622565b92505060406107148682870161064c565b9150509250925092565b60006020828403121561073057600080fd5b600061073e84828501610637565b91505092915050565b61075081610955565b82525050565b61075f816109bf565b82525050565b61076e816109e3565b82525050565b600061077f82610858565b6107898185610863565b9350610799818560208601610a07565b6107a281610a98565b840191505092915050565b6107b6816109a5565b82525050565b60006040820190506107d16000830185610747565b6107de60208301846107ad565b9392505050565b60006020820190506107fa6000830184610756565b92915050565b60006020820190506108156000830184610765565b92915050565b600060208201905081810360008301526108358184610774565b905092915050565b600060208201905061085260008301846107ad565b92915050565b600081519050919050565b600082825260208201905092915050565b600061087f826109a5565b915061088a836109a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156108bf576108be610a3a565b5b828201905092915050565b60006108d5826109a5565b91506108e0836109a5565b9250826108f0576108ef610a69565b5b828204905092915050565b6000610906826109a5565b9150610911836109a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561094a57610949610a3a565b5b828202905092915050565b60008115159050919050565b6000819050919050565b60006dffffffffffffffffffffffffffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b60006109ca826109d1565b9050919050565b60006109dc82610985565b9050919050565b60006109ee826109f5565b9050919050565b6000610a0082610985565b9050919050565b60005b83811015610a25578082015181840152602081019050610a0a565b83811115610a34576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b610ab281610961565b8114610abd57600080fd5b50565b610ac98161096b565b8114610ad457600080fd5b50565b610ae0816109a5565b8114610aeb57600080fd5b50565b610af7816109af565b8114610b0257600080fd5b5056fea2646970667358221220f99f6661c10a705c457a1d8ee18392d07107d495fd334de1b4d65551ddfb90dd64736f6c63430008040033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.