ETH Price: $3,335.07 (-1.18%)

Contract

0x482667A6A9f4D3A31828D51287fC154f1ed62B27
 

Overview

ETH Balance

2.298688 ETH

Eth Value

$7,666.29 (@ $3,335.07/ETH)

Multichain Info

Transaction Hash
Method
Block
From
To
Claim Ambasador ...212010612024-11-16 15:09:2341 days ago1731769763IN
0x482667A6...f1ed62B27
0 ETH0.0006586515.54931567
Claim Ambasador ...210132422024-10-21 10:05:2367 days ago1729505123IN
0x482667A6...f1ed62B27
0 ETH0.000294546.95352798
Claim Ambasador ...210128382024-10-21 8:44:3567 days ago1729500275IN
0x482667A6...f1ed62B27
0 ETH0.000352038.31078501
Claim Ambasador ...209227922024-10-08 18:55:3580 days ago1728413735IN
0x482667A6...f1ed62B27
0 ETH0.0008529720.13691653
Claim Ambasador ...209207132024-10-08 11:58:4780 days ago1728388727IN
0x482667A6...f1ed62B27
0 ETH0.0004606710.87557351
Claim Ambasador ...208955042024-10-04 23:39:2384 days ago1728085163IN
0x482667A6...f1ed62B27
0 ETH0.00012632.98166098
Close Sale208938642024-10-04 18:10:1184 days ago1728065411IN
0x482667A6...f1ed62B27
0 ETH0.000194956.56988845
Claim Ambasador ...208933452024-10-04 16:25:5984 days ago1728059159IN
0x482667A6...f1ed62B27
0 ETH0.000913614.46380817
Claim Ambasador ...208873792024-10-03 20:30:1185 days ago1727987411IN
0x482667A6...f1ed62B27
0 ETH0.000420299.92227349
Start Stage208861532024-10-03 16:23:3585 days ago1727972615IN
0x482667A6...f1ed62B27
0 ETH0.0011590227.76177272
Finish Stage208860272024-10-03 15:57:4785 days ago1727971067IN
0x482667A6...f1ed62B27
0 ETH0.0006609520.45352904
Claim Ambasador ...208858372024-10-03 15:19:2385 days ago1727968763IN
0x482667A6...f1ed62B27
0 ETH0.0004561510.76879071
Start Stage208642992024-09-30 15:14:5988 days ago1727709299IN
0x482667A6...f1ed62B27
0 ETH0.001968547.15105394
Finish Stage208642742024-09-30 15:09:5988 days ago1727708999IN
0x482667A6...f1ed62B27
0 ETH0.0016522251.12879802
Start Stage208427402024-09-27 15:04:5991 days ago1727449499IN
0x482667A6...f1ed62B27
0 ETH0.0035326784.61702398
Finish Stage208427162024-09-27 15:00:1191 days ago1727449211IN
0x482667A6...f1ed62B27
0 ETH0.0012077737.37492471
Start Stage208231532024-09-24 21:29:5994 days ago1727213399IN
0x482667A6...f1ed62B27
0 ETH0.0022559154.03519022
Finish Stage208231282024-09-24 21:24:5994 days ago1727213099IN
0x482667A6...f1ed62B27
0 ETH0.0018014955.74785623
Start Stage208015962024-09-21 21:19:5997 days ago1726953599IN
0x482667A6...f1ed62B27
0 ETH0.000656715.72986465
Finish Stage208015722024-09-21 21:14:5997 days ago1726953299IN
0x482667A6...f1ed62B27
0 ETH0.000464214.36504326
Set Min Deposit207921682024-09-20 13:42:2398 days ago1726839743IN
0x482667A6...f1ed62B27
0 ETH0.0017788656.48090887
Start Stage207800812024-09-18 21:11:35100 days ago1726693895IN
0x482667A6...f1ed62B27
0 ETH0.0013231931.69396125
Finish Stage207724462024-09-17 19:34:59101 days ago1726601699IN
0x482667A6...f1ed62B27
0 ETH0.0012834839.71793123
Start Stage207509352024-09-14 19:28:35104 days ago1726342115IN
0x482667A6...f1ed62B27
0 ETH0.000268126.42231151
Finish Stage207477872024-09-14 8:54:59104 days ago1726304099IN
0x482667A6...f1ed62B27
0 ETH0.000115033.55978532
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
212010612024-11-16 15:09:2341 days ago1731769763
0x482667A6...f1ed62B27
0.024735 ETH
210132422024-10-21 10:05:2367 days ago1729505123
0x482667A6...f1ed62B27
0.0085 ETH
210128382024-10-21 8:44:3567 days ago1729500275
0x482667A6...f1ed62B27
0.0135 ETH
209227922024-10-08 18:55:3580 days ago1728413735
0x482667A6...f1ed62B27
0.01071 ETH
209207132024-10-08 11:58:4780 days ago1728388727
0x482667A6...f1ed62B27
0.0035 ETH
208955042024-10-04 23:39:2384 days ago1728085163
0x482667A6...f1ed62B27
0.102 ETH
208930492024-10-04 15:26:4784 days ago1728055607
0x482667A6...f1ed62B27
0.102 ETH
208873792024-10-03 20:30:1185 days ago1727987411
0x482667A6...f1ed62B27
0.0737 ETH
208858372024-10-03 15:19:2385 days ago1727968763
0x482667A6...f1ed62B27
0.011322 ETH
208611482024-09-30 4:42:5988 days ago1727671379
0x482667A6...f1ed62B27
0.011322 ETH
207246342024-09-11 3:18:11108 days ago1726024691
0x482667A6...f1ed62B27
0.024735 ETH
207148352024-09-09 18:26:35109 days ago1725906395
0x482667A6...f1ed62B27
0.0255 ETH
207138182024-09-09 15:01:47109 days ago1725894107
0x482667A6...f1ed62B27
0.009248 ETH
207080002024-09-08 19:32:59110 days ago1725823979
0x482667A6...f1ed62B27
0.0119 ETH
207048932024-09-08 9:07:23110 days ago1725786443
0x482667A6...f1ed62B27
0.0119 ETH
206087382024-08-25 22:57:59124 days ago1724626679
0x482667A6...f1ed62B27
0.101365 ETH
205870472024-08-22 22:10:59127 days ago1724364659
0x482667A6...f1ed62B27
0.79628 ETH
205865692024-08-22 20:35:11127 days ago1724358911
0x482667A6...f1ed62B27
0.1445 ETH
205856782024-08-22 17:36:47127 days ago1724348207
0x482667A6...f1ed62B27
0.02108 ETH
205856592024-08-22 17:32:59127 days ago1724347979
0x482667A6...f1ed62B27
0.0408 ETH
205856512024-08-22 17:31:11127 days ago1724347871
0x482667A6...f1ed62B27
0.17 ETH
205856452024-08-22 17:29:59127 days ago1724347799
0x482667A6...f1ed62B27
0.085 ETH
205856312024-08-22 17:27:11127 days ago1724347631
0x482667A6...f1ed62B27
0.0102 ETH
205856202024-08-22 17:24:47127 days ago1724347487
0x482667A6...f1ed62B27
0.3247 ETH
205302582024-08-14 23:49:47135 days ago1723679387
0x482667A6...f1ed62B27
0.6 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SaleProcessor

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 500 runs

Other Settings:
paris EvmVersion
File 1 of 13 : SaleProcessor.sol
// SPDX-License-Identifier: NONE
pragma solidity ^0.8.21;

import '@openzeppelin/contracts/access/AccessControl.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/ReentrancyGuard.sol';
import '@openzeppelin/contracts/utils/math/Math.sol';
import './interfaces/ISaleProcessor.sol';

