Contract 0xdEd6C522d803E35f65318a9a4d7333a22d582199

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x9d2ac52f2a5689defca9fae94e26c7c3b5ac9327d43915b16879ff6ead93445a0x60806040255086182022-03-02 21:41:48205 days 22 hrs ago0x59d07dc34b135b17b87840a86bff7302039e7edf IN  Create: RateProvider0 MATIC0.0266805 150
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RateProvider

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 3 : RateProvider.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "../interfaces/IRateProvider.sol";
import "../interfaces/IFxStateChildTunnel.sol";

/**
 * @title RateProvider
 */
contract RateProvider is IRateProvider {
    IFxStateChildTunnel public fxChild;

    constructor(IFxStateChildTunnel _fxChild) {
        fxChild = _fxChild;
    }

    function getRate() external override view returns (uint256) {
        (uint256 stMatic, uint256 matic) = fxChild.getReserves();
        return matic * 1 ether / stMatic;
    }
}

File 2 of 3 : IRateProvider.sol
// SPDX-FileCopyrightText: 2021 ShardLabs
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.7;

interface IRateProvider {
    function getRate() external view returns (uint256);
}

File 3 of 3 : IFxStateChildTunnel.sol
// SPDX-FileCopyrightText: 2021 ShardLabs
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.7;

interface IFxStateChildTunnel {
    function latestStateId() external view returns (uint256);

    function latestRootMessageSender() external view returns (address);

    function latestData() external view returns (bytes memory);

    function sendMessageToRoot(bytes memory message) external;

    function setFxRootTunnel(address _fxRootTunnel) external;

    function getReserves() external view returns (uint256, uint256);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IFxStateChildTunnel","name":"_fxChild","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"fxChild","outputs":[{"internalType":"contract IFxStateChildTunnel","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5060405161026338038061026383398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6101d0806100936000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063450d11f01461003b578063679aefce1461006b575b600080fd5b60005461004e906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610073610081565b604051908152602001610062565b6000805460408051630240bc6b60e21b81528151849384936001600160a01b0390911692630902f1ac9260048083019392829003018186803b1580156100c657600080fd5b505afa1580156100da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fe9190610127565b90925090508161011682670de0b6b3a764000061016d565b610120919061014b565b9250505090565b6000806040838503121561013a57600080fd5b505080516020909101519092909150565b60008261016857634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561019557634e487b7160e01b600052601160045260246000fd5b50029056fea2646970667358221220e4c12cc5f80b3ee5725f581533220d6f00c343f7dfddd3ed6c25fcdfc336da6464736f6c634300080700330000000000000000000000000833f5bd45803e05ef54e119a77e463ce6b1a963

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

0000000000000000000000000833f5bd45803e05ef54e119a77e463ce6b1a963

-----Decoded View---------------
Arg [0] : _fxChild (address): 0x0833f5bd45803e05ef54e119a77e463ce6b1a963

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000833f5bd45803e05ef54e119a77e463ce6b1a963


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.