Contract 0x785808779131b0947f42b4b54537a4682ebeab86

 

Contract Overview

Balance:
0 MATIC

MATIC Value:
$0.00

Token:
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xc01de39c996fce78552d9716b01a449232ee4af2ca38d9116df5ee24bb1ca720Transfer Ownersh...155915622021-06-11 15:25:23381 days 5 hrs ago0x62ca555de2d65f8e9d45a9b3d5c1b92ac1a64ecc IN  0x785808779131b0947f42b4b54537a4682ebeab860 MATIC0.000057372
0x0f52eae4fd3ee7bf105812c3debdc714320e755ef2b727bdff5cbc3a820fa194Transfer Ownersh...146364992021-05-18 8:28:12405 days 12 hrs agoIron.Finance: Deployer IN  0x785808779131b0947f42b4b54537a4682ebeab860 MATIC0.0000308851
0x24bba800bb50730cc7d8debce47d7d42eb2858ddafc92490aee26cfe97130ac30x60806040145911352021-05-17 4:38:54406 days 15 hrs agoIron.Finance: Deployer IN  Create: CollateralOracle0 MATIC0.0004426851
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CollateralOracle

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at polygonscan.com on 2021-06-09
*/

// Sources flattened with hardhat v2.2.1 https://hardhat.org
// SPDX-License-Identifier: MIT
// File @openzeppelin/contracts/utils/[email protected]

pragma solidity ^0.8.0;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// File @openzeppelin/contracts/access/[email protected]

pragma solidity ^0.8.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// File @chainlink/contracts/src/v0.6/interfaces/[email protected]

pragma solidity >=0.6.0;

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

    function description() external view returns (string memory);

    function version() external view returns (uint256);

    // getRoundData and latestRoundData should both raise "No data present"
    // if they do not have data to report, instead of returning unset values
    // which could be misinterpreted as actual reported values.
    function getRoundData(uint80 _roundId)
        external
        view
        returns (
            uint80 roundId,
            int256 answer,
            uint256 startedAt,
            uint256 updatedAt,
            uint80 answeredInRound
        );

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

// File contracts/interfaces/IOracle.sol

pragma solidity 0.8.4;
pragma experimental ABIEncoderV2;

interface IOracle {
    function consult() external view returns (uint256);
}

// File contracts/oracle/CollateralOracle.sol

pragma solidity 0.8.4;

