Amoy Testnet

Contract

0x305D35887A7f62080A58693F85e2C7011f0d0aC3

Overview

POL Balance

Polygon PoS Chain Amoy LogoPolygon PoS Chain Amoy LogoPolygon PoS Chain Amoy Logo0 POL

Multichain Info

N/A
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FakeAltroFeeManager

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 14 : FakeAltroFeeManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "./interfaces/IFeeManager.sol";
import "./interfaces/ILicenseManager.sol";

/**
 * @title FakeAltroFeeManager
 * @author FakeAltro Developer
 * @dev This contract facilitates management of fees for all the taxed processes of the FakeAltro protocol.
 */
contract FakeAltroFeeManager is AccessControlUpgradeable, IFeeManager {
	using SafeERC20 for IERC20;
	using ERC165Checker for address;

	struct SaleInfo {
		bool isRedemptionFeePaid;
		uint256 firstSalePrice;
		address redemptionFeeTokenAddress;
	}

	bytes4 private constant FEE_CALLBACK_MAGIC_BYTES = this.receiveZeroExFeeCallback.selector;
	uint256 private constant _MIN_FEE = 50;
	uint256 private constant _MAX_FEE = 1000;
	uint256 private constant _DENOMINATOR = 10000;

	bytes32 public constant TRADE_CHECKER_ROLE = keccak256("TRADE_CHECKER_ROLE");
	bytes32 public constant ZERO_EX_ROLE = keccak256("ZERO_EX_ROLE");
	/**
	 * @dev The MAX_REDEMPTION_FEE is a constant variable that holds the maximum fee that can be charged for redemption of the physical assets represented by the NFTs
	 */
	uint256 public constant MAX_REDEMPTION_FEE = 1000;

	/**
	 * @dev The userDiscount mapping allows an owner to specify a discount for certain users when they redeem an NFT
	 */
	mapping(address => bool) public userDiscount;
	/**
	 * @dev The salesInfo mapping stores the information needed for every nft saled by our platform
	 */
	mapping(address => mapping(uint256 => SaleInfo)) public salesInfo;

	/**
	 * @dev The governanceTreasury variable holds the address of the FakeAltro governance treasury
	 */
	address public governanceTreasury;
	/**
	 * @dev The licenseManager variable holds the address of the license manager contract
	 */
	address public licenseManager;
	/**
	 * @dev The redemptionFee variable holds the percentage of the first sale price to be paid as fee that is charged for redemption of the physical assets represented by the NFTs.
	 */
	uint256 public redemptionFee;
	/**
	 * @dev The protocol fee for fractions buyouts
	 */
	uint256 public buyoutFee;
	/**
	 * @dev The protocol fee for fractions sales
	 */
	uint256 public saleFee;
	/**
	 * @dev The FeeReceived event is emitted when a fee is received
	 * @param tokenAddress The address of the token that the fee was paid with
	 * @param amount The amount of the fee
	 * @param feeData Additional data about the fee
	 */
	event FeeReceived(address indexed tokenAddress, uint256 amount, bytes feeData);
	/**
	 * @dev The RebateReceived event is emitted when a rebate is received by a user
	 * @param receiver The address of the user that received the rebate
	 * @param tokenAddress The address of the token that the rebate was paid with
	 * @param amount The amount of the rebate
	 * @param feeData Additional data about the rebate
	 */
	event RebateReceived(address indexed receiver, address indexed tokenAddress, uint256 amount, bytes feeData);
	/**
	 * @dev The GovernanceTreasuryChanged event is emitted when the governance treasury address is changed
	 * @param governanceTreasury The new address of the governance treasury
	 */
	event GovernanceTreasuryChanged(address indexed governanceTreasury);
	/**
	 * @dev The LicenseManagerChanged event is emitted when the license manager address is changed
	 * @param licenseManager The new address of the license manager contract
	 */
	event LicenseManagerChanged(address indexed licenseManager);
	/**
	 * @dev The RedemptionFeePaid event is emitted when a redemption fee is paid for a specific NFT
	 * @param nftCollection The address of the NFT collection that the NFT belongs to
	 * @param tokenId The ID of the NFT for which the redemption fee was paid
	 * @param sender The address of the user that paid the redemption fee
	 * @param fee The amount of the redemption fee
	 */
	event RedemptionFeePaid(address indexed nftCollection, uint256 indexed tokenId, address indexed sender, uint256 fee);
	/**
	 * @dev The RedemptionFeeSet event is emitted when the redemption fee is set
	 * @param redemptionFee The new redemption fee amount
	 */
	event RedemptionFeeSet(uint256 redemptionFee);
	/**
	 * @dev The SaleInfoSet event is emitted when the sale info is set
	 * @param redemptionFeeTokenAddress The new redemption fee token address
	 * @param nftCollection The address of the nft collection contract
	 * @param tokenId The token id of the nft collection
	 * @param price The price of the first sale of the token
	 */
	event SaleInfoSet(address indexed nftCollection, uint256 indexed tokenId, address indexed redemptionFeeTokenAddress, uint256 price);
	/**
	 * @dev Emitted when the fractions buyout fee is set
	 * @param buyoutFee The new fractions buyout fee
	 */
	event BuyoutFeeSet(uint256 buyoutFee);
	/**
	 * @dev Emitted when the fractions sale fee is set
	 * @param saleFee The new fractions sale fee
	 */
	event SaleFeeSet(uint256 saleFee);
	/**
	 * @dev check that fee is included in boundaries
	 * @param fee The fee to check
	 */
	modifier feeChecker(uint256 fee) {
		require(fee >= _MIN_FEE && fee <= _MAX_FEE, "FakeAltroFeeManager: protocol fee exceeds boundaries");
		_;
	}

	/**
	 * @dev The constructor initializes the contract and sets the initial values for some of the variables
	 */
	/// @custom:oz-upgrades-unsafe-allow constructor
	constructor() {
		_disableInitializers();
	}

	/**
	 * @dev The receiveZeroExFeeCallback function handles the callback from 0x protocol
	 *  when the order is filled and fees are paid.
	 * @param tokenAddress The address of the token that the fee was paid with
	 * @param feeData Additional data about the fee
	 * @return success bytes4
	 */
	function receiveZeroExFeeCallback(address tokenAddress, uint256, bytes calldata feeData) external override onlyRole(ZERO_EX_ROLE) returns (bytes4 success) {
		uint256 finalAmount = IERC20(tokenAddress).balanceOf(address(this));
		uint256 discount = ILicenseManager(licenseManager).getDiscount(tx.origin);

		if (discount > 0) {
			uint256 rebateAmount = (finalAmount * discount) / 10000;
			finalAmount -= rebateAmount;
			IERC20(tokenAddress).safeTransfer(tx.origin, rebateAmount);

			emit RebateReceived(tx.origin, tokenAddress, rebateAmount, feeData);
		}
		IERC20(tokenAddress).safeTransfer(governanceTreasury, finalAmount);
		emit FeeReceived(tokenAddress, finalAmount, feeData);

		return FEE_CALLBACK_MAGIC_BYTES;
	}

	/**
	 * @dev The setGovernanceTreasury function allows the owner to set the governance treasury address
	 * @param governanceTreasury_ The new governance treasury address
	 */
	function setGovernanceTreasury(address governanceTreasury_) external onlyRole(DEFAULT_ADMIN_ROLE) {
		_setGovernanceTreasury(governanceTreasury_);
		emit GovernanceTreasuryChanged(governanceTreasury_);
	}

	/**
	 * @dev The setLicenseManager function allows the owner to set the address of the license manager contract
	 * @param licenseManager_ The new address of the license manager contract
	 */
	function setLicenseManager(address licenseManager_) external onlyRole(DEFAULT_ADMIN_ROLE) {
		_setLicenseManager(licenseManager_);
		emit LicenseManagerChanged(licenseManager_);
	}

	/**
	 * @dev The setRedemptionFee function allows the owner to set the amount of the redemption fee
	 * @param redemptionFee_ The new amount of the redemption fee
	 */
	function setRedemptionFee(uint256 redemptionFee_) external onlyRole(DEFAULT_ADMIN_ROLE) {
		_setRedemptionFee(redemptionFee_);
		emit RedemptionFeeSet(redemptionFee_);
	}

	/**
	 * @dev The setRedemptionFeeTokenAddress function allows the sale contract to set the address of the token that will be used to pay the redemption fee
	 * @param redemptionFeeTokenAddress The new address of the redemption fee token
	 * @param nftCollection The address of the nft collection contract
	 * @param tokenId The token id of the nft collection
	 * @param price The first price of sale
	 */
	function setSaleInfo(address nftCollection, uint256 tokenId, address redemptionFeeTokenAddress, uint256 price) external onlyRole(TRADE_CHECKER_ROLE) {
		SaleInfo storage saleInfo = salesInfo[nftCollection][tokenId];
		require(saleInfo.redemptionFeeTokenAddress == address(0), "FakeAltroFeeManager: redempiton fee token address already set");
		require(saleInfo.firstSalePrice == 0, "FakeAltroFeeManager: first sale price already set");

		_setRedemptionFeeTokenAddress(nftCollection, tokenId, redemptionFeeTokenAddress);
		saleInfo.firstSalePrice = price;
		emit SaleInfoSet(nftCollection, tokenId, redemptionFeeTokenAddress, price);
	}

	/**
	 * @dev The payRedemptionFee function allows a user to pay the redemption fee for a specific NFT
	 * @param nftCollection The address of the NFT collection that the NFT belongs to
	 * @param tokenId The ID of the NFT for which the redemption fee is being paid
	 */
	function payRedemptionFee(address nftCollection, uint256 tokenId) external {
		salesInfo[nftCollection][tokenId].isRedemptionFeePaid = true;

		address redemptionFeeToken = salesInfo[nftCollection][tokenId].redemptionFeeTokenAddress;
		uint256 feeAmount = (salesInfo[nftCollection][tokenId].firstSalePrice * redemptionFee) / _DENOMINATOR;

		emit FeeReceived(redemptionFeeToken, feeAmount, "0x");
		emit RedemptionFeePaid(nftCollection, tokenId, msg.sender, feeAmount);

		IERC20(redemptionFeeToken).safeTransferFrom(msg.sender, governanceTreasury, feeAmount);
	}

	/**
	 * @dev Allows an admin to set the protocol fee for the buyout of fractions
	 * @param _buyoutFee The new protocol fee
	 */
	function setBuyoutFee(uint256 _buyoutFee) external onlyRole(DEFAULT_ADMIN_ROLE) {
		_setBuyoutFee(_buyoutFee);

		emit BuyoutFeeSet(_buyoutFee);
	}

	/**
	 * @dev Allows an admin to set the protocol fee for the sale of fractions
	 * @param _saleFee The new protocol fee
	 */
	function setSaleFee(uint256 _saleFee) external onlyRole(DEFAULT_ADMIN_ROLE) {
		_setSaleFee(_saleFee);

		emit SaleFeeSet(_saleFee);
	}

	/**
	 * @dev The initialize function allows the contract owner to set the governance treasury address, license manager address and redemption fee
	 * @param governanceTreasury_ The address of the governance treasury
	 * @param licenseManager_ The address of the license manager contract
	 * @param redemptionFee_ The amount of the redemption fee
	 */
	function initialize(
		address governanceTreasury_,
		address licenseManager_,
		uint256 redemptionFee_,
		uint256 buyoutFee_,
		uint256 saleFee_,
		address zeroEx
	) external initializer {
		__FakeAltroFeeManager_init(governanceTreasury_, licenseManager_, redemptionFee_, buyoutFee_, saleFee_, zeroEx);
	}

	/**
	 * @dev The isRedemptionFeePaid function returns whether or not the redemption fee has been paid for a specific NFT
	 * @param nftCollection The address of the NFT collection that the NFT belongs to
	 * @param tokenId The ID of the NFT for which the fee status is being checked
	 * @return feePaid A boolean indicating whether or not the redemption fee has been paid for the specified NFT
	 */
	function isRedemptionFeePaid(address nftCollection, uint256 tokenId) external view returns (bool feePaid) {
		if (redemptionFee == 0) {
			return true;
		}
		return salesInfo[nftCollection][tokenId].isRedemptionFeePaid;
	}

	/**
	 * @dev The supportsInterface function allows to check if this contract implement a specific interface.
	 * @param interfaceId the interfaceId to check
	 * @return bool a boolean indicating whether this contract implement the specified interfaceId
	 */
	function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
		return interfaceId == type(IFeeManager).interfaceId || super.supportsInterface(interfaceId);
	}

	/**
	 * @dev The _setGovernanceTreasury function allows to set the governanceTreasury address
	 * @param governanceTreasury_ The new governanceTreasury address
	 */
	function _setGovernanceTreasury(address governanceTreasury_) internal {
		require(governanceTreasury_ != address(0), "FakeAltroFeeManager: cannot be null address");
		governanceTreasury = governanceTreasury_;
	}

	/**
	 * @dev The _setLicenseManager function allows to set the licenseManager address
	 * @param licenseManager_ The new licenseManager address
	 */
	function _setLicenseManager(address licenseManager_) internal {
		require(licenseManager_ != address(0), "FakeAltroFeeManager: cannot be null address");
		require(licenseManager_.supportsInterface(type(ILicenseManager).interfaceId), "FakeAltroFeeManager: does not support ILicenseManager interface");
		licenseManager = licenseManager_;
	}

	/**
	 * @dev The _setRedemptionFee function allows to set the redemptionFee
	 * @param redemptionFee_ The new redemptionFee
	 */
	function _setRedemptionFee(uint256 redemptionFee_) internal {
		require(redemptionFee_ <= MAX_REDEMPTION_FEE, "FakeAltroFeeManager: redemption fee too high");
		redemptionFee = redemptionFee_;
	}

	/**
	 * @dev The _setRedemptionFeeTokenAddress function allows to set the redemptionFeeTokenAddress
	 * @param redemptionFeeTokenAddress_ The new redemptionFeeTokenAddress
	 * @param nftCollection The address of the nft collection contract
	 * @param tokenId The token id of the nft collection
	 */
	function _setRedemptionFeeTokenAddress(address nftCollection, uint256 tokenId, address redemptionFeeTokenAddress_) internal {
		require(redemptionFeeTokenAddress_ != address(0), "FakeAltroFeeManager: cannot be null address");
		salesInfo[nftCollection][tokenId].redemptionFeeTokenAddress = redemptionFeeTokenAddress_;
	}

	function __FakeAltroFeeManager_init(
		address governanceTreasury_,
		address licenseManager_,
		uint256 redemptionFee_,
		uint256 buyoutFee_,
		uint256 saleFee_,
		address zeroEx
	) internal onlyInitializing {
		_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
		_grantRole(ZERO_EX_ROLE, zeroEx);
		__FakeAltroFeeManager_init_unchained(governanceTreasury_, licenseManager_, redemptionFee_, buyoutFee_, saleFee_);
	}

	function __FakeAltroFeeManager_init_unchained(
		address governanceTreasury_,
		address licenseManager_,
		uint256 redemptionFee_,
		uint256 buyoutFee_,
		uint256 saleFee_
	) internal onlyInitializing {
		_setGovernanceTreasury(governanceTreasury_);
		_setLicenseManager(licenseManager_);
		_setRedemptionFee(redemptionFee_);
		_setBuyoutFee(buyoutFee_);
		_setSaleFee(saleFee_);
	}

	/**
	 * @dev Sets the protocol fee for the buyout of fractions
	 * @param _buyoutFee The new protocol fee for the buyout of fractions
	 */
	function _setBuyoutFee(uint256 _buyoutFee) internal feeChecker(_buyoutFee) {
		buyoutFee = _buyoutFee;
	}

	/**
	 * @dev Sets the protocol fee for the sale of fractions
	 * @param _saleFee The new protocol fee for the sale of fractions
	 */
	function _setSaleFee(uint256 _saleFee) internal feeChecker(_saleFee) {
		saleFee = _saleFee;
	}
}

