ETH Price: $3,411.42 (+1.69%)

Contract

0xf5181AE6B3aFe4b6c0b3B7Fc1b5Ae0E3D2430860
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Add Next Round D...209787082024-10-16 14:25:4771 days ago1729088747IN
0xf5181AE6...3D2430860
0 ETH0.0009563522.00197476
Add Next Round D...201548712024-06-23 14:05:23186 days ago1719151523IN
0xf5181AE6...3D2430860
0 ETH0.000351262.92130751
Add Next Round D...201477242024-06-22 14:04:47187 days ago1719065087IN
0xf5181AE6...3D2430860
0 ETH0.00045963.82266117
Add Next Round D...201405782024-06-21 14:04:59188 days ago1718978699IN
0xf5181AE6...3D2430860
0 ETH0.00076956.39953843
Add Next Round D...201334202024-06-20 14:04:59189 days ago1718892299IN
0xf5181AE6...3D2430860
0 ETH0.001864315.50434528
Add Next Round D...201262712024-06-19 14:06:11190 days ago1718805971IN
0xf5181AE6...3D2430860
0 ETH0.001079488.97749082
Add Next Round D...201191202024-06-18 14:05:11191 days ago1718719511IN
0xf5181AE6...3D2430860
0 ETH0.0027747223.07576334
Add Next Round D...201119892024-06-17 14:05:23192 days ago1718633123IN
0xf5181AE6...3D2430860
0 ETH0.00116749.7086098
Add Next Round D...201048322024-06-16 14:04:11193 days ago1718546651IN
0xf5181AE6...3D2430860
0 ETH0.000558964.64855502
Add Next Round D...200976702024-06-15 14:04:47194 days ago1718460287IN
0xf5181AE6...3D2430860
0 ETH0.000872937.2597115
Add Next Round D...200905242024-06-14 14:04:23195 days ago1718373863IN
0xf5181AE6...3D2430860
0 ETH0.0016108513.39654659
Add Next Round D...200833772024-06-13 14:04:11196 days ago1718287451IN
0xf5181AE6...3D2430860
0 ETH0.0019668516.35720858
Add Next Round D...200762222024-06-12 14:03:47197 days ago1718201027IN
0xf5181AE6...3D2430860
0 ETH0.0036202130.10728078
Add Next Round D...200690612024-06-11 14:03:59198 days ago1718114639IN
0xf5181AE6...3D2430860
0 ETH0.0030399725.28174763
Add Next Round D...200619052024-06-10 14:03:47199 days ago1718028227IN
0xf5181AE6...3D2430860
0 ETH0.0020295816.87891579
Add Next Round D...200547522024-06-09 14:05:47200 days ago1717941947IN
0xf5181AE6...3D2430860
0 ETH0.0012054710.02525843
Add Next Round D...200475862024-06-08 14:03:47201 days ago1717855427IN
0xf5181AE6...3D2430860
0 ETH0.000936067.78473217
Add Next Round D...200404312024-06-07 14:05:11202 days ago1717769111IN
0xf5181AE6...3D2430860
0 ETH0.0025491721.19999829
Add Next Round D...200332652024-06-06 14:04:59203 days ago1717682699IN
0xf5181AE6...3D2430860
0 ETH0.0036788130.59456166
Add Next Round D...200261082024-06-05 14:04:47204 days ago1717596287IN
0xf5181AE6...3D2430860
0 ETH0.0032430426.97050474
Add Next Round D...200189372024-06-04 14:04:59205 days ago1717509899IN
0xf5181AE6...3D2430860
0 ETH0.0015496212.88737275
Add Next Round D...200117732024-06-03 14:04:59206 days ago1717423499IN
0xf5181AE6...3D2430860
0 ETH0.0024076520.02311713
Add Next Round D...200046182024-06-02 14:05:23207 days ago1717337123IN
0xf5181AE6...3D2430860
0 ETH0.00115759.6263065
Add Next Round D...199974522024-06-01 14:05:35208 days ago1717250735IN
0xf5181AE6...3D2430860
0 ETH0.0012380110.29584384
Add Next Round D...199902872024-05-31 14:04:23209 days ago1717164263IN
0xf5181AE6...3D2430860
0 ETH0.0029986124.9377752
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

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

Contract Name:
Oracle

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 4 : Oracle.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

