Contract 0xC3e733eaCCD9c3bc54450aCe8074F589760Ae079 1

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xac5cf55414a376f801c9c77d871dfd775ef0ac8ef64e1875b170a3e7f05695530x6080604061071852022-02-15 13:31:52833 days 17 hrs ago0xd8166138eda6defd2bf2403d7637f41ce01c4bbe IN  Create: OracleAggregator0 ETH0.00146442201 ETH0.547283602
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x995e809942d7f590bca5f8380f94e0bedca4624848a7bfaf4264296410c0c60f710283122023-03-18 8:20:22437 days 22 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x74fefa58da9e4b9a239cbfe04e8aa2f85a0de82e1edb277d8b020b2e1f44c9d1706793762023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x74fefa58da9e4b9a239cbfe04e8aa2f85a0de82e1edb277d8b020b2e1f44c9d1706793762023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x6558387def6b0940bea36dbf83f77eb9df3f88db0ffab1149c6094c2d0177b9f706793752023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x6558387def6b0940bea36dbf83f77eb9df3f88db0ffab1149c6094c2d0177b9f706793752023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x8a84f396139a6631a54c42a787d3ba0106a4b025b337a0fe64c632af3d57e67d706793742023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x8a84f396139a6631a54c42a787d3ba0106a4b025b337a0fe64c632af3d57e67d706793742023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xe617eece9af8191a773890136878b8778688c56b0d72e638c48ab0c8f0a8cf49706793732023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xe617eece9af8191a773890136878b8778688c56b0d72e638c48ab0c8f0a8cf49706793732023-03-17 8:00:12438 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x7fa4d4ab9f04e3381e324040dceac235979fbba23c2e979b434fd411568c293d684668592023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x7fa4d4ab9f04e3381e324040dceac235979fbba23c2e979b434fd411568c293d684668592023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xed761356e4d45fdeeaafdc571124faa4bd9772c5f3faf71e7cddb7e995cca02c684668592023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xed761356e4d45fdeeaafdc571124faa4bd9772c5f3faf71e7cddb7e995cca02c684668592023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x5626be348fe524b838a0ba670debc529dcab681019eebb4ba117343b3b22b41d684668592023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x5626be348fe524b838a0ba670debc529dcab681019eebb4ba117343b3b22b41d684668592023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xe5e1ecdcbd7cb08212c50f40ecfee683eae2f36827624c5d7b786cfe7f0c7393684668582023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xe5e1ecdcbd7cb08212c50f40ecfee683eae2f36827624c5d7b786cfe7f0c7393684668582023-03-10 8:00:08445 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xd38bd4172f60bb84dcb60d799c3a3783d20ced7a36c3f0b107a9ac823fbc3b02663119212023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0xd38bd4172f60bb84dcb60d799c3a3783d20ced7a36c3f0b107a9ac823fbc3b02663119212023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x959b4cf5c31e9c6bd14405a2f071642d54c846941443ac19c61a524b22cb7ae9663119202023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x959b4cf5c31e9c6bd14405a2f071642d54c846941443ac19c61a524b22cb7ae9663119202023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x4eb7d49cc25946d0469fdd8604f3769a6937e179d5c616b6055fb839837d75f8663119202023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x4eb7d49cc25946d0469fdd8604f3769a6937e179d5c616b6055fb839837d75f8663119202023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x4184147af829f05db563d78f036daad7c2d6b57c077213feff870d907c4b527c663119192023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
0x4184147af829f05db563d78f036daad7c2d6b57c077213feff870d907c4b527c663119192023-03-03 8:00:14452 days 23 hrs ago Opium Network: Oracle Aggregator 0xc3e733eaccd9c3bc54450ace8074f589760ae0790 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
OracleAggregator

Compiler Version
v0.8.5+commit.a4f2e591

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 1 : OracleAggregator.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.5;

/**
    Error codes:
    - O1 = ERROR_ORACLE_AGGREGATOR_DATA_ALREADY_EXISTS
    - O2 = ERROR_ORACLE_AGGREGATOR_DATA_DOESNT_EXIST
 */

