MON Price: $0.022142 (-0.11%)

Contract

0x763673dD2c8e82a90a2F37e11A17e63c4Ba52D15

Overview

MON Balance

Monad Chain LogoMonad Chain LogoMonad Chain Logo0 MON

MON Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ScaledRedstoneFeed

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.22;

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

contract ScaledRedstoneFeed {
    IRedstoneFeed public immutable feed;
    uint256 public immutable scale; // multiplier to convert feed decimals -> target decimals

    event UpdatedFeed(address indexed oldFeed, address indexed newFeed);

    constructor(address _feed, uint256 _scale) {
        require(_feed != address(0), "zero feed");
        require(_scale > 0, "zero scale");
        feed = IRedstoneFeed(_feed);
        scale = _scale;
    }

    // Curve expects a single numeric view function. We expose latestAnswer with uint256 return.
    function latestAnswer() external view returns (uint256) {
        int256 v = feed.latestAnswer();
        require(v >= 0, "negative feed value");
        return uint256(v) * scale;
    }
}

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

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_feed","type":"address"},{"internalType":"uint256","name":"_scale","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldFeed","type":"address"},{"indexed":true,"internalType":"address","name":"newFeed","type":"address"}],"name":"UpdatedFeed","type":"event"},{"inputs":[],"name":"feed","outputs":[{"internalType":"contract IRedstoneFeed","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"latestAnswer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"scale","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

60c060405234801561001057600080fd5b5060405161037638038061037683398101604081905261002f916100c9565b6001600160a01b0382166100765760405162461bcd60e51b81526020600482015260096024820152681e995c9bc81999595960ba1b60448201526064015b60405180910390fd5b600081116100b35760405162461bcd60e51b815260206004820152600a6024820152697a65726f207363616c6560b01b604482015260640161006d565b6001600160a01b0390911660805260a052610103565b600080604083850312156100dc57600080fd5b82516001600160a01b03811681146100f357600080fd5b6020939093015192949293505050565b60805160a0516102436101336000396000818160a5015261019e015260008181604b015260cc01526102436000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806337a7b7d81461004657806350d25bcd1461008a578063f51e181a146100a0575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100926100c7565b604051908152602001610081565b6100927f000000000000000000000000000000000000000000000000000000000000000081565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610128573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014c91906101c9565b905060008112156101995760405162461bcd60e51b81526020600482015260136024820152726e6567617469766520666565642076616c756560681b604482015260640160405180910390fd5b6101c37f0000000000000000000000000000000000000000000000000000000000000000826101e2565b91505090565b6000602082840312156101db57600080fd5b5051919050565b808202811582820484141761020757634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220a14249b76da902ba6af10dbc1c79a4aa7c7423193946b954539037fab7087bfd64736f6c634300081600330000000000000000000000008c9f39f0d08ee284a4fe0198524fe7c28630ceab00000000000000000000000000000000000000000000000000000002540be400

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100415760003560e01c806337a7b7d81461004657806350d25bcd1461008a578063f51e181a146100a0575b600080fd5b61006d7f0000000000000000000000008c9f39f0d08ee284a4fe0198524fe7c28630ceab81565b6040516001600160a01b0390911681526020015b60405180910390f35b6100926100c7565b604051908152602001610081565b6100927f00000000000000000000000000000000000000000000000000000002540be40081565b6000807f0000000000000000000000008c9f39f0d08ee284a4fe0198524fe7c28630ceab6001600160a01b03166350d25bcd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610128573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014c91906101c9565b905060008112156101995760405162461bcd60e51b81526020600482015260136024820152726e6567617469766520666565642076616c756560681b604482015260640160405180910390fd5b6101c37f00000000000000000000000000000000000000000000000000000002540be400826101e2565b91505090565b6000602082840312156101db57600080fd5b5051919050565b808202811582820484141761020757634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220a14249b76da902ba6af10dbc1c79a4aa7c7423193946b954539037fab7087bfd64736f6c63430008160033

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

0000000000000000000000008c9f39f0d08ee284a4fe0198524fe7c28630ceab00000000000000000000000000000000000000000000000000000002540be400

-----Decoded View---------------
Arg [0] : _feed (address): 0x8C9f39f0D08EE284a4Fe0198524fE7C28630CEAb
Arg [1] : _scale (uint256): 10000000000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008c9f39f0d08ee284a4fe0198524fe7c28630ceab
Arg [1] : 00000000000000000000000000000000000000000000000000000002540be400


Block Transaction 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

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.