import { IAggregatorV3 } from "./interfaces/IAggregatorV3.sol";
import { ICegaState } from "./interfaces/ICegaState.sol";
import { RoundData } from "./Structs.sol";

contract Oracle is IAggregatorV3 {
    event OracleCreated(address indexed cegaState, uint8 decimals, string description);
    event RoundDataAdded(int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
    event RoundDataUpdated(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

    uint8 public decimals;
    string public description;
    uint256 public version = 1;
    ICegaState public cegaState;
    RoundData[] public oracleData;
    uint80 public nextRoundId;

    /**
     * @notice Creates a new oracle for a given asset / data source pair
     * @param _cegaState is the address of the CegaState contract
     * @param _decimals is the number of decimals for the asset
     * @param _description is the aset
     */
    constructor(address _cegaState, uint8 _decimals, string memory _description) {
        cegaState = ICegaState(_cegaState);
        decimals = _decimals;
        description = _description;
        emit OracleCreated(_cegaState, _decimals, _description);
    }

    /**
     * @notice Asserts whether the sender has the SERVICE_ADMIN_ROLE
     */
    modifier onlyServiceAdmin() {
        require(cegaState.isServiceAdmin(msg.sender), "403:SA");
        _;
    }

    /**
     * @notice Asserts whether the sender has the DEFAULT_ADMIN_ROLE
     */
    modifier onlyDefaultAdmin() {
        require(cegaState.isDefaultAdmin(msg.sender), "403:DA");
        _;
    }

    /**
     * @notice Adds the pricing data for the next round
     * @param _roundData is the data to be added
     */
    function addNextRoundData(RoundData calldata _roundData) public onlyServiceAdmin {
        if (nextRoundId != 0) {
            (, , , uint256 updatedAt, ) = latestRoundData();
            require(updatedAt <= _roundData.startedAt, "400:P");
        }
        require(block.timestamp - 1 days <= _roundData.startedAt, "400:T"); // Within 1 days

        oracleData.push(_roundData);
        nextRoundId++;
        emit RoundDataAdded(_roundData.answer, _roundData.startedAt, _roundData.updatedAt, _roundData.answeredInRound);
    }

    /**
     * @notice Updates the pricing data for a given round
     * @param _roundData is the data to be updated
     */
    function updateRoundData(uint80 roundId, RoundData calldata _roundData) public onlyDefaultAdmin {
        oracleData[roundId] = _roundData;
        emit RoundDataUpdated(
            roundId,
            _roundData.answer,
            _roundData.startedAt,
            _roundData.updatedAt,
            _roundData.answeredInRound
        );
    }

    /**
     * @notice Gets the pricing data for a given round Id
     * @param _roundId is the id of the round
     */
    function getRoundData(
        uint80 _roundId
    )
        public
        view
        override
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
    {
        return (
            _roundId,
            oracleData[_roundId].answer,
            oracleData[_roundId].startedAt,
            oracleData[_roundId].updatedAt,
            oracleData[_roundId].answeredInRound
        );
    }

    /**
     * @notice Gets the pricing data for the latest round
     */
    function latestRoundData()
        public
        view
        override
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
    {
        uint80 _roundId = nextRoundId - 1;
        return (
            _roundId,
            oracleData[_roundId].answer,
            oracleData[_roundId].startedAt,
            oracleData[_roundId].updatedAt,
            oracleData[_roundId].answeredInRound
        );
    }
}

File 2 of 4 : IAggregatorV3.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface IAggregatorV3 {
    function decimals() external view returns (uint8);

    function description() external view returns (string memory);

    function version() external view returns (uint256);

    function getRoundData(
        uint80 _roundId
    )
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);

    function latestRoundData()
        external
        view
        returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}

File 3 of 4 : ICegaState.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

interface ICegaState {
    function marketMakerAllowList(address marketMaker) external view returns (bool);

    function products(string memory productName) external view returns (address);

    function oracleAddresses(string memory oracleName) external view returns (address);

    function oracleNames() external view returns (string[] memory);

    function productNames() external view returns (string[] memory);

    function feeRecipient() external view returns (address);

    function isDefaultAdmin(address sender) external view returns (bool);

    function isTraderAdmin(address sender) external view returns (bool);

    function isOperatorAdmin(address sender) external view returns (bool);

    function isServiceAdmin(address sender) external view returns (bool);

    function getOracleNames() external view returns (string[] memory);

    function addOracle(string memory oracleName, address oracleAddress) external;

    function removeOracle(string memory oracleName) external;

    function getProductNames() external view returns (string[] memory);

    function addProduct(string memory productName, address product) external;

    function removeProduct(string memory productName) external;

    function updateMarketMakerPermission(address marketMaker, bool allow) external;

    function setFeeRecipient(address _feeRecipient) external;

    function moveAssetsToProduct(string memory productName, address vaultAddress, uint256 amount) external;
}

File 4 of 4 : Structs.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;

enum OptionBarrierType {
    None,
    KnockIn
}

struct Deposit {
    uint256 amount;
    address receiver;
}

struct Withdrawal {
    uint256 amountShares;
    address receiver;
}

enum VaultStatus {
    DepositsClosed,
    DepositsOpen,
    NotTraded,
    Traded,
    TradeExpired,
    PayoffCalculated,
    FeesCollected,
    WithdrawalQueueProcessed,
    Zombie
}

struct OptionBarrier {
    uint256 barrierBps;
    uint256 barrierAbsoluteValue;
    uint256 strikeBps;
    uint256 strikeAbsoluteValue;
    string asset;
    string oracleName;
    OptionBarrierType barrierType;
}

struct FCNVaultMetadata {
    uint256 vaultStart;
    uint256 tradeDate;
    uint256 tradeExpiry;
    uint256 aprBps;
    uint256 tenorInDays;
    uint256 underlyingAmount; // This is how many assets were ever deposited into the vault
    uint256 currentAssetAmount; // This is how many assets are currently allocated for the vault (not sent for trade)
    uint256 totalCouponPayoff;
    uint256 vaultFinalPayoff;
    uint256 queuedWithdrawalsSharesAmount;
    uint256 queuedWithdrawalsCount;
    uint256 optionBarriersCount;
    uint256 leverage;
    address vaultAddress;
    VaultStatus vaultStatus;
    bool isKnockedIn;
    OptionBarrier[] optionBarriers;
}

struct RoundData {
    int256 answer;
    uint256 startedAt;
    uint256 updatedAt;
    uint80 answeredInRound;
}

Settings
{
  "metadata": {
    "bytecodeHash": "none"
  },
  "optimizer": {
    "enabled": true,
    "runs": 200,
    "details": {
      "yul": true
    }
  },
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_cegaState","type":"address"},{"internalType":"uint8","name":"_decimals","type":"uint8"},{"internalType":"string","name":"_description","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"cegaState","type":"address"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"},{"indexed":false,"internalType":"string","name":"description","type":"string"}],"name":"OracleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"int256","name":"answer","type":"int256"},{"indexed":false,"internalType":"uint256","name":"startedAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"updatedAt","type":"uint256"},{"indexed":false,"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"name":"RoundDataAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint80","name":"roundId","type":"uint80"},{"indexed":false,"internalType":"int256","name":"answer","type":"int256"},{"indexed":false,"internalType":"uint256","name":"startedAt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"updatedAt","type":"uint256"},{"indexed":false,"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"name":"RoundDataUpdated","type":"event"},{"inputs":[{"components":[{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"internalType":"struct RoundData","name":"_roundData","type":"tuple"}],"name":"addNextRoundData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cegaState","outputs":[{"internalType":"contract ICegaState","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"description","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"_roundId","type":"uint80"}],"name":"getRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextRoundId","outputs":[{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"oracleData","outputs":[{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint80","name":"roundId","type":"uint80"},{"components":[{"internalType":"int256","name":"answer","type":"int256"},{"internalType":"uint256","name":"startedAt","type":"uint256"},{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint80","name":"answeredInRound","type":"uint80"}],"internalType":"struct RoundData","name":"_roundData","type":"tuple"}],"name":"updateRoundData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

Deployed Bytecode

0x608060408181526004918236101561001657600080fd5b600092833560e01c9182632f87045c146106fd57508163313ce567146106dd5781634002eda6146106b557816348c717af1461046c57816354fd4d501461044d5781637284e4161461030a5781639a6fc8f5146102a0578163aa4dea001461023a578163ebd0bb30146100c8575063feaf968c1461009357600080fd5b346100c457816003193601126100c4576100c0906100af61080d565b929593949190915195869586610775565b0390f35b5080fd5b919050346102365760a0366003190112610236576100e461075a565b6080366023190112610232576003548251632c9556a560e11b8152338582015290602090829060249082906001600160a01b03165afa9081156102285785916101fa575b50156101ce57610137816107a5565b9390936101bc5750602435918284556044358060018601556003606435958660028201550194608435916001600160501b038316938484036101b8577fce681dc19b73a559407cc81dcf28f71444f3d9d1c594f98cc28ced88903aa799976101b2956001600160501b03198254161790555195869586610775565b0390a180f35b8880fd5b634e487b7160e01b8552849052602484fd5b815162461bcd60e51b815260208185015260066024820152653430333a444160d01b6044820152606490fd5b61021b915060203d8111610221575b6102138183610722565b8101906107f5565b38610128565b503d610209565b83513d87823e3d90fd5b8380fd5b8280fd5b9050823461029d57602036600319011261029d578135915482101561029d5750610263906107a5565b508054600182015460028301546003909301549351918252602082015260408101919091526001600160501b039091166060820152608090f35b80fd5b82843461029d57602036600319011261029d57506102bc61075a565b6100c06102c8826107a5565b50549260016102d6846107a5565b50015460026102e4856107a5565b500154906001600160501b0360036102fb876107a5565b50015416925195869586610775565b82843461029d578060031936011261029d5781519080600180549081811c918181168015610443575b6020988985108214610430575091839189959388958652908160001461040f57506001146103b4575b505061036e9250959392950382610722565b82519382859384528251928382860152825b84811061039e57505050828201840152601f01601f19168101030190f35b8181018301518882018801528795508201610380565b8086527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf69492508591905b8183106103f757508894505082010161036e8861035c565b855488840185015294850194879450918301916103df565b91505061036e94925060ff191682840152151560051b82010186928861035c565b634e487b7160e01b875260229052602486fd5b92607f1692610333565b5050346100c457816003193601126100c4576020906002549051908152f35b8383346100c45760803660031901126100c4576003548151633b9033c960e01b81523385820152602092916024919084908290849082906001600160a01b03165afa908115610228578591610698575b501561066e576001600160501b03918260055416610630575b6201517f1942019342851161061e5782358095116105f557508554680100000000000000008110156105e357806001610510920188556107a5565b9290926105d357863593848455856001850155600360443594856002820155019060643598818a1692838b036105cf576001600160501b0319938482541617905560055493828516918383146105be5750506001011691161760055551918252602082019290925260408101919091526001600160501b03929092166060830152907fe7ddf63c860421e83a9bedde9a44e9769a4e116a96f51ad2ecb8e0506bb4f1e69080608081016101b2565b634e487b7160e01b8b526011905289fd5b8980fd5b634e487b7160e01b865285875285fd5b634e487b7160e01b8652604187528286fd5b6064926005918893519362461bcd60e51b8552840152820152640d0c0c0e9560da1b6044820152fd5b634e487b7160e01b8652601187528286fd5b61063861080d565b5092505050823510156104d5576005606492858893519362461bcd60e51b85528401528201526403430303a560dc1b6044820152fd5b6006906064938693519362461bcd60e51b8552840152820152653430333a534160d01b6044820152fd5b6106af9150843d8611610221576102138183610722565b866104bc565b5050346100c457816003193601126100c4576020906001600160501b03600554169051908152f35b5050346100c457816003193601126100c45760ff60209254169051908152f35b8490346100c457816003193601126100c4576003546001600160a01b03168152602090f35b90601f8019910116810190811067ffffffffffffffff82111761074457604052565b634e487b7160e01b600052604160045260246000fd5b600435906001600160501b038216820361077057565b600080fd5b93608093969591929660a08601976001600160501b03809516875260208701526040860152606085015216910152565b6004548110156107df57600460005260021b7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0190600090565b634e487b7160e01b600052603260045260246000fd5b90816020910312610770575180151581036107705790565b6001600160501b03906000198260055416019180831161086857610830836107a5565b505492600161083e826107a5565b50015492600261084d836107a5565b50015492600361085c846107a5565b50015416919493929190565b634e487b7160e01b600052601160045260246000fdfea164736f6c6343000811000a

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
[ 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.