contract SaleProcessor is ISaleProcessor, ReentrancyGuard, AccessControl {
  using SafeERC20 for IERC20;
  
  address internal constant tokenAddress = 0x9000000000000000000000000000000000000009;
  address internal constant ethAddress = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

  uint256 private _vipLimit;
  uint256 private _totalReleasedTokens;

  uint256 private _cAmbRate = 50;
  uint256 private _tAmbRate = 50;

  address private _bank;
  State private _saleState;

  Stage[] private _stages;
  uint256 private _currentStage;
  
  uint256 private _maxDeposit;
  uint256 private _minDeposit;

  bytes32 public constant MANAGER_ROLE = keccak256('MANAGER_ROLE');

  mapping(address => uint256) private _totalBalances;
  mapping(address => mapping(uint256 => uint256)) private _stageBalances;
  mapping(address => bool) private _vip;
  mapping(address => Ambasador) private _ambasadors;
  mapping(address => address) private _ambUsers;
  mapping(address => mapping(address => uint256)) _ambBalances;

  event Claimed(address indexed ambasador, address indexed asset, uint256 amount);

  constructor(address bank_) {
    require(bank_ != address(0), "SaleProcessor: zero bank address");

    _bank = bank_;

    _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
    _grantRole(MANAGER_ROLE, _msgSender());
  }

  function getBank() external view returns (address) {
    return _bank;
  }

  function getMaximalDeposit() external view returns (uint256) {
    return _maxDeposit;
  }

  function getMinimalDeposit() external view returns (uint256) {
    return _minDeposit;
  }

  function getStagesAmount() external view returns (uint256) {
    return _stages.length;
  }

  function getCurrentStageIndex() external view returns (uint256) {
    return _currentStage;
  }

  function getStageInfo(uint256 index_) external view  returns (Stage memory) {
    return _stages[index_];
  }

  function getTotalSold() external view returns (uint256) {
    return _totalReleasedTokens;
  }

  function balanceOf(uint256 round_, address user_) external view returns (uint256) {
    return _stageBalances[user_][round_];
  }

  function ambasadorBalanceOf(address asset_, address user_) external view returns (uint256) {
    return _ambBalances[user_][asset_];
  }

  function regularDepositLimit(address user_) external view returns (uint256) {
    uint256 amount = _totalBalances[user_];
    uint256 limit = _vipLimit;
    if (isVip(user_)) {
      limit = _maxDeposit;
    }
    return amount < limit ? limit - amount : 0;
  }

  function maxDepositLimit(address user_) external view returns (uint256) {
    uint256 amount = _totalBalances[user_];
    return amount < _maxDeposit ? _maxDeposit - amount : 0;
  }

  function getVipLimit() external view returns (uint256) {
    return _vipLimit;
  }

  function getAmbasadorRates() external view returns (uint256, uint256) {
    return (_cAmbRate, _tAmbRate);
  }

  function getAmbasador(address user_, address amb_) external view returns (address) {
    Ambasador memory ref = _ambasadors[_ambUsers[user_]];
    if (ref.defined && ref.enabled) {
      return _ambUsers[user_];
    }
    ref = _ambasadors[amb_];
    if (!ref.defined || ref.enabled) {
      return amb_;
    }
    return address(0);
  }

  function getAmbasadorRate(address amb_) external view returns (uint256, uint256) {
    Ambasador memory ref = _ambasadors[amb_];
    if (ref.defined) {
      return (Math.max(ref.firstRefRate, _cAmbRate), Math.max(ref.secondRefRate, _tAmbRate));
    }
    return (_cAmbRate, _tAmbRate);
  }

  function isSaleActive() public view returns (bool) {
    return _saleState == State.Opened;
  }

  function isSaleInactive() public view returns (bool) {
    return _saleState == State.Closed;
  }

  function getCurrentPrice(Option option_) public view returns (uint256) {
    if (_stages[_currentStage].state == State.Opened) {
      return option_ == Option.Short ? _stages[_currentStage].sPrice : _stages[_currentStage].lPrice;
    }
    return 0;
  }

  function isVip(address user_) public view returns (bool) {
    return _vip[user_];
  }

  function openSale()
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(_saleState == State.None, "SaleProcessor: sale already started");
  
    _saleState = State.Opened;
  }

  function closeSale()
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(isSaleActive(), "SaleProcessor: sale not started");

    _saleState = State.Closed;
  }

  function setStage(uint256 sPrice_, uint256 lPrice_, uint256 supply_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(!isSaleInactive(), "SaleProcessor: sale closed");

    _stages.push(
      Stage({ defined: true, state: State.None, sPrice: sPrice_, lPrice: lPrice_, sold: 0, supply: supply_})
    );
  }

  function setAmbasadorRate(uint256 firstAmbRate_, uint256 secondAmbRate_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(!isSaleInactive(), "SaleProcessor: sale closed");
    require(firstAmbRate_ <= 1000, "SaleProcessor: cant set first rate more then 100%");
    require(secondAmbRate_ <= 1000, "SaleProcessor: cant set second rate more then 100%");

    _cAmbRate = firstAmbRate_;
    _tAmbRate = secondAmbRate_;
  }

  function setupAmbasadors(address[] calldata ambs_, uint256[] calldata firstAmbRates_, uint256[] calldata secondAmbRates_)
    external onlyRole(MANAGER_ROLE)
  {
    require(!isSaleInactive(), "SaleProcessor: sale closed");
    require(ambs_.length == firstAmbRates_.length && ambs_.length == secondAmbRates_.length, "SaleProcessor: invalid arrays length setup");

    for (uint256 index = 0; index < ambs_.length; index++) {
      _ambasadors[ambs_[index]] = Ambasador({
        defined: true,
        enabled: true,
        firstRefRate: firstAmbRates_[index],
        secondRefRate: secondAmbRates_[index]
      });
    }
  }

  function updateStagePrice(uint256 index_, uint256 sPrice_, uint256 lPrice_) 
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(!isSaleInactive(), "SaleProcessor: sale closed");
    require(_stages[index_].defined, "SaleProcessor: stage should be defined");
    require(_stages[index_].state == State.None, "SaleProcessor: stage should not be started");

    _stages[index_].sPrice = sPrice_;
    _stages[index_].lPrice = lPrice_;
  }

  function updateStageSupply(uint256 index_, uint256 supply_) 
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(!isSaleInactive(), "SaleProcessor: sale closed");
    require(_stages[index_].defined, "SaleProcessor: stage should be defined");
    require(_stages[index_].state != State.Closed, "SaleProcessor: stage should not be closed");
    require(_stages[index_].sold < supply_, "SaleProcessor: new supply must be bigger then sold tokens");

    _stages[index_].supply = supply_;
  }

  function startStage(uint256 index_)
    external onlyRole(MANAGER_ROLE)
  {
    require(isSaleActive(), "SaleProcessor: sale not active");
    require(_stages[index_].defined, "SaleProcessor: stage should be defined");
    require(_stages[index_].state == State.None, "SaleProcessor: stage should not be used");
  
    if (_stages[_currentStage].state == State.Opened) {
      _stages[_currentStage].state = State.Closed;
    }
    _stages[index_].state = State.Opened;
    _currentStage = index_;
  }

  function finishStage(uint256 index_)
    external onlyRole(MANAGER_ROLE)
  {
    require(_stages[index_].defined, "SaleProcessor: stage should be defined");
    require(_stages[index_].state == State.Opened, "SaleProcessor: stage should be active");

    _stages[index_].state = State.Closed;
  }

  function setupVip(address user_, bool value_)
    external onlyRole(MANAGER_ROLE)
  {
    _vip[user_] = value_;
  }

  function setupVipBatch(address[] calldata users_, bool[] calldata values_)
    external onlyRole(MANAGER_ROLE)
  {
    require(users_.length == values_.length, "SaleProcessor: invalid arrays length setup");

    for (uint256 index = 0; index < users_.length; index++) {
      _vip[users_[index]] = values_[index];
    }
  }

  function setMaxDeposit(uint256 amount_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(amount_ <= 10000000000000000000000000, "SaleProcessor: value is too big");
    require(amount_ >= _minDeposit, "SaleProcessor: value is too small");

    _maxDeposit = amount_;
  }

  function setMinDeposit(uint256 amount_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(amount_ >= 100000000000000000, "SaleProcessor: value is too small");
    require(amount_ <= _maxDeposit, "SaleProcessor: value is too big");

    _minDeposit = amount_;
  }

  function setVipLimit(uint256 amount_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(amount_ >= _minDeposit && amount_ <= _maxDeposit, "SaleProcessor: invalid value");

    _vipLimit = amount_;
  }

  function setBank(address bank_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(bank_ != address(0), "SaleProcessor: zero bank address");

    _bank = bank_;
  }

  function process(address user_, address asset_, uint256 amount_, uint256 sold_, address amb_, uint256 fReward_, uint256 sReward_)
    external onlyRole(MANAGER_ROLE)
  {
    _totalBalances[user_] = _totalBalances[user_] + amount_;
    _totalReleasedTokens = _totalReleasedTokens + sold_;
    _stages[_currentStage].sold = _stages[_currentStage].sold + sold_;
    _stageBalances[user_][_currentStage] = _stageBalances[user_][_currentStage] + sold_;

    if (amb_ != address(0)) {
      if (!_ambasadors[amb_].defined) {
        _ambasadors[amb_].defined = true;
        _ambasadors[amb_].enabled = true;
      }
      _ambBalances[amb_][asset_] += fReward_;
      _ambBalances[amb_][tokenAddress] += sReward_;
      _ambUsers[user_] = amb_;  
    }
  }

  function enableAmbasador(address amb_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(_ambasadors[amb_].defined, "SaleProcessor: ambasador not defined");
    require(!_ambasadors[amb_].enabled, "SaleProcessor: ambasador already enabled");

    _ambasadors[amb_].enabled = true;
  }

  function disableAmbasador(address amb_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    require(_ambasadors[amb_].defined, "SaleProcessor: ambasador not defined");
    require(_ambasadors[amb_].enabled, "SaleProcessor: ambasador already disabled");

    _ambasadors[amb_].enabled = false;
  }

  function claimAmbasadorRewards(address[] calldata assets_)
    external nonReentrant()
  {
    address amb = _msgSender();
  
    require(assets_.length > 0, "SaleProcessor: no assets to process");
    require(_ambasadors[amb].defined, "SaleProcessor: ambasador not defined");
    require(_ambasadors[amb].enabled, "SaleProcessor: ambasador not enabled");

    for (uint256 i = 0; i < assets_.length; i++) {
      address token = assets_[i];
      uint256 balance = _ambBalances[amb][token];
      if (balance == 0) { continue; }

      _ambBalances[amb][token] = 0;
      if (token == ethAddress) {        
        (bool success, ) = amb.call{value: balance}('');
        require(success, "SaleProcessor: native claim error");
      } else {
        IERC20(token).safeTransfer(amb, balance);
      }
      
      emit Claimed(amb, token, balance);
    }
  }

  function recoverNative()
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    uint256 balance = address(this).balance;
    _msgSender().call{value: balance}('');
  }

  function recoverErc20(address asset_, uint256 amount_)
    external onlyRole(DEFAULT_ADMIN_ROLE)
  {
    IERC20(asset_).safeTransfer(_msgSender(), amount_);
  }

  receive() external payable { }
}

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

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

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

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

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

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

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

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

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

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

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

        _revokeRole(role, callerConfirmation);
    }

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

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

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

