ETH Price: $2,672.26 (+1.33%)

Contract

0xFCFe283B64be414eF0aE65e863c07607a2b4A442
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Collateral V...171699652023-05-02 1:54:47479 days ago1682992487IN
0xFCFe283B...7a2b4A442
0 ETH0.0025710182.84787103
Set Collateral V...171670472023-05-01 16:04:47479 days ago1682957087IN
0xFCFe283B...7a2b4A442
0 ETH0.00313076100.88514526
Set Collateral V...171135352023-04-24 3:40:35487 days ago1682307635IN
0xFCFe283B...7a2b4A442
0 ETH0.0011054235.62097512
Set Collateral V...171135302023-04-24 3:39:35487 days ago1682307575IN
0xFCFe283B...7a2b4A442
0 ETH0.0010886635.08075287
Set Collateral V...171113322023-04-23 20:16:59487 days ago1682281019IN
0xFCFe283B...7a2b4A442
0 ETH0.0014271145.9871625
Set Collateral V...171077062023-04-23 8:04:11488 days ago1682237051IN
0xFCFe283B...7a2b4A442
0 ETH0.0011057535.63145407
Set Collateral V...170989072023-04-22 2:28:11489 days ago1682130491IN
0xFCFe283B...7a2b4A442
0 ETH0.0011477836.98597385
Set Collateral V...170989022023-04-22 2:27:11489 days ago1682130431IN
0xFCFe283B...7a2b4A442
0 ETH0.0010747834.63368331
Set Collateral V...170847832023-04-20 2:29:47491 days ago1681957787IN
0xFCFe283B...7a2b4A442
0 ETH0.0017156455.28466556
Set Collateral V...170847782023-04-20 2:28:47491 days ago1681957727IN
0xFCFe283B...7a2b4A442
0 ETH0.0016533753.27797696
Set Collateral V...170390032023-04-13 14:11:11497 days ago1681395071IN
0xFCFe283B...7a2b4A442
0 ETH0.0013946544.94118577
Set Collateral V...169651972023-04-03 1:17:23508 days ago1680484643IN
0xFCFe283B...7a2b4A442
0 ETH0.0005417417.45718968
Set Collateral V...169340812023-03-29 16:17:35512 days ago1680106655IN
0xFCFe283B...7a2b4A442
0 ETH0.0012587740.56250733
Set Collateral V...168929662023-03-23 21:39:59518 days ago1679607599IN
0xFCFe283B...7a2b4A442
0 ETH0.0007895325.44174335
Set Collateral V...168857872023-03-22 21:24:47519 days ago1679520287IN
0xFCFe283B...7a2b4A442
0 ETH0.0006319520.36409863
Set Collateral V...168692052023-03-20 13:32:59521 days ago1679319179IN
0xFCFe283B...7a2b4A442
0 ETH0.0007336423.64082924
Set Collateral V...168581162023-03-19 0:10:11523 days ago1679184611IN
0xFCFe283B...7a2b4A442
0 ETH0.0005264616.96467712
Set Collateral V...168513382023-03-18 1:19:23524 days ago1679102363IN
0xFCFe283B...7a2b4A442
0 ETH0.0011455736.91485593
Set Collateral V...168451312023-03-17 4:22:35525 days ago1679026955IN
0xFCFe283B...7a2b4A442
0 ETH0.0005220916.82382766
Set Collateral V...168217532023-03-13 21:30:47528 days ago1678743047IN
0xFCFe283B...7a2b4A442
0 ETH0.0007876225.38029885
Set Collateral V...168204332023-03-13 17:04:59528 days ago1678727099IN
0xFCFe283B...7a2b4A442
0 ETH0.0013117542.26976031
Set Collateral V...168131632023-03-12 16:34:11529 days ago1678638851IN
0xFCFe283B...7a2b4A442
0 ETH0.0006583521.21469037
Set Collateral V...167992632023-03-10 17:39:23531 days ago1678469963IN
0xFCFe283B...7a2b4A442
0 ETH0.0014934948.12597414
Set Collateral V...167946772023-03-10 2:05:47532 days ago1678413947IN
0xFCFe283B...7a2b4A442
0 ETH0.0007634824.60240997
Set Collateral V...167946692023-03-10 2:04:11532 days ago1678413851IN
0xFCFe283B...7a2b4A442
0 ETH0.0008343626.88642131
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StaticCollateralOracle

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 9 : StaticCollateralOracle.sol
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;

