ETH Price: $1,956.04 (-2.62%)
 

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Create Up Rating316244052025-06-16 1:42:37240 days ago1750038157IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000410.0061
Create Up Rating316040152025-06-15 14:22:57241 days ago1749997377IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000330.0018993
Create Up Rating315796102025-06-15 0:49:27241 days ago1749948567IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000260.0039
Create Up Rating315382452025-06-14 1:50:37242 days ago1749865837IN
0xE07f02ff...43Bab442f
0.00035 ETH0.000000880.0068
Create Up Rating315312372025-06-13 21:57:01242 days ago1749851821IN
0xE07f02ff...43Bab442f
0.00014 ETH0.000000140.00209002
Create Up Rating314938972025-06-13 1:12:21243 days ago1749777141IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000015330.13501022
Create Up Rating314491032025-06-12 0:19:13244 days ago1749687553IN
0xE07f02ff...43Bab442f
0.00035 ETH0.000001140.0087
Create Up Rating314086522025-06-11 1:50:51245 days ago1749606651IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000660.0058
Create Up Rating313623772025-06-10 0:08:21246 days ago1749514101IN
0xE07f02ff...43Bab442f
0.00035 ETH0.00000190.028
Create Up Rating313526452025-06-09 18:43:57246 days ago1749494637IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000830.00972457
Create Up Rating313220552025-06-09 1:44:17247 days ago1749433457IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000590.0087
Create Down Rati...312785422025-06-08 1:33:51248 days ago1749346431IN
0xE07f02ff...43Bab442f
0.00035 ETH0.000000370.0055
Create Up Rating312545402025-06-07 12:13:47249 days ago1749298427IN
0xE07f02ff...43Bab442f
0.00035 ETH0.00000080.0061
Create Up Rating311912462025-06-06 1:03:59250 days ago1749171839IN
0xE07f02ff...43Bab442f
0.00035 ETH0.000000740.0057
Create Up Rating311706842025-06-05 13:38:35251 days ago1749130715IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000260.0019228
Create Down Rati...311463232025-06-05 0:06:33251 days ago1749081993IN
0xE07f02ff...43Bab442f
0.00035 ETH0.00000090.0133
Create Up Rating311288072025-06-04 14:22:41252 days ago1749046961IN
0xE07f02ff...43Bab442f
0.00035 ETH0.000003850.0565
Create Up Rating310737762025-06-03 7:48:19253 days ago1748936899IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000070.00096499
Create Up Rating310666342025-06-03 3:50:15253 days ago1748922615IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000230.0018096
Create Down Rati...310605292025-06-03 0:26:45253 days ago1748910405IN
0xE07f02ff...43Bab442f
0.00035 ETH0.000000850.0124
Create Up Rating310415192025-06-02 13:53:05254 days ago1748872385IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000090.0008744
Create Up Rating310178262025-06-02 0:43:19254 days ago1748824999IN
0xE07f02ff...43Bab442f
0.00035 ETH0.000000280.0042
Create Up Rating309976062025-06-01 13:29:19255 days ago1748784559IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000120.0018086
Create Up Rating309968192025-06-01 13:03:05255 days ago1748782985IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000230.00180097
Create Down Rati...309961262025-06-01 12:39:59255 days ago1748781599IN
0xE07f02ff...43Bab442f
0.00007 ETH0.000000120.00181309
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
316244052025-06-16 1:42:37240 days ago1750038157
0xE07f02ff...43Bab442f
0.00007 ETH
316040152025-06-15 14:22:57241 days ago1749997377
0xE07f02ff...43Bab442f
0.00007 ETH
315796102025-06-15 0:49:27241 days ago1749948567
0xE07f02ff...43Bab442f
0.00007 ETH
315382452025-06-14 1:50:37242 days ago1749865837
0xE07f02ff...43Bab442f
0.00035 ETH
315312372025-06-13 21:57:01242 days ago1749851821
0xE07f02ff...43Bab442f
0.00014 ETH
314938972025-06-13 1:12:21243 days ago1749777141
0xE07f02ff...43Bab442f
0.00007 ETH
314491032025-06-12 0:19:13244 days ago1749687553
0xE07f02ff...43Bab442f
0.00035 ETH
314086522025-06-11 1:50:51245 days ago1749606651
0xE07f02ff...43Bab442f
0.00007 ETH
313623772025-06-10 0:08:21246 days ago1749514101
0xE07f02ff...43Bab442f
0.00035 ETH
313526452025-06-09 18:43:57246 days ago1749494637
0xE07f02ff...43Bab442f
0.00007 ETH
313220552025-06-09 1:44:17247 days ago1749433457
0xE07f02ff...43Bab442f
0.00007 ETH
312785422025-06-08 1:33:51248 days ago1749346431
0xE07f02ff...43Bab442f
0.00035 ETH
312545402025-06-07 12:13:47249 days ago1749298427
0xE07f02ff...43Bab442f
0.00035 ETH
311912462025-06-06 1:03:59250 days ago1749171839
0xE07f02ff...43Bab442f
0.00035 ETH
311706842025-06-05 13:38:35251 days ago1749130715
0xE07f02ff...43Bab442f
0.00007 ETH
311463232025-06-05 0:06:33251 days ago1749081993
0xE07f02ff...43Bab442f
0.00035 ETH
311288072025-06-04 14:22:41252 days ago1749046961
0xE07f02ff...43Bab442f
0.00035 ETH
310737762025-06-03 7:48:19253 days ago1748936899
0xE07f02ff...43Bab442f
0.00007 ETH
310666342025-06-03 3:50:15253 days ago1748922615
0xE07f02ff...43Bab442f
0.00007 ETH
310605292025-06-03 0:26:45253 days ago1748910405
0xE07f02ff...43Bab442f
0.00035 ETH
310415192025-06-02 13:53:05254 days ago1748872385
0xE07f02ff...43Bab442f
0.00007 ETH
310178262025-06-02 0:43:19254 days ago1748824999
0xE07f02ff...43Bab442f
0.00035 ETH
309976062025-06-01 13:29:19255 days ago1748784559
0xE07f02ff...43Bab442f
0.00007 ETH
309968192025-06-01 13:03:05255 days ago1748782985
0xE07f02ff...43Bab442f
0.00007 ETH
309961262025-06-01 12:39:59255 days ago1748781599
0xE07f02ff...43Bab442f
0.00007 ETH
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ImmutableRatings