File 3 of 13 : 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 4 of 13 : 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 5 of 13 : 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 6 of 13 : 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 7 of 13 : 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 8 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

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

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

pragma solidity ^0.8.20;

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

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

File 10 of 13 : 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 11 of 13 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

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

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

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

    constructor() {
        _status = NOT_ENTERED;
    }

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

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

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

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

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

File 13 of 13 : ISaleProcessor.sol
// SPDX-License-Identifier: NONE

pragma solidity ^0.8.21;

interface ISaleProcessor {
  enum Option { Short, Long }
  enum State { None, Opened, Closed }

  struct Stage {
    bool defined;
    State state;
    uint256 sPrice;
    uint256 lPrice;
    uint256 sold;
    uint256 supply;
  }

  struct Ambasador {
    bool defined;
    bool enabled;
    uint256 firstRefRate;
    uint256 secondRefRate;
  }

  function isSaleActive() external view returns (bool);
  function getStageInfo(uint256 index_) external view returns (Stage memory);
  function getCurrentStageIndex() external view returns (uint256);
  function regularDepositLimit(address receiver_) external view returns (uint256);
  function maxDepositLimit(address receiver_) external view returns (uint256);
  function getMinimalDeposit() external view returns (uint256);
  function getAmbasador(address receiver_, address ambasador_) external view returns (address);
  function getAmbasadorRate(address ambasador_) external view returns (uint256, uint256);
  function getCurrentPrice(Option option_) external view returns (uint256);
  function getBank() external view returns (address);

