Contract 0x15fd4e8244ad590e2582a76c3e3098675fda9315 2

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x205a36db19b636ab25ead7a74b26c17ced7e3c9f2105eb539c4c21d4b5cef896Set Oracle245896542022-09-14 11:14:4821 days 12 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.00000998
0x5e53b90812c845228cd0a5fb77f9d2187c87166d66bc95b37898cfd5df64d694Set Oracle245895122022-09-14 11:13:2421 days 12 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.00000998
0x4dea500a82b16c6bd5a93b84ffdb8396ad97eca692ccc006ab4f5297d6a7d051Set Oracle245892662022-09-14 11:10:5921 days 12 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.00001033
0x85c09504eb8abf5f3fff7ce93ce63662d41b4531594384876c65240df227b2c7Set Oracle245882532022-09-14 11:01:0221 days 13 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.00001059
0xa83eb6ecba1ce0b3f73cd6016daa305b0be30493ec5f562810a45d7cf05af833Set Oracle118656062022-05-12 4:35:42146 days 19 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.000666416133 ETH
0x1498167c077e81a666c6a59832f09c52e544f34936255e62e5d4cfa78ef9a746Set Oracle36921752021-12-09 3:20:20300 days 20 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.000765020285 ETH
0x7f67e8a94f41988243eaf106d321cbcfbb79825c3b57dccfb28e857bda62d065Set Oracle29678812021-11-11 5:16:30328 days 18 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.001409372179 ETH
0x65b8227bf418b80323752f1558315bb0ba483b5d5b3d1f222b271eab378a7126Set Oracle29678582021-11-11 5:13:41328 days 18 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.001409376698 ETH
0x11873b08a615b5d828ce07d08d69bcb2317f93feddc24b6b951d7f1b65bcd586Set Oracle29678252021-11-11 5:12:15328 days 18 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.001411455378 ETH
0xc3749883c3821866b86aa540061440d9ca40f1059437a56bae469bb09151fab0Set Oracle26429242021-10-28 4:07:55342 days 19 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.001324508035 ETH
0xfb8e05c22996e7971a75dd81a2339cf402531843fe26e3942d60a813f4bbf511Set Oracle26429112021-10-28 4:06:43342 days 20 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.001326468289 ETH
0x2eaf83b6671dca2841761bcbd6158037f8f7a280446a5343eaef56114a422060Set Oracle25193732021-10-24 23:37:04346 days 29 mins ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.000511760485 ETH
0x0705a2d34aba352f385176716d1936ddc10091be966a735606a30313579f9488Set Oracle25193232021-10-24 23:36:07346 days 30 mins ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.000511760485 ETH
0x8635d60422210d21a6151b5f5e4023f19cfd23195fd7567d2099b960e439956bSet Oracle24413732021-10-22 6:28:26348 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.000579687582 ETH
0xc9009a2bba19eb1ba118707bf6177e88b670b372b70d27375256fd734c7b5685Set Oracle24413642021-10-22 6:28:26348 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.000579687582 ETH
0xd711f818707975de8870b419428b2ebd05ac02c6124fbf4b0532e6d5aa28bb84Set Oracle24413532021-10-22 6:27:50348 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.000737729971 ETH
0xe058255d64e0fa826b82419e27e9b539d860b1978de1ef1ec8b3691e587f5ef8Set Oracle24413432021-10-22 6:27:50348 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH0.00073663974 ETH
0xfdabb45468d098cdf404ee3e79ebc5a9dae70b97d9fcb0dec4f711c58e6f62760x6080604024412832021-10-22 6:25:35348 days 17 hrs ago0x420220b72bbd307db8615e7aa0eadca399cf2fc0 IN  Create: ChainlinkFiatOracle0 ETH0.023561055084 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0x639fe6ab55c921f74e7fac1ee960c0b6293ba6120 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0xa112d1bfd43fcfbf2be2ebfcaebd6b6db73aad8b 0x15fd4e8244ad590e2582a76c3e3098675fda93150 ETH
0x30e138eaad60a6d467c2fdea091c657aaff21ea4de7adf7a49ea728b5dc2b00f285836272022-10-05 22:24:351 hr 42 mins ago 0x15fd4e8244ad590e2582a76c3e3098675fda9315 0xe12e73c06f983ffd535840033973a1b382fc8df80 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ChainlinkFiatOracle

Compiler Version
v0.8.3+commit.8d00100c

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 10 : ChainlinkFiatOracle.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@chainlink/contracts/src/v0.7/interfaces/AggregatorV3Interface.sol";
import "@openzeppelin/contracts/utils/math/SignedSafeMath.sol";
import "../interfaces/Bank/IOracle.sol";