import "@openzeppelin/contracts/access/AccessControl.sol";

import "./interfaces/ICollateralOracle.sol";

/**
 * @title Static Collateral Oracle
 */
contract StaticCollateralOracle is AccessControl, ICollateralOracle {
    /**************************************************************************/
    /* Constants */
    /**************************************************************************/

    /**
     * @notice Implementation version
     */
    string public constant IMPLEMENTATION_VERSION = "1.0";

    /**************************************************************************/
    /* Access Control Roles */
    /**************************************************************************/

    /**
     * @notice Parameter admin role
     */
    bytes32 public constant PARAMETER_ADMIN_ROLE = keccak256("PARAMETER_ADMIN");

    /**************************************************************************/
    /* Errors */
    /**************************************************************************/

    /**
     * @notice Invalid address (e.g. zero address)
     */
    error InvalidAddress();

    /**************************************************************************/
    /* Events */
    /**************************************************************************/

    /**
     * @notice Emitted when collateral value for a collateral token is updated
     * @param collateralToken Address of collateral token
     * @param collateralValue Collateral value
     */
    event CollateralValueUpdated(address indexed collateralToken, uint256 collateralValue);

    /**************************************************************************/
    /* State */
    /**************************************************************************/

    /**
     * @dev Mapping of collateral token contract to collateral value
     */
    mapping(address => uint256) private _collateralValue;

    /**
     * @inheritdoc ICollateralOracle
     */
    IERC20 public immutable override currencyToken;

    /**************************************************************************/
    /* Constructor */
    /**************************************************************************/

    /**
     * @notice CollateralOracle constructor
     * @param currencyToken_ Currency token used for pricing
     */
    constructor(IERC20 currencyToken_) {
        currencyToken = currencyToken_;

        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(PARAMETER_ADMIN_ROLE, msg.sender);
    }

    /**************************************************************************/
    /* Getters */
    /**************************************************************************/

    /**
     * @inheritdoc ICollateralOracle
     */
    function collateralValue(address collateralToken, uint256 collateralTokenId) external view returns (uint256) {
        collateralTokenId;

        if (_collateralValue[collateralToken] == 0) revert UnsupportedCollateral();

        return _collateralValue[collateralToken];
    }

    /**************************************************************************/
    /* Setters */
    /**************************************************************************/

    /**
     * @notice Set collateral value
     *
     * Emits a {CollateralValueUpdated} event.
     *
     * @param collateralToken Collateral token contract
     * @param collateralValue_ Collateral value
     */
    function setCollateralValue(address collateralToken, uint256 collateralValue_)
        external
        onlyRole(PARAMETER_ADMIN_ROLE)
    {
        if (collateralToken == address(0)) revert InvalidAddress();

        _collateralValue[collateralToken] = collateralValue_;

        emit CollateralValueUpdated(collateralToken, collateralValue_);
    }
}