  function process(address receiver_, address token_, uint256 amount_, uint256 sold_, address ambasador_, uint256 fReward_, uint256 sReward_) external;
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"bank_","type":"address"}],"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":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ambasador","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset_","type":"address"},{"internalType":"address","name":"user_","type":"address"}],"name":"ambasadorBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"round_","type":"uint256"},{"internalType":"address","name":"user_","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets_","type":"address[]"}],"name":"claimAmbasadorRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"amb_","type":"address"}],"name":"disableAmbasador","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"amb_","type":"address"}],"name":"enableAmbasador","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"finishStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"},{"internalType":"address","name":"amb_","type":"address"}],"name":"getAmbasador","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"amb_","type":"address"}],"name":"getAmbasadorRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAmbasadorRates","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBank","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum ISaleProcessor.Option","name":"option_","type":"uint8"}],"name":"getCurrentPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentStageIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaximalDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinimalDeposit","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":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"getStageInfo","outputs":[{"components":[{"internalType":"bool","name":"defined","type":"bool"},{"internalType":"enum ISaleProcessor.State","name":"state","type":"uint8"},{"internalType":"uint256","name":"sPrice","type":"uint256"},{"internalType":"uint256","name":"lPrice","type":"uint256"},{"internalType":"uint256","name":"sold","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"}],"internalType":"struct ISaleProcessor.Stage","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStagesAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalSold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVipLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"isSaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSaleInactive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"isVip","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"maxDepositLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"},{"internalType":"address","name":"asset_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint256","name":"sold_","type":"uint256"},{"internalType":"address","name":"amb_","type":"address"},{"internalType":"uint256","name":"fReward_","type":"uint256"},{"internalType":"uint256","name":"sReward_","type":"uint256"}],"name":"process","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"recoverErc20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"recoverNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"regularDepositLimit","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":[{"internalType":"uint256","name":"firstAmbRate_","type":"uint256"},{"internalType":"uint256","name":"secondAmbRate_","type":"uint256"}],"name":"setAmbasadorRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bank_","type":"address"}],"name":"setBank","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setMaxDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setMinDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"sPrice_","type":"uint256"},{"internalType":"uint256","name":"lPrice_","type":"uint256"},{"internalType":"uint256","name":"supply_","type":"uint256"}],"name":"setStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setVipLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"ambs_","type":"address[]"},{"internalType":"uint256[]","name":"firstAmbRates_","type":"uint256[]"},{"internalType":"uint256[]","name":"secondAmbRates_","type":"uint256[]"}],"name":"setupAmbasadors","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"},{"internalType":"bool","name":"value_","type":"bool"}],"name":"setupVip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users_","type":"address[]"},{"internalType":"bool[]","name":"values_","type":"bool[]"}],"name":"setupVipBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"startStage","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":"uint256","name":"index_","type":"uint256"},{"internalType":"uint256","name":"sPrice_","type":"uint256"},{"internalType":"uint256","name":"lPrice_","type":"uint256"}],"name":"updateStagePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"},{"internalType":"uint256","name":"supply_","type":"uint256"}],"name":"updateStageSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608034620000ec57601f6200253738819003918201601f19168301916001600160401b03831184841017620000f157808492602094604052833981010312620000ec57516001600160a01b03811690819003620000ec576001600055603260045560326005558015620000a857600680546001600160a01b0319169190911790556200008b3362000107565b50620000973362000188565b506040516122eb90816200022c8239f35b606460405162461bcd60e51b815260206004820152602060248201527f53616c6550726f636573736f723a207a65726f2062616e6b20616464726573736044820152fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b031660008181527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604081205490919060ff16620001845781805260016020526040822081835260205260408220600160ff198254161790553391600080516020620025178339815191528180a4600190565b5090565b6001600160a01b031660008181527ffdb122eb892c6b3193f8499f050265ce5458caab5f6480270d8972921f24f42960205260408120549091907f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b089060ff16620002265780835260016020526040832082845260205260408320600160ff1982541617905560008051602062002517833981519152339380a4600190565b50509056fe60806040818152600480361015610021575b505050361561001f57600080fd5b005b600092833560e01c90816301ffc9a71461198e575080630876fc5614611909578063090d23b91461187e5780631490d330146117a6578063167ff46f146117115780631c652ec814611607578063248a9ca3146115de5780632f2ff15d146115b5578063315c1c96146114a557806336568abe1461145e5780633656eec21461141f57806348f0aeeb146113c857806349bdb663146113a95780634bbc471a146111525780634c5b0324146111225780634c6c624c1461110357806354d44e9514610fbd578063564566a814610fa05780635a54db8614610f7657806360d704db14610f4e57806370f1031d14610f10578063738a8ce614610ed55780637f2e669a14610eb257806383d4c20d14610e9357806384203f4b14610e575780638b8b010814610cd15780638c4513b214610c895780638d8e1ad714610c435780638ed8409e14610bd65780638fcc9cfb14610b9257806390daaf6714610b7357806391d1485414610b2e5780639d7b8e6814610b0f578063a1524418146109ac578063a217fddf14610991578063a3759f6014610890578063bb371fdd14610849578063c129d83e146106e9578063cb825d0414610616578063d547741f146105d8578063daa4cf88146105b9578063e07267a8146104f2578063e7cd40f91461042d578063ea1ea81f14610407578063ebdfd88514610330578063ec87621c146102f1578063ee55efee146102705763eff8fe5a03610011573461026c57602036600319011261026c57359160028310156102695750610262602092611ec2565b9051908152f35b80fd5b8280fd5b50903461026c578260031936011261026c5761028a611a74565b610292611e7c565b156102ae576006805460ff60a01b1916600160a11b1790558280f35b906020606492519162461bcd60e51b8352820152601f60248201527f53616c6550726f636573736f723a2073616c65206e6f742073746172746564006044820152fd5b50503461032c578160031936011261032c57602090517f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b088152f35b5080fd5b503461026c578160031936011261026c5767ffffffffffffffff918135838111610403576103619036908401611a43565b9390926024359182116103ff5761037a91369101611a43565b610385949194611acc565b610390818314611f63565b855b82811061039d578680f35b6103a8818388611fd1565b359081151582036103fb576103f16103f6926001600160a01b036103d56103d085898c611fd1565b611fe1565b168a52600d602052868a209060ff801983541691151516179055565b611fc2565b610392565b8780fd5b8580fd5b8480fd5b50503461032c578160031936011261032c57602090610424611eaa565b90519015158152f35b503461026c57602036600319011261026c576001600160a01b0361044f6119e2565b610457611a74565b1690818452600e60205261047060ff84862054166120ff565b818452600e60205260ff8385205460081c161561049d57508252600e6020528120805461ff001916905580f35b608490602084519162461bcd60e51b8352820152602960248201527f53616c6550726f636573736f723a20616d62617361646f7220616c726561647960448201526808191a5cd8589b195960ba1b6064820152fd5b503461026c57602036600319011261026c576001600160a01b036105146119e2565b61051c611a74565b1690818452600e60205261053560ff84862054166120ff565b818452600e60205260ff8385205460081c1661056557508252600e6020528120805461ff00191661010017905580f35b608490602084519162461bcd60e51b8352820152602860248201527f53616c6550726f636573736f723a20616d62617361646f7220616c726561647960448201526708195b98589b195960c21b6064820152fd5b50503461032c578160031936011261032c576020906008549051908152f35b50903461026c578060031936011261026c57610612913561060d60016105fc6119fd565b938387528160205286200154611b28565b611bcf565b5080f35b503461026c57602036600319011261026c57803591610633611acc565b61064960ff61064185611c95565b505416611ff5565b60ff61065484611c95565b505460081c1660038110156106d657600103610685578361067484611c95565b50805461ff00191661020017905580f35b906020608492519162461bcd60e51b8352820152602560248201527f53616c6550726f636573736f723a2073746167652073686f756c642062652061604482015264637469766560d81b6064820152fd5b634e487b7160e01b855260218352602485fd5b50903461026c57606090816003193601126108455767ffffffffffffffff83358181116103ff5761071d9036908601611a43565b9390926024358381116103fb576107379036908801611a43565b9390966044359182116108415761075091369101611a43565b909361075a611acc565b61076b610765611eaa565b15611f17565b80871480610838575b61077d90611f63565b88805b88811061078b575080f35b8060028a8a8a8a8f8b61083199600e6107b58a8f8f826107ae9161080e99611fd1565b3598611fd1565b35976001600160a01b036107f36103d086519d8e946107d386611c79565b60019c8d9b8c88526020978881019d8e528b81019e8f52019e8f52611fd1565b168352522096511515879060ff801983541691151516179055565b51855461ff00191690151560081b61ff0016178555519084015551910155611fc2565b8990610780565b50868214610774565b8880fd5b8380fd5b83823461032c57602036600319011261032c5735610865611a74565b61087c6a084595161401484a000000821115612050565b61088a600a5482101561209c565b60095580f35b5091903461032c57602036600319011261032c578160a082516108b281611c47565b828152826020820152828482015282606082015282608082015201526108d88335611c95565b508151926108e584611c47565b60ff82548181161515865260081c16926020850193600381101561097e578452600183015481860190815260028401549260608701938452876003860154956080890196875201549560a0880196875283519751151588525190600382101561096b575060c09750602087015251908501525160608401525160808301525160a0820152f35b634e487b7160e01b815260218952602490fd5b634e487b7160e01b835260218752602483fd5b50503461032c578160031936011261032c5751908152602090f35b503461026c57602036600319011261026c578035916109c9611acc565b6109d1611e7c565b15610acc576109e460ff61064185611c95565b60ff6109ef84611c95565b505460081c1660038110156106d657610a7957506008549060ff610a1283611c95565b505460081c16906003821015610a665750600114610a49575b50610a3581611c95565b50805461ff00191661010017905560085580f35b610a5290611c95565b50805461ff00191661020017905538610a2b565b634e487b7160e01b855260219052602484fd5b906020608492519162461bcd60e51b8352820152602760248201527f53616c6550726f636573736f723a2073746167652073686f756c64206e6f74206044820152661899481d5cd95960ca1b6064820152fd5b906020606492519162461bcd60e51b8352820152601e60248201527f53616c6550726f636573736f723a2073616c65206e6f742061637469766500006044820152fd5b50503461032c578160031936011261032c576020906003549051908152f35b503461026c578160031936011261026c578160209360ff92610b4e6119fd565b90358252600186526001600160a01b0383832091168252855220541690519015158152f35b50503461032c578160031936011261032c57602090600a549051908152f35b83823461032c57602036600319011261032c5735610bae611a74565b610bc267016345785d8a000082101561209c565b610bd0600954821115612050565b600a5580f35b50503461032c57602036600319011261032c576020916001600160a01b03610bfc6119e2565b168152600b835281812054600254600d855260ff8484205416610c3a575b80821015610c32576102629250611ce6565b51908152f35b505090610c2c565b50600954610c1a565b50503461032c57602036600319011261032c576020916001600160a01b03610c696119e2565b168152600b83528181205460095480821015610c32576102629250611ce6565b50503461032c578060031936011261032c5780602092610ca76119e2565b6001600160a01b0380610cb86119fd565b1683526010865283832091168252845220549051908152f35b50503461032c5760e036600319011261032c57610cec6119e2565b90610cf56119fd565b91606435608435936001600160a01b0392838616809603610e53578390610d1a611acc565b1690818752602092600b8452610d35604435878a20546120f2565b838952600b855286892055610d4c816003546120f2565b6003556008546003610d73610d6d8483610d6586611c95565b5001546120f2565b92611c95565b500155828852600c8452610d968689209160085492838b528652878a20546120f2565b90838952600c855286892090895284528588205585610db3578680f35b600f93868852600e8452858820805460ff811615610e41575b505060108452858820911687528252838620610deb60a43582546120f2565b90558486526010825283862073900000000000000000000000000000000000000987528252838620610e2060c43582546120f2565b90558552528220906001600160a01b03198254161790553880808080808680f35b61ffff19166101011790553880610dcc565b8680fd5b50503461032c57602036600319011261032c5760ff816020936001600160a01b03610e806119e2565b168152600d855220541690519015158152f35b50503461032c578160031936011261032c576020906009549051908152f35b508234610269578060031936011261026957505460055482519182526020820152f35b50503461032c5736600319011261026957610f0d610ef16119e2565b610ef9611a74565b602435906001600160a01b033391166121a2565b80f35b50503461032c578060031936011261032c576020906001600160a01b03610f46610f386119e2565b610f406119fd565b90611d09565b915191168152f35b50503461032c578160031936011261032c576020906001600160a01b03600654169051908152f35b8334610269578060031936011261026957610f8f611a74565b8080808047335af150610612612157565b50503461032c578160031936011261032c57602090610424611e7c565b503461026c57610fcc36611a2d565b92610fd5611a74565b610fe0610765611eaa565b610fee60ff61064184611c95565b60ff610ff983611c95565b505460081c1660038110156110f05760021461109c5783600361101b84611c95565b5001541015611034575061102e90611c95565b50015580f35b5162461bcd60e51b8152602081840152603960248201527f53616c6550726f636573736f723a206e657720737570706c79206d757374206260448201527f6520626967676572207468656e20736f6c6420746f6b656e73000000000000006064820152608490fd5b5162461bcd60e51b8152602081840152602960248201527f53616c6550726f636573736f723a2073746167652073686f756c64206e6f742060448201526818994818db1bdcd95960ba1b6064820152608490fd5b634e487b7160e01b865260218452602486fd5b50503461032c578160031936011261032c576020906002549051908152f35b82843461026957602036600319011261026957506111466111416119e2565b611df2565b82519182526020820152f35b503461026c576020908160031936011261084557803567ffffffffffffffff8111610403576111849036908301611a43565b60028694929454146113995760028655801561134a57338652600e82526111b060ff86882054166120ff565b338652600e825260ff8587205460081c16156112fb57855b8181106111d757866001815580f35b6111e56103d0828488611fd1565b33885260108085526001600160a01b03888a20921691828a528552878920549081156112ef57338a528552878920828a528552888881205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee82146000146112d9578880808084335af161124b612157565b501561128c579061128792915b88519081527ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd3992683863392a3611fc2565b6111c8565b875162461bcd60e51b8152808701869052602160248201527f53616c6550726f636573736f723a206e617469766520636c61696d206572726f6044820152603960f91b6064820152608490fd5b90816112ea611287949333846121a2565b611258565b50505061128790611fc2565b845162461bcd60e51b81528084018390526024808201527f53616c6550726f636573736f723a20616d62617361646f72206e6f7420656e61604482015263189b195960e21b6064820152608490fd5b845162461bcd60e51b8152808401839052602360248201527f53616c6550726f636573736f723a206e6f2061737365747320746f2070726f6360448201526265737360e81b6064820152608490fd5b8451633ee5aeb560e01b81528390fd5b50503461032c578160031936011261032c576020906007549051908152f35b50503461032c578060031936011261032c576113e26119e2565b90602435908115158203610845576001600160a01b03610f0d93611404611acc565b168452600d60205283209060ff801983541691151516179055565b503461026c578160031936011261026c5760209282916001600160a01b036114456119fd565b168252600c855282822090358252845220549051908152f35b5091903461032c578060031936011261032c576114796119fd565b90336001600160a01b038316036114965750610612919235611bcf565b5163334bd91960e11b81528390fd5b50903461026c576114b536611a2d565b9290916114c0611a74565b6114cb610765611eaa565b6103e880841161154c5784116114e357505560055580f35b906020608492519162461bcd60e51b8352820152603260248201527f53616c6550726f636573736f723a2063616e7420736574207365636f6e64207260448201527f617465206d6f7265207468656e203130302500000000000000000000000000006064820152fd5b815162461bcd60e51b8152602081850152603160248201527f53616c6550726f636573736f723a2063616e742073657420666972737420726160448201527f7465206d6f7265207468656e20313030250000000000000000000000000000006064820152608490fd5b50903461026c578060031936011261026c5761061291356115d960016105fc6119fd565b611b4e565b503461026c57602036600319011261026c57816020936001923581528285522001549051908152f35b503461026c5761161636611a13565b919390611621611a74565b61162c610765611eaa565b81519461163886611c47565b600186526020860192878452860190815260608601918252608086019287845260a08701948552600754680100000000000000008110156116fe578060016116839201600755611c95565b9790976116ec576116a390511515889060ff801983541691151516179055565b5160038110156116d95761ff0087549160081b169061ff0019161786555160018601555160028501555160038401555191015580f35b634e487b7160e01b885260218652602488fd5b634e487b7160e01b8952888752602489fd5b634e487b7160e01b895260418752602489fd5b503461026c578260031936011261026c5761172a611a74565b6006549160ff8360a01c1660038110156106d65761175757505060ff60a01b1916600160a01b1760065580f35b906020608492519162461bcd60e51b8352820152602360248201527f53616c6550726f636573736f723a2073616c6520616c726561647920737461726044820152621d195960ea1b6064820152fd5b50903461026c576117b636611a13565b939091926117c2611a74565b6117cd610765611eaa565b6117db60ff61064186611c95565b60ff6117e685611c95565b505460081c16600381101561186b576118155750508161102e91600161180d600295611c95565b500155611c95565b906020608492519162461bcd60e51b8352820152602a60248201527f53616c6550726f636573736f723a2073746167652073686f756c64206e6f74206044820152691899481cdd185c9d195960b21b6064820152fd5b634e487b7160e01b875260218352602487fd5b503461026c57602036600319011261026c576001600160a01b036118a06119e2565b6118a8611a74565b169182156118c65750506001600160a01b0319600654161760065580f35b906020606492519162461bcd60e51b8352820152602060248201527f53616c6550726f636573736f723a207a65726f2062616e6b20616464726573736044820152fd5b503461026c57602036600319011261026c57803591611926611a74565b600a5483101580611982575b1561193f57505060025580f35b906020606492519162461bcd60e51b8352820152601c60248201527f53616c6550726f636573736f723a20696e76616c69642076616c7565000000006044820152fd5b50600954831115611932565b9250503461026c57602036600319011261026c573563ffffffff60e01b811680910361026c5760209250637965db0b60e01b81149081156119d1575b5015158152f35b6301ffc9a760e01b149050386119ca565b600435906001600160a01b03821682036119f857565b600080fd5b602435906001600160a01b03821682036119f857565b60609060031901126119f857600435906024359060443590565b60409060031901126119f8576004359060243590565b9181601f840112156119f85782359167ffffffffffffffff83116119f8576020808501948460051b0101116119f857565b3360009081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604081205460ff1615611aae5750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b3360009081527ffdb122eb892c6b3193f8499f050265ce5458caab5f6480270d8972921f24f42960205260409020547f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b089060ff1615611aae5750565b80600052600160205260406000203360005260205260ff6040600020541615611aae5750565b9060009180835260016020526001600160a01b036040842092169182845260205260ff60408420541615600014611bca5780835260016020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b9060009180835260016020526001600160a01b036040842092169182845260205260ff604084205416600014611bca578083526001602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b60c0810190811067ffffffffffffffff821117611c6357604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117611c6357604052565b600754811015611cd0576005906007600052027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880190600090565b634e487b7160e01b600052603260045260246000fd5b91908203918211611cf357565b634e487b7160e01b600052601160045260246000fd5b906001600160a01b03809216600092818452602090600f82526040928184872054168652600e8352838620845190611d4082611c79565b8054916060600260ff80861615159586855260081c16151593848985015260018101548a850152015491015281611dea575b50611dd9575083168452600e8152818420918051611d8f81611c79565b6060600285549560ff8716159460ff86159889875260081c1615158097860152600182015490850152015491015291611dd1575b50611dcc575090565b905090565b905038611dc3565b85600f939296949550525220541690565b905038611d72565b906001600160a01b0360609216600052600e6020526040600020604051611e1881611c79565b81549060ff80831615159283835260081c1615156020820152600260018401549384604084015201549485910152611e57575090506004549060055490565b60045480821115611e745750915b60055480821115611dcc575090565b905091611e65565b60ff60065460a01c166003811015611e945760011490565b634e487b7160e01b600052602160045260246000fd5b60ff60065460a01c166003811015611e945760021490565b6008549060ff611ed183611c95565b505460081c166003811015611e9457600114611eee575050600090565b6002811015611e9457611f0c57611f06600191611c95565b50015490565b611f06600291611c95565b15611f1e57565b60405162461bcd60e51b815260206004820152601a60248201527f53616c6550726f636573736f723a2073616c6520636c6f7365640000000000006044820152606490fd5b15611f6a57565b60405162461bcd60e51b815260206004820152602a60248201527f53616c6550726f636573736f723a20696e76616c696420617272617973206c6560448201526906e6774682073657475760b41b6064820152608490fd5b6000198114611cf35760010190565b9190811015611cd05760051b0190565b356001600160a01b03811681036119f85790565b15611ffc57565b60405162461bcd60e51b815260206004820152602660248201527f53616c6550726f636573736f723a2073746167652073686f756c64206265206460448201526519599a5b995960d21b6064820152608490fd5b1561205757565b60405162461bcd60e51b815260206004820152601f60248201527f53616c6550726f636573736f723a2076616c756520697320746f6f20626967006044820152606490fd5b156120a357565b60405162461bcd60e51b815260206004820152602160248201527f53616c6550726f636573736f723a2076616c756520697320746f6f20736d616c6044820152601b60fa1b6064820152608490fd5b91908201809211611cf357565b1561210657565b60405162461bcd60e51b8152602060048201526024808201527f53616c6550726f636573736f723a20616d62617361646f72206e6f74206465666044820152631a5b995960e21b6064820152608490fd5b3d1561219d5767ffffffffffffffff903d828111611c635760405192601f8201601f19908116603f0116840190811184821017611c635760405282523d6000602084013e565b606090565b91906121fa9060405193602085019363a9059cbb60e01b85526001600160a01b0380931660248701526044860152604485526121dd85611c79565b1692600080938192519082875af16121f3612157565b9084612252565b90815191821515928361222a575b5050506122125750565b60249060405190635274afe760e01b82526004820152fd5b81929350906020918101031261032c5760200151908115918215036102695750388080612208565b90612279575080511561226757805190602001fd5b604051630a12f52160e11b8152600490fd5b815115806122ac575b61228a575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561228256fea26469706673582212209e31e3a3d05303e8ac11c8abab1f42a4176d0af54bf118c0869cbdbb07277dfc64736f6c634300081500332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d000000000000000000000000f75e3e1c90f13a5643b99a49ab151125f0e8d3c9