Compiler Version
v0.8.22+commit.4fc1097e

Optimization Enabled:
Yes with 800 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.22;

import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {Ownable, Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {TUP} from "./TUP.sol";
import {TDN} from "./TDN.sol";

/**
 * @title Immutable Ratings
 * @author immutable-ratings
 * @notice Core controller contract for the Immutable Ratings platform
 */
contract ImmutableRatings is Ownable2Step, ReentrancyGuard {
    using SafeERC20 for IERC20;

    /// @dev The TUP token. Represents upvotes.
    TUP public immutable tokenUp;

    /// @dev The TDN token. Represents downvotes.
    TDN public immutable tokenDown;

    /// @dev This contract is immutable and non-upgradeable.
    /// Further versions of this contract will be deployed independently.
    string public constant VERSION = "1.0.0";

    /// @dev Seed for market creation
    string public constant SEED = "Immutable_Ratings_by_GM_EB_MB";

    /// @dev The minimum amount of tokens that can be rated
    uint256 public constant MIN_RATING_AMOUNT = 1000 ether;

    /// @dev The price of a rating in ether
    uint256 public ratingPrice = 0.00000007 ether;

    /// @dev Address of the fee receiver
    address public receiver;

    /// @dev Whether the contract is paused
    bool public isPaused = false;

    /// @dev Mapping of active markets to their URLs
    mapping(address market => string url) public marketToUrl;

    /// @dev Mapping of URLs to their markets
    mapping(string url => address market) public urlToMarket;

    /// @dev Defines the structure of a rating request
    struct MarketRating {
        string url;
        uint256 amount;
    }

    // Events
    event MarketCreated(address indexed marketAddress, string url);
    event RatingUpCreated(address indexed user, address indexed market, uint256 amount);
    event RatingDownCreated(address indexed user, address indexed market, uint256 amount);
    event ReceiverUpdated(address indexed newReceiver);
    event Paused(bool isPaused);

    // Errors
    error ZeroAddress();
    error EmptyURL();
    error MarketAlreadyExists(string url);
    error InvalidRatingAmount();
    error InsufficientPayment();
    error ContractPaused();

    /**
     * @dev Enforces that a function can only be called if the contract is not paused
     */
    modifier notPaused() {
        if (isPaused) revert ContractPaused();
        _;
    }

    /**
     * @param _tokenUp The address of the TUP token
     * @param _tokenDown The address of the TDN token
     * @param _receiver The address of the fee receiver
     */
    constructor(address _tokenUp, address _tokenDown, address _receiver) Ownable(msg.sender) {
        if (_tokenUp == address(0) || _tokenDown == address(0) || _receiver == address(0)) revert ZeroAddress();

        tokenUp = TUP(_tokenUp);
        tokenDown = TDN(_tokenDown);
        receiver = _receiver;
    }

    /**
     * Returns the total number of immutables ratings (IRs) for a user
     * @param user The address of the user
     * @return total The total number of ratings
     */
    function getUserRatings(address user) external view returns (uint256 total) {
        return tokenUp.upvotes(user) + tokenDown.downvotes(user);
    }

    /**
     * @notice Sets the fee receiver address
     * @param _receiver The address of the fee receiver
     */
    function setReceiver(address _receiver) external onlyOwner {
        receiver = _receiver;
        emit ReceiverUpdated(_receiver);
    }

    /**
     * @notice Pauses or unpauses the contract
     * @param _isPaused Whether to pause the contract
     */
    function setIsPaused(bool _isPaused) external onlyOwner {
        isPaused = _isPaused;
        emit Paused(_isPaused);
    }

    /**
     * @notice Creates a new market for a URL
     * @param url The URL for the market
     */
    function createMarket(string calldata url) external notPaused {
        if (urlToMarket[url] != address(0)) revert MarketAlreadyExists(url);
        _createMarket(url);
    }

    /**
     * @notice Gets the market address for a URL
     * @param url The URL for the market
     * @return marketAddress The address of the created market
     */
    function getMarketAddress(string calldata url) external pure returns (address) {
        return _createMarketAddress(url);
    }

    /**
     * @dev Creates a new market for a URL. It is assumed that the URL has already been validated and normalized
     * @param url The URL for the market.
     * @return marketAddress The address of the created market
     */
    function _createMarket(string calldata url) internal returns (address marketAddress) {
        marketAddress = _createMarketAddress(url);
        marketToUrl[marketAddress] = url;
        urlToMarket[url] = marketAddress;

        emit MarketCreated(marketAddress, url);
    }

    /**
     * @dev Returns a market if it exists, otherwise creates a new one
     * @param url The URL for the market
     * @return marketAddress The address of the created market
     */
    function _getMarket(string calldata url) internal returns (address marketAddress) {
        marketAddress = urlToMarket[url];
        if (marketAddress == address(0)) {
            marketAddress = _createMarket(url);
        }
    }

    /**
     * @notice Creates a new market for a URL
     * @dev It is assumed that the URL has already been validated and normalized
     * @param url The URL for the market
     * @return marketAddress The address of the created market
     */
    function _createMarketAddress(string calldata url) internal pure returns (address) {
        if (bytes(url).length == 0) revert EmptyURL();

        return address(uint160(uint256(keccak256(abi.encodePacked(SEED, url)))));
    }

    /**
     * @notice Creates an up rating for a single market
     * @param rating The rating to create
     */
    function createUpRating(MarketRating calldata rating) external payable nonReentrant notPaused {
        _validateRating(rating);
        _createUpRating(msg.sender, rating);
        _processPayment(rating.amount);
    }

    /**
     * @notice Creates a down rating for a single market
     * @param rating The rating to create
     */
    function createDownRating(MarketRating calldata rating) external payable nonReentrant notPaused {
        _validateRating(rating);
        _createDownRating(msg.sender, rating);
        _processPayment(rating.amount);
    }

    /**
     * @dev Creates an UP rating. Does not validate the rating amount or user count.
     * @param rating The rating to create
     */
    function _createUpRating(address from, MarketRating calldata rating) internal {
        address marketAddress = _getMarket(rating.url);
        tokenUp.mint(from, marketAddress, rating.amount);
        emit RatingUpCreated(from, marketAddress, rating.amount);
    }

    /**
     * @dev Creates a DOWN rating. Does not validate the rating amount or user count.
     * @param rating The rating to create
     */
    function _createDownRating(address from, MarketRating calldata rating) internal {
        address marketAddress = _getMarket(rating.url);
        tokenDown.mint(from, marketAddress, rating.amount);
        emit RatingDownCreated(from, marketAddress, rating.amount);
    }

    /**
     * @dev Validates a rating is correctly formatted
     *  - Amount is not 0
     *  - Amount is a multiple of 1 ether (prevents decimal ratings)
     * @param rating The rating to validate
     */
    function _validateRating(MarketRating calldata rating) internal pure {
        if (rating.amount % 1 ether != 0 || rating.amount < MIN_RATING_AMOUNT) {
            revert InvalidRatingAmount();
        }
    }

    /**
     * @notice Preview the payment for a rating
     * @param amount The amount of tokens to rate
     * @return price The price of the rating
     */
    function previewPayment(uint256 amount) external view returns (uint256) {
        return _getRatingPrice(amount);
    }

    /**
     * @notice Gets the market price for a rating based on the amount of tokens
     * @param amount The amount of tokens to rate
     * @return price The price of the rating
     */
    function _getRatingPrice(uint256 amount) internal view returns (uint256) {
        return (amount * ratingPrice) / 1 ether;
    }

    /**
     * @notice Processes the payment for a rating, including funds distribution and excess refund
     * @param amount The amount of tokens to rate
     */
    function _processPayment(uint256 amount) internal {
        uint256 price = _getRatingPrice(amount);
        if (msg.value < price) revert InsufficientPayment();
        _refundExcessPayment(msg.value - price);
        _distributePayment(price);
    }

    /**
     * @notice Refunds excess amount to the caller
     * @param amount The amount of tokens to refund
     */
    function _refundExcessPayment(uint256 amount) internal {
        if (amount > 0) {
            payable(msg.sender).transfer(amount);
        }
    }

    /**
     * @notice Distributes the payment to the receiver
     * @param amount The amount of tokens to distribute
     */
    function _distributePayment(uint256 amount) internal {
        payable(receiver).transfer(amount);
    }

    /**
     * @notice Recovers ERC20 tokens from the contract
     * @param tokenAddress The address of the token to recover
     * @param recipient The address of the recipient
     */
    function recoverERC20(address tokenAddress, address recipient) external onlyOwner {
        if (tokenAddress == address(0) || recipient == address(0)) revert ZeroAddress();
        IERC20(tokenAddress).safeTransfer(recipient, IERC20(tokenAddress).balanceOf(address(this)));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../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:
 *
 * ```solidity
 * 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}:
 *
 * ```solidity
 * 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. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @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 returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @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 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.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual 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.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual 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 `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC-165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @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.
     */
    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. This account bears the admin role (for the granted role).
     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
     */
    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 `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (access/Ownable2Step.sol)

pragma solidity ^0.8.20;

import {Ownable} from "./Ownable.sol";

/**
 * @dev Contract module which provides access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This extension of the {Ownable} contract includes a two-step mechanism to transfer
 * ownership, where the new owner must call {acceptOwnership} in order to replace the
 * old one. This can help prevent common mistakes, such as transfers of ownership to
 * incorrect accounts, or to contracts that are unable to interact with the
 * permission system.
 *
 * The initial owner is specified at deployment time in the constructor for `Ownable`. This
 * can later be changed with {transferOwnership} and {acceptOwnership}.
 *
 * This module is used through inheritance. It will make available all functions
 * from parent (Ownable).
 */
abstract contract Ownable2Step is Ownable {
    address private _pendingOwner;

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

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

    /**
     * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
     * Can only be called by the current owner.
     *
     * Setting `newOwner` to the zero address is allowed; this can be used to cancel an initiated ownership transfer.
     */
    function transferOwnership(address newOwner) public virtual override onlyOwner {
        _pendingOwner = newOwner;
        emit OwnershipTransferStarted(owner(), newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual override {
        delete _pendingOwner;
        super._transferOwnership(newOwner);
    }

    /**
     * @dev The new owner accepts the ownership transfer.
     */
    function acceptOwnership() public virtual {
        address sender = _msgSender();
        if (pendingOwner() != sender) {
            revert OwnableUnauthorizedAccount(sender);
        }
        _transferOwnership(sender);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC-20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC-721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC-1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";

/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}

File 8 of 19 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../utils/introspection/IERC165.sol";

File 9 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC-20
 * applications.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

    mapping(address account => mapping(address spender => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Skips emitting an {Approval} event indicating an allowance update. This is not
     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     *
     * ```solidity
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance < type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * 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[ERC 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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
 * consider using {ReentrancyGuardTransient} instead.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant NOT_ENTERED = 1;
    uint256 private constant ENTERED = 2;

    uint256 private _status;

    /**
     * @dev Unauthorized reentrant call.
     */
    error ReentrancyGuardReentrantCall();

    constructor() {
        _status = NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be NOT_ENTERED
        if (_status == ENTERED) {
            revert ReentrancyGuardReentrantCall();
        }

        // Any calls to nonReentrant after this point will fail
        _status = ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == ENTERED;
    }
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.22;

import {ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

/**
 * @title Thumbs Down (TDN)
 * @author immutable-ratings
 */
contract TDN is ERC20, AccessControl {
    using SafeERC20 for IERC20;

    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    error ZeroAddress();

    /// @dev The number of downvotes that a user has created
    mapping(address user => uint256 downvotes) public downvotes;

    constructor() ERC20("Thumbs Down", "TDN") {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setRoleAdmin(MINTER_ROLE, DEFAULT_ADMIN_ROLE);
    }

    /**
     * @notice Mints token to the given address
     * @param minter The address of the user minting the tokens
     * @param to The address to mint the tokens to
     * @param amount The amount of tokens to mint
     */
    function mint(address minter, address to, uint256 amount) public onlyRole(MINTER_ROLE) {
        _mint(to, amount);
        downvotes[minter] += amount;
    }

    /**
     * @notice Recovers ERC20 tokens from the contract
     * @param tokenAddress The address of the token to recover
     * @param recipient The address of the recipient
     */
    function recoverERC20(address tokenAddress, address recipient) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (tokenAddress == address(0) || recipient == address(0)) revert ZeroAddress();
        IERC20(tokenAddress).safeTransfer(recipient, IERC20(tokenAddress).balanceOf(address(this)));
    }
}

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.22;

import {ERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

/**
 * @title Thumbs Up (TUP)
 * @author immutable-ratings
 */
contract TUP is ERC20, AccessControl {
    using SafeERC20 for IERC20;
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    error ZeroAddress();

    /// @dev The number of upvotes that a user has created
    mapping(address user => uint256 upvotes) public upvotes;

    constructor() ERC20("Thumbs Up", "TUP") {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setRoleAdmin(MINTER_ROLE, DEFAULT_ADMIN_ROLE);
    }

    /**
     * @notice Mints token to the given address
     * @param minter The address of the user minting the tokens
     * @param to The address to mint the tokens to
     * @param amount The amount of tokens to mint
     */
    function mint(address minter, address to, uint256 amount) public onlyRole(MINTER_ROLE) {
        _mint(to, amount);
        upvotes[minter] += amount;
    }

    /**
     * @notice Recovers ERC20 tokens from the contract
     * @param tokenAddress The address of the token to recover
     * @param recipient The address of the recipient
     */
    function recoverERC20(address tokenAddress, address recipient) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (tokenAddress == address(0) || recipient == address(0)) revert ZeroAddress();
        IERC20(tokenAddress).safeTransfer(recipient, IERC20(tokenAddress).balanceOf(address(this)));
    }
}

Settings
{
  "metadata": {
    "bytecodeHash": "none",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_tokenUp","type":"address"},{"internalType":"address","name":"_tokenDown","type":"address"},{"internalType":"address","name":"_receiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ContractPaused","type":"error"},{"inputs":[],"name":"EmptyURL","type":"error"},{"inputs":[],"name":"InsufficientPayment","type":"error"},{"inputs":[],"name":"InvalidRatingAmount","type":"error"},{"inputs":[{"internalType":"string","name":"url","type":"string"}],"name":"MarketAlreadyExists","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"marketAddress","type":"address"},{"indexed":false,"internalType":"string","name":"url","type":"string"}],"name":"MarketCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isPaused","type":"bool"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RatingDownCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RatingUpCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newReceiver","type":"address"}],"name":"ReceiverUpdated","type":"event"},{"inputs":[],"name":"MIN_RATING_AMOUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SEED","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"url","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ImmutableRatings.MarketRating","name":"rating","type":"tuple"}],"name":"createDownRating","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"url","type":"string"}],"name":"createMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"string","name":"url","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ImmutableRatings.MarketRating","name":"rating","type":"tuple"}],"name":"createUpRating","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"url","type":"string"}],"name":"getMarketAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserRatings","outputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"market","type":"address"}],"name":"marketToUrl","outputs":[{"internalType":"string","name":"url","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"previewPayment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ratingPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPaused","type":"bool"}],"name":"setIsPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"}],"name":"setReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenDown","outputs":[{"internalType":"contract TDN","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenUp","outputs":[{"internalType":"contract TUP","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"url","type":"string"}],"name":"urlToMarket","outputs":[{"internalType":"address","name":"market","type":"address"}],"stateMutability":"view","type":"function"}]

60c060405264104c533c006003556004805460ff60a01b191690553480156200002757600080fd5b5060405162001816380380620018168339810160408190526200004a916200018c565b33806200007157604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200007c8162000101565b5060016002556001600160a01b0383161580620000a057506001600160a01b038216155b80620000b357506001600160a01b038116155b15620000d25760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0392831660805290821660a052600480546001600160a01b03191691909216179055620001d6565b600180546001600160a01b03191690556200011c816200011f565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200018757600080fd5b919050565b600080600060608486031215620001a257600080fd5b620001ad846200016f565b9250620001bd602085016200016f565b9150620001cd604085016200016f565b90509250925092565b60805160a0516115fe6200021860003960008181610395015281816109b30152610ebe0152600081816102c101528181610a3f0152610b7101526115fe6000f3fe60806040526004361061018b5760003560e01c80638da5cb5b116100d6578063e30c39781161007f578063f7260d3e11610059578063f7260d3e146104ba578063fbd8cc4c146104da578063ffa1ad74146104f057600080fd5b8063e30c39781461045c578063f2fde38b1461047a578063f50336f91461049a57600080fd5b8063a00c582e116100b0578063a00c582e146103f8578063b187bd2614610418578063c4baaa9f1461044957600080fd5b80638da5cb5b146103655780639c25cc62146103835780639f8472d4146103b757600080fd5b806354888f5511610138578063718da7ee11610112578063718da7ee1461031057806379ba509714610330578063886f039a1461034557600080fd5b806354888f551461028f5780636bfc5c6e146102af578063715018a6146102fb57600080fd5b806323da93171161016957806323da93171461023a578063240976bf1461024f57806350a1a8681461026f57600080fd5b806303994dc5146101905780630edc4737146101c657806317da760a1461020f575b600080fd5b34801561019c57600080fd5b506101b06101ab3660046110f3565b610539565b6040516101bd9190611132565b60405180910390f35b3480156101d257600080fd5b506101b06040518060400160405280601d81526020017f496d6d757461626c655f526174696e67735f62795f474d5f45425f4d4200000081525081565b34801561021b57600080fd5b5061022c683635c9adc5dea0000081565b6040519081526020016101bd565b61024d610248366004611165565b6105d3565b005b34801561025b57600080fd5b5061024d61026a3660046111a0565b610633565b34801561027b57600080fd5b5061022c61028a3660046111c2565b6106ae565b34801561029b57600080fd5b5061024d6102aa3660046111db565b6106bf565b3480156102bb57600080fd5b506102e37f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101bd565b34801561030757600080fd5b5061024d61075a565b34801561031c57600080fd5b5061024d61032b3660046110f3565b61076e565b34801561033c57600080fd5b5061024d6107c0565b34801561035157600080fd5b5061024d61036036600461124d565b610801565b34801561037157600080fd5b506000546001600160a01b03166102e3565b34801561038f57600080fd5b506102e37f000000000000000000000000000000000000000000000000000000000000000081565b3480156103c357600080fd5b506102e36103d2366004611296565b80516020818301810180516006825292820191909301209152546001600160a01b031681565b34801561040457600080fd5b506102e36104133660046111db565b6108c7565b34801561042457600080fd5b5060045461043990600160a01b900460ff1681565b60405190151581526020016101bd565b61024d610457366004611165565b6108da565b34801561046857600080fd5b506001546001600160a01b03166102e3565b34801561048657600080fd5b5061024d6104953660046110f3565b610920565b3480156104a657600080fd5b5061022c6104b53660046110f3565b610991565b3480156104c657600080fd5b506004546102e3906001600160a01b031681565b3480156104e657600080fd5b5061022c60035481565b3480156104fc57600080fd5b506101b06040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6005602052600090815260409020805461055290611347565b80601f016020809104026020016040519081016040528092919081815260200182805461057e90611347565b80156105cb5780601f106105a0576101008083540402835291602001916105cb565b820191906000526020600020905b8154815290600101906020018083116105ae57829003601f168201915b505050505081565b6105db610ab4565b600454600160a01b900460ff16156106065760405163ab35696f60e01b815260040160405180910390fd5b61060f81610adc565b6106193382610b29565b6106268160200135610c25565b6106306001600255565b50565b61063b610c6e565b60048054821515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790556040517f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd2906106a390831515815260200190565b60405180910390a150565b60006106b982610c9b565b92915050565b600454600160a01b900460ff16156106ea5760405163ab35696f60e01b815260040160405180910390fd5b60006001600160a01b031660068383604051610707929190611381565b908152604051908190036020019020546001600160a01b03161461074b5781816040516337afdd7160e01b8152600401610742929190611391565b60405180910390fd5b6107558282610cbe565b505050565b610762610c6e565b61076c6000610d70565b565b610776610c6e565b600480546001600160a01b0319166001600160a01b0383169081179091556040517f75fd3aa5d9b6e2a8a9d8894008c9263200713f4b1fa9113665e09ceac002774690600090a250565b60015433906001600160a01b031681146107f85760405163118cdaa760e01b81526001600160a01b0382166004820152602401610742565b61063081610d70565b610809610c6e565b6001600160a01b038216158061082657506001600160a01b038116155b156108445760405163d92e233d60e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526108c39082906001600160a01b038516906370a0823190602401602060405180830381865afa15801561088e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b291906113c0565b6001600160a01b0385169190610d89565b5050565b60006108d38383610df0565b9392505050565b6108e2610ab4565b600454600160a01b900460ff161561090d5760405163ab35696f60e01b815260040160405180910390fd5b61091681610adc565b6106193382610e7b565b610928610c6e565b600180546001600160a01b0383166001600160a01b031990911681179091556109596000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6040516324abc0b960e01b81526001600160a01b0382811660048301526000917f0000000000000000000000000000000000000000000000000000000000000000909116906324abc0b990602401602060405180830381865afa1580156109fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2091906113c0565b60405163daf4906d60e01b81526001600160a01b0384811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063daf4906d90602401602060405180830381865afa158015610a86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aaa91906113c0565b6106b991906113ef565b6002805403610ad657604051633ee5aeb560e01b815260040160405180910390fd5b60028055565b610af2670de0b6b3a76400006020830135611418565b151580610b0b5750683635c9adc5dea000008160200135105b156106305760405163a31fbaaf60e01b815260040160405180910390fd5b6000610b3d610b38838061142c565b610f65565b604051636361ddf360e11b81526001600160a01b0385811660048301528083166024830152602085013560448301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063c6c3bbe690606401600060405180830381600087803b158015610bb757600080fd5b505af1158015610bcb573d6000803e3d6000fd5b50505050806001600160a01b0316836001600160a01b03167f93a8393c8cf19d12c7dec41659d1c180332cccdddc65483285d6fb00d10166628460200135604051610c1891815260200190565b60405180910390a3505050565b6000610c3082610c9b565b905080341015610c535760405163cd1c886760e01b815260040160405180910390fd5b610c65610c60823461147a565b610fa3565b6108c381610fd6565b6000546001600160a01b0316331461076c5760405163118cdaa760e01b8152336004820152602401610742565b6000670de0b6b3a764000060035483610cb4919061148d565b6106b991906114a4565b6000610cca8383610df0565b6001600160a01b0381166000908152600560205260409020909150610cf0838583611508565b508060068484604051610d04929190611381565b90815260405190819003602001812080546001600160a01b039384166001600160a01b0319909116179055908216907f89e2b56dfb4365b59dc3a37aaf819ce4937e48be6ab23686edcecacf0124ae0390610d629086908690611391565b60405180910390a292915050565b600180546001600160a01b031916905561063081611010565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610755908490611060565b6000818103610e1257604051631662e66b60e01b815260040160405180910390fd5b6040518060400160405280601d81526020017f496d6d757461626c655f526174696e67735f62795f474d5f45425f4d420000008152508383604051602001610e5c939291906115c9565b60408051601f1981840301815291905280516020909101209392505050565b6000610e8a610b38838061142c565b604051636361ddf360e11b81526001600160a01b0385811660048301528083166024830152602085013560448301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063c6c3bbe690606401600060405180830381600087803b158015610f0457600080fd5b505af1158015610f18573d6000803e3d6000fd5b50505050806001600160a01b0316836001600160a01b03167f4b713de7cd2c27b9508eb36ff702536841b4eac8273c0683243fde092ff5a0bd8460200135604051610c1891815260200190565b600060068383604051610f79929190611381565b908152604051908190036020019020546001600160a01b03169050806106b9576108d38383610cbe565b801561063057604051339082156108fc029083906000818181858888f193505050501580156108c3573d6000803e3d6000fd5b6004546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108c3573d6000803e3d6000fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080602060008451602086016000885af180611083576040513d6000823e3d81fd5b50506000513d9150811561109b5780600114156110a8565b6001600160a01b0384163b155b156110d157604051635274afe760e01b81526001600160a01b0385166004820152602401610742565b50505050565b80356001600160a01b03811681146110ee57600080fd5b919050565b60006020828403121561110557600080fd5b6108d3826110d7565b60005b83811015611129578181015183820152602001611111565b50506000910152565b602081526000825180602084015261115181604085016020870161110e565b601f01601f19169190910160400192915050565b60006020828403121561117757600080fd5b813567ffffffffffffffff81111561118e57600080fd5b8201604081850312156108d357600080fd5b6000602082840312156111b257600080fd5b813580151581146108d357600080fd5b6000602082840312156111d457600080fd5b5035919050565b600080602083850312156111ee57600080fd5b823567ffffffffffffffff8082111561120657600080fd5b818501915085601f83011261121a57600080fd5b81358181111561122957600080fd5b86602082850101111561123b57600080fd5b60209290920196919550909350505050565b6000806040838503121561126057600080fd5b611269836110d7565b9150611277602084016110d7565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156112a857600080fd5b813567ffffffffffffffff808211156112c057600080fd5b818401915084601f8301126112d457600080fd5b8135818111156112e6576112e6611280565b604051601f8201601f19908116603f0116810190838211818310171561130e5761130e611280565b8160405282815287602084870101111561132757600080fd5b826020860160208301376000928101602001929092525095945050505050565b600181811c9082168061135b57607f821691505b60208210810361137b57634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6000602082840312156113d257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106b9576106b96113d9565b634e487b7160e01b600052601260045260246000fd5b60008261142757611427611402565b500690565b6000808335601e1984360301811261144357600080fd5b83018035915067ffffffffffffffff82111561145e57600080fd5b60200191503681900382131561147357600080fd5b9250929050565b818103818111156106b9576106b96113d9565b80820281158282048414176106b9576106b96113d9565b6000826114b3576114b3611402565b500490565b601f821115610755576000816000526020600020601f850160051c810160208610156114e15750805b601f850160051c820191505b81811015611500578281556001016114ed565b505050505050565b67ffffffffffffffff83111561152057611520611280565b6115348361152e8354611347565b836114b8565b6000601f84116001811461156857600085156115505750838201355b600019600387901b1c1916600186901b1783556115c2565b600083815260209020601f19861690835b828110156115995786850135825560209485019460019092019101611579565b50868210156115b65760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b600084516115db81846020890161110e565b820183858237600093019283525090939250505056fea164736f6c6343000816000a000000000000000000000000e6d3d08a6519f1346344bba0f25a6fe7ab50f06c0000000000000000000000004461a66a7b5ecdbbe0bbbf09b41816f94c4834b2000000000000000000000000c1ec5b421905290f477c741adf97c062921aa18a

Deployed Bytecode

0x60806040526004361061018b5760003560e01c80638da5cb5b116100d6578063e30c39781161007f578063f7260d3e11610059578063f7260d3e146104ba578063fbd8cc4c146104da578063ffa1ad74146104f057600080fd5b8063e30c39781461045c578063f2fde38b1461047a578063f50336f91461049a57600080fd5b8063a00c582e116100b0578063a00c582e146103f8578063b187bd2614610418578063c4baaa9f1461044957600080fd5b80638da5cb5b146103655780639c25cc62146103835780639f8472d4146103b757600080fd5b806354888f5511610138578063718da7ee11610112578063718da7ee1461031057806379ba509714610330578063886f039a1461034557600080fd5b806354888f551461028f5780636bfc5c6e146102af578063715018a6146102fb57600080fd5b806323da93171161016957806323da93171461023a578063240976bf1461024f57806350a1a8681461026f57600080fd5b806303994dc5146101905780630edc4737146101c657806317da760a1461020f575b600080fd5b34801561019c57600080fd5b506101b06101ab3660046110f3565b610539565b6040516101bd9190611132565b60405180910390f35b3480156101d257600080fd5b506101b06040518060400160405280601d81526020017f496d6d757461626c655f526174696e67735f62795f474d5f45425f4d4200000081525081565b34801561021b57600080fd5b5061022c683635c9adc5dea0000081565b6040519081526020016101bd565b61024d610248366004611165565b6105d3565b005b34801561025b57600080fd5b5061024d61026a3660046111a0565b610633565b34801561027b57600080fd5b5061022c61028a3660046111c2565b6106ae565b34801561029b57600080fd5b5061024d6102aa3660046111db565b6106bf565b3480156102bb57600080fd5b506102e37f000000000000000000000000e6d3d08a6519f1346344bba0f25a6fe7ab50f06c81565b6040516001600160a01b0390911681526020016101bd565b34801561030757600080fd5b5061024d61075a565b34801561031c57600080fd5b5061024d61032b3660046110f3565b61076e565b34801561033c57600080fd5b5061024d6107c0565b34801561035157600080fd5b5061024d61036036600461124d565b610801565b34801561037157600080fd5b506000546001600160a01b03166102e3565b34801561038f57600080fd5b506102e37f0000000000000000000000004461a66a7b5ecdbbe0bbbf09b41816f94c4834b281565b3480156103c357600080fd5b506102e36103d2366004611296565b80516020818301810180516006825292820191909301209152546001600160a01b031681565b34801561040457600080fd5b506102e36104133660046111db565b6108c7565b34801561042457600080fd5b5060045461043990600160a01b900460ff1681565b60405190151581526020016101bd565b61024d610457366004611165565b6108da565b34801561046857600080fd5b506001546001600160a01b03166102e3565b34801561048657600080fd5b5061024d6104953660046110f3565b610920565b3480156104a657600080fd5b5061022c6104b53660046110f3565b610991565b3480156104c657600080fd5b506004546102e3906001600160a01b031681565b3480156104e657600080fd5b5061022c60035481565b3480156104fc57600080fd5b506101b06040518060400160405280600581526020017f312e302e3000000000000000000000000000000000000000000000000000000081525081565b6005602052600090815260409020805461055290611347565b80601f016020809104026020016040519081016040528092919081815260200182805461057e90611347565b80156105cb5780601f106105a0576101008083540402835291602001916105cb565b820191906000526020600020905b8154815290600101906020018083116105ae57829003601f168201915b505050505081565b6105db610ab4565b600454600160a01b900460ff16156106065760405163ab35696f60e01b815260040160405180910390fd5b61060f81610adc565b6106193382610b29565b6106268160200135610c25565b6106306001600255565b50565b61063b610c6e565b60048054821515600160a01b027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff9091161790556040517f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd2906106a390831515815260200190565b60405180910390a150565b60006106b982610c9b565b92915050565b600454600160a01b900460ff16156106ea5760405163ab35696f60e01b815260040160405180910390fd5b60006001600160a01b031660068383604051610707929190611381565b908152604051908190036020019020546001600160a01b03161461074b5781816040516337afdd7160e01b8152600401610742929190611391565b60405180910390fd5b6107558282610cbe565b505050565b610762610c6e565b61076c6000610d70565b565b610776610c6e565b600480546001600160a01b0319166001600160a01b0383169081179091556040517f75fd3aa5d9b6e2a8a9d8894008c9263200713f4b1fa9113665e09ceac002774690600090a250565b60015433906001600160a01b031681146107f85760405163118cdaa760e01b81526001600160a01b0382166004820152602401610742565b61063081610d70565b610809610c6e565b6001600160a01b038216158061082657506001600160a01b038116155b156108445760405163d92e233d60e01b815260040160405180910390fd5b6040516370a0823160e01b81523060048201526108c39082906001600160a01b038516906370a0823190602401602060405180830381865afa15801561088e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b291906113c0565b6001600160a01b0385169190610d89565b5050565b60006108d38383610df0565b9392505050565b6108e2610ab4565b600454600160a01b900460ff161561090d5760405163ab35696f60e01b815260040160405180910390fd5b61091681610adc565b6106193382610e7b565b610928610c6e565b600180546001600160a01b0383166001600160a01b031990911681179091556109596000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6040516324abc0b960e01b81526001600160a01b0382811660048301526000917f0000000000000000000000004461a66a7b5ecdbbe0bbbf09b41816f94c4834b2909116906324abc0b990602401602060405180830381865afa1580156109fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2091906113c0565b60405163daf4906d60e01b81526001600160a01b0384811660048301527f000000000000000000000000e6d3d08a6519f1346344bba0f25a6fe7ab50f06c169063daf4906d90602401602060405180830381865afa158015610a86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aaa91906113c0565b6106b991906113ef565b6002805403610ad657604051633ee5aeb560e01b815260040160405180910390fd5b60028055565b610af2670de0b6b3a76400006020830135611418565b151580610b0b5750683635c9adc5dea000008160200135105b156106305760405163a31fbaaf60e01b815260040160405180910390fd5b6000610b3d610b38838061142c565b610f65565b604051636361ddf360e11b81526001600160a01b0385811660048301528083166024830152602085013560448301529192507f000000000000000000000000e6d3d08a6519f1346344bba0f25a6fe7ab50f06c9091169063c6c3bbe690606401600060405180830381600087803b158015610bb757600080fd5b505af1158015610bcb573d6000803e3d6000fd5b50505050806001600160a01b0316836001600160a01b03167f93a8393c8cf19d12c7dec41659d1c180332cccdddc65483285d6fb00d10166628460200135604051610c1891815260200190565b60405180910390a3505050565b6000610c3082610c9b565b905080341015610c535760405163cd1c886760e01b815260040160405180910390fd5b610c65610c60823461147a565b610fa3565b6108c381610fd6565b6000546001600160a01b0316331461076c5760405163118cdaa760e01b8152336004820152602401610742565b6000670de0b6b3a764000060035483610cb4919061148d565b6106b991906114a4565b6000610cca8383610df0565b6001600160a01b0381166000908152600560205260409020909150610cf0838583611508565b508060068484604051610d04929190611381565b90815260405190819003602001812080546001600160a01b039384166001600160a01b0319909116179055908216907f89e2b56dfb4365b59dc3a37aaf819ce4937e48be6ab23686edcecacf0124ae0390610d629086908690611391565b60405180910390a292915050565b600180546001600160a01b031916905561063081611010565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610755908490611060565b6000818103610e1257604051631662e66b60e01b815260040160405180910390fd5b6040518060400160405280601d81526020017f496d6d757461626c655f526174696e67735f62795f474d5f45425f4d420000008152508383604051602001610e5c939291906115c9565b60408051601f1981840301815291905280516020909101209392505050565b6000610e8a610b38838061142c565b604051636361ddf360e11b81526001600160a01b0385811660048301528083166024830152602085013560448301529192507f0000000000000000000000004461a66a7b5ecdbbe0bbbf09b41816f94c4834b29091169063c6c3bbe690606401600060405180830381600087803b158015610f0457600080fd5b505af1158015610f18573d6000803e3d6000fd5b50505050806001600160a01b0316836001600160a01b03167f4b713de7cd2c27b9508eb36ff702536841b4eac8273c0683243fde092ff5a0bd8460200135604051610c1891815260200190565b600060068383604051610f79929190611381565b908152604051908190036020019020546001600160a01b03169050806106b9576108d38383610cbe565b801561063057604051339082156108fc029083906000818181858888f193505050501580156108c3573d6000803e3d6000fd5b6004546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108c3573d6000803e3d6000fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080602060008451602086016000885af180611083576040513d6000823e3d81fd5b50506000513d9150811561109b5780600114156110a8565b6001600160a01b0384163b155b156110d157604051635274afe760e01b81526001600160a01b0385166004820152602401610742565b50505050565b80356001600160a01b03811681146110ee57600080fd5b919050565b60006020828403121561110557600080fd5b6108d3826110d7565b60005b83811015611129578181015183820152602001611111565b50506000910152565b602081526000825180602084015261115181604085016020870161110e565b601f01601f19169190910160400192915050565b60006020828403121561117757600080fd5b813567ffffffffffffffff81111561118e57600080fd5b8201604081850312156108d357600080fd5b6000602082840312156111b257600080fd5b813580151581146108d357600080fd5b6000602082840312156111d457600080fd5b5035919050565b600080602083850312156111ee57600080fd5b823567ffffffffffffffff8082111561120657600080fd5b818501915085601f83011261121a57600080fd5b81358181111561122957600080fd5b86602082850101111561123b57600080fd5b60209290920196919550909350505050565b6000806040838503121561126057600080fd5b611269836110d7565b9150611277602084016110d7565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156112a857600080fd5b813567ffffffffffffffff808211156112c057600080fd5b818401915084601f8301126112d457600080fd5b8135818111156112e6576112e6611280565b604051601f8201601f19908116603f0116810190838211818310171561130e5761130e611280565b8160405282815287602084870101111561132757600080fd5b826020860160208301376000928101602001929092525095945050505050565b600181811c9082168061135b57607f821691505b60208210810361137b57634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6000602082840312156113d257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106b9576106b96113d9565b634e487b7160e01b600052601260045260246000fd5b60008261142757611427611402565b500690565b6000808335601e1984360301811261144357600080fd5b83018035915067ffffffffffffffff82111561145e57600080fd5b60200191503681900382131561147357600080fd5b9250929050565b818103818111156106b9576106b96113d9565b80820281158282048414176106b9576106b96113d9565b6000826114b3576114b3611402565b500490565b601f821115610755576000816000526020600020601f850160051c810160208610156114e15750805b601f850160051c820191505b81811015611500578281556001016114ed565b505050505050565b67ffffffffffffffff83111561152057611520611280565b6115348361152e8354611347565b836114b8565b6000601f84116001811461156857600085156115505750838201355b600019600387901b1c1916600186901b1783556115c2565b600083815260209020601f19861690835b828110156115995786850135825560209485019460019092019101611579565b50868210156115b65760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b600084516115db81846020890161110e565b820183858237600093019283525090939250505056fea164736f6c6343000816000a

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

000000000000000000000000e6d3d08a6519f1346344bba0f25a6fe7ab50f06c0000000000000000000000004461a66a7b5ecdbbe0bbbf09b41816f94c4834b2000000000000000000000000c1ec5b421905290f477c741adf97c062921aa18a

-----Decoded View---------------
Arg [0] : _tokenUp (address): 0xE6D3d08a6519F1346344bba0F25A6fE7aB50F06C
Arg [1] : _tokenDown (address): 0x4461a66A7B5eCdBBE0bbBf09b41816f94c4834b2
Arg [2] : _receiver (address): 0xc1Ec5b421905290F477C741ADf97c062921AA18A

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000e6d3d08a6519f1346344bba0f25a6fe7ab50f06c
Arg [1] : 0000000000000000000000004461a66a7b5ecdbbe0bbbf09b41816f94c4834b2
Arg [2] : 000000000000000000000000c1ec5b421905290f477c741adf97c062921aa18a


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
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  ]
[ 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.