File 2 of 14 : AccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {ERC165Upgradeable} from "../utils/introspection/ERC165Upgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControl, ERC165Upgradeable {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;


    /// @custom:storage-location erc7201:openzeppelin.storage.AccessControl
    struct AccessControlStorage {
        mapping(bytes32 role => RoleData) _roles;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.AccessControl")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant AccessControlStorageLocation = 0x02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800;

    function _getAccessControlStorage() private pure returns (AccessControlStorage storage $) {
        assembly {
            $.slot := AccessControlStorageLocation
        }
    }

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

    function __AccessControl_init() internal onlyInitializing {
    }

    function __AccessControl_init_unchained() internal onlyInitializing {
    }
    /**
     * @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) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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 {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        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) {
        AccessControlStorage storage $ = _getAccessControlStorage();
        if (hasRole(role, account)) {
            $._roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 3 of 14 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.20;

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Storage of the initializable contract.
     *
     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
     * when using with upgradeable contracts.
     *
     * @custom:storage-location erc7201:openzeppelin.storage.Initializable
     */
    struct InitializableStorage {
        /**
         * @dev Indicates that the contract has been initialized.
         */
        uint64 _initialized;
        /**
         * @dev Indicates that the contract is in the process of being initialized.
         */
        bool _initializing;
    }

    // keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;

    /**
     * @dev The contract is already initialized.
     */
    error InvalidInitialization();

    /**
     * @dev The contract is not initializing.
     */
    error NotInitializing();

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint64 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
     * production.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        // Cache values to avoid duplicated sloads
        bool isTopLevelCall = !$._initializing;
        uint64 initialized = $._initialized;

        // Allowed calls:
        // - initialSetup: the contract is not in the initializing state and no previous version was
        //                 initialized
        // - construction: the contract is initialized at version 1 (no reininitialization) and the
        //                 current contract is just being deployed
        bool initialSetup = initialized == 0 && isTopLevelCall;
        bool construction = initialized == 1 && address(this).code.length == 0;

        if (!initialSetup && !construction) {
            revert InvalidInitialization();
        }
        $._initialized = 1;
        if (isTopLevelCall) {
            $._initializing = true;
        }
        _;
        if (isTopLevelCall) {
            $._initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint64 version) {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing || $._initialized >= version) {
            revert InvalidInitialization();
        }
        $._initialized = version;
        $._initializing = true;
        _;
        $._initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        _checkInitializing();
        _;
    }

    /**
     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
     */
    function _checkInitializing() internal view virtual {
        if (!_isInitializing()) {
            revert NotInitializing();
        }
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        // solhint-disable-next-line var-name-mixedcase
        InitializableStorage storage $ = _getInitializableStorage();

        if ($._initializing) {
            revert InvalidInitialization();
        }
        if ($._initialized != type(uint64).max) {
            $._initialized = type(uint64).max;
            emit Initialized(type(uint64).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint64) {
        return _getInitializableStorage()._initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _getInitializableStorage()._initializing;
    }

    /**
     * @dev Returns a pointer to the storage namespace.
     */
    // solhint-disable-next-line var-name-mixedcase
    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
        assembly {
            $.slot := INITIALIZABLE_STORAGE
        }
    }
}

