Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
OracleWrapper
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-FileCopyrightText: © 2023 Dai Foundation <www.daifoundation.org>
// SPDX-License-Identifier: AGPL-3.0-or-later
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity ^0.8.21;
interface PipLike {
function read() external view returns (bytes32);
}
contract OracleWrapper {
PipLike public immutable pip;
address public immutable flapper;
uint256 public immutable divisor; // Assumes divisor << WAD
constructor(
address _pip,
address _flapper,
uint256 _divisor
) {
pip = PipLike(_pip);
flapper = _flapper;
divisor = _divisor;
}
function read() external view returns (bytes32) {
require(msg.sender == flapper, "OracleWrapper/unauthorized-reader"); // preserve oracles whitelisting
return bytes32(uint256(pip.read()) / divisor);
}
}{
"remappings": [
"dss-interfaces/=lib/dss-test/lib/dss-interfaces/src/",
"dss-test/=lib/dss-test/src/",
"forge-std/=lib/dss-test/lib/forge-std/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_pip","type":"address"},{"internalType":"address","name":"_flapper","type":"address"},{"internalType":"uint256","name":"_divisor","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"divisor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"flapper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pip","outputs":[{"internalType":"contract PipLike","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"read","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60e060405234801561001057600080fd5b5060405161038738038061038783398101604081905261002f91610066565b6001600160a01b03928316608052911660a05260c0526100a2565b80516001600160a01b038116811461006157600080fd5b919050565b60008060006060848603121561007b57600080fd5b6100848461004a565b92506100926020850161004a565b9150604084015190509250925092565b60805160a05160c0516102a46100e360003960008181605601526101830152600081816098015261010601526000818160d701526101a401526102a46000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80631f2dc5ef1461005157806357de26a41461008b5780635ca0d72314610093578063d741e2f9146100d2575b600080fd5b6100787f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100786100f9565b6100ba7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610082565b6100ba7f000000000000000000000000000000000000000000000000000000000000000081565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146101815760405162461bcd60e51b815260206004820152602160248201527f4f7261636c65577261707065722f756e617574686f72697a65642d72656164656044820152603960f91b606482015260840160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166357de26a46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610200573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102249190610233565b61022e919061024c565b919050565b60006020828403121561024557600080fd5b5051919050565b60008261026957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b9722448f6a4e10254b47ea6d4a84d5617cdf45133105a3ddd678f78e055c56664736f6c63430008150033000000000000000000000000dbbe5e9b1daa91430cf0772fcebe53f6c6f137df000000000000000000000000c5a9caeba70d6974cbdfb28120c3611dd99103550000000000000000000000000000000000000000000000000000000000005dc0
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80631f2dc5ef1461005157806357de26a41461008b5780635ca0d72314610093578063d741e2f9146100d2575b600080fd5b6100787f0000000000000000000000000000000000000000000000000000000000005dc081565b6040519081526020015b60405180910390f35b6100786100f9565b6100ba7f000000000000000000000000c5a9caeba70d6974cbdfb28120c3611dd991035581565b6040516001600160a01b039091168152602001610082565b6100ba7f000000000000000000000000dbbe5e9b1daa91430cf0772fcebe53f6c6f137df81565b6000336001600160a01b037f000000000000000000000000c5a9caeba70d6974cbdfb28120c3611dd991035516146101815760405162461bcd60e51b815260206004820152602160248201527f4f7261636c65577261707065722f756e617574686f72697a65642d72656164656044820152603960f91b606482015260840160405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000005dc07f000000000000000000000000dbbe5e9b1daa91430cf0772fcebe53f6c6f137df6001600160a01b03166357de26a46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610200573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102249190610233565b61022e919061024c565b919050565b60006020828403121561024557600080fd5b5051919050565b60008261026957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220b9722448f6a4e10254b47ea6d4a84d5617cdf45133105a3ddd678f78e055c56664736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000dbbe5e9b1daa91430cf0772fcebe53f6c6f137df000000000000000000000000c5a9caeba70d6974cbdfb28120c3611dd99103550000000000000000000000000000000000000000000000000000000000005dc0
-----Decoded View---------------
Arg [0] : _pip (address): 0xdbBe5e9B1dAa91430cF0772fCEbe53F6c6f137DF
Arg [1] : _flapper (address): 0xc5A9CaeBA70D6974cBDFb28120C3611Dd9910355
Arg [2] : _divisor (uint256): 24000
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000dbbe5e9b1daa91430cf0772fcebe53f6c6f137df
Arg [1] : 000000000000000000000000c5a9caeba70d6974cbdfb28120c3611dd9910355
Arg [2] : 0000000000000000000000000000000000000000000000000000000000005dc0
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.