File 2 of 9 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)

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 virtual 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 virtual {
        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 virtual 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 revoked `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}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    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);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 3 of 9 : ICollateralOracle.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @title Interface to a Collateral Oracle
 */
interface ICollateralOracle {
    /**************************************************************************/
    /* Error codes */
    /**************************************************************************/

    /**
     * @notice Unsupported collateral token
     */
    error UnsupportedCollateral();

    /**************************************************************************/
    /* Getters */
    /**************************************************************************/

    /**
     * @notice Get currency token used for pricing
     * @return Currency token contract
     */
    function currencyToken() external view returns (IERC20);

    /**
     * @notice Get collateral value
     * @param collateralToken Collateral token contract
     * @param collateralTokenId Collateral token ID
     * @return Collateral value
     */
    function collateralValue(address collateralToken, uint256 collateralTokenId) external view returns (uint256);
}

File 4 of 9 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

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 5 of 9 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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 6 of 9 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

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 7 of 9 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

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 8 of 9 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

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);
}

File 9 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"currencyToken_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"UnsupportedCollateral","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"collateralToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"collateralValue","type":"uint256"}],"name":"CollateralValueUpdated","type":"event"},{"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":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"IMPLEMENTATION_VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PARAMETER_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collateralToken","type":"address"},{"internalType":"uint256","name":"collateralTokenId","type":"uint256"}],"name":"collateralValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currencyToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"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":"collateralToken","type":"address"},{"internalType":"uint256","name":"collateralValue_","type":"uint256"}],"name":"setCollateralValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b50604051610afa380380610afa83398101604081905261002f91610116565b6001600160a01b038116608052610047600033610077565b6100717ff0b50f04623eeaacfa1f202e062a3001c925a35c6b75d6903e67b43f44bbf15233610077565b50610146565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610112576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556100d13390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006020828403121561012857600080fd5b81516001600160a01b038116811461013f57600080fd5b9392505050565b608051610999610161600039600061015201526109996000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063754b377c11610071578063754b377c1461018c57806391d14854146101bb578063a217fddf146101ce578063b626de1b146101d6578063d4e04df1146101fd578063d547741f1461021057600080fd5b806301ffc9a7146100b9578063248a9ca3146100e15780632f2ff15d1461011257806336568abe146101275780636873509b1461013a5780636b2fa3741461014d575b600080fd5b6100cc6100c7366004610746565b610223565b60405190151581526020015b60405180910390f35b6101046100ef366004610770565b60009081526020819052604090206001015490565b6040519081526020016100d8565b6101256101203660046107a5565b61025a565b005b6101256101353660046107a5565b610285565b6101256101483660046107d1565b610308565b6101747f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100d8565b6101ae604051806040016040528060038152602001620312e360ec1b81525081565b6040516100d8919061082b565b6100cc6101c93660046107a5565b6103b4565b610104600081565b6101047ff0b50f04623eeaacfa1f202e062a3001c925a35c6b75d6903e67b43f44bbf15281565b61010461020b3660046107d1565b6103dd565b61012561021e3660046107a5565b610430565b60006001600160e01b03198216637965db0b60e01b148061025457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102768133610456565b61028083836104ba565b505050565b6001600160a01b03811633146102fa5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610304828261053e565b5050565b7ff0b50f04623eeaacfa1f202e062a3001c925a35c6b75d6903e67b43f44bbf1526103338133610456565b6001600160a01b03831661035a5760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03831660008181526001602052604090819020849055517fd199278b84d2158d759787bf88d0db7c9252f6fe225e9060fa2f32055a952249906103a79085815260200190565b60405180910390a2505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6001600160a01b0382166000908152600160205260408120546104135760405163621a135560e01b815260040160405180910390fd5b50506001600160a01b031660009081526001602052604090205490565b60008281526020819052604090206001015461044c8133610456565b610280838361053e565b61046082826103b4565b61030457610478816001600160a01b031660146105a3565b6104838360206105a3565b60405160200161049492919061085e565b60408051601f198184030181529082905262461bcd60e51b82526102f19160040161082b565b6104c482826103b4565b610304576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556104fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61054882826103b4565b15610304576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b606060006105b28360026108e9565b6105bd906002610908565b67ffffffffffffffff8111156105d5576105d5610920565b6040519080825280601f01601f1916602001820160405280156105ff576020820181803683370190505b509050600360fc1b8160008151811061061a5761061a610936565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061064957610649610936565b60200101906001600160f81b031916908160001a905350600061066d8460026108e9565b610678906001610908565b90505b60018111156106f0576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106106ac576106ac610936565b1a60f81b8282815181106106c2576106c2610936565b60200101906001600160f81b031916908160001a90535060049490941c936106e98161094c565b905061067b565b50831561073f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016102f1565b9392505050565b60006020828403121561075857600080fd5b81356001600160e01b03198116811461073f57600080fd5b60006020828403121561078257600080fd5b5035919050565b80356001600160a01b03811681146107a057600080fd5b919050565b600080604083850312156107b857600080fd5b823591506107c860208401610789565b90509250929050565b600080604083850312156107e457600080fd5b6107ed83610789565b946020939093013593505050565b60005b838110156108165781810151838201526020016107fe565b83811115610825576000848401525b50505050565b602081526000825180602084015261084a8160408501602087016107fb565b601f01601f19169190910160400192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516108968160178501602088016107fb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516108c78160288401602088016107fb565b01602801949350505050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610903576109036108d3565b500290565b6000821982111561091b5761091b6108d3565b500190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008161095b5761095b6108d3565b50600019019056fea2646970667358221220a8e5e8b3058fb21358bfb96a128c4e4bf968e8ab9bb5308b59462b953bbee9f264736f6c634300080900330000000000000000000000006b175474e89094c44da98b954eedeac495271d0f

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063754b377c11610071578063754b377c1461018c57806391d14854146101bb578063a217fddf146101ce578063b626de1b146101d6578063d4e04df1146101fd578063d547741f1461021057600080fd5b806301ffc9a7146100b9578063248a9ca3146100e15780632f2ff15d1461011257806336568abe146101275780636873509b1461013a5780636b2fa3741461014d575b600080fd5b6100cc6100c7366004610746565b610223565b60405190151581526020015b60405180910390f35b6101046100ef366004610770565b60009081526020819052604090206001015490565b6040519081526020016100d8565b6101256101203660046107a5565b61025a565b005b6101256101353660046107a5565b610285565b6101256101483660046107d1565b610308565b6101747f0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f81565b6040516001600160a01b0390911681526020016100d8565b6101ae604051806040016040528060038152602001620312e360ec1b81525081565b6040516100d8919061082b565b6100cc6101c93660046107a5565b6103b4565b610104600081565b6101047ff0b50f04623eeaacfa1f202e062a3001c925a35c6b75d6903e67b43f44bbf15281565b61010461020b3660046107d1565b6103dd565b61012561021e3660046107a5565b610430565b60006001600160e01b03198216637965db0b60e01b148061025457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000828152602081905260409020600101546102768133610456565b61028083836104ba565b505050565b6001600160a01b03811633146102fa5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b610304828261053e565b5050565b7ff0b50f04623eeaacfa1f202e062a3001c925a35c6b75d6903e67b43f44bbf1526103338133610456565b6001600160a01b03831661035a5760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03831660008181526001602052604090819020849055517fd199278b84d2158d759787bf88d0db7c9252f6fe225e9060fa2f32055a952249906103a79085815260200190565b60405180910390a2505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6001600160a01b0382166000908152600160205260408120546104135760405163621a135560e01b815260040160405180910390fd5b50506001600160a01b031660009081526001602052604090205490565b60008281526020819052604090206001015461044c8133610456565b610280838361053e565b61046082826103b4565b61030457610478816001600160a01b031660146105a3565b6104838360206105a3565b60405160200161049492919061085e565b60408051601f198184030181529082905262461bcd60e51b82526102f19160040161082b565b6104c482826103b4565b610304576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556104fa3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61054882826103b4565b15610304576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b606060006105b28360026108e9565b6105bd906002610908565b67ffffffffffffffff8111156105d5576105d5610920565b6040519080825280601f01601f1916602001820160405280156105ff576020820181803683370190505b509050600360fc1b8160008151811061061a5761061a610936565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061064957610649610936565b60200101906001600160f81b031916908160001a905350600061066d8460026108e9565b610678906001610908565b90505b60018111156106f0576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106106ac576106ac610936565b1a60f81b8282815181106106c2576106c2610936565b60200101906001600160f81b031916908160001a90535060049490941c936106e98161094c565b905061067b565b50831561073f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016102f1565b9392505050565b60006020828403121561075857600080fd5b81356001600160e01b03198116811461073f57600080fd5b60006020828403121561078257600080fd5b5035919050565b80356001600160a01b03811681146107a057600080fd5b919050565b600080604083850312156107b857600080fd5b823591506107c860208401610789565b90509250929050565b600080604083850312156107e457600080fd5b6107ed83610789565b946020939093013593505050565b60005b838110156108165781810151838201526020016107fe565b83811115610825576000848401525b50505050565b602081526000825180602084015261084a8160408501602087016107fb565b601f01601f19169190910160400192915050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516108968160178501602088016107fb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516108c78160288401602088016107fb565b01602801949350505050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615610903576109036108d3565b500290565b6000821982111561091b5761091b6108d3565b500190565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008161095b5761095b6108d3565b50600019019056fea2646970667358221220a8e5e8b3058fb21358bfb96a128c4e4bf968e8ab9bb5308b59462b953bbee9f264736f6c63430008090033

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

0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f

-----Decoded View---------------
Arg [0] : currencyToken_ (address): 0x6B175474E89094C44Da98b954EedeAC495271d0F

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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.