ETH Price: $3,029.96 (+3.95%)

Contract

0x86e761F620b7ac8Ea373e0463C8c3BCCE7bD385B
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RedstoneAggregator

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 400 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

import {IAggregator} from "interfaces/IAggregator.sol";

interface IRedstoneAdapter {
    function getValueForDataFeed(bytes32 dataFeedId) external view returns (uint256);
}

contract RedstoneAggregator is IAggregator {
    error ErrUnsafeUintToIntConversion();

    uint8 public constant decimals = 8;
    IRedstoneAdapter public immutable priceFeedAdapter;
    bytes32 public immutable dataFeedId;
    string public description;

    constructor(string memory _description, IRedstoneAdapter _priceFeedAdapter, bytes32 _dataFeedId) {
        description = _description;
        priceFeedAdapter = _priceFeedAdapter;
        dataFeedId = _dataFeedId;
    }

    function latestRoundData() public view override returns (uint80, int256, uint256, uint256, uint80) {
        return (0, latestAnswer(), 0, 0, 0);
    }

    function latestAnswer() public view override returns (int256) {
        uint256 uintAnswer = priceFeedAdapter.getValueForDataFeed(dataFeedId);

        if (uintAnswer > uint256(type(int256).max)) {
            revert ErrUnsafeUintToIntConversion();
        }

        return int256(uintAnswer);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;

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

    function latestAnswer() external view returns (int256 answer);

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

Settings
{
  "remappings": [
    "/=src/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "BoringSolidity/=lib/BoringSolidity/contracts/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/solmate/src/",
    "utils/=utils/",
    "libraries/=src/libraries/",
    "interfaces/=src/interfaces/",
    "cauldrons/=src/cauldrons/",
    "staking/=src/staking/",
    "swappers/=src/swappers/",
    "oracles/=src/oracles/",
    "strategies/=src/strategies/",
    "tokens/=src/tokens/",
    "periphery/=src/periphery/",
    "mixins/=src/mixins/",
    "lenses/=src/lenses/",
    "surl/=lib/surl/src/",
    "solady/=lib/solady/src/",
    "forge-deploy/=lib/forge-deploy/contracts/",
    "ExcessivelySafeCall/=lib/ExcessivelySafeCall/src/",
    "safe-contracts/=lib/safe-contracts/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 400
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"string","name":"_description","type":"string"},{"internalType":"contract IRedstoneAdapter","name":"_priceFeedAdapter","type":"address"},{"internalType":"bytes32","name":"_dataFeedId","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ErrUnsafeUintToIntConversion","type":"error"},{"inputs":[],"name":"dataFeedId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[],"name":"latestAnswer","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestRoundData","outputs":[{"internalType":"uint80","name":"","type":"uint80"},{"internalType":"int256","name":"","type":"int256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint80","name":"","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"priceFeedAdapter","outputs":[{"internalType":"contract IRedstoneAdapter","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60c060405234801561001057600080fd5b506040516106ac3803806106ac83398101604081905261002f91610085565b600061003b84826101f1565b506001600160a01b0390911660805260a052506102b0565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b038116811461008057600080fd5b919050565b60008060006060848603121561009a57600080fd5b83516001600160401b03808211156100b157600080fd5b818601915086601f8301126100c557600080fd5b8151818111156100d7576100d7610053565b604051601f8201601f19908116603f011681019083821181831017156100ff576100ff610053565b8160405282815260209350898484870101111561011b57600080fd5b600091505b8282101561013d5784820184015181830185015290830190610120565b6000848483010152809750505050610156818701610069565b93505050604084015190509250925092565b600181811c9082168061017c57607f821691505b60208210810361019c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156101ec57600081815260208120601f850160051c810160208610156101c95750805b601f850160051c820191505b818110156101e8578281556001016101d5565b5050505b505050565b81516001600160401b0381111561020a5761020a610053565b61021e816102188454610168565b846101a2565b602080601f831160018114610253576000841561023b5750858301515b600019600386901b1c1916600185901b1785556101e8565b600085815260208120601f198616915b8281101561028257888601518255948401946001909101908401610263565b50858210156102a05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a0516103cb6102e16000396000818160da0152610175015260008181607c01526101a801526103cb6000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c806350d25bcd1161005057806350d25bcd1461010a5780637284e41614610112578063feaf968c1461012757600080fd5b80630618311014610077578063313ce567146100bb578063370c826b146100d5575b600080fd5b61009e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c3600881565b60405160ff90911681526020016100b2565b6100fc7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100b2565b6100fc610166565b61011a610242565b6040516100b291906102f4565b61012f6102d0565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a0016100b2565b60405163227014c160e11b81527f0000000000000000000000000000000000000000000000000000000000000000600482015260009081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906344e0298290602401602060405180830381865afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102139190610342565b90506001600160ff1b0381111561023d57604051635dc1750760e11b815260040160405180910390fd5b919050565b6000805461024f9061035b565b80601f016020809104026020016040519081016040528092919081815260200182805461027b9061035b565b80156102c85780601f1061029d576101008083540402835291602001916102c8565b820191906000526020600020905b8154815290600101906020018083116102ab57829003601f168201915b505050505081565b6000806000806000806102e1610166565b9096909550600094508493508392509050565b600060208083528351808285015260005b8181101561032157858101830151858201604001528201610305565b506000604082860101526040601f19601f8301168501019250505092915050565b60006020828403121561035457600080fd5b5051919050565b600181811c9082168061036f57607f821691505b60208210810361038f57634e487b7160e01b600052602260045260246000fd5b5091905056fea26469706673582212207bd15ac264bd989b8d08778e90b370d91cccb157d32646f7256f09943aefc82564736f6c6343000814003300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000af23b08bcd8ad35d1e8e8f2d2b779024bd8d24a455448000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045745544800000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100725760003560e01c806350d25bcd1161005057806350d25bcd1461010a5780637284e41614610112578063feaf968c1461012757600080fd5b80630618311014610077578063313ce567146100bb578063370c826b146100d5575b600080fd5b61009e7f0000000000000000000000000af23b08bcd8ad35d1e8e8f2d2b779024bd8d24a81565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c3600881565b60405160ff90911681526020016100b2565b6100fc7f455448000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100b2565b6100fc610166565b61011a610242565b6040516100b291906102f4565b61012f6102d0565b6040805169ffffffffffffffffffff968716815260208101959095528401929092526060830152909116608082015260a0016100b2565b60405163227014c160e11b81527f4554480000000000000000000000000000000000000000000000000000000000600482015260009081906001600160a01b037f0000000000000000000000000af23b08bcd8ad35d1e8e8f2d2b779024bd8d24a16906344e0298290602401602060405180830381865afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102139190610342565b90506001600160ff1b0381111561023d57604051635dc1750760e11b815260040160405180910390fd5b919050565b6000805461024f9061035b565b80601f016020809104026020016040519081016040528092919081815260200182805461027b9061035b565b80156102c85780601f1061029d576101008083540402835291602001916102c8565b820191906000526020600020905b8154815290600101906020018083116102ab57829003601f168201915b505050505081565b6000806000806000806102e1610166565b9096909550600094508493508392509050565b600060208083528351808285015260005b8181101561032157858101830151858201604001528201610305565b506000604082860101526040601f19601f8301168501019250505092915050565b60006020828403121561035457600080fd5b5051919050565b600181811c9082168061036f57607f821691505b60208210810361038f57634e487b7160e01b600052602260045260246000fd5b5091905056fea26469706673582212207bd15ac264bd989b8d08778e90b370d91cccb157d32646f7256f09943aefc82564736f6c63430008140033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000af23b08bcd8ad35d1e8e8f2d2b779024bd8d24a455448000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045745544800000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _description (string): WETH
Arg [1] : _priceFeedAdapter (address): 0x0af23B08bcd8AD35D1e8e8f2D2B779024Bd8D24A
Arg [2] : _dataFeedId (bytes32): 0x4554480000000000000000000000000000000000000000000000000000000000

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 0000000000000000000000000af23b08bcd8ad35d1e8e8f2d2b779024bd8d24a
Arg [2] : 4554480000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [4] : 5745544800000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

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.