contract ChainlinkFiatOracle is IOracle, AccessControl {
    using SignedSafeMath for int256;

    // Roles
    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
    bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    // Oracle data
    AggregatorV3Interface public ETH_USD;
    // fxAsset address => chainlink ISO_USD oracle address
    mapping(address => address) public assetOracles;

    constructor(address _ETH_USD) {
        _setupRole(ADMIN_ROLE, msg.sender);
        _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);
        _setRoleAdmin(OPERATOR_ROLE, ADMIN_ROLE);
        ETH_USD = AggregatorV3Interface(_ETH_USD);
    }

    function getRate(address fxAsset)
        external
        view
        override
        returns (uint256 unitPrice)
    {
        // Get prices
        (, int256 ethPrice, , , ) = ETH_USD.latestRoundData();
        (, int256 ISOPrice, , , ) =
            AggregatorV3Interface(assetOracles[fxAsset]).latestRoundData();

        // Calculate indirect quote
        int256 finalQuote = ISOPrice.mul(1 ether).div(ethPrice);
        unitPrice = uint256(finalQuote >= 0 ? finalQuote : -finalQuote);
    }

    function setOracle(address fxAsset, address oracle)
        external
        override
        onlyOperator
    {
        require(fxAsset != address(0), "Asset cannot be address 0");
        require(oracle != address(0), "Oracle cannot be address 0");
        assetOracles[fxAsset] = oracle;
    }

    modifier onlyOperator() {
        require(
            hasRole(OPERATOR_ROLE, msg.sender) ||
                hasRole(ADMIN_ROLE, msg.sender),
            "Caller is not an operator or admin"
        );
        _;
    }
}

File 2 of 10 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    function _grantRole(bytes32 role, address account) private {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 10 : AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.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 4 of 10 : SignedSafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SignedSafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SignedSafeMath {
    /**
     * @dev Returns the multiplication of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(int256 a, int256 b) internal pure returns (int256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two signed integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(int256 a, int256 b) internal pure returns (int256) {
        return a / b;
    }

    /**
     * @dev Returns the subtraction of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(int256 a, int256 b) internal pure returns (int256) {
        return a - b;
    }

    /**
     * @dev Returns the addition of two signed integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(int256 a, int256 b) internal pure returns (int256) {
        return a + b;
    }
}

File 5 of 10 : IOracle.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

interface IOracle {
    /**
     * @notice Returns the price of 1 fxAsset in ETH
     * @param fxAsset the asset to get a rate for
     * @return unitPrice the cost of a single fxAsset in ETH
     */
    function getRate(address fxAsset) external view returns (uint256 unitPrice);

    /**
     * @notice A setter function to add or update an oracle for a given fx asset.
     * @param fxAsset the asset to update
     * @param oracle the oracle to set for the fxAsset
     */
    function setOracle(address fxAsset, address oracle) external;
}

File 6 of 10 : IAccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 7 of 10 : Context.sol
// SPDX-License-Identifier: MIT

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) {
        return msg.data;
    }
}

