Overview
ETH Balance
10.092626 ETH
Eth Value
$33,397.10 (@ $3,309.06/ETH)Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,121 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Ref | 21267953 | 26 hrs ago | IN | 0 ETH | 0.00044982 | ||||
Claim Ref | 21186242 | 12 days ago | IN | 0 ETH | 0.00125548 | ||||
Claim Ref | 21151079 | 17 days ago | IN | 0 ETH | 0.00080855 | ||||
Claim Ref | 21128796 | 20 days ago | IN | 0 ETH | 0.00072866 | ||||
Claim Ref | 21127286 | 20 days ago | IN | 0 ETH | 0.00328211 | ||||
Claim Ref | 21125723 | 20 days ago | IN | 0 ETH | 0.00113133 | ||||
Claim Ref | 21123079 | 21 days ago | IN | 0 ETH | 0.00055595 | ||||
Claim Ref | 20931043 | 48 days ago | IN | 0 ETH | 0.0008852 | ||||
Claim Ref | 20929069 | 48 days ago | IN | 0 ETH | 0.00130583 | ||||
Claim Ref | 20913025 | 50 days ago | IN | 0 ETH | 0.00037207 | ||||
Claim Ref | 20679121 | 83 days ago | IN | 0 ETH | 0.00069835 | ||||
Claim Ref | 20617585 | 91 days ago | IN | 0 ETH | 0.00004926 | ||||
Claim Ref | 20583013 | 96 days ago | IN | 0 ETH | 0.00004465 | ||||
Claim Ref | 20583011 | 96 days ago | IN | 0 ETH | 0.00008454 | ||||
Claim Ref | 20565267 | 99 days ago | IN | 0 ETH | 0.00007602 | ||||
Claim Ref | 20560423 | 99 days ago | IN | 0 ETH | 0.00004668 | ||||
Claim Ref | 20490692 | 109 days ago | IN | 0 ETH | 0.00014254 | ||||
Claim Ref | 20438562 | 116 days ago | IN | 0 ETH | 0.00007086 | ||||
Claim Ref | 20400724 | 122 days ago | IN | 0 ETH | 0.00102089 | ||||
Claim Ref | 20384513 | 124 days ago | IN | 0 ETH | 0.00064752 | ||||
Claim Ref | 20380586 | 124 days ago | IN | 0 ETH | 0.00018614 | ||||
Claim Ref | 20364881 | 127 days ago | IN | 0 ETH | 0.00036639 | ||||
Claim Ref | 20360140 | 127 days ago | IN | 0 ETH | 0.00012347 | ||||
Claim Ref | 20350716 | 129 days ago | IN | 0 ETH | 0.00011283 | ||||
Claim Ref | 20349231 | 129 days ago | IN | 0 ETH | 0.00015237 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
21267953 | 26 hrs ago | 0.015 ETH | ||||
21186242 | 12 days ago | 0.01875 ETH | ||||
21128796 | 20 days ago | 0.00855 ETH | ||||
21127286 | 20 days ago | 0.04392 ETH | ||||
21125723 | 20 days ago | 0.0075 ETH | ||||
21123079 | 21 days ago | 0.0206 ETH | ||||
20929069 | 48 days ago | 0.018 ETH | ||||
20913025 | 50 days ago | 0.08265 ETH | ||||
20679121 | 83 days ago | 0.00375 ETH | ||||
20617585 | 91 days ago | 0.0085 ETH | ||||
20565267 | 99 days ago | 0.00525 ETH | ||||
20560423 | 99 days ago | 0.027 ETH | ||||
20490692 | 109 days ago | 0.012087 ETH | ||||
20438562 | 116 days ago | 0.0045 ETH | ||||
20380586 | 124 days ago | 0.084 ETH | ||||
20364881 | 127 days ago | 0.075038 ETH | ||||
20360140 | 127 days ago | 0.059235 ETH | ||||
20350716 | 129 days ago | 0.02175 ETH | ||||
20349231 | 129 days ago | 0.069 ETH | ||||
20320727 | 133 days ago | 0.0063 ETH | ||||
20312843 | 134 days ago | 0.22032 ETH | ||||
20309239 | 134 days ago | 0.0198 ETH | ||||
20305182 | 135 days ago | 0.015 ETH | ||||
20287913 | 137 days ago | 0.007157 ETH | ||||
20233555 | 145 days ago | 0.04335 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Storage
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.24; 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'; contract Storage is AccessControl, ReentrancyGuard { using SafeERC20 for IERC20; enum Option { Short, Long } enum State { None, Opened, Closed } struct Round { bool defined; State state; uint256 sPrice; uint256 lPrice; uint256 sold; uint256 supply; } struct Referral { bool defined; bool enabled; uint256 firstRefRate; uint256 secondRefRate; } bytes32 public constant OPERATOR_ROLE = keccak256('OPERATOR_ROLE'); address internal constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address internal constant TOKEN = 0x0000000000000000000000000000000000000001; uint256 internal constant MAX = 1000000000000000000000000; uint256 internal constant MIN = 1000000000000000000; address private _treasury; State private _state; Round[] private _rounds; uint256 private _currentRound; uint256 private _max; uint256 private _min; uint256 private _authLimit; mapping(address => bool) private _auth; uint256 private _firstRefRate = 50; uint256 private _secondRefRate = 50; uint256 private _totalSold; mapping(address => uint256) private _funds; mapping(address => mapping(uint256 => uint256)) private _balances; mapping(address => Referral) private _refs; mapping(address => address) private _refsUsers; mapping(address => mapping(address => uint256)) _refsBalances; event StateUpdated(State state); event RoundOpened(uint256 indexed round); event RoundClosed(uint256 indexed round); event RoundAdded(uint256 sPrice, uint256 lPrice, uint256 supply); event RoundPriceUpdated(uint256 indexed round, uint256 sPrice, uint256 lPrice); event RoundSupplyUpdated(uint256 indexed round, uint256 supply); event Erc20Recovered(address token, uint256 amount); event CoinRecovered(uint256 amount); event AuthLimitUpdated(uint256 limit); event AuthUserUpdated(address indexed user, bool value); event MaxUpdated(uint256 amount); event MinUpdated(uint256 amount); event TreasuryUpdated(address indexed treasury); event RefRateSetup(uint256 firstRefRate, uint256 secondRefRate); event ReferralSetup(address indexed ref, uint256 firstRefRate, uint256 secondRefRate); event ReferralEnabled(address indexed ref); event ReferralDisabled(address indexed ref); event ClaimedFunds(address indexed ref, address indexed token, uint256 amount); error ErrParamsInvalid(); error ErrStarted(); error ErrClosed(); error ErrNullAddress(); error ErrRoundUndefined(uint256 index_); error ErrRoundStarted(uint256 index_); error ErrRoundClosed(uint256 index_); error ErrRoundSupply(uint256 index_); error ErrMin(uint256 amount_, uint256 min_); error ErrMax(uint256 amount_, uint256 max_); error ErrAuthLimit(uint256 limit_, uint256 min_, uint256 max_); error ErrFirstRefFunds(uint256 reward_); error ErrSecondRefFunds(uint256 reward_); error ErrRefUndefined(address ref_); error ErrRefEnabled(address ref_); error ErrRefDisabled(address ref_); error ErrTokenUndefined(); error ErrTransfer(); constructor(address treasury_) { if (treasury_ == address(0)) { revert ErrNullAddress(); } _treasury = treasury_; _grantRole(DEFAULT_ADMIN_ROLE, _msgSender()); _grantRole(OPERATOR_ROLE, _msgSender()); } function open() external onlyRole(DEFAULT_ADMIN_ROLE) { if (_state != State.None) { revert ErrStarted(); } _state = State.Opened; emit StateUpdated(_state); } function close() external onlyRole(DEFAULT_ADMIN_ROLE) { if (!isActive()) { revert ErrClosed(); } _state = State.Closed; emit StateUpdated(_state); } function setRound(uint256 sPrice_, uint256 lPrice_, uint256 supply_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (isInactive()) { revert ErrClosed(); } _rounds.push( Round({ defined: true, state: State.None, sPrice: sPrice_, lPrice: lPrice_, sold: 0, supply: supply_}) ); emit RoundAdded(sPrice_, lPrice_, supply_); } function setRefRate(uint256 firstRefRate_, uint256 secondRefRate_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (isInactive()) { revert ErrClosed(); } if (firstRefRate_ > 1000) { revert ErrFirstRefFunds(firstRefRate_); } if (secondRefRate_ > 1000) { revert ErrSecondRefFunds(secondRefRate_); } _firstRefRate = firstRefRate_; _secondRefRate = secondRefRate_; emit RefRateSetup(_firstRefRate, _secondRefRate); } function setupReferrals(address[] calldata refs_, uint256[] calldata firstRefRate_, uint256[] calldata secodRefFunds_) external onlyRole(OPERATOR_ROLE) { if (isInactive()) { revert ErrClosed(); } if (refs_.length != firstRefRate_.length || refs_.length != secodRefFunds_.length) { revert ErrParamsInvalid(); } for (uint256 index = 0; index < refs_.length; index++) { _refs[refs_[index]] = Referral({ defined: true, enabled: true, firstRefRate: firstRefRate_[index], secondRefRate: secodRefFunds_[index] }); emit ReferralSetup(refs_[index], firstRefRate_[index], secodRefFunds_[index]); } } function updateRoundPrice(uint256 index_, uint256 sPrice_, uint256 lPrice_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (isInactive()) { revert ErrClosed(); } if (!_rounds[index_].defined) { revert ErrRoundUndefined(index_); } if (_rounds[index_].state != State.None) { revert ErrRoundStarted(index_); } _rounds[index_].sPrice = sPrice_; _rounds[index_].lPrice = lPrice_; emit RoundPriceUpdated(index_, sPrice_, lPrice_); } function updateRoundSupply(uint256 index_, uint256 supply_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (isInactive()) { revert ErrClosed(); } if (!_rounds[index_].defined) { revert ErrRoundUndefined(index_); } if (_rounds[index_].state == State.Closed) { revert ErrRoundClosed(index_); } if (_rounds[index_].sold > supply_) { revert ErrRoundSupply(index_); } _rounds[index_].supply = supply_; emit RoundSupplyUpdated(index_, supply_); } function openRound(uint256 index_) external onlyRole(OPERATOR_ROLE) { if (!isActive()) { revert ErrClosed(); } if (!_rounds[index_].defined) { revert ErrRoundUndefined(index_); } if (_rounds[index_].state != State.None) { revert ErrRoundStarted(index_); } if (_rounds[_currentRound].state == State.Opened) { _rounds[_currentRound].state = State.Closed; } _rounds[index_].state = State.Opened; _currentRound = index_; emit RoundOpened(index_); } function closeRound(uint256 index_) external onlyRole(OPERATOR_ROLE) { if (!_rounds[index_].defined) { revert ErrRoundUndefined(index_); } if (_rounds[index_].state != State.Opened) { revert ErrRoundClosed(index_); } _rounds[index_].state = State.Closed; emit RoundClosed(index_); } function setAuth(address user_, bool value_) external onlyRole(OPERATOR_ROLE) { _auth[user_] = value_; emit AuthUserUpdated(user_, value_); } function setAuthBatch(address[] calldata users_, bool[] calldata values_) external onlyRole(OPERATOR_ROLE) { if (users_.length != values_.length) { revert ErrParamsInvalid(); } for (uint256 index = 0; index < users_.length; index++) { _auth[users_[index]] = values_[index]; emit AuthUserUpdated(users_[index], values_[index]); } } function setMax(uint256 amount_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (amount_ > MAX) { revert ErrMax(amount_, MAX); } if (amount_ < _min) { revert ErrMin(amount_, _min); } _max = amount_; emit MaxUpdated(_max); } function setMin(uint256 amount_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (amount_ < MIN) { revert ErrMin(amount_, MIN); } if (amount_ > _max) { revert ErrMax(amount_, _max); } _min = amount_; emit MinUpdated(_min); } function setAuthLimit(uint256 amount_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (_min > amount_ || amount_ > _max) { revert ErrAuthLimit(amount_, _min, _max); } _authLimit = amount_; emit AuthLimitUpdated(amount_); } function setTreasury(address treasury_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (treasury_ == address(0)) { revert ErrNullAddress(); } _treasury = treasury_; emit TreasuryUpdated(_treasury); } function setState(address user_, address token_, uint256 amount_, uint256 sold_, address ref_, uint256 fReward_, uint256 sReward_) external onlyRole(OPERATOR_ROLE) { _funds[user_] = _funds[user_] + amount_; _totalSold = _totalSold + sold_; _rounds[_currentRound].sold = _rounds[_currentRound].sold + sold_; _balances[user_][_currentRound] = _balances[user_][_currentRound] + sold_; if (ref_ != address(0)) { if (!_refs[ref_].defined) { _refs[ref_].defined = true; _refs[ref_].enabled = true; emit ReferralSetup(ref_, _firstRefRate, _secondRefRate); } _refsBalances[ref_][token_] += fReward_; _refsBalances[ref_][TOKEN] += sReward_; _refsUsers[user_] = ref_; } } function enableReferral(address ref_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (!_refs[ref_].defined) { revert ErrRefUndefined(ref_); } if (_refs[ref_].enabled) { revert ErrRefEnabled(ref_); } _refs[ref_].enabled = true; emit ReferralEnabled(ref_); } function disableReferral(address ref_) external onlyRole(DEFAULT_ADMIN_ROLE) { if (!_refs[ref_].defined) { revert ErrRefUndefined(ref_); } if (!_refs[ref_].enabled) { revert ErrRefDisabled(ref_); } _refs[ref_].enabled = false; emit ReferralDisabled(ref_); } function claimRef(address[] calldata tokens_) external nonReentrant() { address ref_ = _msgSender(); if (tokens_.length == 0) { revert ErrTokenUndefined(); } if (!_refs[ref_].defined) { revert ErrRefUndefined(ref_); } if (!_refs[ref_].enabled) { revert ErrRefDisabled(ref_); } for (uint256 i = 0; i < tokens_.length; i++) { address token = tokens_[i]; uint256 balance = _refsBalances[ref_][token]; if (balance == 0) { continue; } _refsBalances[ref_][token] = 0; if (token == ETH) { (bool success, ) = ref_.call{value: balance}(''); if (!success) revert ErrTransfer(); } else { IERC20(token).safeTransfer(ref_, balance); } emit ClaimedFunds(ref_, token, balance); } } function recoverCoin() external onlyRole(DEFAULT_ADMIN_ROLE) { uint256 balance = address(this).balance; _msgSender().call{value: balance}(''); emit CoinRecovered(balance); } function recoverErc20(address token_, uint256 amount_) external onlyRole(DEFAULT_ADMIN_ROLE) { IERC20(token_).safeTransfer(_msgSender(), amount_); emit Erc20Recovered(token_, amount_); } function getTreasury() external view returns (address) { return _treasury; } function getMax() external view returns (uint256) { return _max; } function getMin() external view returns (uint256) { return _min; } function getRoundsCount() external view returns (uint256) { return _rounds.length; } function getCurrentRound() external view returns (uint256) { return _currentRound; } function getRound(uint256 index_) external view returns (Round memory) { return _rounds[index_]; } function getTotalSold() external view returns (uint256) { return _totalSold; } function balanceOf(uint256 round_, address user_) external view returns (uint256) { return _balances[user_][round_]; } function refBalanceOf(address token_, address user_) external view returns (uint256) { return _refsBalances[user_][token_]; } function limitOf(address user_) external view returns (uint256) { uint256 amount = _funds[user_]; uint256 limit = _authLimit; if (isAuth(user_)) { limit = _max; } return amount < limit ? limit - amount : 0; } function maxLimitOf(address user_) external view returns (uint256) { uint256 amount = _funds[user_]; return amount < _max ? _max - amount : 0; } function getAuthLimit() external view returns (uint256) { return _authLimit; } function getRefRates() external view returns (uint256, uint256) { return (_firstRefRate, _secondRefRate); } function getRef(address user_, address ref_) external view returns (address) { Referral memory ref = _refs[_refsUsers[user_]]; if (ref.defined && ref.enabled) { return _refsUsers[user_]; } ref = _refs[ref_]; if (!ref.defined || ref.enabled) { return ref_; } return address(0); } function getRefRates(address ref_) external view returns (uint256, uint256) { Referral memory ref = _refs[ref_]; if (ref.defined) { return (Math.max(ref.firstRefRate, _firstRefRate), Math.max(ref.secondRefRate, _secondRefRate)); } return (_firstRefRate, _secondRefRate); } function isActive() public view returns (bool) { return _state == State.Opened; } function isInactive() public view returns (bool) { return _state == State.Closed; } function getPrice(Option option_) public view returns (uint256) { if (_rounds[_currentRound].state == State.Opened) { return option_ == Option.Short ? _rounds[_currentRound].sPrice : _rounds[_currentRound].lPrice; } return 0; } function isAuth(address user_) public view returns (bool) { return _auth[user_]; } receive() external payable { } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol) pragma solidity ^0.8.20; import {IAccessControl} from "./IAccessControl.sol"; import {Context} from "../utils/Context.sol"; import {ERC165} from "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```solidity * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ```solidity * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} * to enforce additional security measures for this role. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address account => bool) hasRole; bytes32 adminRole; } mapping(bytes32 role => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with an {AccessControlUnauthorizedAccount} error including the required role. */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].hasRole[account]; } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()` * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier. */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account` * is missing `role`. */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert AccessControlUnauthorizedAccount(account, role); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `callerConfirmation`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address callerConfirmation) public virtual { if (callerConfirmation != _msgSender()) { revert AccessControlBadConfirmation(); } _revokeRole(role, callerConfirmation); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual returns (bool) { if (!hasRole(role, account)) { _roles[role].hasRole[account] = true; emit RoleGranted(role, account, _msgSender()); return true; } else { return false; } } /** * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual returns (bool) { if (hasRole(role, account)) { _roles[role].hasRole[account] = false; emit RoleRevoked(role, account, _msgSender()); return true; } else { return false; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.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; }
// 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); }
// 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); }
// 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; } }
// 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(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.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; } }
// 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); }
// 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; } }
// 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "viaIR": true, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"treasury_","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":[{"internalType":"uint256","name":"limit_","type":"uint256"},{"internalType":"uint256","name":"min_","type":"uint256"},{"internalType":"uint256","name":"max_","type":"uint256"}],"name":"ErrAuthLimit","type":"error"},{"inputs":[],"name":"ErrClosed","type":"error"},{"inputs":[{"internalType":"uint256","name":"reward_","type":"uint256"}],"name":"ErrFirstRefFunds","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint256","name":"max_","type":"uint256"}],"name":"ErrMax","type":"error"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint256","name":"min_","type":"uint256"}],"name":"ErrMin","type":"error"},{"inputs":[],"name":"ErrNullAddress","type":"error"},{"inputs":[],"name":"ErrParamsInvalid","type":"error"},{"inputs":[{"internalType":"address","name":"ref_","type":"address"}],"name":"ErrRefDisabled","type":"error"},{"inputs":[{"internalType":"address","name":"ref_","type":"address"}],"name":"ErrRefEnabled","type":"error"},{"inputs":[{"internalType":"address","name":"ref_","type":"address"}],"name":"ErrRefUndefined","type":"error"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"ErrRoundClosed","type":"error"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"ErrRoundStarted","type":"error"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"ErrRoundSupply","type":"error"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"ErrRoundUndefined","type":"error"},{"inputs":[{"internalType":"uint256","name":"reward_","type":"uint256"}],"name":"ErrSecondRefFunds","type":"error"},{"inputs":[],"name":"ErrStarted","type":"error"},{"inputs":[],"name":"ErrTokenUndefined","type":"error"},{"inputs":[],"name":"ErrTransfer","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":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"AuthLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"AuthUserUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ref","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimedFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CoinRecovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Erc20Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MaxUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MinUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"firstRefRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secondRefRate","type":"uint256"}],"name":"RefRateSetup","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ref","type":"address"}],"name":"ReferralDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ref","type":"address"}],"name":"ReferralEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ref","type":"address"},{"indexed":false,"internalType":"uint256","name":"firstRefRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secondRefRate","type":"uint256"}],"name":"ReferralSetup","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"sPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"RoundAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"}],"name":"RoundClosed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"}],"name":"RoundOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"sPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lPrice","type":"uint256"}],"name":"RoundPriceUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"round","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"RoundSupplyUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum Storage.State","name":"state","type":"uint8"}],"name":"StateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"treasury","type":"address"}],"name":"TreasuryUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":"tokens_","type":"address[]"}],"name":"claimRef","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"close","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"closeRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"ref_","type":"address"}],"name":"disableReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"ref_","type":"address"}],"name":"enableReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAuthLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentRound","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMax","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum Storage.Option","name":"option_","type":"uint8"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"},{"internalType":"address","name":"ref_","type":"address"}],"name":"getRef","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRefRates","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"ref_","type":"address"}],"name":"getRefRates","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"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":"getRound","outputs":[{"components":[{"internalType":"bool","name":"defined","type":"bool"},{"internalType":"enum Storage.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 Storage.Round","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRoundsCount","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":"getTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"isAuth","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isInactive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"limitOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"maxLimitOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"open","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"openRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"recoverCoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"recoverErc20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"address","name":"user_","type":"address"}],"name":"refBalanceOf","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":"address","name":"user_","type":"address"},{"internalType":"bool","name":"value_","type":"bool"}],"name":"setAuth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"users_","type":"address[]"},{"internalType":"bool[]","name":"values_","type":"bool[]"}],"name":"setAuthBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setAuthLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setMax","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"setMin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"firstRefRate_","type":"uint256"},{"internalType":"uint256","name":"secondRefRate_","type":"uint256"}],"name":"setRefRate","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":"setRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"},{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"},{"internalType":"uint256","name":"sold_","type":"uint256"},{"internalType":"address","name":"ref_","type":"address"},{"internalType":"uint256","name":"fReward_","type":"uint256"},{"internalType":"uint256","name":"sReward_","type":"uint256"}],"name":"setState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasury_","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"refs_","type":"address[]"},{"internalType":"uint256[]","name":"firstRefRate_","type":"uint256[]"},{"internalType":"uint256[]","name":"secodRefFunds_","type":"uint256[]"}],"name":"setupReferrals","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":"updateRoundPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"},{"internalType":"uint256","name":"supply_","type":"uint256"}],"name":"updateRoundSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608034620000b957601f620023e838819003918201601f19168301916001600160401b03831184841017620000be57808492602094604052833981010312620000b957516001600160a01b03811690819003620000b9576001805560326009556032600a558015620000a757600280546001600160a01b0319169190911790556200008a33620000d4565b50620000963362000154565b506040516121d19081620001f78239f35b604051633eaa20b360e01b8152600490fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b031660008181527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604081205490919060ff166200015057818052816020526040822081835260205260408220600160ff198254161790553391600080516020620023c88339815191528180a4600190565b5090565b6001600160a01b031660008181527fee57cd81e84075558e8fcc182a1f4393f91fc97f963a136e66b7f949a62f319f60205260408120549091907f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9299060ff16620001f157808352826020526040832082845260205260408320600160ff19825416179055600080516020620023c8833981519152339380a4600190565b50509056fe60806040818152600480361015610021575b505050361561001f57600080fd5b005b600092833560e01c90816301ffc9a714611a50575080630b44a218146119cb5780630b6539a21461186d5780631fe9eabc1461180057806322f3e2d4146117e3578063248a9ca3146117ba5780632520e7ff1461177c57806328cf0786146116df5780632f2ff15d146116b65780633075f5521461169757806336568abe146116505780633656eec21461161157806337f1e7f2146115e85780633b19e84a146115bf5780633f9114ed1461159a57806343d726d61461152557806345dc3dd814611486578063470919ff146113ee5780634bba38b8146113af578063546a2ca4146113505780635e829a021461132a57806370f5b38e1461130b578063738a8ce61461128657806388e01a98146111b85780638f11740b146111885780638f1327c01461109b57806391d14854146110565780639d7b8e6814611037578063a09686c414611018578063a217fddf14610ffd578063a23b892714610fa3578063a32bf59714610f86578063a35e0ac114610f3e578063a7c717c314610e29578063ac76453c14610dd3578063bcf92ee414610d29578063bde22ae014610be6578063be41f5ae14610a27578063c626341a14610930578063d547741f146108f2578063d6362e97146108d3578063d63ac077146107da578063e122434914610603578063e8feeaa91461045a578063ef39c4ba14610398578063f0f442601461031e578063f5b541a6146102df5763fcfff16f0361001157346102db57826003193601126102db57610252611f2b565b6002549060ff8260a01c1660038110156102c8576102ba575060ff60a01b1916600160a01b17600281905590517f23ad33ab6a13a00aa7d06cd167b2abd03dec86af3cf3cc91759dcd3ae841188791602091906102b690829060a01c60ff16611b05565ba180f35b82516301eae73160e61b8152fd5b634e487b7160e01b855260218252602485fd5b8280fd5b50503461031a578160031936011261031a57602090517f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9298152f35b5080fd5b50346102db5760203660031901126102db57610338611aa4565b610340611f2b565b6001600160a01b031691821561038b575050600280546001600160a01b031916821790557f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d18280a280f35b51633eaa20b360e01b8152fd5b5090346102db5760203660031901126102db576103b3611aa4565b6103bb611f2b565b6001600160a01b0316808452600e6020528184205490929060ff161561044557828452600e60205260ff8285205460081c166104305750818352600e6020528220805461ff0019166101001790557fdee93a1edc83a961c8568e6abd0ea56cc40d3486eb57405439ab5a6171e4747b8280a280f35b826024925191633fc7dd9560e01b8352820152fd5b826024925191638bb4324760e01b8352820152fd5b5090346102db5760e03660031901126102db57610475611aa4565b61047d611abf565b6001600160a01b0360843581811695919360643593918790036105ff5784906104a4611eb1565b169182885261051d602094600c86526104c2604435898c2054611ea4565b858b52600c8752888b20556104d981600b54611ea4565b600b55825460036104ff6104f984836104f186611bc9565b500154611ea4565b92611bc9565b500155848a52600d8652878a20925492838b528652878a2054611ea4565b90838952600d85528689209089528452858820558561053a578680f35b600f93868852600e8452858820805460ff8116156105b9575b50508688526010845285882091168752825283862061057560a4358254611ea4565b90558486526010825283862060018752825283862061059760c4358254611ea4565b9055855252822080546001600160a01b03191690911790553880808080808680f35b6101019061ffff1916179055867f372b63854d71f2006d3c3d77a7cf47d5c1fa75785576bc437cc4d49185354b9a87600954600a54825191825288820152a23880610553565b8780fd5b5091903461031a5760609260606003193601126102db5767ffffffffffffffff81358181116107d6576106399036908401611b28565b9290916024358181116107d2576106539036908401611b28565b9390916044359081116105ff5761066d9036908501611b28565b959093610678611eb1565b610680611d92565b6107c4578582148015906107ba575b6107ac5750875b8181106106a1578880f35b8789826106af818a89611e73565b358d6106bc838d8c611e73565b35908551926106ca84611b8b565b600191828552876020978887019285845282880194855287019586528b8d600160a01b60019003998a926106fd92611e73565b61070690611e90565b168152600e8952209451151561072890869060ff801983541691151516179055565b51151584549060081b61ff00169061ff0019161784555190830155519060020155610754848688611e73565b61075d90611e90565b610768858b8a611e73565b3592610775868d8c611e73565b3590855194855284015216917f372b63854d71f2006d3c3d77a7cf47d5c1fa75785576bc437cc4d49185354b9a91a2600101610696565b8751630bf0197f60e31b8152fd5b508682141561068f565b87516305e5234560e21b8152fd5b8680fd5b8480fd5b5082903461031a576107eb36611ad5565b9491926107f6611f2b565b6107fe611d92565b6108c55760ff61080d85611bc9565b505416156108ae5760ff61082085611bc9565b505460081c16600381101561089b5761088457508293948160016108647fe59bb95a5ed919ae17924d73dac63cdfb284a9e74556fe42799109122c26baff96611bc9565b50015580600261087387611bc9565b50015582519182526020820152a280f35b82516319404b3560e21b8152908101849052602490fd5b634e487b7160e01b865260218252602486fd5b82516356cc720160e01b8152908101849052602490fd5b82516305e5234560e21b8152fd5b50503461031a578160031936011261031a576020906006549051908152f35b5090346102db57806003193601126102db5761092c91356109276001610916611abf565b938387528660205286200154611f65565b612009565b5080f35b5090346102db5761094036611aef565b91909261094b611f2b565b610953611d92565b610a195760ff61096285611bc9565b50541615610a045760ff61097585611bc9565b505460081c16600381101561089b576002146109ef5782600361099786611bc9565b500154116109da5791602091817f21f832484b0a70433e1503130c26a907da5dfa3c0fc8f8e75bd0e12966246e3f946109cf87611bc9565b50015551908152a280f35b8360249251916307853b0d60e01b8352820152fd5b836024925191630256864760e11b8352820152fd5b8360249251916356cc720160e01b8352820152fd5b90516305e5234560e21b8152fd5b5090346102db5760209182600319360112610be257803567ffffffffffffffff81116107d657610a5a9036908301611b28565b939092600194600260015414610bd25760026001558015610bc257338752600e835260ff828820541615610bac57338752600e835260ff8288205460081c1615610b9657865b818110610aaf57876001805580f35b610ac2610abd828489611e73565b611e90565b3389526010808652848a206001600160a01b03909216808b52918652848a205490898215610b8c5750338b528652848a20828b52865289858120558873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8314600014610b7957508980808084335af1610b2d611e33565b5015610b6957908892915b85519081527fc44a96d7c09248efe1aa8b5d81502c98edd45ef58d5f7c5036955e58d25c5d7e873392a35b01610aa0565b845163ba83c1af60e01b81528790fd5b929190610b8781338461207e565b610b38565b9392505050610b63565b81516303dd186b60e11b81523381860152602490fd5b8151638bb4324760e01b81523381860152602490fd5b8151636be30f0360e01b81528490fd5b8151633ee5aeb560e01b81528490fd5b8380fd5b5091903461031a57602036600319011261031a57823590610c05611eb1565b610c0d611c1a565b15610d1a5760ff610c1d83611bc9565b50541615610d055760ff610c3083611bc9565b505460081c166003811015610cf257610cdd575082549260ff610c5285611bc9565b505460081c16936003851015610cca57600183949514610cad575b50610c7782611bc9565b50805461ff001916610100179055557ff5d5acf597a5f9d06a24389ebea67f576c74da4d4a73b97a5dfac2452acad6478280a280f35b610cb690611bc9565b50805461ff00191661020017905538610c6d565b634e487b7160e01b845260218252602484fd5b516319404b3560e21b81529283015250602490fd5b634e487b7160e01b845260218552602484fd5b516356cc720160e01b81529283015250602490fd5b516305e5234560e21b81528390fd5b5090346102db5760203660031901126102db57610d44611aa4565b610d4c611f2b565b6001600160a01b0316808452600e6020528184205490929060ff161561044557828452600e60205260ff8285205460081c1615610dbe5750818352600e6020528220805461ff00191690557fc04b676c7814734db85196b059bccd1616ebcbcce673a0cbd07e9cbde3136ddd8280a280f35b8260249251916303dd186b60e11b8352820152fd5b50503461031a57602036600319011261031a576020916001600160a01b03610df9611aa4565b168152600c83528181205460055480821015610e2157610e199250611d6f565b905b51908152f35b505090610e1b565b5091903461031a578060031936011261031a5767ffffffffffffffff928035848111610be257610e5c9036908301611b28565b9190946024359081116107d657610e769036908301611b28565b91610e7f611eb1565b828403610f305750845b838110610e94578580f35b80857f76bab131533fa0cb4af0c278542b93d4bb1cd3705e6dc02f9c85cd7ad3bc2da888610f10610abd858a8e610f0b610ed9610ed460019c8f8f611e73565b611e83565b8b8060a01b03998a610eef610abd888888611e73565b16895260209860088a52209060ff801983541691151516179055565b611e73565b92610f1f610ed4868a8a611e73565b938a5194151585521692a201610e89565b8451630bf0197f60e31b8152fd5b50503461031a578060031936011261031a5780602092610f5c611aa4565b6001600160a01b0380610f6d611abf565b1683526010865283832091168252845220549051908152f35b50346102db57826003193601126102db5760209250549051908152f35b50503461031a578160031936011261031a5760207f997d0c369c0eddd4cd02edbdc0fba7541f175bd55d30f7a94119ebca571a180691610fe1611f2b565b47908480808085335af150610ff4611e33565b5051908152a180f35b50503461031a578160031936011261031a5751908152602090f35b50503461031a578160031936011261031a576020906003549051908152f35b50503461031a578160031936011261031a57602090600b549051908152f35b50346102db57816003193601126102db578160209360ff92611076611abf565b903582528186528282206001600160a01b039091168252855220549151911615158152f35b509134611185576020366003190112611185578060a083516110bc81611b59565b828152826020820152828582015282606082015282608082015201526110e28335611bc9565b508251926110ef84611b59565b60ff82548181161515865260081c166020850193600382101561117257509060c0959184526001830154818601908152611159600285015493606088019485526003860154956080890196875201549560a088019687528351975115158852516020880190611b05565b51908501525160608401525160808301525160a0820152f35b634e487b7160e01b815260218752602490fd5b80fd5b82843461118557602036600319011261118557506111ac6111a7611aa4565b611daa565b82519182526020820152f35b50346102db5760203660031901126102db578035916111d5611eb1565b60ff6111e084611bc9565b505416156112715760ff6111f384611bc9565b505460081c16600381101561125e5760010361124957505061121481611bc9565b50805461ff0019166102001790557fe9f7d7fd0b133404f0ccff737d6f3594748e04bc5507adfaed35835ef98937118280a280f35b916024925191630256864760e11b8352820152fd5b634e487b7160e01b855260218352602485fd5b9160249251916356cc720160e01b8352820152fd5b50503461031a578060031936011261031a577fa75ce34872c395a628c61aff7fee33ef71bed972e3a28c7f63fff0022f629aa9906112c2611aa4565b611305602435926112d1611f2b565b6112e584336001600160a01b03861661207e565b516001600160a01b03909216825260208201929092529081906040820190565b0390a180f35b50503461031a578160031936011261031a576020906007549051908152f35b50503461031a578160031936011261031a57602090611347611d92565b90519015158152f35b50503461031a57602036600319011261031a576020916001600160a01b03611376611aa4565b168152600c8352818120546007546008855260ff84842054166113a6575b80821015610e2157610e199250611d6f565b50600554611394565b50503461031a578060031936011261031a576020906113dd6113cf611aa4565b6113d7611abf565b90611c87565b90516001600160a01b039091168152f35b5090346102db5760203660031901126102db5781359161140c611f2b565b600654838111801561147b575b61144f57847f5674bc2234931579f7286b8fb07b7f97e343da15771e084a80c71293ebd8cc97602086868160075551908152a180f35b6005549251630d499ab760e11b8152918201938452602084015260408301919091529081906060010390fd5b506005548411611419565b5090346102db5760203660031901126102db578135916114a4611f2b565b670de0b6b3a764000080841061150b57506005548084116114f157847f1d050a6b52c8117e90396aa62306797e25f55f84df750b9aed8500371995147e602086868160065551908152a180f35b836044935192634909fb6f60e11b84528301526024820152fd5b836044935192637932cc9560e01b84528301526024820152fd5b50346102db57826003193601126102db5761153e611f2b565b611546611c1a565b15610a1957506002805460ff60a01b1916600160a11b179081905590517f23ad33ab6a13a00aa7d06cd167b2abd03dec86af3cf3cc91759dcd3ae841188791602091906102b690829060a01c60ff16611b05565b82843461118557806003193601126111855750600954600a5482519182526020820152f35b50503461031a578160031936011261031a5760025490516001600160a01b039091168152602090f35b50346102db5760203660031901126102db57359160028310156111855750610e19602092611c32565b50346102db57816003193601126102db5760209282916001600160a01b03611637611abf565b168252600d855282822090358252845220549051908152f35b5091903461031a578060031936011261031a5761166b611abf565b90336001600160a01b03831603611688575061092c919235612009565b5163334bd91960e11b81528390fd5b50503461031a578160031936011261031a576020906005549051908152f35b5090346102db57806003193601126102db5761092c91356116da6001610916611abf565b611f8b565b5091903461031a576116f036611aef565b936116f9611f2b565b611701611d92565b6108c5576103e880831161176657851161174f57507f199e9510de3e118432835b88b156199d411b959206e57aa31c0e5a85999eead692938160095580600a5582519182526020820152a180f35b8251634beb7f4760e11b8152908101859052602490fd5b509151634219e7d760e11b815291820152602490fd5b50503461031a57602036600319011261031a5760209160ff9082906001600160a01b036117a7611aa4565b1681526008855220541690519015158152f35b50346102db5760203660031901126102db57816020936001923581528085522001549051908152f35b50503461031a578160031936011261031a57602090611347611c1a565b5090346102db5760203660031901126102db5781359161181e611f2b565b69d3c21bcecceda10000008084116114f1575060065480841061150b57847f772ff6e3371c3a674ced69185fcffe1c41e3e910595f1f186268b6bf79cfb7f7602086868160055551908152a180f35b5091903461031a5761187e36611ad5565b9092611888611f2b565b611890611d92565b6119bc57805161189f81611b59565b600181526020810186815282820185815260608301878152608084019189835260a0850193878552600354680100000000000000008110156119a9578060016118eb9201600355611bc9565b9690966119975761190b90511515879060ff801983541691151516179055565b51600381101561198457855461ff00191660089190911b61ff001617855551600185015551600284015551600383015551960195909555935190815260208101919091526040810192909252907f527ad3db8f604c215553922f1f63e784584f9129564774aef6c410bee0eef647908060608101611305565b634e487b7160e01b8b5260218c5260248bfd5b634e487b7160e01b8c528b8d5260248cfd5b634e487b7160e01b8c5260418d5260248cfd5b516305e5234560e21b81528590fd5b50503461031a578060031936011261031a576119e5611aa4565b90602435918215158084036107d6577f76bab131533fa0cb4af0c278542b93d4bb1cd3705e6dc02f9c85cd7ad3bc2da892611a48602093611a24611eb1565b60018060a01b031695868852600885528288209060ff801983541691151516179055565b51908152a280f35b925050346102db5760203660031901126102db573563ffffffff60e01b81168091036102db5760209250637965db0b60e01b8114908115611a93575b5015158152f35b6301ffc9a760e01b14905038611a8c565b600435906001600160a01b0382168203611aba57565b600080fd5b602435906001600160a01b0382168203611aba57565b6060906003190112611aba57600435906024359060443590565b6040906003190112611aba576004359060243590565b906003821015611b125752565b634e487b7160e01b600052602160045260246000fd5b9181601f84011215611aba5782359167ffffffffffffffff8311611aba576020808501948460051b010111611aba57565b60c0810190811067ffffffffffffffff821117611b7557604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117611b7557604052565b90601f8019910116810190811067ffffffffffffffff821117611b7557604052565b600354811015611c04576005906003600052027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b634e487b7160e01b600052603260045260246000fd5b60ff60025460a01c166003811015611b125760011490565b6004549060ff611c4183611bc9565b505460081c166003811015611b1257600114611c5e575050600090565b6002811015611b1257611c7c57611c76600191611bc9565b50015490565b611c76600291611bc9565b9060018060a01b03809216600092818452602090600f82526040928184872054168652600e8352838620845190611cbd82611b8b565b8054916060600260ff80861615159586855260081c16151593848985015260018101548a850152015491015281611d67575b50611d56575083168452600e8152818420918051611d0c81611b8b565b6060600285549560ff8716159460ff86159889875260081c1615158097860152600182015490850152015491015291611d4e575b50611d49575090565b905090565b905038611d40565b85600f939296949550525220541690565b905038611cef565b91908203918211611d7c57565b634e487b7160e01b600052601160045260246000fd5b60ff60025460a01c166003811015611b125760021490565b9060609160018060a01b0316600052600e6020526040600020604051611dcf81611b8b565b81549060ff80831615159283835260081c1615156020820152600260018401549384604084015201549485910152611e0e5750905060095490600a5490565b60095480821115611e2b5750915b600a5480821115611d49575090565b905091611e1c565b3d15611e6e573d9067ffffffffffffffff8211611b755760405191611e62601f8201601f191660200184611ba7565b82523d6000602084013e565b606090565b9190811015611c045760051b0190565b358015158103611aba5790565b356001600160a01b0381168103611aba5790565b91908201809211611d7c57565b3360009081527fee57cd81e84075558e8fcc182a1f4393f91fc97f963a136e66b7f949a62f319f60205260409020547f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9299060ff1615611f0d5750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b3360009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604081205460ff1615611f0d5750565b80600052600060205260406000203360005260205260ff6040600020541615611f0d5750565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054161560001461200457808352826020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054166000146120045780835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b60405163a9059cbb60e01b602082019081526001600160a01b039390931660248201526044808201949094529283526120e0906120bc606485611ba7565b60018060a01b031692600080938192519082875af16120d9611e33565b9084612138565b908151918215159283612110575b5050506120f85750565b60249060405190635274afe760e01b82526004820152fd5b81929350906020918101031261031a57602001519081159182150361118557503880806120ee565b9061215f575080511561214d57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612192575b612170575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561216856fea26469706673582212209a5164f1029a5794620803b9333b6d16fed5eae186f8af953051677d096e128c64736f6c634300081800332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d000000000000000000000000ce30537a0e81795a4142110b46060eb05c987c70
Deployed Bytecode
0x60806040818152600480361015610021575b505050361561001f57600080fd5b005b600092833560e01c90816301ffc9a714611a50575080630b44a218146119cb5780630b6539a21461186d5780631fe9eabc1461180057806322f3e2d4146117e3578063248a9ca3146117ba5780632520e7ff1461177c57806328cf0786146116df5780632f2ff15d146116b65780633075f5521461169757806336568abe146116505780633656eec21461161157806337f1e7f2146115e85780633b19e84a146115bf5780633f9114ed1461159a57806343d726d61461152557806345dc3dd814611486578063470919ff146113ee5780634bba38b8146113af578063546a2ca4146113505780635e829a021461132a57806370f5b38e1461130b578063738a8ce61461128657806388e01a98146111b85780638f11740b146111885780638f1327c01461109b57806391d14854146110565780639d7b8e6814611037578063a09686c414611018578063a217fddf14610ffd578063a23b892714610fa3578063a32bf59714610f86578063a35e0ac114610f3e578063a7c717c314610e29578063ac76453c14610dd3578063bcf92ee414610d29578063bde22ae014610be6578063be41f5ae14610a27578063c626341a14610930578063d547741f146108f2578063d6362e97146108d3578063d63ac077146107da578063e122434914610603578063e8feeaa91461045a578063ef39c4ba14610398578063f0f442601461031e578063f5b541a6146102df5763fcfff16f0361001157346102db57826003193601126102db57610252611f2b565b6002549060ff8260a01c1660038110156102c8576102ba575060ff60a01b1916600160a01b17600281905590517f23ad33ab6a13a00aa7d06cd167b2abd03dec86af3cf3cc91759dcd3ae841188791602091906102b690829060a01c60ff16611b05565ba180f35b82516301eae73160e61b8152fd5b634e487b7160e01b855260218252602485fd5b8280fd5b50503461031a578160031936011261031a57602090517f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9298152f35b5080fd5b50346102db5760203660031901126102db57610338611aa4565b610340611f2b565b6001600160a01b031691821561038b575050600280546001600160a01b031916821790557f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d18280a280f35b51633eaa20b360e01b8152fd5b5090346102db5760203660031901126102db576103b3611aa4565b6103bb611f2b565b6001600160a01b0316808452600e6020528184205490929060ff161561044557828452600e60205260ff8285205460081c166104305750818352600e6020528220805461ff0019166101001790557fdee93a1edc83a961c8568e6abd0ea56cc40d3486eb57405439ab5a6171e4747b8280a280f35b826024925191633fc7dd9560e01b8352820152fd5b826024925191638bb4324760e01b8352820152fd5b5090346102db5760e03660031901126102db57610475611aa4565b61047d611abf565b6001600160a01b0360843581811695919360643593918790036105ff5784906104a4611eb1565b169182885261051d602094600c86526104c2604435898c2054611ea4565b858b52600c8752888b20556104d981600b54611ea4565b600b55825460036104ff6104f984836104f186611bc9565b500154611ea4565b92611bc9565b500155848a52600d8652878a20925492838b528652878a2054611ea4565b90838952600d85528689209089528452858820558561053a578680f35b600f93868852600e8452858820805460ff8116156105b9575b50508688526010845285882091168752825283862061057560a4358254611ea4565b90558486526010825283862060018752825283862061059760c4358254611ea4565b9055855252822080546001600160a01b03191690911790553880808080808680f35b6101019061ffff1916179055867f372b63854d71f2006d3c3d77a7cf47d5c1fa75785576bc437cc4d49185354b9a87600954600a54825191825288820152a23880610553565b8780fd5b5091903461031a5760609260606003193601126102db5767ffffffffffffffff81358181116107d6576106399036908401611b28565b9290916024358181116107d2576106539036908401611b28565b9390916044359081116105ff5761066d9036908501611b28565b959093610678611eb1565b610680611d92565b6107c4578582148015906107ba575b6107ac5750875b8181106106a1578880f35b8789826106af818a89611e73565b358d6106bc838d8c611e73565b35908551926106ca84611b8b565b600191828552876020978887019285845282880194855287019586528b8d600160a01b60019003998a926106fd92611e73565b61070690611e90565b168152600e8952209451151561072890869060ff801983541691151516179055565b51151584549060081b61ff00169061ff0019161784555190830155519060020155610754848688611e73565b61075d90611e90565b610768858b8a611e73565b3592610775868d8c611e73565b3590855194855284015216917f372b63854d71f2006d3c3d77a7cf47d5c1fa75785576bc437cc4d49185354b9a91a2600101610696565b8751630bf0197f60e31b8152fd5b508682141561068f565b87516305e5234560e21b8152fd5b8680fd5b8480fd5b5082903461031a576107eb36611ad5565b9491926107f6611f2b565b6107fe611d92565b6108c55760ff61080d85611bc9565b505416156108ae5760ff61082085611bc9565b505460081c16600381101561089b5761088457508293948160016108647fe59bb95a5ed919ae17924d73dac63cdfb284a9e74556fe42799109122c26baff96611bc9565b50015580600261087387611bc9565b50015582519182526020820152a280f35b82516319404b3560e21b8152908101849052602490fd5b634e487b7160e01b865260218252602486fd5b82516356cc720160e01b8152908101849052602490fd5b82516305e5234560e21b8152fd5b50503461031a578160031936011261031a576020906006549051908152f35b5090346102db57806003193601126102db5761092c91356109276001610916611abf565b938387528660205286200154611f65565b612009565b5080f35b5090346102db5761094036611aef565b91909261094b611f2b565b610953611d92565b610a195760ff61096285611bc9565b50541615610a045760ff61097585611bc9565b505460081c16600381101561089b576002146109ef5782600361099786611bc9565b500154116109da5791602091817f21f832484b0a70433e1503130c26a907da5dfa3c0fc8f8e75bd0e12966246e3f946109cf87611bc9565b50015551908152a280f35b8360249251916307853b0d60e01b8352820152fd5b836024925191630256864760e11b8352820152fd5b8360249251916356cc720160e01b8352820152fd5b90516305e5234560e21b8152fd5b5090346102db5760209182600319360112610be257803567ffffffffffffffff81116107d657610a5a9036908301611b28565b939092600194600260015414610bd25760026001558015610bc257338752600e835260ff828820541615610bac57338752600e835260ff8288205460081c1615610b9657865b818110610aaf57876001805580f35b610ac2610abd828489611e73565b611e90565b3389526010808652848a206001600160a01b03909216808b52918652848a205490898215610b8c5750338b528652848a20828b52865289858120558873eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee8314600014610b7957508980808084335af1610b2d611e33565b5015610b6957908892915b85519081527fc44a96d7c09248efe1aa8b5d81502c98edd45ef58d5f7c5036955e58d25c5d7e873392a35b01610aa0565b845163ba83c1af60e01b81528790fd5b929190610b8781338461207e565b610b38565b9392505050610b63565b81516303dd186b60e11b81523381860152602490fd5b8151638bb4324760e01b81523381860152602490fd5b8151636be30f0360e01b81528490fd5b8151633ee5aeb560e01b81528490fd5b8380fd5b5091903461031a57602036600319011261031a57823590610c05611eb1565b610c0d611c1a565b15610d1a5760ff610c1d83611bc9565b50541615610d055760ff610c3083611bc9565b505460081c166003811015610cf257610cdd575082549260ff610c5285611bc9565b505460081c16936003851015610cca57600183949514610cad575b50610c7782611bc9565b50805461ff001916610100179055557ff5d5acf597a5f9d06a24389ebea67f576c74da4d4a73b97a5dfac2452acad6478280a280f35b610cb690611bc9565b50805461ff00191661020017905538610c6d565b634e487b7160e01b845260218252602484fd5b516319404b3560e21b81529283015250602490fd5b634e487b7160e01b845260218552602484fd5b516356cc720160e01b81529283015250602490fd5b516305e5234560e21b81528390fd5b5090346102db5760203660031901126102db57610d44611aa4565b610d4c611f2b565b6001600160a01b0316808452600e6020528184205490929060ff161561044557828452600e60205260ff8285205460081c1615610dbe5750818352600e6020528220805461ff00191690557fc04b676c7814734db85196b059bccd1616ebcbcce673a0cbd07e9cbde3136ddd8280a280f35b8260249251916303dd186b60e11b8352820152fd5b50503461031a57602036600319011261031a576020916001600160a01b03610df9611aa4565b168152600c83528181205460055480821015610e2157610e199250611d6f565b905b51908152f35b505090610e1b565b5091903461031a578060031936011261031a5767ffffffffffffffff928035848111610be257610e5c9036908301611b28565b9190946024359081116107d657610e769036908301611b28565b91610e7f611eb1565b828403610f305750845b838110610e94578580f35b80857f76bab131533fa0cb4af0c278542b93d4bb1cd3705e6dc02f9c85cd7ad3bc2da888610f10610abd858a8e610f0b610ed9610ed460019c8f8f611e73565b611e83565b8b8060a01b03998a610eef610abd888888611e73565b16895260209860088a52209060ff801983541691151516179055565b611e73565b92610f1f610ed4868a8a611e73565b938a5194151585521692a201610e89565b8451630bf0197f60e31b8152fd5b50503461031a578060031936011261031a5780602092610f5c611aa4565b6001600160a01b0380610f6d611abf565b1683526010865283832091168252845220549051908152f35b50346102db57826003193601126102db5760209250549051908152f35b50503461031a578160031936011261031a5760207f997d0c369c0eddd4cd02edbdc0fba7541f175bd55d30f7a94119ebca571a180691610fe1611f2b565b47908480808085335af150610ff4611e33565b5051908152a180f35b50503461031a578160031936011261031a5751908152602090f35b50503461031a578160031936011261031a576020906003549051908152f35b50503461031a578160031936011261031a57602090600b549051908152f35b50346102db57816003193601126102db578160209360ff92611076611abf565b903582528186528282206001600160a01b039091168252855220549151911615158152f35b509134611185576020366003190112611185578060a083516110bc81611b59565b828152826020820152828582015282606082015282608082015201526110e28335611bc9565b508251926110ef84611b59565b60ff82548181161515865260081c166020850193600382101561117257509060c0959184526001830154818601908152611159600285015493606088019485526003860154956080890196875201549560a088019687528351975115158852516020880190611b05565b51908501525160608401525160808301525160a0820152f35b634e487b7160e01b815260218752602490fd5b80fd5b82843461118557602036600319011261118557506111ac6111a7611aa4565b611daa565b82519182526020820152f35b50346102db5760203660031901126102db578035916111d5611eb1565b60ff6111e084611bc9565b505416156112715760ff6111f384611bc9565b505460081c16600381101561125e5760010361124957505061121481611bc9565b50805461ff0019166102001790557fe9f7d7fd0b133404f0ccff737d6f3594748e04bc5507adfaed35835ef98937118280a280f35b916024925191630256864760e11b8352820152fd5b634e487b7160e01b855260218352602485fd5b9160249251916356cc720160e01b8352820152fd5b50503461031a578060031936011261031a577fa75ce34872c395a628c61aff7fee33ef71bed972e3a28c7f63fff0022f629aa9906112c2611aa4565b611305602435926112d1611f2b565b6112e584336001600160a01b03861661207e565b516001600160a01b03909216825260208201929092529081906040820190565b0390a180f35b50503461031a578160031936011261031a576020906007549051908152f35b50503461031a578160031936011261031a57602090611347611d92565b90519015158152f35b50503461031a57602036600319011261031a576020916001600160a01b03611376611aa4565b168152600c8352818120546007546008855260ff84842054166113a6575b80821015610e2157610e199250611d6f565b50600554611394565b50503461031a578060031936011261031a576020906113dd6113cf611aa4565b6113d7611abf565b90611c87565b90516001600160a01b039091168152f35b5090346102db5760203660031901126102db5781359161140c611f2b565b600654838111801561147b575b61144f57847f5674bc2234931579f7286b8fb07b7f97e343da15771e084a80c71293ebd8cc97602086868160075551908152a180f35b6005549251630d499ab760e11b8152918201938452602084015260408301919091529081906060010390fd5b506005548411611419565b5090346102db5760203660031901126102db578135916114a4611f2b565b670de0b6b3a764000080841061150b57506005548084116114f157847f1d050a6b52c8117e90396aa62306797e25f55f84df750b9aed8500371995147e602086868160065551908152a180f35b836044935192634909fb6f60e11b84528301526024820152fd5b836044935192637932cc9560e01b84528301526024820152fd5b50346102db57826003193601126102db5761153e611f2b565b611546611c1a565b15610a1957506002805460ff60a01b1916600160a11b179081905590517f23ad33ab6a13a00aa7d06cd167b2abd03dec86af3cf3cc91759dcd3ae841188791602091906102b690829060a01c60ff16611b05565b82843461118557806003193601126111855750600954600a5482519182526020820152f35b50503461031a578160031936011261031a5760025490516001600160a01b039091168152602090f35b50346102db5760203660031901126102db57359160028310156111855750610e19602092611c32565b50346102db57816003193601126102db5760209282916001600160a01b03611637611abf565b168252600d855282822090358252845220549051908152f35b5091903461031a578060031936011261031a5761166b611abf565b90336001600160a01b03831603611688575061092c919235612009565b5163334bd91960e11b81528390fd5b50503461031a578160031936011261031a576020906005549051908152f35b5090346102db57806003193601126102db5761092c91356116da6001610916611abf565b611f8b565b5091903461031a576116f036611aef565b936116f9611f2b565b611701611d92565b6108c5576103e880831161176657851161174f57507f199e9510de3e118432835b88b156199d411b959206e57aa31c0e5a85999eead692938160095580600a5582519182526020820152a180f35b8251634beb7f4760e11b8152908101859052602490fd5b509151634219e7d760e11b815291820152602490fd5b50503461031a57602036600319011261031a5760209160ff9082906001600160a01b036117a7611aa4565b1681526008855220541690519015158152f35b50346102db5760203660031901126102db57816020936001923581528085522001549051908152f35b50503461031a578160031936011261031a57602090611347611c1a565b5090346102db5760203660031901126102db5781359161181e611f2b565b69d3c21bcecceda10000008084116114f1575060065480841061150b57847f772ff6e3371c3a674ced69185fcffe1c41e3e910595f1f186268b6bf79cfb7f7602086868160055551908152a180f35b5091903461031a5761187e36611ad5565b9092611888611f2b565b611890611d92565b6119bc57805161189f81611b59565b600181526020810186815282820185815260608301878152608084019189835260a0850193878552600354680100000000000000008110156119a9578060016118eb9201600355611bc9565b9690966119975761190b90511515879060ff801983541691151516179055565b51600381101561198457855461ff00191660089190911b61ff001617855551600185015551600284015551600383015551960195909555935190815260208101919091526040810192909252907f527ad3db8f604c215553922f1f63e784584f9129564774aef6c410bee0eef647908060608101611305565b634e487b7160e01b8b5260218c5260248bfd5b634e487b7160e01b8c528b8d5260248cfd5b634e487b7160e01b8c5260418d5260248cfd5b516305e5234560e21b81528590fd5b50503461031a578060031936011261031a576119e5611aa4565b90602435918215158084036107d6577f76bab131533fa0cb4af0c278542b93d4bb1cd3705e6dc02f9c85cd7ad3bc2da892611a48602093611a24611eb1565b60018060a01b031695868852600885528288209060ff801983541691151516179055565b51908152a280f35b925050346102db5760203660031901126102db573563ffffffff60e01b81168091036102db5760209250637965db0b60e01b8114908115611a93575b5015158152f35b6301ffc9a760e01b14905038611a8c565b600435906001600160a01b0382168203611aba57565b600080fd5b602435906001600160a01b0382168203611aba57565b6060906003190112611aba57600435906024359060443590565b6040906003190112611aba576004359060243590565b906003821015611b125752565b634e487b7160e01b600052602160045260246000fd5b9181601f84011215611aba5782359167ffffffffffffffff8311611aba576020808501948460051b010111611aba57565b60c0810190811067ffffffffffffffff821117611b7557604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117611b7557604052565b90601f8019910116810190811067ffffffffffffffff821117611b7557604052565b600354811015611c04576005906003600052027fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0190600090565b634e487b7160e01b600052603260045260246000fd5b60ff60025460a01c166003811015611b125760011490565b6004549060ff611c4183611bc9565b505460081c166003811015611b1257600114611c5e575050600090565b6002811015611b1257611c7c57611c76600191611bc9565b50015490565b611c76600291611bc9565b9060018060a01b03809216600092818452602090600f82526040928184872054168652600e8352838620845190611cbd82611b8b565b8054916060600260ff80861615159586855260081c16151593848985015260018101548a850152015491015281611d67575b50611d56575083168452600e8152818420918051611d0c81611b8b565b6060600285549560ff8716159460ff86159889875260081c1615158097860152600182015490850152015491015291611d4e575b50611d49575090565b905090565b905038611d40565b85600f939296949550525220541690565b905038611cef565b91908203918211611d7c57565b634e487b7160e01b600052601160045260246000fd5b60ff60025460a01c166003811015611b125760021490565b9060609160018060a01b0316600052600e6020526040600020604051611dcf81611b8b565b81549060ff80831615159283835260081c1615156020820152600260018401549384604084015201549485910152611e0e5750905060095490600a5490565b60095480821115611e2b5750915b600a5480821115611d49575090565b905091611e1c565b3d15611e6e573d9067ffffffffffffffff8211611b755760405191611e62601f8201601f191660200184611ba7565b82523d6000602084013e565b606090565b9190811015611c045760051b0190565b358015158103611aba5790565b356001600160a01b0381168103611aba5790565b91908201809211611d7c57565b3360009081527fee57cd81e84075558e8fcc182a1f4393f91fc97f963a136e66b7f949a62f319f60205260409020547f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b9299060ff1615611f0d5750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b3360009081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604081205460ff1615611f0d5750565b80600052600060205260406000203360005260205260ff6040600020541615611f0d5750565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054161560001461200457808352826020526040832082845260205260408320600160ff198254161790557f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a4600190565b505090565b9060009180835282602052604083209160018060a01b03169182845260205260ff6040842054166000146120045780835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4600190565b60405163a9059cbb60e01b602082019081526001600160a01b039390931660248201526044808201949094529283526120e0906120bc606485611ba7565b60018060a01b031692600080938192519082875af16120d9611e33565b9084612138565b908151918215159283612110575b5050506120f85750565b60249060405190635274afe760e01b82526004820152fd5b81929350906020918101031261031a57602001519081159182150361118557503880806120ee565b9061215f575080511561214d57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580612192575b612170575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561216856fea26469706673582212209a5164f1029a5794620803b9333b6d16fed5eae186f8af953051677d096e128c64736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ce30537a0e81795a4142110b46060eb05c987c70
-----Decoded View---------------
Arg [0] : treasury_ (address): 0xCE30537A0e81795A4142110B46060EB05c987C70
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ce30537a0e81795a4142110b46060eb05c987c70
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
BSC | 31.52% | $609.82 | 61.2488 | $37,350.63 | |
BSC | 22.11% | $0.999719 | 26,209.7262 | $26,202.36 | |
BSC | 0.96% | $1 | 1,139.5082 | $1,139.52 | |
ETH | Ether (ETH) | 28.18% | $3,309.06 | 10.0926 | $33,397.1 |
ETH | 5.54% | $0.999924 | 6,570.2832 | $6,569.78 | |
ETH | 1.20% | $0.99981 | 1,422.4875 | $1,422.22 | |
POL | 5.38% | $0.518345 | 12,304.7221 | $6,378.09 | |
POL | 1.50% | $0.999871 | 1,777.131 | $1,776.9 | |
POL | 1.02% | $1 | 1,203.3365 | $1,203.34 | |
POL | 0.60% | $1 | 709.178 | $709.18 | |
AVAX | 1.69% | $42.28 | 47.3881 | $2,003.67 | |
AVAX | 0.26% | $0.999545 | 303.839 | $303.7 | |
AVAX | 0.05% | $1 | 55.3965 | $55.4 |
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.