File 4 of 14 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    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;
    }
}

File 5 of 14 : ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {Initializable} from "../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165Upgradeable is Initializable, IERC165 {
    function __ERC165_init() internal onlyInitializing {
    }

    function __ERC165_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 6 of 14 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 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, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

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

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

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

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

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

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

File 7 of 14 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 8 of 14 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
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);
}

File 9 of 14 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 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 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 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.
     */
    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.
     */
    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.
     */
    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 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).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            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 silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 10 of 14 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}

File 11 of 14 : ERC165Checker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165Checker.sol)

pragma solidity ^0.8.20;

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

/**
 * @dev Library used to query support of an interface declared via {IERC165}.
 *
 * Note that these functions return the actual result of the query: they do not
 * `revert` if an interface is not supported. It is up to the caller to decide
 * what to do in these cases.
 */
library ERC165Checker {
    // As per the EIP-165 spec, no interface should ever match 0xffffffff
    bytes4 private constant INTERFACE_ID_INVALID = 0xffffffff;

    /**
     * @dev Returns true if `account` supports the {IERC165} interface.
     */
    function supportsERC165(address account) internal view returns (bool) {
        // Any contract that implements ERC165 must explicitly indicate support of
        // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
        return
            supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&
            !supportsERC165InterfaceUnchecked(account, INTERFACE_ID_INVALID);
    }

    /**
     * @dev Returns true if `account` supports the interface defined by
     * `interfaceId`. Support for {IERC165} itself is queried automatically.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
        // query support of both ERC165 as per the spec and support of _interfaceId
        return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
    }

    /**
     * @dev Returns a boolean array where each value corresponds to the
     * interfaces passed in and whether they're supported or not. This allows
     * you to batch check interfaces for a contract where your expectation
     * is that some interfaces may not be supported.
     *
     * See {IERC165-supportsInterface}.
     */
    function getSupportedInterfaces(
        address account,
        bytes4[] memory interfaceIds
    ) internal view returns (bool[] memory) {
        // an array of booleans corresponding to interfaceIds and whether they're supported or not
        bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);

        // query support of ERC165 itself
        if (supportsERC165(account)) {
            // query support of each interface in interfaceIds
            for (uint256 i = 0; i < interfaceIds.length; i++) {
                interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
            }
        }

        return interfaceIdsSupported;
    }

    /**
     * @dev Returns true if `account` supports all the interfaces defined in
     * `interfaceIds`. Support for {IERC165} itself is queried automatically.
     *
     * Batch-querying can lead to gas savings by skipping repeated checks for
     * {IERC165} support.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
        // query support of ERC165 itself
        if (!supportsERC165(account)) {
            return false;
        }

        // query support of each interface in interfaceIds
        for (uint256 i = 0; i < interfaceIds.length; i++) {
            if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
                return false;
            }
        }

        // all interfaces supported
        return true;
    }

    /**
     * @notice Query if a contract implements an interface, does not check ERC165 support
     * @param account The address of the contract to query for support of an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @return true if the contract at account indicates support of the interface with
     * identifier interfaceId, false otherwise
     * @dev Assumes that account contains a contract that supports ERC165, otherwise
     * the behavior of this method is undefined. This precondition can be checked
     * with {supportsERC165}.
     *
     * Some precompiled contracts will falsely indicate support for a given interface, so caution
     * should be exercised when using this function.
     *
     * Interface identification is specified in ERC-165.
     */
    function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
        // prepare call
        bytes memory encodedParams = abi.encodeCall(IERC165.supportsInterface, (interfaceId));

        // perform static call
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly {
            success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0x00)
        }

        return success && returnSize >= 0x20 && returnValue > 0;
    }
}