File 8 of 10 : Strings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 9 of 10 : ERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 10 of 10 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_ETH_USD","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ETH_USD","outputs":[{"internalType":"contract AggregatorV3Interface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"assetOracles","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"fxAsset","type":"address"}],"name":"getRate","outputs":[{"internalType":"uint256","name":"unitPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"fxAsset","type":"address"},{"internalType":"address","name":"oracle","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162000f6538038062000f658339810160408190526200003491620001c6565b6200004f60008051602062000f4583398151915233620000cb565b6200006a60008051602062000f4583398151915280620000db565b620000a57f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92960008051602062000f45833981519152620000db565b600180546001600160a01b0319166001600160a01b0392909216919091179055620001f6565b620000d7828262000126565b5050565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000d7576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001823390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600060208284031215620001d8578081fd5b81516001600160a01b0381168114620001ef578182fd5b9392505050565b610d3f80620002066000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80635c38eb3a1161008c57806391d148541161006657806391d14854146101f6578063a217fddf14610209578063d547741f14610211578063f5b541a614610224576100cf565b80635c38eb3a146101a95780636260f55b146101bc57806375b238fc146101cf576100cf565b806301ffc9a7146100d4578063248a9ca3146100fc5780632b6639861461012d5780632f2ff15d1461016e57806336568abe1461018357806337cef79114610196575b600080fd5b6100e76100e2366004610a7f565b61024b565b60405190151581526020015b60405180910390f35b61011f61010a366004610a45565b60009081526020819052604090206001015490565b6040519081526020016100f3565b61015661013b3660046109f9565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016100f3565b61018161017c366004610a5d565b610284565b005b610181610191366004610a5d565b6102b0565b61011f6101a43660046109f9565b610333565b6101816101b7366004610a13565b6104a0565b600154610156906001600160a01b031681565b61011f7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b6100e7610204366004610a5d565b61062b565b61011f600081565b61018161021f366004610a5d565b610654565b61011f7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b60006001600160e01b03198216637965db0b60e01b148061027c57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b6000828152602081905260409020600101546102a181335b61067a565b6102ab83836106de565b505050565b6001600160a01b03811633146103255760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61032f8282610762565b5050565b600080600160009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561038457600080fd5b505afa158015610398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103bc9190610aa7565b5050506001600160a01b03808616600090815260026020526040808220548151633fabe5a360e21b8152915194965091945091169163feaf968c9160048082019260a092909190829003018186803b15801561041757600080fd5b505afa15801561042b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044f9190610aa7565b505050915050600061047c83610476670de0b6b3a7640000856107c790919063ffffffff16565b906107da565b905060008112156104955761049081610cd9565b610497565b805b95945050505050565b6104ca7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9293361062b565b806104fa57506104fa7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217753361062b565b6105515760405162461bcd60e51b815260206004820152602260248201527f43616c6c6572206973206e6f7420616e206f70657261746f72206f722061646d60448201526134b760f11b606482015260840161031c565b6001600160a01b0382166105a75760405162461bcd60e51b815260206004820152601960248201527f41737365742063616e6e6f742062652061646472657373203000000000000000604482015260640161031c565b6001600160a01b0381166105fd5760405162461bcd60e51b815260206004820152601a60248201527f4f7261636c652063616e6e6f7420626520616464726573732030000000000000604482015260640161031c565b6001600160a01b03918216600090815260026020526040902080546001600160a01b03191691909216179055565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600082815260208190526040902060010154610670813361029c565b6102ab8383610762565b610684828261062b565b61032f5761069c816001600160a01b031660146107e6565b6106a78360206107e6565b6040516020016106b8929190610af6565b60408051601f198184030181529082905262461bcd60e51b825261031c91600401610b6b565b6106e8828261062b565b61032f576000828152602081815260408083206001600160a01b03851684529091529020805460ff1916600117905561071e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61076c828261062b565b1561032f576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006107d38284610bf0565b9392505050565b60006107d38284610bb6565b606060006107f5836002610c73565b610800906002610b9e565b67ffffffffffffffff81111561082657634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610850576020820181803683370190505b509050600360fc1b8160008151811061087957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106108b657634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060006108da846002610c73565b6108e5906001610b9e565b90505b6001811115610979576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061092757634e487b7160e01b600052603260045260246000fd5b1a60f81b82828151811061094b57634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a90535060049490941c9361097281610cc2565b90506108e8565b5083156107d35760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161031c565b80356001600160a01b038116811461027f57600080fd5b805169ffffffffffffffffffff8116811461027f57600080fd5b600060208284031215610a0a578081fd5b6107d3826109c8565b60008060408385031215610a25578081fd5b610a2e836109c8565b9150610a3c602084016109c8565b90509250929050565b600060208284031215610a56578081fd5b5035919050565b60008060408385031215610a6f578182fd5b82359150610a3c602084016109c8565b600060208284031215610a90578081fd5b81356001600160e01b0319811681146107d3578182fd5b600080600080600060a08688031215610abe578081fd5b610ac7866109df565b9450602086015193506040860151925060608601519150610aea608087016109df565b90509295509295909350565b60007f416363657373436f6e74726f6c3a206163636f756e742000000000000000000082528351610b2e816017850160208801610c92565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610b5f816028840160208801610c92565b01602801949350505050565b6000602082528251806020840152610b8a816040850160208701610c92565b601f01601f19169190910160400192915050565b60008219821115610bb157610bb1610cf3565b500190565b600082610bd157634e487b7160e01b81526012600452602481fd5b600160ff1b821460001984141615610beb57610beb610cf3565b500590565b60006001600160ff1b0381841382841380821686840486111615610c1657610c16610cf3565b600160ff1b84871282811687830589121615610c3457610c34610cf3565b858712925087820587128484161615610c4f57610c4f610cf3565b87850587128184161615610c6557610c65610cf3565b505050929093029392505050565b6000816000190483118215151615610c8d57610c8d610cf3565b500290565b60005b83811015610cad578181015183820152602001610c95565b83811115610cbc576000848401525b50505050565b600081610cd157610cd1610cf3565b506000190190565b6000600160ff1b821415610cef57610cef610cf3565b0390565b634e487b7160e01b600052601160045260246000fdfea26469706673582212207f8c0f9f7e7e4880252d4cdaeb3d116108131078da0ff1c12579e5165764fbd564736f6c63430008030033a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba612

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

000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba612

-----Decoded View---------------
Arg [0] : _ETH_USD (address): 0x639fe6ab55c921f74e7fac1ee960c0b6293ba612

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba612


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.