contract CollateralOracle is Ownable, IOracle {
    address public chainlinkCollateralUsd;

    uint256 private constant PRICE_PRECISION = 1e6;

    constructor(address _chainlinkCollateralUsd) {
        chainlinkCollateralUsd = _chainlinkCollateralUsd;
    }

    function consult() external view override returns (uint256) {
        AggregatorV3Interface _priceFeed = AggregatorV3Interface(chainlinkCollateralUsd);
        (, int256 _price, , , ) = _priceFeed.latestRoundData();
        uint8 _decimals = _priceFeed.decimals();
        return (uint256(_price) * PRICE_PRECISION) / (10**_decimals);
    }

    function setChainlinkCollateralUsd(address _chainlinkCollateralUsd) external onlyOwner {
        chainlinkCollateralUsd = _chainlinkCollateralUsd;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_chainlinkCollateralUsd","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"chainlinkCollateralUsd","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"consult","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_chainlinkCollateralUsd","type":"address"}],"name":"setChainlinkCollateralUsd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5060405161070638038061070683398101604081905261002f91610095565b600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b0319166001600160a01b03929092169190911790556100c3565b6000602082840312156100a6578081fd5b81516001600160a01b03811681146100bc578182fd5b9392505050565b610634806100d26000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063313e758d14610067578063666cff671461007c578063715018a6146100ac5780637eeda703146100b45780638da5cb5b146100ca578063f2fde38b146100db575b600080fd5b61007a6100753660046103e6565b6100ee565b005b60015461008f906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61007a610143565b6100bc6101b7565b6040519081526020016100a3565b6000546001600160a01b031661008f565b61007a6100e93660046103e6565b6102dd565b6000546001600160a01b031633146101215760405162461bcd60e51b815260040161011890610484565b60405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461016d5760405162461bcd60e51b815260040161011890610484565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60015460408051633fabe5a360e21b815290516000926001600160a01b0316918391839163feaf968c9160048083019260a0929190829003018186803b15801561020057600080fd5b505afa158015610214573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102389190610414565b5050509150506000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561027957600080fd5b505afa15801561028d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b19190610463565b90506102be81600a61051c565b6102cb620f4240846105c9565b6102d591906104b9565b935050505090565b6000546001600160a01b031633146103075760405162461bcd60e51b815260040161011890610484565b6001600160a01b03811661036c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610118565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b805169ffffffffffffffffffff811681146103e157600080fd5b919050565b6000602082840312156103f7578081fd5b81356001600160a01b038116811461040d578182fd5b9392505050565b600080600080600060a0868803121561042b578081fd5b610434866103c7565b9450602086015193506040860151925060608601519150610457608087016103c7565b90509295509295909350565b600060208284031215610474578081fd5b815160ff8116811461040d578182fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000826104d457634e487b7160e01b81526012600452602481fd5b500490565b600181815b808511156105145781600019048211156104fa576104fa6105e8565b8085161561050757918102915b93841c93908002906104de565b509250929050565b600061040d60ff841683600082610535575060016105c3565b81610542575060006105c3565b816001811461055857600281146105625761057e565b60019150506105c3565b60ff841115610573576105736105e8565b50506001821b6105c3565b5060208310610133831016604e8410600b84101617156105a1575081810a6105c3565b6105ab83836104d9565b80600019048211156105bf576105bf6105e8565b0290505b92915050565b60008160001904831182151516156105e3576105e36105e8565b500290565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220c6e4f720be4b0b01abed5862635277c39874805daa6e80a672df499ef453f32064736f6c63430008040033000000000000000000000000fe4a8cc5b5b2366c1b58bea3858e81843581b2f7

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

000000000000000000000000fe4a8cc5b5b2366c1b58bea3858e81843581b2f7

-----Decoded View---------------
Arg [0] : _chainlinkCollateralUsd (address): 0xfe4a8cc5b5b2366c1b58bea3858e81843581b2f7

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000fe4a8cc5b5b2366c1b58bea3858e81843581b2f7


Deployed ByteCode Sourcemap

4709:784:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5336:154;;;;;;:::i;:::-;;:::i;:::-;;4762:37;;;;;-1:-1:-1;;;;;4762:37:0;;;;;;-1:-1:-1;;;;;1459:32:1;;;1441:51;;1429:2;1414:18;4762:37:0;;;;;;;;2815:148;;;:::i;4983:345::-;;;:::i;:::-;;;2417:25:1;;;2405:2;2390:18;4983:345:0;2372:76:1;2164:87:0;2210:7;2237:6;-1:-1:-1;;;;;2237:6:0;2164:87;;3118:244;;;;;;:::i;:::-;;:::i;5336:154::-;2210:7;2237:6;-1:-1:-1;;;;;2237:6:0;801:10;2384:23;2376:68;;;;-1:-1:-1;;;2376:68:0;;;;;;;:::i;:::-;;;;;;;;;5434:22:::1;:48:::0;;-1:-1:-1;;;;;;5434:48:0::1;-1:-1:-1::0;;;;;5434:48:0;;;::::1;::::0;;;::::1;::::0;;5336:154::o;2815:148::-;2210:7;2237:6;-1:-1:-1;;;;;2237:6:0;801:10;2384:23;2376:68;;;;-1:-1:-1;;;2376:68:0;;;;;;;:::i;:::-;2922:1:::1;2906:6:::0;;2885:40:::1;::::0;-1:-1:-1;;;;;2906:6:0;;::::1;::::0;2885:40:::1;::::0;2922:1;;2885:40:::1;2953:1;2936:19:::0;;-1:-1:-1;;;;;;2936:19:0::1;::::0;;2815:148::o;4983:345::-;5111:22;;5171:28;;;-1:-1:-1;;;5171:28:0;;;;5034:7;;-1:-1:-1;;;;;5111:22:0;;5034:7;;5111:22;;5171:26;;:28;;;;;;;;;;;;;;5111:22;5171:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5145:54;;;;;;5210:15;5228:10;-1:-1:-1;;;;;5228:19:0;;:21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5210:39;-1:-1:-1;5306:13:0;5210:39;5306:2;:13;:::i;:::-;5268:33;4851:3;5276:6;5268:33;:::i;:::-;5267:53;;;;:::i;:::-;5260:60;;;;;4983:345;:::o;3118:244::-;2210:7;2237:6;-1:-1:-1;;;;;2237:6:0;801:10;2384:23;2376:68;;;;-1:-1:-1;;;2376:68:0;;;;;;;:::i;:::-;-1:-1:-1;;;;;3207:22:0;::::1;3199:73;;;::::0;-1:-1:-1;;;3199:73:0;;1705:2:1;3199:73:0::1;::::0;::::1;1687:21:1::0;1744:2;1724:18;;;1717:30;1783:34;1763:18;;;1756:62;-1:-1:-1;;;1834:18:1;;;1827:36;1880:19;;3199:73:0::1;1677:228:1::0;3199:73:0::1;3309:6;::::0;;3288:38:::1;::::0;-1:-1:-1;;;;;3288:38:0;;::::1;::::0;3309:6;::::1;::::0;3288:38:::1;::::0;::::1;3337:6;:17:::0;;-1:-1:-1;;;;;;3337:17:0::1;-1:-1:-1::0;;;;;3337:17:0;;;::::1;::::0;;;::::1;::::0;;3118:244::o;14:179:1:-;92:13;;145:22;134:34;;124:45;;114:2;;183:1;180;173:12;114:2;73:120;;;:::o;198:306::-;257:6;310:2;298:9;289:7;285:23;281:32;278:2;;;331:6;323;316:22;278:2;362:23;;-1:-1:-1;;;;;414:31:1;;404:42;;394:2;;465:6;457;450:22;394:2;493:5;268:236;-1:-1:-1;;;268:236:1:o;509:483::-;612:6;620;628;636;644;697:3;685:9;676:7;672:23;668:33;665:2;;;719:6;711;704:22;665:2;747:39;776:9;747:39;:::i;:::-;737:49;;826:2;815:9;811:18;805:25;795:35;;870:2;859:9;855:18;849:25;839:35;;914:2;903:9;899:18;893:25;883:35;;937:49;981:3;970:9;966:19;937:49;:::i;:::-;927:59;;655:337;;;;;;;;:::o;997:293::-;1065:6;1118:2;1106:9;1097:7;1093:23;1089:32;1086:2;;;1139:6;1131;1124:22;1086:2;1176:9;1170:16;1226:4;1219:5;1215:16;1208:5;1205:27;1195:2;;1251:6;1243;1236:22;1910:356;2112:2;2094:21;;;2131:18;;;2124:30;2190:34;2185:2;2170:18;;2163:62;2257:2;2242:18;;2084:182::o;2453:217::-;2493:1;2519;2509:2;;-1:-1:-1;;;2544:31:1;;2598:4;2595:1;2588:15;2626:4;2551:1;2616:15;2509:2;-1:-1:-1;2655:9:1;;2499:171::o;2675:422::-;2764:1;2807:5;2764:1;2821:270;2842:7;2832:8;2829:21;2821:270;;;2901:4;2897:1;2893:6;2889:17;2883:4;2880:27;2877:2;;;2910:18;;:::i;:::-;2960:7;2950:8;2946:22;2943:2;;;2980:16;;;;2943:2;3059:22;;;;3019:15;;;;2821:270;;;2825:3;2739:358;;;;;:::o;3102:140::-;3160:5;3189:47;3230:4;3220:8;3216:19;3210:4;3296:5;3326:8;3316:2;;-1:-1:-1;3367:1:1;3381:5;;3316:2;3415:4;3405:2;;-1:-1:-1;3452:1:1;3466:5;;3405:2;3497:4;3515:1;3510:59;;;;3583:1;3578:130;;;;3490:218;;3510:59;3540:1;3531:10;;3554:5;;;3578:130;3615:3;3605:8;3602:17;3599:2;;;3622:18;;:::i;:::-;-1:-1:-1;;3678:1:1;3664:16;;3693:5;;3490:218;;3792:2;3782:8;3779:16;3773:3;3767:4;3764:13;3760:36;3754:2;3744:8;3741:16;3736:2;3730:4;3727:12;3723:35;3720:77;3717:2;;;-1:-1:-1;3829:19:1;;;3861:5;;3717:2;3908:34;3933:8;3927:4;3908:34;:::i;:::-;3978:6;3974:1;3970:6;3966:19;3957:7;3954:32;3951:2;;;3989:18;;:::i;:::-;4027:20;;-1:-1:-1;3306:747:1;;;;;:::o;4058:168::-;4098:7;4164:1;4160;4156:6;4152:14;4149:1;4146:21;4141:1;4134:9;4127:17;4123:45;4120:2;;;4171:18;;:::i;:::-;-1:-1:-1;4211:9:1;;4110:116::o;4231:127::-;4292:10;4287:3;4283:20;4280:1;4273:31;4323:4;4320:1;4313:15;4347:4;4344:1;4337:15

Swarm Source

ipfs://c6e4f720be4b0b01abed5862635277c39874805daa6e80a672df499ef453f320
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
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.