/// @title Opium.OracleAggregator contract requests and caches the data from `oracleId`s and provides them to the Core for positions execution
contract OracleAggregator {
    event LogDataProvided(address indexed _oracleId, uint256 indexed _timestamp, uint256 indexed _data);
    // Storage for the `oracleId` results
    // dataCache[oracleId][timestamp] => data
    mapping(address => mapping(uint256 => uint256)) private dataCache;

    // Flags whether data were provided
    // dataExist[oracleId][timestamp] => bool
    mapping(address => mapping(uint256 => bool)) private dataExist;

    // EXTERNAL FUNCTIONS

    /// @notice Receives and caches data from `msg.sender`
    /// @param timestamp uint256 Timestamp of data
    /// @param data uint256 Data itself
    function __callback(uint256 timestamp, uint256 data) external {
        // Don't allow to push data twice
        require(!dataExist[msg.sender][timestamp], "O1");

        // Saving data
        dataCache[msg.sender][timestamp] = data;

        // Flagging that data were received
        dataExist[msg.sender][timestamp] = true;

        emit LogDataProvided(msg.sender, timestamp, data);
    }

    // VIEW FUNCTIONS

    /// @notice Returns cached data if they exist, or reverts with an error
    /// @param oracleId address Address of the `oracleId` smart contract
    /// @param timestamp uint256 Timestamp at which data were requested
    /// @return dataResult uint256 Cached data provided by `oracleId`
    function getData(address oracleId, uint256 timestamp) external view returns (uint256 dataResult) {
        // Check if Opium.OracleAggregator has data
        require(hasData(oracleId, timestamp), "O2");

        // Return cached data
        dataResult = dataCache[oracleId][timestamp];
    }

    /// @notice Getter for dataExist mapping
    /// @param oracleId address Address of the `oracleId` smart contract
    /// @param timestamp uint256 Timestamp at which data were requested
    /// @param result bool Returns whether data were provided already
    function hasData(address oracleId, uint256 timestamp) public view returns (bool result) {
        return dataExist[oracleId][timestamp];
    }

    // Reserved storage space to allow for layout changes in the future.
    uint256[50] private __gap;
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_oracleId","type":"address"},{"indexed":true,"internalType":"uint256","name":"_timestamp","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_data","type":"uint256"}],"name":"LogDataProvided","type":"event"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"data","type":"uint256"}],"name":"__callback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oracleId","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"getData","outputs":[{"internalType":"uint256","name":"dataResult","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oracleId","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"hasData","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50610297806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632979d025146100465780633102e5ab1461006c578063c8384d2f14610081575b600080fd5b610059610054366004610207565b6100ca565b6040519081526020015b60405180910390f35b61007f61007a36600461023f565b61014d565b005b6100ba61008f366004610207565b6001600160a01b03919091166000908152600160209081526040808320938352929052205460ff1690565b6040519015158152602001610063565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff166101275760405162461bcd60e51b8152602060048201526002602482015261279960f11b60448201526064015b60405180910390fd5b506001600160a01b03909116600090815260208181526040808320938352929052205490565b33600090815260016020908152604080832085845290915290205460ff161561019d5760405162461bcd60e51b81526020600482015260026024820152614f3160f01b604482015260640161011e565b3360008181526020818152604080832086845282528083208590558383526001808352818420878552909252808320805460ff1916909217909155518392859290917fbafe09c91210ac772a509fe28b36bf6b3c82f1aa1db44d58721d57a9595417de9190a45050565b6000806040838503121561021a57600080fd5b82356001600160a01b038116811461023157600080fd5b946020939093013593505050565b6000806040838503121561025257600080fd5b5050803592602090910135915056fea2646970667358221220285c5e7f5702c9e18d23c3371355364ac0c60109d736d927c56bd1a49355bd7864736f6c63430008050033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c80632979d025146100465780633102e5ab1461006c578063c8384d2f14610081575b600080fd5b610059610054366004610207565b6100ca565b6040519081526020015b60405180910390f35b61007f61007a36600461023f565b61014d565b005b6100ba61008f366004610207565b6001600160a01b03919091166000908152600160209081526040808320938352929052205460ff1690565b6040519015158152602001610063565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff166101275760405162461bcd60e51b8152602060048201526002602482015261279960f11b60448201526064015b60405180910390fd5b506001600160a01b03909116600090815260208181526040808320938352929052205490565b33600090815260016020908152604080832085845290915290205460ff161561019d5760405162461bcd60e51b81526020600482015260026024820152614f3160f01b604482015260640161011e565b3360008181526020818152604080832086845282528083208590558383526001808352818420878552909252808320805460ff1916909217909155518392859290917fbafe09c91210ac772a509fe28b36bf6b3c82f1aa1db44d58721d57a9595417de9190a45050565b6000806040838503121561021a57600080fd5b82356001600160a01b038116811461023157600080fd5b946020939093013593505050565b6000806040838503121561025257600080fd5b5050803592602090910135915056fea2646970667358221220285c5e7f5702c9e18d23c3371355364ac0c60109d736d927c56bd1a49355bd7864736f6c63430008050033

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.