File 12 of 14 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

File 13 of 14 : IFeeManager.sol
// SPDX-License-Identifier: Apache-2.0
/*

  Copyright 2021 ZeroEx Intl.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/

pragma solidity ^0.8.17;

interface IFeeManager {
	/**
	 * @dev A callback function invoked in the ERC721Feature for each ERC721
	 *      order fee that get paid. Integrators can make use of this callback
	 *      to implement arbitrary fee-handling logic, e.g. splitting the fee
	 *      between multiple parties.
	 * @param tokenAddress The address of the token in which the received fee is
	 *        denominated. `0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` indicates
	 *        that the fee was paid in the native token (e.g. ETH).
	 * @param amount The amount of the given token received.
	 * @param feeData Arbitrary data encoded in the `Fee` used by this callback.
	 * @return success The selector of this function (0x0190805e),
	 *         indicating that the callback succeeded.
	 */
	function receiveZeroExFeeCallback(address tokenAddress, uint256 amount, bytes calldata feeData) external returns (bytes4 success);

	function isRedemptionFeePaid(address nftCollection, uint256 tokenId) external view returns (bool feePaid);

	function buyoutFee() external view returns (uint256 buyoutFee);

	function saleFee() external view returns (uint256 saleFee);

	function governanceTreasury() external view returns (address governanceTreasury);

	function setSaleInfo(address nftCollection, uint256 tokenId, address redemptionFeeTokenAddress, uint256 price) external;

	function salesInfo(
		address nftCollection,
		uint256 tokenId
	) external returns (bool isRedemptionFeePaid, uint256 firstSalePrice, address redemptionFeeTokenAddress);
}

File 14 of 14 : ILicenseManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

interface ILicenseManager {
	function getDiscount(address user) external view returns (uint256);

