Contract 0x7561E6D8301cDac56787E203b06E98427a36B1e0 1

 
 
Txn Hash
Method
Block
From
To
Value
0xb004dd126cf94f11009b3b2e6fd42ad86a7cb11fb93426153fb3d39c2c27d9a00x6080604089338972019-11-14 18:21:551172 days 48 mins agoSet: Deployer IN  Create: ConstantPriceOracle0 Ether0.0012076810
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ConstantPriceOracle

Compiler Version
v0.5.7+commit.6da8b019

Optimization Enabled:
Yes with 200 runs

Other Settings:
byzantium EvmVersion, Apache-2.0 license
/**
 *Submitted for verification at Etherscan.io on 2020-01-15
*/

// File: contracts/meta-oracles/interfaces/IOracle.sol

/*
    Copyright 2019 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;


/**
 * @title IOracle
 * @author Set Protocol
 *
 * Interface for operating with any external Oracle that returns uint256 or
 * an adapting contract that converts oracle output to uint256
 */
interface IOracle {

    /**
     * Returns the queried data from an oracle returning uint256
     *
     * @return  Current price of asset represented in uint256
     */
    function read()
        external
        view
        returns (uint256);
}

// File: contracts/meta-oracles/oracles/ConstantPriceOracle.sol

/*
    Copyright 2019 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
*/

pragma solidity 0.5.7;



/**
 * @title ConstantPriceOracle
 * @author Set Protocol
 *
 * Oracle built to adhere to IOracle interface the returns a constant price. Intended
 * for stablecoin use.
 */
contract ConstantPriceOracle is
    IOracle
{
    /* ============ State Variables ============ */
    uint256 public stablePrice;

    /* ============ Constructor ============ */
    /*
     * Set price oracle is made to return
     *
     * @param  _oracleAddress    The address of oracle being proxied
     */
    constructor(
        uint256 _stablePrice
    )
        public
    {
        stablePrice = _stablePrice;
    }

    /**
     * Returns the stable price
     *
     * @return  Stable price of asset represented in uint256
     */
    function read()
        external
        view
        returns (uint256)
    {
        return stablePrice;
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"read","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stablePrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_stablePrice","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

608060405234801561001057600080fd5b506040516020806100ec8339810180604052602081101561003057600080fd5b505160005560a9806100436000396000f3fe6080604052348015600f57600080fd5b5060043610604e577c0100000000000000000000000000000000000000000000000000000000600035046357de26a481146053578063db61e31714606b575b600080fd5b60596071565b60408051918252519081900360200190f35b60596077565b60005490565b6000548156fea165627a7a723058203a8cbbf3d852dc85e199a6b9fdc8d5aa551e939f63f37d118e45b1687917e89e00290000000000000000000000000000000000000000000000000de0b6b3a7640000

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

0000000000000000000000000000000000000000000000000de0b6b3a7640000

-----Decoded View---------------
Arg [0] : _stablePrice (uint256): 1000000000000000000

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000


Deployed ByteCode Sourcemap

2053:693:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2053:693:0;;;;;;;;;;;;;;;;;;;;;;;;2626:117;;;:::i;:::-;;;;;;;;;;;;;;;;2159:26;;;:::i;2626:117::-;2692:7;2724:11;2626:117;:::o;2159:26::-;;;;:::o

Swarm Source

bzzr://3a8cbbf3d852dc85e199a6b9fdc8d5aa551e939f63f37d118e45b1687917e89e
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.