Deployed Bytecode

0x60806040818152600480361015610021575b505050361561001f57600080fd5b005b600092833560e01c90816301ffc9a71461198e575080630876fc5614611909578063090d23b91461187e5780631490d330146117a6578063167ff46f146117115780631c652ec814611607578063248a9ca3146115de5780632f2ff15d146115b5578063315c1c96146114a557806336568abe1461145e5780633656eec21461141f57806348f0aeeb146113c857806349bdb663146113a95780634bbc471a146111525780634c5b0324146111225780634c6c624c1461110357806354d44e9514610fbd578063564566a814610fa05780635a54db8614610f7657806360d704db14610f4e57806370f1031d14610f10578063738a8ce614610ed55780637f2e669a14610eb257806383d4c20d14610e9357806384203f4b14610e575780638b8b010814610cd15780638c4513b214610c895780638d8e1ad714610c435780638ed8409e14610bd65780638fcc9cfb14610b9257806390daaf6714610b7357806391d1485414610b2e5780639d7b8e6814610b0f578063a1524418146109ac578063a217fddf14610991578063a3759f6014610890578063bb371fdd14610849578063c129d83e146106e9578063cb825d0414610616578063d547741f146105d8578063daa4cf88146105b9578063e07267a8146104f2578063e7cd40f91461042d578063ea1ea81f14610407578063ebdfd88514610330578063ec87621c146102f1578063ee55efee146102705763eff8fe5a03610011573461026c57602036600319011261026c57359160028310156102695750610262602092611ec2565b9051908152f35b80fd5b8280fd5b50903461026c578260031936011261026c5761028a611a74565b610292611e7c565b156102ae576006805460ff60a01b1916600160a11b1790558280f35b906020606492519162461bcd60e51b8352820152601f60248201527f53616c6550726f636573736f723a2073616c65206e6f742073746172746564006044820152fd5b50503461032c578160031936011261032c57602090517f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b088152f35b5080fd5b503461026c578160031936011261026c5767ffffffffffffffff918135838111610403576103619036908401611a43565b9390926024359182116103ff5761037a91369101611a43565b610385949194611acc565b610390818314611f63565b855b82811061039d578680f35b6103a8818388611fd1565b359081151582036103fb576103f16103f6926001600160a01b036103d56103d085898c611fd1565b611fe1565b168a52600d602052868a209060ff801983541691151516179055565b611fc2565b610392565b8780fd5b8580fd5b8480fd5b50503461032c578160031936011261032c57602090610424611eaa565b90519015158152f35b503461026c57602036600319011261026c576001600160a01b0361044f6119e2565b610457611a74565b1690818452600e60205261047060ff84862054166120ff565b818452600e60205260ff8385205460081c161561049d57508252600e6020528120805461ff001916905580f35b608490602084519162461bcd60e51b8352820152602960248201527f53616c6550726f636573736f723a20616d62617361646f7220616c726561647960448201526808191a5cd8589b195960ba1b6064820152fd5b503461026c57602036600319011261026c576001600160a01b036105146119e2565b61051c611a74565b1690818452600e60205261053560ff84862054166120ff565b818452600e60205260ff8385205460081c1661056557508252600e6020528120805461ff00191661010017905580f35b608490602084519162461bcd60e51b8352820152602860248201527f53616c6550726f636573736f723a20616d62617361646f7220616c726561647960448201526708195b98589b195960c21b6064820152fd5b50503461032c578160031936011261032c576020906008549051908152f35b50903461026c578060031936011261026c57610612913561060d60016105fc6119fd565b938387528160205286200154611b28565b611bcf565b5080f35b503461026c57602036600319011261026c57803591610633611acc565b61064960ff61064185611c95565b505416611ff5565b60ff61065484611c95565b505460081c1660038110156106d657600103610685578361067484611c95565b50805461ff00191661020017905580f35b906020608492519162461bcd60e51b8352820152602560248201527f53616c6550726f636573736f723a2073746167652073686f756c642062652061604482015264637469766560d81b6064820152fd5b634e487b7160e01b855260218352602485fd5b50903461026c57606090816003193601126108455767ffffffffffffffff83358181116103ff5761071d9036908601611a43565b9390926024358381116103fb576107379036908801611a43565b9390966044359182116108415761075091369101611a43565b909361075a611acc565b61076b610765611eaa565b15611f17565b80871480610838575b61077d90611f63565b88805b88811061078b575080f35b8060028a8a8a8a8f8b61083199600e6107b58a8f8f826107ae9161080e99611fd1565b3598611fd1565b35976001600160a01b036107f36103d086519d8e946107d386611c79565b60019c8d9b8c88526020978881019d8e528b81019e8f52019e8f52611fd1565b168352522096511515879060ff801983541691151516179055565b51855461ff00191690151560081b61ff0016178555519084015551910155611fc2565b8990610780565b50868214610774565b8880fd5b8380fd5b83823461032c57602036600319011261032c5735610865611a74565b61087c6a084595161401484a000000821115612050565b61088a600a5482101561209c565b60095580f35b5091903461032c57602036600319011261032c578160a082516108b281611c47565b828152826020820152828482015282606082015282608082015201526108d88335611c95565b508151926108e584611c47565b60ff82548181161515865260081c16926020850193600381101561097e578452600183015481860190815260028401549260608701938452876003860154956080890196875201549560a0880196875283519751151588525190600382101561096b575060c09750602087015251908501525160608401525160808301525160a0820152f35b634e487b7160e01b815260218952602490fd5b634e487b7160e01b835260218752602483fd5b50503461032c578160031936011261032c5751908152602090f35b503461026c57602036600319011261026c578035916109c9611acc565b6109d1611e7c565b15610acc576109e460ff61064185611c95565b60ff6109ef84611c95565b505460081c1660038110156106d657610a7957506008549060ff610a1283611c95565b505460081c16906003821015610a665750600114610a49575b50610a3581611c95565b50805461ff00191661010017905560085580f35b610a5290611c95565b50805461ff00191661020017905538610a2b565b634e487b7160e01b855260219052602484fd5b906020608492519162461bcd60e51b8352820152602760248201527f53616c6550726f636573736f723a2073746167652073686f756c64206e6f74206044820152661899481d5cd95960ca1b6064820152fd5b906020606492519162461bcd60e51b8352820152601e60248201527f53616c6550726f636573736f723a2073616c65206e6f742061637469766500006044820152fd5b50503461032c578160031936011261032c576020906003549051908152f35b503461026c578160031936011261026c578160209360ff92610b4e6119fd565b90358252600186526001600160a01b0383832091168252855220541690519015158152f35b50503461032c578160031936011261032c57602090600a549051908152f35b83823461032c57602036600319011261032c5735610bae611a74565b610bc267016345785d8a000082101561209c565b610bd0600954821115612050565b600a5580f35b50503461032c57602036600319011261032c576020916001600160a01b03610bfc6119e2565b168152600b835281812054600254600d855260ff8484205416610c3a575b80821015610c32576102629250611ce6565b51908152f35b505090610c2c565b50600954610c1a565b50503461032c57602036600319011261032c576020916001600160a01b03610c696119e2565b168152600b83528181205460095480821015610c32576102629250611ce6565b50503461032c578060031936011261032c5780602092610ca76119e2565b6001600160a01b0380610cb86119fd565b1683526010865283832091168252845220549051908152f35b50503461032c5760e036600319011261032c57610cec6119e2565b90610cf56119fd565b91606435608435936001600160a01b0392838616809603610e53578390610d1a611acc565b1690818752602092600b8452610d35604435878a20546120f2565b838952600b855286892055610d4c816003546120f2565b6003556008546003610d73610d6d8483610d6586611c95565b5001546120f2565b92611c95565b500155828852600c8452610d968689209160085492838b528652878a20546120f2565b90838952600c855286892090895284528588205585610db3578680f35b600f93868852600e8452858820805460ff811615610e41575b505060108452858820911687528252838620610deb60a43582546120f2565b90558486526010825283862073900000000000000000000000000000000000000987528252838620610e2060c43582546120f2565b90558552528220906001600160a01b03198254161790553880808080808680f35b61ffff19166101011790553880610dcc565b8680fd5b50503461032c57602036600319011261032c5760ff816020936001600160a01b03610e806119e2565b168152600d855220541690519015158152f35b50503461032c578160031936011261032c576020906009549051908152f35b508234610269578060031936011261026957505460055482519182526020820152f35b50503461032c5736600319011261026957610f0d610ef16119e2565b610ef9611a74565b602435906001600160a01b033391166121a2565b80f35b50503461032c578060031936011261032c576020906001600160a01b03610f46610f386119e2565b610f406119fd565b90611d09565b915191168152f35b50503461032c578160031936011261032c576020906001600160a01b03600654169051908152f35b8334610269578060031936011261026957610f8f611a74565b8080808047335af150610612612157565b50503461032c578160031936011261032c57602090610424611e7c565b503461026c57610fcc36611a2d565b92610fd5611a74565b610fe0610765611eaa565b610fee60ff61064184611c95565b60ff610ff983611c95565b505460081c1660038110156110f05760021461109c5783600361101b84611c95565b5001541015611034575061102e90611c95565b50015580f35b5162461bcd60e51b8152602081840152603960248201527f53616c6550726f636573736f723a206e657720737570706c79206d757374206260448201527f6520626967676572207468656e20736f6c6420746f6b656e73000000000000006064820152608490fd5b5162461bcd60e51b8152602081840152602960248201527f53616c6550726f636573736f723a2073746167652073686f756c64206e6f742060448201526818994818db1bdcd95960ba1b6064820152608490fd5b634e487b7160e01b865260218452602486fd5b50503461032c578160031936011261032c576020906002549051908152f35b82843461026957602036600319011261026957506111466111416119e2565b611df2565b82519182526020820152f35b503461026c576020908160031936011261084557803567ffffffffffffffff8111610403576111849036908301611a43565b60028694929454146113995760028655801561134a57338652600e82526111b060ff86882054166120ff565b338652600e825260ff8587205460081c16156112fb57855b8181106111d757866001815580f35b6111e56103d0828488611fd1565b33885260108085526001600160a01b03888a20921691828a528552878920549081156112ef57338a528552878920828a528552888881205573eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee82146000146112d9578880808084335af161124b612157565b501561128c579061128792915b88519081527ff7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd3992683863392a3611fc2565b6111c8565b875162461bcd60e51b8152808701869052602160248201527f53616c6550726f636573736f723a206e617469766520636c61696d206572726f6044820152603960f91b6064820152608490fd5b90816112ea611287949333846121a2565b611258565b50505061128790611fc2565b845162461bcd60e51b81528084018390526024808201527f53616c6550726f636573736f723a20616d62617361646f72206e6f7420656e61604482015263189b195960e21b6064820152608490fd5b845162461bcd60e51b8152808401839052602360248201527f53616c6550726f636573736f723a206e6f2061737365747320746f2070726f6360448201526265737360e81b6064820152608490fd5b8451633ee5aeb560e01b81528390fd5b50503461032c578160031936011261032c576020906007549051908152f35b50503461032c578060031936011261032c576113e26119e2565b90602435908115158203610845576001600160a01b03610f0d93611404611acc565b168452600d60205283209060ff801983541691151516179055565b503461026c578160031936011261026c5760209282916001600160a01b036114456119fd565b168252600c855282822090358252845220549051908152f35b5091903461032c578060031936011261032c576114796119fd565b90336001600160a01b038316036114965750610612919235611bcf565b5163334bd91960e11b81528390fd5b50903461026c576114b536611a2d565b9290916114c0611a74565b6114cb610765611eaa565b6103e880841161154c5784116114e357505560055580f35b906020608492519162461bcd60e51b8352820152603260248201527f53616c6550726f636573736f723a2063616e7420736574207365636f6e64207260448201527f617465206d6f7265207468656e203130302500000000000000000000000000006064820152fd5b815162461bcd60e51b8152602081850152603160248201527f53616c6550726f636573736f723a2063616e742073657420666972737420726160448201527f7465206d6f7265207468656e20313030250000000000000000000000000000006064820152608490fd5b50903461026c578060031936011261026c5761061291356115d960016105fc6119fd565b611b4e565b503461026c57602036600319011261026c57816020936001923581528285522001549051908152f35b503461026c5761161636611a13565b919390611621611a74565b61162c610765611eaa565b81519461163886611c47565b600186526020860192878452860190815260608601918252608086019287845260a08701948552600754680100000000000000008110156116fe578060016116839201600755611c95565b9790976116ec576116a390511515889060ff801983541691151516179055565b5160038110156116d95761ff0087549160081b169061ff0019161786555160018601555160028501555160038401555191015580f35b634e487b7160e01b885260218652602488fd5b634e487b7160e01b8952888752602489fd5b634e487b7160e01b895260418752602489fd5b503461026c578260031936011261026c5761172a611a74565b6006549160ff8360a01c1660038110156106d65761175757505060ff60a01b1916600160a01b1760065580f35b906020608492519162461bcd60e51b8352820152602360248201527f53616c6550726f636573736f723a2073616c6520616c726561647920737461726044820152621d195960ea1b6064820152fd5b50903461026c576117b636611a13565b939091926117c2611a74565b6117cd610765611eaa565b6117db60ff61064186611c95565b60ff6117e685611c95565b505460081c16600381101561186b576118155750508161102e91600161180d600295611c95565b500155611c95565b906020608492519162461bcd60e51b8352820152602a60248201527f53616c6550726f636573736f723a2073746167652073686f756c64206e6f74206044820152691899481cdd185c9d195960b21b6064820152fd5b634e487b7160e01b875260218352602487fd5b503461026c57602036600319011261026c576001600160a01b036118a06119e2565b6118a8611a74565b169182156118c65750506001600160a01b0319600654161760065580f35b906020606492519162461bcd60e51b8352820152602060248201527f53616c6550726f636573736f723a207a65726f2062616e6b20616464726573736044820152fd5b503461026c57602036600319011261026c57803591611926611a74565b600a5483101580611982575b1561193f57505060025580f35b906020606492519162461bcd60e51b8352820152601c60248201527f53616c6550726f636573736f723a20696e76616c69642076616c7565000000006044820152fd5b50600954831115611932565b9250503461026c57602036600319011261026c573563ffffffff60e01b811680910361026c5760209250637965db0b60e01b81149081156119d1575b5015158152f35b6301ffc9a760e01b149050386119ca565b600435906001600160a01b03821682036119f857565b600080fd5b602435906001600160a01b03821682036119f857565b60609060031901126119f857600435906024359060443590565b60409060031901126119f8576004359060243590565b9181601f840112156119f85782359167ffffffffffffffff83116119f8576020808501948460051b0101116119f857565b3360009081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604081205460ff1615611aae5750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b3360009081527ffdb122eb892c6b3193f8499f050265ce5458caab5f6480270d8972921f24f42960205260409020547f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b089060ff1615611aae5750565b80600052600160205260406000203360005260205260ff6040600020541615611aae5750565b9060009180835260016020526001600160a01b036040842092169182845260205260ff60408420541615600014611bca5780835260016020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b9060009180835260016020526001600160a01b036040842092169182845260205260ff604084205416600014611bca578083526001602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b60c0810190811067ffffffffffffffff821117611c6357604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117611c6357604052565b600754811015611cd0576005906007600052027fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880190600090565b634e487b7160e01b600052603260045260246000fd5b91908203918211611cf357565b634e487b7160e01b600052601160045260246000fd5b906001600160a01b03809216600092818452602090600f82526040928184872054168652600e8352838620845190611d4082611c79565b8054916060600260ff80861615159586855260081c16151593848985015260018101548a850152015491015281611dea575b50611dd9575083168452600e8152818420918051611d8f81611c79565b6060600285549560ff8716159460ff86159889875260081c1615158097860152600182015490850152015491015291611dd1575b50611dcc575090565b905090565b905038611dc3565b85600f939296949550525220541690565b905038611d72565b906001600160a01b0360609216600052600e6020526040600020604051611e1881611c79565b81549060ff80831615159283835260081c1615156020820152600260018401549384604084015201549485910152611e57575090506004549060055490565b60045480821115611e745750915b60055480821115611dcc575090565b905091611e65565b60ff60065460a01c166003811015611e945760011490565b634e487b7160e01b600052602160045260246000fd5b60ff60065460a01c166003811015611e945760021490565b6008549060ff611ed183611c95565b505460081c166003811015611e9457600114611eee575050600090565b6002811015611e9457611f0c57611f06600191611c95565b50015490565b611f06600291611c95565b15611f1e57565b60405162461bcd60e51b815260206004820152601a60248201527f53616c6550726f636573736f723a2073616c6520636c6f7365640000000000006044820152606490fd5b15611f6a57565b60405162461bcd60e51b815260206004820152602a60248201527f53616c6550726f636573736f723a20696e76616c696420617272617973206c6560448201526906e6774682073657475760b41b6064820152608490fd5b6000198114611cf35760010190565b9190811015611cd05760051b0190565b356001600160a01b03811681036119f85790565b15611ffc57565b60405162461bcd60e51b815260206004820152602660248201527f53616c6550726f636573736f723a2073746167652073686f756c64206265206460448201526519599a5b995960d21b6064820152608490fd5b1561205757565b60405162461bcd60e51b815260206004820152601f60248201527f53616c6550726f636573736f723a2076616c756520697320746f6f20626967006044820152606490fd5b156120a357565b60405162461bcd60e51b815260206004820152602160248201527f53616c6550726f636573736f723a2076616c756520697320746f6f20736d616c6044820152601b60fa1b6064820152608490fd5b91908201809211611cf357565b1561210657565b60405162461bcd60e51b8152602060048201526024808201527f53616c6550726f636573736f723a20616d62617361646f72206e6f74206465666044820152631a5b995960e21b6064820152608490fd5b3d1561219d5767ffffffffffffffff903d828111611c635760405192601f8201601f19908116603f0116840190811184821017611c635760405282523d6000602084013e565b606090565b91906121fa9060405193602085019363a9059cbb60e01b85526001600160a01b0380931660248701526044860152604485526121dd85611c79565b1692600080938192519082875af16121f3612157565b9084612252565b90815191821515928361222a575b5050506122125750565b60249060405190635274afe760e01b82526004820152fd5b81929350906020918101031261032c5760200151908115918215036102695750388080612208565b90612279575080511561226757805190602001fd5b604051630a12f52160e11b8152600490fd5b815115806122ac575b61228a575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561228256fea26469706673582212209e31e3a3d05303e8ac11c8abab1f42a4176d0af54bf118c0869cbdbb07277dfc64736f6c63430008150033

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

000000000000000000000000f75e3e1c90f13a5643b99a49ab151125f0e8d3c9

-----Decoded View---------------
Arg [0] : bank_ (address): 0xF75e3E1C90f13a5643B99A49Ab151125F0E8D3C9

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000f75e3e1c90f13a5643b99a49ab151125f0e8d3c9


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.