	function isAQualifiedOracle(address oracle) external view returns (bool);
}

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

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"buyoutFee","type":"uint256"}],"name":"BuyoutFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"feeData","type":"bytes"}],"name":"FeeReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"governanceTreasury","type":"address"}],"name":"GovernanceTreasuryChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"licenseManager","type":"address"}],"name":"LicenseManagerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"feeData","type":"bytes"}],"name":"RebateReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftCollection","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"RedemptionFeePaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"redemptionFee","type":"uint256"}],"name":"RedemptionFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"saleFee","type":"uint256"}],"name":"SaleFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"nftCollection","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"redemptionFeeTokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"}],"name":"SaleInfoSet","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_REDEMPTION_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRADE_CHECKER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZERO_EX_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyoutFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governanceTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"governanceTreasury_","type":"address"},{"internalType":"address","name":"licenseManager_","type":"address"},{"internalType":"uint256","name":"redemptionFee_","type":"uint256"},{"internalType":"uint256","name":"buyoutFee_","type":"uint256"},{"internalType":"uint256","name":"saleFee_","type":"uint256"},{"internalType":"address","name":"zeroEx","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftCollection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isRedemptionFeePaid","outputs":[{"internalType":"bool","name":"feePaid","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"licenseManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nftCollection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"payRedemptionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"name":"receiveZeroExFeeCallback","outputs":[{"internalType":"bytes4","name":"success","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redemptionFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"salesInfo","outputs":[{"internalType":"bool","name":"isRedemptionFeePaid","type":"bool"},{"internalType":"uint256","name":"firstSalePrice","type":"uint256"},{"internalType":"address","name":"redemptionFeeTokenAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_buyoutFee","type":"uint256"}],"name":"setBuyoutFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"governanceTreasury_","type":"address"}],"name":"setGovernanceTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"licenseManager_","type":"address"}],"name":"setLicenseManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"redemptionFee_","type":"uint256"}],"name":"setRedemptionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleFee","type":"uint256"}],"name":"setSaleFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nftCollection","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"redemptionFeeTokenAddress","type":"address"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setSaleInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userDiscount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061001961001e565b6100d0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6118c7806100df6000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c806345f330a2116100f9578063a741d96411610097578063cd1a906211610071578063cd1a90621461040c578063d547741f14610433578063d638028114610446578063e7fd7bd51461045957600080fd5b8063a741d9641461037b578063b1a5d12d146103e6578063bdcafc55146103f957600080fd5b806366559fbb116100d357806366559fbb1461033a5780637dbc1df01461034d57806391d1485414610360578063a217fddf1461037357600080fd5b806345f330a21461030b5780635585bbdd1461031e5780635abd98db1461033157600080fd5b80632ceb46e21161016657806330787dd11161014057806330787dd1146102b057806336568abe146102dc578063365f383f146102ef578063458f58151461030257600080fd5b80632ceb46e2146102535780632dc0aa7f146102765780632f2ff15d1461029d57600080fd5b8063011c25a2146101ae57806301ffc9a7146101c35780630ad51144146101eb578063178021e314610216578063248a9ca31461022d5780632c59277514610240575b600080fd5b6101c16101bc3660046114f2565b610462565b005b6101d66101d136600461151c565b610589565b60405190151581526020015b60405180910390f35b6003546101fe906001600160a01b031681565b6040516001600160a01b0390911681526020016101e2565b61021f60065481565b6040519081526020016101e2565b61021f61023b366004611546565b6105b4565b6101c161024e36600461155f565b6105d6565b6101d661026136600461155f565b60006020819052908152604090205460ff1681565b61021f7fb1bb46d4d74e79a1f9b457db447cb64f6108baf43c5c27f4303d80f0fb00a00b81565b6101c16102ab36600461157a565b610622565b6102c36102be3660046115a6565b61063e565b6040516001600160e01b031990911681526020016101e2565b6101c16102ea36600461157a565b61084e565b6002546101fe906001600160a01b031681565b61021f60045481565b6101c1610319366004611546565b610886565b6101d661032c3660046114f2565b6108d2565b61021f6103e881565b6101c161034836600461155f565b610912565b6101c161035b366004611546565b61095e565b6101d661036e36600461157a565b6109a2565b61021f600081565b6103c06103893660046114f2565b6001602081815260009384526040808520909152918352912080549181015460029091015460ff909216916001600160a01b031683565b60408051931515845260208401929092526001600160a01b0316908201526060016101e2565b6101c16103f436600461162d565b6109da565b6101c1610407366004611546565b610af4565b61021f7fd839b475bf2ae1f274a9d3f66eb75bf367ac9d68ad7778d1836e33ed88c370da81565b6101c161044136600461157a565b610b38565b6101c161045436600461168c565b610b54565b61021f60055481565b6001600160a01b0382811660009081526001602081815260408084208685529091528220805460ff191682178155600281015460045491909201549190931692612710916104b091906116e6565b6104ba91906116fd565b9050816001600160a01b03167fc37905e27a29a0577730d37e05f9e1f77a8ebb37b3f97f07b4ff68c07cbf01438260405161051191815260406020820181905260029082015261060f60f31b606082015260800190565b60405180910390a2336001600160a01b031683856001600160a01b03167f4f48f517ff8f23822962aebf920b85c18d6bd76187d49bf21e0919ad7bd081818460405161055f91815260200190565b60405180910390a4600254610583906001600160a01b038481169133911684610cf8565b50505050565b60006001600160e01b0319821663069533ff60e51b14806105ae57506105ae82610d5f565b92915050565b6000908152600080516020611872833981519152602052604090206001015490565b60006105e181610d94565b6105ea82610da1565b6040516001600160a01b038316907f6be31731b2d63eb099220665b7e72458be7d6078084268add405755c15580bd590600090a25050565b61062b826105b4565b61063481610d94565b6105838383610de9565b60007fb1bb46d4d74e79a1f9b457db447cb64f6108baf43c5c27f4303d80f0fb00a00b61066a81610d94565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa1580156106b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d5919061171f565b6003546040516303793c8d60e11b81523260048201529192506000916001600160a01b03909116906306f2791a90602401602060405180830381865afa158015610723573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610747919061171f565b905080156107db57600061271061075e83856116e6565b61076891906116fd565b90506107748184611738565b925061078a6001600160a01b038a163283610e8e565b886001600160a01b0316326001600160a01b03167f4e148ec9ce322149fe82da79a21d76cd6ab67f18088445fd719c2d8f441acb84838a8a6040516107d19392919061174b565b60405180910390a3505b6002546107f5906001600160a01b038a8116911684610e8e565b876001600160a01b03167fc37905e27a29a0577730d37e05f9e1f77a8ebb37b3f97f07b4ff68c07cbf01438388886040516108329392919061174b565b60405180910390a2506330787dd160e01b979650505050505050565b6001600160a01b03811633146108775760405163334bd91960e11b815260040160405180910390fd5b6108818282610ebf565b505050565b600061089181610d94565b61089a82610f3b565b6040518281527f618f7ccb92cca20d555727f06d9cb96e92d01bcfc352c21f9a342ff1e610b155906020015b60405180910390a15050565b60006004546000036108e6575060016105ae565b506001600160a01b03919091166000908152600160209081526040808320938352929052205460ff1690565b600061091d81610d94565b61092682610f71565b6040516001600160a01b038316907f83b3f972b017fb4298b8c664a2c388f95f0c3896f3f134bee4361ffefe9a722990600090a25050565b600061096981610d94565b61097282611045565b6040518281527f91cc643d187eb250905520d3dae0b1017edd16961d27ab9a4a61fea5e38f717d906020016108c6565b6000918252600080516020611872833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff16600081158015610a205750825b905060008267ffffffffffffffff166001148015610a3d5750303b155b905081158015610a4b575080155b15610a695760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a9357845460ff60401b1916600160401b1785555b610aa18b8b8b8b8b8b6110b1565b8315610ae757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050505050565b6000610aff81610d94565b610b0882611105565b6040518281527f28cc5bc2acd96e4739763aa17be8edff698d2205c67025f22a1bebcf6894ea98906020016108c6565b610b41826105b4565b610b4a81610d94565b6105838383610ebf565b7fd839b475bf2ae1f274a9d3f66eb75bf367ac9d68ad7778d1836e33ed88c370da610b7e81610d94565b6001600160a01b0380861660009081526001602090815260408083208884529091529020600281015490911615610c225760405162461bcd60e51b815260206004820152603d60248201527f46616b65416c74726f4665654d616e616765723a20726564656d7069746f6e2060448201527f66656520746f6b656e206164647265737320616c72656164792073657400000060648201526084015b60405180910390fd5b600181015415610c8e5760405162461bcd60e51b815260206004820152603160248201527f46616b65416c74726f4665654d616e616765723a2066697273742073616c65206044820152701c1c9a58d948185b1c9958591e481cd95d607a1b6064820152608401610c19565b610c9986868661113b565b828160010181905550836001600160a01b031685876001600160a01b03167fbe1ede7ef2c71c3c70664f7ccf20be7114cd68e749cce26dd3d41944012d7f7486604051610ce891815260200190565b60405180910390a4505050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526105839186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061119f565b60006001600160e01b03198216637965db0b60e01b14806105ae57506301ffc9a760e01b6001600160e01b03198316146105ae565b610d9e8133611202565b50565b6001600160a01b038116610dc75760405162461bcd60e51b8152600401610c1990611781565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000600080516020611872833981519152610e0484846109a2565b610e84576000848152602082815260408083206001600160a01b03871684529091529020805460ff19166001179055610e3a3390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019150506105ae565b60009150506105ae565b6040516001600160a01b0383811660248301526044820183905261088191859182169063a9059cbb90606401610d2d565b6000600080516020611872833981519152610eda84846109a2565b15610e84576000848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a460019150506105ae565b8060328110158015610f4f57506103e88111155b610f6b5760405162461bcd60e51b8152600401610c19906117cc565b50600555565b6001600160a01b038116610f975760405162461bcd60e51b8152600401610c1990611781565b610fb16001600160a01b03821663f7524e3160e01b61123f565b6110235760405162461bcd60e51b815260206004820152603f60248201527f46616b65416c74726f4665654d616e616765723a20646f6573206e6f7420737560448201527f70706f727420494c6963656e73654d616e6167657220696e74657266616365006064820152608401610c19565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6103e88111156110ac5760405162461bcd60e51b815260206004820152602c60248201527f46616b65416c74726f4665654d616e616765723a20726564656d7074696f6e2060448201526b0cccaca40e8dede40d0d2ced60a31b6064820152608401610c19565b600455565b6110b9611262565b6110c4600033610de9565b506110ef7fb1bb46d4d74e79a1f9b457db447cb64f6108baf43c5c27f4303d80f0fb00a00b82610de9565b506110fd86868686866112ad565b505050505050565b806032811015801561111957506103e88111155b6111355760405162461bcd60e51b8152600401610c19906117cc565b50600655565b6001600160a01b0381166111615760405162461bcd60e51b8152600401610c1990611781565b6001600160a01b0392831660009081526001602090815260408083209483529390529190912060020180546001600160a01b03191691909216179055565b60006111b46001600160a01b038416836112e9565b905080516000141580156111d95750808060200190518101906111d79190611820565b155b1561088157604051635274afe760e01b81526001600160a01b0384166004820152602401610c19565b61120c82826109a2565b61123b5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610c19565b5050565b600061124a836112f7565b801561125b575061125b838361132a565b9392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166112ab57604051631afcd79f60e31b815260040160405180910390fd5b565b6112b5611262565b6112be85610da1565b6112c784610f71565b6112d083611045565b6112d982610f3b565b6112e281611105565b5050505050565b606061125b838360006113b4565b600061130a826301ffc9a760e01b61132a565b80156105ae5750611323826001600160e01b031961132a565b1592915050565b6040516001600160e01b031982166024820152600090819060440160408051601f19818403018152919052602080820180516001600160e01b03166301ffc9a760e01b178152825192935060009283928392909183918a617530fa92503d9150600051905082801561139d575060208210155b80156113a95750600081115b979650505050505050565b6060814710156113d95760405163cd78605960e01b8152306004820152602401610c19565b600080856001600160a01b031684866040516113f59190611842565b60006040518083038185875af1925050503d8060008114611432576040519150601f19603f3d011682016040523d82523d6000602084013e611437565b606091505b5091509150611447868383611451565b9695505050505050565b60608261146657611461826114ad565b61125b565b815115801561147d57506001600160a01b0384163b155b156114a657604051639996b31560e01b81526001600160a01b0385166004820152602401610c19565b508061125b565b8051156114bd5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b03811681146114ed57600080fd5b919050565b6000806040838503121561150557600080fd5b61150e836114d6565b946020939093013593505050565b60006020828403121561152e57600080fd5b81356001600160e01b03198116811461125b57600080fd5b60006020828403121561155857600080fd5b5035919050565b60006020828403121561157157600080fd5b61125b826114d6565b6000806040838503121561158d57600080fd5b8235915061159d602084016114d6565b90509250929050565b600080600080606085870312156115bc57600080fd5b6115c5856114d6565b935060208501359250604085013567ffffffffffffffff808211156115e957600080fd5b818701915087601f8301126115fd57600080fd5b81358181111561160c57600080fd5b88602082850101111561161e57600080fd5b95989497505060200194505050565b60008060008060008060c0878903121561164657600080fd5b61164f876114d6565b955061165d602088016114d6565b945060408701359350606087013592506080870135915061168060a088016114d6565b90509295509295509295565b600080600080608085870312156116a257600080fd5b6116ab856114d6565b9350602085013592506116c0604086016114d6565b9396929550929360600135925050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176105ae576105ae6116d0565b60008261171a57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561173157600080fd5b5051919050565b818103818111156105ae576105ae6116d0565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252602b908201527f46616b65416c74726f4665654d616e616765723a2063616e6e6f74206265206e60408201526a756c6c206164647265737360a81b606082015260800190565b60208082526034908201527f46616b65416c74726f4665654d616e616765723a2070726f746f636f6c20666560408201527365206578636565647320626f756e64617269657360601b606082015260800190565b60006020828403121561183257600080fd5b8151801515811461125b57600080fd5b6000825160005b818110156118635760208186018101518583015201611849565b50600092019182525091905056fe02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800a26469706673582212208a6fcc953e60a3ba09c06f855854c480892a4bde5ceabf62b013f6403b58f5f064736f6c63430008140033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806345f330a2116100f9578063a741d96411610097578063cd1a906211610071578063cd1a90621461040c578063d547741f14610433578063d638028114610446578063e7fd7bd51461045957600080fd5b8063a741d9641461037b578063b1a5d12d146103e6578063bdcafc55146103f957600080fd5b806366559fbb116100d357806366559fbb1461033a5780637dbc1df01461034d57806391d1485414610360578063a217fddf1461037357600080fd5b806345f330a21461030b5780635585bbdd1461031e5780635abd98db1461033157600080fd5b80632ceb46e21161016657806330787dd11161014057806330787dd1146102b057806336568abe146102dc578063365f383f146102ef578063458f58151461030257600080fd5b80632ceb46e2146102535780632dc0aa7f146102765780632f2ff15d1461029d57600080fd5b8063011c25a2146101ae57806301ffc9a7146101c35780630ad51144146101eb578063178021e314610216578063248a9ca31461022d5780632c59277514610240575b600080fd5b6101c16101bc3660046114f2565b610462565b005b6101d66101d136600461151c565b610589565b60405190151581526020015b60405180910390f35b6003546101fe906001600160a01b031681565b6040516001600160a01b0390911681526020016101e2565b61021f60065481565b6040519081526020016101e2565b61021f61023b366004611546565b6105b4565b6101c161024e36600461155f565b6105d6565b6101d661026136600461155f565b60006020819052908152604090205460ff1681565b61021f7fb1bb46d4d74e79a1f9b457db447cb64f6108baf43c5c27f4303d80f0fb00a00b81565b6101c16102ab36600461157a565b610622565b6102c36102be3660046115a6565b61063e565b6040516001600160e01b031990911681526020016101e2565b6101c16102ea36600461157a565b61084e565b6002546101fe906001600160a01b031681565b61021f60045481565b6101c1610319366004611546565b610886565b6101d661032c3660046114f2565b6108d2565b61021f6103e881565b6101c161034836600461155f565b610912565b6101c161035b366004611546565b61095e565b6101d661036e36600461157a565b6109a2565b61021f600081565b6103c06103893660046114f2565b6001602081815260009384526040808520909152918352912080549181015460029091015460ff909216916001600160a01b031683565b60408051931515845260208401929092526001600160a01b0316908201526060016101e2565b6101c16103f436600461162d565b6109da565b6101c1610407366004611546565b610af4565b61021f7fd839b475bf2ae1f274a9d3f66eb75bf367ac9d68ad7778d1836e33ed88c370da81565b6101c161044136600461157a565b610b38565b6101c161045436600461168c565b610b54565b61021f60055481565b6001600160a01b0382811660009081526001602081815260408084208685529091528220805460ff191682178155600281015460045491909201549190931692612710916104b091906116e6565b6104ba91906116fd565b9050816001600160a01b03167fc37905e27a29a0577730d37e05f9e1f77a8ebb37b3f97f07b4ff68c07cbf01438260405161051191815260406020820181905260029082015261060f60f31b606082015260800190565b60405180910390a2336001600160a01b031683856001600160a01b03167f4f48f517ff8f23822962aebf920b85c18d6bd76187d49bf21e0919ad7bd081818460405161055f91815260200190565b60405180910390a4600254610583906001600160a01b038481169133911684610cf8565b50505050565b60006001600160e01b0319821663069533ff60e51b14806105ae57506105ae82610d5f565b92915050565b6000908152600080516020611872833981519152602052604090206001015490565b60006105e181610d94565b6105ea82610da1565b6040516001600160a01b038316907f6be31731b2d63eb099220665b7e72458be7d6078084268add405755c15580bd590600090a25050565b61062b826105b4565b61063481610d94565b6105838383610de9565b60007fb1bb46d4d74e79a1f9b457db447cb64f6108baf43c5c27f4303d80f0fb00a00b61066a81610d94565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a0823190602401602060405180830381865afa1580156106b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d5919061171f565b6003546040516303793c8d60e11b81523260048201529192506000916001600160a01b03909116906306f2791a90602401602060405180830381865afa158015610723573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610747919061171f565b905080156107db57600061271061075e83856116e6565b61076891906116fd565b90506107748184611738565b925061078a6001600160a01b038a163283610e8e565b886001600160a01b0316326001600160a01b03167f4e148ec9ce322149fe82da79a21d76cd6ab67f18088445fd719c2d8f441acb84838a8a6040516107d19392919061174b565b60405180910390a3505b6002546107f5906001600160a01b038a8116911684610e8e565b876001600160a01b03167fc37905e27a29a0577730d37e05f9e1f77a8ebb37b3f97f07b4ff68c07cbf01438388886040516108329392919061174b565b60405180910390a2506330787dd160e01b979650505050505050565b6001600160a01b03811633146108775760405163334bd91960e11b815260040160405180910390fd5b6108818282610ebf565b505050565b600061089181610d94565b61089a82610f3b565b6040518281527f618f7ccb92cca20d555727f06d9cb96e92d01bcfc352c21f9a342ff1e610b155906020015b60405180910390a15050565b60006004546000036108e6575060016105ae565b506001600160a01b03919091166000908152600160209081526040808320938352929052205460ff1690565b600061091d81610d94565b61092682610f71565b6040516001600160a01b038316907f83b3f972b017fb4298b8c664a2c388f95f0c3896f3f134bee4361ffefe9a722990600090a25050565b600061096981610d94565b61097282611045565b6040518281527f91cc643d187eb250905520d3dae0b1017edd16961d27ab9a4a61fea5e38f717d906020016108c6565b6000918252600080516020611872833981519152602090815260408084206001600160a01b0393909316845291905290205460ff1690565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff16600081158015610a205750825b905060008267ffffffffffffffff166001148015610a3d5750303b155b905081158015610a4b575080155b15610a695760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a9357845460ff60401b1916600160401b1785555b610aa18b8b8b8b8b8b6110b1565b8315610ae757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050505050505050565b6000610aff81610d94565b610b0882611105565b6040518281527f28cc5bc2acd96e4739763aa17be8edff698d2205c67025f22a1bebcf6894ea98906020016108c6565b610b41826105b4565b610b4a81610d94565b6105838383610ebf565b7fd839b475bf2ae1f274a9d3f66eb75bf367ac9d68ad7778d1836e33ed88c370da610b7e81610d94565b6001600160a01b0380861660009081526001602090815260408083208884529091529020600281015490911615610c225760405162461bcd60e51b815260206004820152603d60248201527f46616b65416c74726f4665654d616e616765723a20726564656d7069746f6e2060448201527f66656520746f6b656e206164647265737320616c72656164792073657400000060648201526084015b60405180910390fd5b600181015415610c8e5760405162461bcd60e51b815260206004820152603160248201527f46616b65416c74726f4665654d616e616765723a2066697273742073616c65206044820152701c1c9a58d948185b1c9958591e481cd95d607a1b6064820152608401610c19565b610c9986868661113b565b828160010181905550836001600160a01b031685876001600160a01b03167fbe1ede7ef2c71c3c70664f7ccf20be7114cd68e749cce26dd3d41944012d7f7486604051610ce891815260200190565b60405180910390a4505050505050565b6040516001600160a01b0384811660248301528381166044830152606482018390526105839186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b03838183161783525050505061119f565b60006001600160e01b03198216637965db0b60e01b14806105ae57506301ffc9a760e01b6001600160e01b03198316146105ae565b610d9e8133611202565b50565b6001600160a01b038116610dc75760405162461bcd60e51b8152600401610c1990611781565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000600080516020611872833981519152610e0484846109a2565b610e84576000848152602082815260408083206001600160a01b03871684529091529020805460ff19166001179055610e3a3390565b6001600160a01b0316836001600160a01b0316857f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019150506105ae565b60009150506105ae565b6040516001600160a01b0383811660248301526044820183905261088191859182169063a9059cbb90606401610d2d565b6000600080516020611872833981519152610eda84846109a2565b15610e84576000848152602082815260408083206001600160a01b0387168085529252808320805460ff1916905551339287917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a460019150506105ae565b8060328110158015610f4f57506103e88111155b610f6b5760405162461bcd60e51b8152600401610c19906117cc565b50600555565b6001600160a01b038116610f975760405162461bcd60e51b8152600401610c1990611781565b610fb16001600160a01b03821663f7524e3160e01b61123f565b6110235760405162461bcd60e51b815260206004820152603f60248201527f46616b65416c74726f4665654d616e616765723a20646f6573206e6f7420737560448201527f70706f727420494c6963656e73654d616e6167657220696e74657266616365006064820152608401610c19565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6103e88111156110ac5760405162461bcd60e51b815260206004820152602c60248201527f46616b65416c74726f4665654d616e616765723a20726564656d7074696f6e2060448201526b0cccaca40e8dede40d0d2ced60a31b6064820152608401610c19565b600455565b6110b9611262565b6110c4600033610de9565b506110ef7fb1bb46d4d74e79a1f9b457db447cb64f6108baf43c5c27f4303d80f0fb00a00b82610de9565b506110fd86868686866112ad565b505050505050565b806032811015801561111957506103e88111155b6111355760405162461bcd60e51b8152600401610c19906117cc565b50600655565b6001600160a01b0381166111615760405162461bcd60e51b8152600401610c1990611781565b6001600160a01b0392831660009081526001602090815260408083209483529390529190912060020180546001600160a01b03191691909216179055565b60006111b46001600160a01b038416836112e9565b905080516000141580156111d95750808060200190518101906111d79190611820565b155b1561088157604051635274afe760e01b81526001600160a01b0384166004820152602401610c19565b61120c82826109a2565b61123b5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610c19565b5050565b600061124a836112f7565b801561125b575061125b838361132a565b9392505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166112ab57604051631afcd79f60e31b815260040160405180910390fd5b565b6112b5611262565b6112be85610da1565b6112c784610f71565b6112d083611045565b6112d982610f3b565b6112e281611105565b5050505050565b606061125b838360006113b4565b600061130a826301ffc9a760e01b61132a565b80156105ae5750611323826001600160e01b031961132a565b1592915050565b6040516001600160e01b031982166024820152600090819060440160408051601f19818403018152919052602080820180516001600160e01b03166301ffc9a760e01b178152825192935060009283928392909183918a617530fa92503d9150600051905082801561139d575060208210155b80156113a95750600081115b979650505050505050565b6060814710156113d95760405163cd78605960e01b8152306004820152602401610c19565b600080856001600160a01b031684866040516113f59190611842565b60006040518083038185875af1925050503d8060008114611432576040519150601f19603f3d011682016040523d82523d6000602084013e611437565b606091505b5091509150611447868383611451565b9695505050505050565b60608261146657611461826114ad565b61125b565b815115801561147d57506001600160a01b0384163b155b156114a657604051639996b31560e01b81526001600160a01b0385166004820152602401610c19565b508061125b565b8051156114bd5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80356001600160a01b03811681146114ed57600080fd5b919050565b6000806040838503121561150557600080fd5b61150e836114d6565b946020939093013593505050565b60006020828403121561152e57600080fd5b81356001600160e01b03198116811461125b57600080fd5b60006020828403121561155857600080fd5b5035919050565b60006020828403121561157157600080fd5b61125b826114d6565b6000806040838503121561158d57600080fd5b8235915061159d602084016114d6565b90509250929050565b600080600080606085870312156115bc57600080fd5b6115c5856114d6565b935060208501359250604085013567ffffffffffffffff808211156115e957600080fd5b818701915087601f8301126115fd57600080fd5b81358181111561160c57600080fd5b88602082850101111561161e57600080fd5b95989497505060200194505050565b60008060008060008060c0878903121561164657600080fd5b61164f876114d6565b955061165d602088016114d6565b945060408701359350606087013592506080870135915061168060a088016114d6565b90509295509295509295565b600080600080608085870312156116a257600080fd5b6116ab856114d6565b9350602085013592506116c0604086016114d6565b9396929550929360600135925050565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176105ae576105ae6116d0565b60008261171a57634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561173157600080fd5b5051919050565b818103818111156105ae576105ae6116d0565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b6020808252602b908201527f46616b65416c74726f4665654d616e616765723a2063616e6e6f74206265206e60408201526a756c6c206164647265737360a81b606082015260800190565b60208082526034908201527f46616b65416c74726f4665654d616e616765723a2070726f746f636f6c20666560408201527365206578636565647320626f756e64617269657360601b606082015260800190565b60006020828403121561183257600080fd5b8151801515811461125b57600080fd5b6000825160005b818110156118635760208186018101518583015201611849565b50600092019182525091905056fe02dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800a26469706673582212208a6fcc953e60a3ba09c06f855854c480892a4bde5ceabf62b013f6403b58f5f064736f6c63430008140033

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
Loading...
Loading

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.