Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 317 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Add Next Round D... | 20978708 | 71 days ago | IN | 0 ETH | 0.00095635 | ||||
Add Next Round D... | 20154871 | 186 days ago | IN | 0 ETH | 0.00035126 | ||||
Add Next Round D... | 20147724 | 187 days ago | IN | 0 ETH | 0.0004596 | ||||
Add Next Round D... | 20140578 | 188 days ago | IN | 0 ETH | 0.0007695 | ||||
Add Next Round D... | 20133420 | 189 days ago | IN | 0 ETH | 0.0018643 | ||||
Add Next Round D... | 20126271 | 190 days ago | IN | 0 ETH | 0.00107948 | ||||
Add Next Round D... | 20119120 | 191 days ago | IN | 0 ETH | 0.00277472 | ||||
Add Next Round D... | 20111989 | 192 days ago | IN | 0 ETH | 0.0011674 | ||||
Add Next Round D... | 20104832 | 193 days ago | IN | 0 ETH | 0.00055896 | ||||
Add Next Round D... | 20097670 | 194 days ago | IN | 0 ETH | 0.00087293 | ||||
Add Next Round D... | 20090524 | 195 days ago | IN | 0 ETH | 0.00161085 | ||||
Add Next Round D... | 20083377 | 196 days ago | IN | 0 ETH | 0.00196685 | ||||
Add Next Round D... | 20076222 | 197 days ago | IN | 0 ETH | 0.00362021 | ||||
Add Next Round D... | 20069061 | 198 days ago | IN | 0 ETH | 0.00303997 | ||||
Add Next Round D... | 20061905 | 199 days ago | IN | 0 ETH | 0.00202958 | ||||
Add Next Round D... | 20054752 | 200 days ago | IN | 0 ETH | 0.00120547 | ||||
Add Next Round D... | 20047586 | 201 days ago | IN | 0 ETH | 0.00093606 | ||||
Add Next Round D... | 20040431 | 202 days ago | IN | 0 ETH | 0.00254917 | ||||
Add Next Round D... | 20033265 | 203 days ago | IN | 0 ETH | 0.00367881 | ||||
Add Next Round D... | 20026108 | 204 days ago | IN | 0 ETH | 0.00324304 | ||||
Add Next Round D... | 20018937 | 205 days ago | IN | 0 ETH | 0.00154962 | ||||
Add Next Round D... | 20011773 | 206 days ago | IN | 0 ETH | 0.00240765 | ||||
Add Next Round D... | 20004618 | 207 days ago | IN | 0 ETH | 0.0011575 | ||||
Add Next Round D... | 19997452 | 208 days ago | IN | 0 ETH | 0.00123801 | ||||
Add Next Round D... | 19990287 | 209 days ago | IN | 0 ETH | 0.00299861 |
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
Contract Source Code (Solidity Standard Json-Input format)
// 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 ); } }
// 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); }
// 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; }
// 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; }
{ "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
- No Contract Security Audit Submitted- Submit Audit Here
[{"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
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.