More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 92 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Fund | 20605165 | 43 hrs ago | IN | 0 ETH | 0.0000898 | ||||
Claim Fund | 20544195 | 10 days ago | IN | 0 ETH | 0.00012486 | ||||
Claim Fund | 20414114 | 28 days ago | IN | 0 ETH | 0.00041771 | ||||
Claim All | 20409699 | 29 days ago | IN | 0 ETH | 0.00040946 | ||||
Claim Fund | 20398449 | 30 days ago | IN | 0 ETH | 0.00052122 | ||||
Claim Fund | 20397598 | 30 days ago | IN | 0 ETH | 0.00030702 | ||||
Claim All | 20397232 | 30 days ago | IN | 0 ETH | 0.00061841 | ||||
Claim Fund | 20396380 | 30 days ago | IN | 0 ETH | 0.00025946 | ||||
Claim Fund | 20374644 | 33 days ago | IN | 0 ETH | 0.00041053 | ||||
Claim All | 20365193 | 35 days ago | IN | 0 ETH | 0.00133134 | ||||
Claim Fund | 20247520 | 51 days ago | IN | 0 ETH | 0.00026822 | ||||
Claim Fund | 20200269 | 58 days ago | IN | 0 ETH | 0.0003595 | ||||
Claim Fund | 20199289 | 58 days ago | IN | 0 ETH | 0.00042361 | ||||
Claim Fund | 20193829 | 59 days ago | IN | 0 ETH | 0.00026262 | ||||
Claim Fund | 20191452 | 59 days ago | IN | 0 ETH | 0.0007198 | ||||
Claim Fund | 20188399 | 59 days ago | IN | 0 ETH | 0.00036107 | ||||
Claim Fund | 20183703 | 60 days ago | IN | 0 ETH | 0.0017214 | ||||
Claim All | 20182582 | 60 days ago | IN | 0 ETH | 0.00175834 | ||||
Claim Fund | 20182390 | 60 days ago | IN | 0 ETH | 0.00053614 | ||||
Claim Fund | 20182366 | 60 days ago | IN | 0 ETH | 0.00052729 | ||||
Claim All | 20152571 | 64 days ago | IN | 0 ETH | 0.00076718 | ||||
Claim Fund | 20146799 | 65 days ago | IN | 0 ETH | 0.0002833 | ||||
Claim Fund | 20093041 | 73 days ago | IN | 0 ETH | 0.00063527 | ||||
Claim Fund | 20089775 | 73 days ago | IN | 0 ETH | 0.00091154 | ||||
Claim Fund | 20089771 | 73 days ago | IN | 0 ETH | 0.00105241 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Vesting
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./IBEP20.sol"; contract Vesting is AccessControl, ReentrancyGuard { using SafeMath for uint256; bytes32 public constant TREASURY_ROLE = keccak256("TREASURY_ROLE"); uint256 public projectIndex; uint256 public poolIndex; mapping(uint256 => Pool) public pools; mapping(uint256 => Project) public projects; event CreatePoolEvent(uint256 poolId); event CreateProjectEvent(uint256 project, string name, address tokenFund); event AddFundEvent(uint256 poolId, address user, uint256 fundAmount); event RemoveFundEvent(uint256 poolId, address user); event ClaimFundEvent( uint256 poolId, address user, uint256 fundClaimed, address contractAddress ); event DepositFundEvent( address contractAddress, address user, uint256 fundAmount ); event WithdrawFundEvent( address contractAddress, address user, uint256 fundAmount ); uint8 private constant VESTING_TYPE_MILESTONE_UNLOCK_FIRST = 1; uint8 private constant VESTING_TYPE_MILESTONE_CLIFF_FIRST = 2; uint8 private constant VESTING_TYPE_LINEAR_UNLOCK_FIRST = 3; uint8 private constant VESTING_TYPE_LINEAR_CLIFF_FIRST = 4; uint256 private constant ONE_HUNDRED_PERCENT_SCALED = 10000; uint256 private constant ONE_HUNDRED_YEARS_IN_S = 3153600000; enum PoolState { NEW, STARTING, PAUSE, SUCCESS } struct Project { uint256 id; IBEP20 tokenFund; string name; uint256[] poolIds; } struct Pool { IBEP20 tokenFund; uint256 id; Project project; string name; uint8 vestingType; uint256 tge; uint256 cliff; uint256 unlockPercent; uint256 linearVestingDuration; uint256[] milestoneTimes; uint256[] milestonePercents; mapping(address => uint256) funds; mapping(address => uint256) released; uint256 fundsTotal; uint256 fundsClaimed; PoolState state; } constructor(address admin, address treasury) { _setupRole(DEFAULT_ADMIN_ROLE, admin); _setupRole(TREASURY_ROLE, treasury); _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); poolIndex = 200; projectIndex = 1; } modifier onlyAdmin() { require( hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "Restricted to admins!" ); _; } modifier onlyTreasury() { require(hasRole(TREASURY_ROLE, msg.sender), "Restricted to treasury!"); _; } function createProject( address _tokenFund, string memory _name ) external nonReentrant onlyAdmin { uint256 index = projectIndex++; Project storage project = projects[index]; project.id = index; project.name = _name; project.tokenFund = IBEP20(_tokenFund); emit CreateProjectEvent(index, _name, _tokenFund); } function createPool( address _tokenFund, string memory _name, uint256 _projectId, uint8 _vestingType, uint256 _tge, uint256 _cliff, uint256 _unlockPercent, uint256 _linearVestingDuration, uint256[] memory _milestoneTimes, uint256[] memory _milestonePercents ) external nonReentrant onlyAdmin { _validateSetup( _vestingType, _unlockPercent, _tge, _cliff, _linearVestingDuration, _milestoneTimes, _milestonePercents ); require( _projectId > 0 && _projectId <= projectIndex, "Invalid project id" ); Project storage project = projects[_projectId]; require(address(project.tokenFund) == _tokenFund, "Invalid tokenFund"); uint256 index = poolIndex++; Pool storage pool = pools[index]; pool.id = index; pool.tokenFund = IBEP20(_tokenFund); pool.name = _name; pool.vestingType = _vestingType; pool.tge = _tge; pool.cliff = _cliff; pool.unlockPercent = _unlockPercent; pool.linearVestingDuration = _linearVestingDuration; pool.milestoneTimes = _milestoneTimes; pool.milestonePercents = _milestonePercents; pool.fundsTotal = 0; pool.fundsClaimed = 0; pool.state = PoolState.NEW; project.poolIds.push(pool.id); pool.project = project; emit CreatePoolEvent(index); } function start(uint256 _poolId) external nonReentrant onlyAdmin { Pool storage pool = pools[_poolId]; require( pool.state == PoolState.NEW || pool.state == PoolState.PAUSE, "Invalid action" ); pool.state = PoolState.STARTING; } function pause(uint256 _poolId) external nonReentrant onlyAdmin { Pool storage pool = pools[_poolId]; require(pool.state != PoolState.PAUSE, "Invalid action"); pool.state = PoolState.PAUSE; } function end(uint256 _poolId) external nonReentrant onlyAdmin { Pool storage pool = pools[_poolId]; require(pool.state == PoolState.STARTING, "Invalid action"); pool.state = PoolState.SUCCESS; } function addFunds( uint256 _poolId, uint256[] memory _fundAmounts, address[] memory _users ) external nonReentrant onlyAdmin { require( _users.length == _fundAmounts.length, "Input arrays length mismatch" ); Pool storage pool = pools[_poolId]; for (uint256 i = 0; i < _users.length; i++) { address user = _users[i]; uint256 fundAmount = _fundAmounts[i]; uint256 oldFund = pool.funds[user]; if (oldFund > 0) { pool.fundsTotal = pool.fundsTotal.add(fundAmount); pool.funds[user] = pool.funds[user].add(fundAmount); } else { pool.fundsTotal = pool.fundsTotal.add(fundAmount); pool.funds[user] = pool.funds[user].add(fundAmount); pool.released[user] = 0; } emit AddFundEvent(_poolId, user, fundAmount); } } function removeFunds( uint256 _poolId, address[] memory _users ) external nonReentrant onlyAdmin { Pool storage pool = pools[_poolId]; for (uint256 i = 0; i < _users.length; i++) { address user = _users[i]; uint256 oldFund = pool.funds[user]; if (oldFund > 0) { pool.funds[user] = 0; pool.released[user] = 0; pool.fundsTotal = pool.fundsTotal.sub(oldFund); emit RemoveFundEvent(_poolId, user); } } } function claimFund(uint256 _poolId) external nonReentrant { _validateClaimFund(_poolId); _claim(_poolId); } function claimAll(uint256 _projectId) external nonReentrant { require( _projectId > 0 && _projectId <= projectIndex, "Invalid project id" ); //get pools user joined in project for (uint256 i = 0; i < projects[_projectId].poolIds.length; i++) { uint256 poolId = projects[_projectId].poolIds[i]; //validate if(checkClaimablePool(poolId, _msgSender())){ _claim(poolId); } } } function _claim(uint256 _poolId) internal { Pool storage pool = pools[_poolId]; uint256 _now = block.timestamp; require(_now >= pool.tge, "Invalid Time"); uint256 claimPercent = computeClaimPercent(_poolId, _now); require(claimPercent > 0, "Not enough unlock token to claim"); uint256 claimTotal = (pool.funds[_msgSender()].mul(claimPercent)).div( ONE_HUNDRED_PERCENT_SCALED ); require(claimTotal > pool.released[_msgSender()], "Not enough unlock token to claim"); uint256 claimRemain = claimTotal.sub(pool.released[_msgSender()]); pool.tokenFund.transfer(_msgSender(), claimRemain); pool.released[_msgSender()] = pool.released[_msgSender()].add( claimRemain ); pool.fundsClaimed = pool.fundsClaimed.add(claimRemain); emit ClaimFundEvent(_poolId, _msgSender(), claimRemain, address(this)); } function depositFund( uint256 _poolId, uint256 _fundAmount ) external nonReentrant onlyTreasury { require(_fundAmount > 0, "Amount must be greater than zero"); Pool storage pool = pools[_poolId]; require( pool.tokenFund.balanceOf(_msgSender()) >= _fundAmount, "Error: not enough Token" ); pool.tokenFund.transferFrom(_msgSender(), address(this), _fundAmount); emit DepositFundEvent(address(this), _msgSender(), _fundAmount); } function withdrawFund( uint256 _poolId, uint256 _fundAmount ) external nonReentrant onlyTreasury { require(_fundAmount > 0, "Amount must be greater than zero"); Pool storage pool = pools[_poolId]; require( pool.tokenFund.balanceOf(address(this)) >= _fundAmount, "Fund insufficient!" ); pool.tokenFund.transfer(_msgSender(), _fundAmount); emit WithdrawFundEvent(address(this), _msgSender(), _fundAmount); } function computeClaimPercent( uint256 _poolId, uint256 _now ) public view returns (uint256) { Pool storage pool = pools[_poolId]; uint256[] memory milestoneTimes = pool.milestoneTimes; uint256[] memory milestonePercents = pool.milestonePercents; uint256 totalPercent = 0; uint256 tge = pool.tge; if (pool.vestingType == VESTING_TYPE_MILESTONE_CLIFF_FIRST) { if (_now >= tge.add(pool.cliff)) { totalPercent = totalPercent.add(pool.unlockPercent); for (uint i = 0; i < milestoneTimes.length; i++) { uint256 milestoneTime = milestoneTimes[i]; uint256 milestonePercent = milestonePercents[i]; if (_now >= milestoneTime) { totalPercent = totalPercent.add(milestonePercent); } } } } else if (pool.vestingType == VESTING_TYPE_MILESTONE_UNLOCK_FIRST) { if (_now >= tge) { totalPercent = totalPercent.add(pool.unlockPercent); if (_now >= tge.add(pool.cliff)) { for (uint i = 0; i < milestoneTimes.length; i++) { uint256 milestoneTime = milestoneTimes[i]; uint256 milestonePercent = milestonePercents[i]; if (_now >= milestoneTime) { totalPercent = totalPercent.add(milestonePercent); } } } } } else if (pool.vestingType == VESTING_TYPE_LINEAR_UNLOCK_FIRST) { if (_now >= tge) { totalPercent = totalPercent.add(pool.unlockPercent); if (_now >= tge.add(pool.cliff)) { uint256 delta = _now.sub(tge).sub(pool.cliff); totalPercent = totalPercent.add( delta .mul( ONE_HUNDRED_PERCENT_SCALED.sub( pool.unlockPercent ) ) .div(pool.linearVestingDuration) ); } } } else if (pool.vestingType == VESTING_TYPE_LINEAR_CLIFF_FIRST) { if (_now >= tge.add(pool.cliff)) { totalPercent = totalPercent.add(pool.unlockPercent); uint256 delta = _now.sub(tge).sub(pool.cliff); totalPercent = totalPercent.add( delta .mul(ONE_HUNDRED_PERCENT_SCALED.sub(pool.unlockPercent)) .div(pool.linearVestingDuration) ); } } return (totalPercent < ONE_HUNDRED_PERCENT_SCALED) ? totalPercent : ONE_HUNDRED_PERCENT_SCALED; } function getFundByUser( uint256 _poolId, address _user ) public view returns (uint256, uint256) { return (pools[_poolId].funds[_user], pools[_poolId].released[_user]); } function getInfoUserReward( uint256 _poolId ) public view returns (uint256, uint256) { Pool storage pool = pools[_poolId]; uint256 tokenTotal = pool.fundsTotal; uint256 claimedTotal = pool.fundsClaimed; return (tokenTotal, claimedTotal); } function checkClaimablePool(uint256 _poolId, address _user) public view returns (bool) { Pool storage pool = pools[_poolId]; if (pool.state != PoolState.STARTING) return false; uint256 _now = block.timestamp; if (_now < pool.tge) return false; if (pool.funds[_user] <= 0) return false; if (pool.funds[_user] <= pool.released[_user]) return false; uint256 claimPercent = computeClaimPercent(_poolId, _now); if (claimPercent <= 0) return false; uint256 claimTotal = (pool.funds[_user].mul(claimPercent)).div( ONE_HUNDRED_PERCENT_SCALED ); if (claimTotal <= pool.released[_user]) return false; return true; } function checkClaimableProject(uint256 _projectId, address _user) public view returns (bool) { require( _projectId > 0 && _projectId <= projectIndex, "Invalid project id" ); for (uint256 i = 0; i < projects[_projectId].poolIds.length; i++) { if(checkClaimablePool(projects[_projectId].poolIds[i], _user)){ return true; } } return false; } function getPool( uint256 _poolId ) public view returns ( address, string memory, uint8, uint256, uint256, uint256, uint256, uint256[] memory, uint256[] memory, uint256, uint256, PoolState ) { Pool storage pool = pools[_poolId]; return ( address(pool.tokenFund), pool.name, pool.vestingType, pool.tge, pool.cliff, pool.unlockPercent, pool.linearVestingDuration, pool.milestoneTimes, pool.milestonePercents, pool.fundsTotal, pool.fundsClaimed, pool.state ); } function _validateClaimFund(uint256 _poolId) private view { Pool storage pool = pools[_poolId]; require(pool.state == PoolState.STARTING, "Invalid action"); require( pool.funds[_msgSender()] > 0, "Amount must be greater than zero" ); require( pool.funds[_msgSender()] > pool.released[_msgSender()], "All money has been claimed" ); } function _validateSetup( uint8 _vestingType, uint256 _unlockPercent, uint256 _tge, uint256 _cliff, uint256 _linearVestingDuration, uint256[] memory _milestoneTimes, uint256[] memory _milestonePercents ) private { require( _vestingType >= VESTING_TYPE_MILESTONE_UNLOCK_FIRST && _vestingType <= VESTING_TYPE_LINEAR_CLIFF_FIRST, "Invalid action" ); require( _unlockPercent >= 0 && _unlockPercent <= ONE_HUNDRED_PERCENT_SCALED && _cliff >= 0, "Invalid input parameter" ); if ( _vestingType == VESTING_TYPE_MILESTONE_CLIFF_FIRST || _vestingType == VESTING_TYPE_MILESTONE_UNLOCK_FIRST ) { require( _milestoneTimes.length == _milestonePercents.length && _milestoneTimes.length >= 0 && _linearVestingDuration >= 0, "Invalid vesting parameter" ); uint256 total = _unlockPercent; uint256 curTime = 0; for (uint i = 0; i < _milestoneTimes.length; i++) { total = total + _milestonePercents[i]; uint256 tmpTime = _milestoneTimes[i]; require( tmpTime >= _tge + _cliff && tmpTime > curTime, "Invalid input parameter" ); curTime = tmpTime; } require( total == ONE_HUNDRED_PERCENT_SCALED, "Invalid vesting parameter" ); } else { require( _milestoneTimes.length == 0 && _milestonePercents.length == 0 && (_linearVestingDuration > 0 && _linearVestingDuration <= ONE_HUNDRED_YEARS_IN_S), "Invalid vesting parameter" ); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ```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 => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @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; 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 require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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. * * _Available since v3.4._ */ 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 addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.19; interface IBEP20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the token decimals. */ function decimals() external view returns (uint8); /** * @dev Returns the token symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the token name. */ function name() external view returns (string memory); /** * @dev Returns the bep token owner. */ function getOwner() external view returns (address); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address _owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 200 }, "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":"admin","type":"address"},{"internalType":"address","name":"treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"fundAmount","type":"uint256"}],"name":"AddFundEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"fundClaimed","type":"uint256"},{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"}],"name":"ClaimFundEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"CreatePoolEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"project","type":"uint256"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"address","name":"tokenFund","type":"address"}],"name":"CreateProjectEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"fundAmount","type":"uint256"}],"name":"DepositFundEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":false,"internalType":"address","name":"user","type":"address"}],"name":"RemoveFundEvent","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":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"fundAmount","type":"uint256"}],"name":"WithdrawFundEvent","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256[]","name":"_fundAmounts","type":"uint256[]"},{"internalType":"address[]","name":"_users","type":"address[]"}],"name":"addFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"checkClaimablePool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"checkClaimableProject","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"claimAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"claimFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_now","type":"uint256"}],"name":"computeClaimPercent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenFund","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint8","name":"_vestingType","type":"uint8"},{"internalType":"uint256","name":"_tge","type":"uint256"},{"internalType":"uint256","name":"_cliff","type":"uint256"},{"internalType":"uint256","name":"_unlockPercent","type":"uint256"},{"internalType":"uint256","name":"_linearVestingDuration","type":"uint256"},{"internalType":"uint256[]","name":"_milestoneTimes","type":"uint256[]"},{"internalType":"uint256[]","name":"_milestonePercents","type":"uint256[]"}],"name":"createPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenFund","type":"address"},{"internalType":"string","name":"_name","type":"string"}],"name":"createProject","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_fundAmount","type":"uint256"}],"name":"depositFund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"end","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"getFundByUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"getInfoUserReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"getPool","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"string","name":"","type":"string"},{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"enum Vesting.PoolState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"poolIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"contract IBEP20","name":"tokenFund","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"contract IBEP20","name":"tokenFund","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256[]","name":"poolIds","type":"uint256[]"}],"internalType":"struct Vesting.Project","name":"project","type":"tuple"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint8","name":"vestingType","type":"uint8"},{"internalType":"uint256","name":"tge","type":"uint256"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"unlockPercent","type":"uint256"},{"internalType":"uint256","name":"linearVestingDuration","type":"uint256"},{"internalType":"uint256","name":"fundsTotal","type":"uint256"},{"internalType":"uint256","name":"fundsClaimed","type":"uint256"},{"internalType":"enum Vesting.PoolState","name":"state","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"projectIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"projects","outputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"contract IBEP20","name":"tokenFund","type":"address"},{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"address[]","name":"_users","type":"address[]"}],"name":"removeFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"start","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":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_fundAmount","type":"uint256"}],"name":"withdrawFund","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608034620001b25762002d9d90601f38839003908101601f19168201906001600160401b03821183831017620001b75780839160409586948552833981010312620001b2576200004f81620001cd565b906200005f6020809201620001cd565b9060019283805560009283805283835285842060018060a01b0380931690818652845260ff8786205416156200017a575b507fe1dcbdb91df27212a29bc27177c840cf2f819ecf2187432e1fac86c2dd5dfca991828552848452868520911690818552835260ff86852054161562000142575b5050818052818152838220338352815260ff84832054161562000108575b505060c860035560025551612b9a9081620001e38239f35b818052818152838220338084529152838220805460ff19168417905590819060008051602062002d7d8339815191528180a43880620000f0565b8184528383528584208185528352858420805460ff191686179055339160008051602062002d7d8339815191528580a43880620000d2565b8480528484528685208186528452868520805460ff19168717905533908560008051602062002d7d8339815191528180a43862000090565b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620001b25756fe61012080604052600436101561001457600080fd5b60003560e01c90816301ffc9a71461193357508063068bcd8d146118355780630ad24528146117c2578063107046bd14611761578063136439dd146116ee578063138cdfaa146116c8578063248a9ca3146116995780632f2ff15d146115e657806331c7364f1461151857806336568abe146114865780633679345e1461141a578063376ae06f146113f95780634ce272ee146113db5780634f3300ce146112c157806363184726146112a35780636930fd2a146112035780636d96c17e14610c8c5780637bf44ae614610c5c57806389335faf14610a745780638dcde8a1146108d457806391d148541461088757806392ad11cd1461084f57806395805dad146107a6578063a217fddf1461078a578063ac4afa38146105a6578063b88d09f6146103d3578063c5cca334146101e0578063d11a57ec146101a55763d547741f1461015f57600080fd5b346101a05760403660031901126101a05761019e60043561017e611b10565b90806000526000602052610199600160406000200154611cda565b61200e565b005b600080fd5b346101a05760003660031901126101a05760206040517fe1dcbdb91df27212a29bc27177c840cf2f819ecf2187432e1fac86c2dd5dfca98152f35b346101a05760403660031901126101a0576101f9611b26565b6001600160401b036024358181116101a057610219903690600401611bd7565b61022161218e565b336000908152600080516020612b4583398151915260209081526040909120549092906102509060ff166120df565b6002549161025d83612123565b6002558260005260058452604060002091838355600283019082519081116103bd576102938161028d8454611a0f565b84612149565b85601f821160011461033257966103189392826001937f6af90a00b679a98273753aedfee03d06a6de517cf61599a5e4ee39e51fbc4fd59a600091610327575b50600019600383901b1c191690841b1790555b818060a01b03169301836001600160601b0360a01b8254161790556060604051958695865285015260608401906119a9565b9060408301520390a160018055005b90508501518b6102d3565b601f1982169083600052876000209160005b8181106103a65750837f6af90a00b679a98273753aedfee03d06a6de517cf61599a5e4ee39e51fbc4fd59a9361031897969360019687941061038d575b5050811b0190556102e6565b87015160001960f88460031b161c191690558b80610381565b91928960018192868a015181550194019201610344565b634e487b7160e01b600052604160045260246000fd5b346101a0576103e136611b3c565b906103ea61218e565b3360009081527f9e5c930214a7bc8a78d251e617445bcdba028aed2ede5828cc6cd6c8261656f5602090815260409091205490919061042b9060ff1661261c565b610436831515612668565b6000526004815260018060a01b0360406000205416916040516370a0823160e01b81523060048201528281602481875afa801561052f578291600091610575575b501061053b5760405163a9059cbb60e01b815233600482015260248101829052928290849060449082906000905af191821561052f577f4f0e631c7ea5f055e8486b5c246aece5a40c23fe27cfb250fcc0fef0918b08d8936104f893610501575b505060408051308152336020820152908101919091529081906060820190565b0390a160018055005b8161052092903d10610528575b6105188183611a49565b810190612466565b5083806104d8565b503d61050e565b6040513d6000823e3d90fd5b60405162461bcd60e51b815260048101839052601260248201527146756e6420696e73756666696369656e742160701b6044820152606490fd5b809250848092503d831161059f575b61058e8183611a49565b810103126101a05781905185610477565b503d610584565b346101a05760203660031901126101a0576004356000526004602052604060002060018060a01b0381541660e05260018101549060405180608052608081018181106001600160401b038211176103bd576040526002820154905260018060a01b036003820154169160206080510192835261062460048301611a6a565b9260406080510193845261063a60058401611c8b565b9360606080510194855261065060068501611a6a565b60ff60078601541660c0526008850154956009860154916106df600a88015494600b8901549660108a01549860ff601260118d01549c015416610100526040518060a05260e0519052602060a051015261018080604060a0510152608051519060a051015260018060a01b039051166101a060a05101525160806101c060a051015261020060a05101906119a9565b91519060a0516101e061017f19828603019101526020808351948581520192019260005b818110610774575050610721925060a05160608184039101526119a9565b9560c051608060a051015260a08051015260c060a051015260e060a051015261010060a051015261012060a051015261014060a051015261076b61016060a0510161010051611a02565b60a05180910390f35b8451845260209485019490930192600101610703565b346101a05760003660031901126101a057602060405160008152f35b346101a05760203660031901126101a0576107bf61218e565b336000908152600080516020612b4583398151915260205260409020546107e89060ff166120df565b60043560005260046020526012604060002001805460ff811690600482101561083957610821826001931590811561082e575b506123ad565b60ff191617905560018055005b60029150148561081b565b634e487b7160e01b600052602160045260246000fd5b346101a05760203660031901126101a05760043560005260046020526040806000206011601082015491015482519182526020820152f35b346101a05760403660031901126101a0576108a0611b10565b600435600052600060205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346101a0576108e236611b3c565b906108eb61218e565b3360009081527f9e5c930214a7bc8a78d251e617445bcdba028aed2ede5828cc6cd6c8261656f5602090815260409091205490919061092c9060ff1661261c565b610937831515612668565b6000526004815260018060a01b0360406000205416916040516370a0823160e01b81523360048201528281602481875afa801561052f578291600091610a43575b50106109fe576040516323b872dd60e01b815233600482015230602482015260448101829052928290849060649082906000905af191821561052f577f75b1c78f08195fb37b28a69cdb6d3ee669fffa8cb3c0337c24c4e69923a2c916936104f89361050157505060408051308152336020820152908101919091529081906060820190565b60405162461bcd60e51b815260048101839052601760248201527f4572726f723a206e6f7420656e6f75676820546f6b656e0000000000000000006044820152606490fd5b809250848092503d8311610a6d575b610a5c8183611a49565b810103126101a05781905185610978565b503d610a52565b346101a0576060806003193601126101a057600435906001600160401b03906024358281116101a057610aab903690600401611c2d565b916044359081116101a057610ac4903690600401611b69565b90610acd61218e565b336000908152600080516020612b458339815191526020908152604090912054909490610afc9060ff166120df565b8251845103610c175760008181526004865260408120600e8101969590915b8551811015610c1157610bc6907f4f1bde33bc9f5b8310628ac9b28c78df1d5427706aba8596273f8669db69a9ce866001600160a01b03610b5c848b6123ea565b5116610b6884876123ea565b5160008281528d8d52604090205415610bcb5760108801610b8a8282546120ab565b9055816000528c8c52610ba2816040600020546120ab565b826000528d8d526040600020555b604051918983528c8301526040820152a1612123565b610b1b565b60108801610bda8282546120ab565b9055816000528c8c52610bf2816040600020546120ab565b826000528d8d52604060002055600f88018c5260006040812055610bb0565b60018055005b60405162461bcd60e51b815260048101869052601c60248201527f496e70757420617272617973206c656e677468206d69736d61746368000000006044820152606490fd5b346101a05760403660031901126101a0576020610c82610c7a611b10565b600435612a32565b6040519015158152f35b346101a0576101403660031901126101a057610ca6611b26565b6024356001600160401b0381116101a057610cc5903690600401611bd7565b906064359160ff831683036101a057610104356001600160401b0381116101a057610cf4903690600401611c2d565b90610124356001600160401b0381116101a057610d15903690600401611c2d565b91610d1e61218e565b336000908152600080516020612b458339815191526020526040902054610d479060ff166120df565b600160ff86161015806111f5575b610d5e906123ad565b612710928360c4351115806111ed575b610d7790612aac565b600260ff87161480156111e0575b1561118f57815181511480611187575b8061117f575b610da9909691949596612af8565b60c4359360009160009760a43595608435975b86518b1015610e1e57610ddd610e0d91610dd68d886123ea565b51906120ab565b95610e07610deb8d8a6123ea565b5191610df78b8d6120ab565b8310159081610e14575b50612aac565b9a612123565b9994610dbc565b905082118e610e01565b929950965096919450610e32925014612af8565b60443580151580611173575b610e47906121e4565b600090815260056020526040902060018101549095906001600160a01b039081169086160361113a5760035493610e7d85612123565b60035584600052600460205260406000209585600188015560018060a01b03166001600160601b0360a01b8754161786558051906001600160401b0382116103bd578190610edb82610ed260068b0154611a0f565b60068b01612149565b602090601f83116001146110c8576000926110bd575b50508160011b916000199060031b1c19161760068601555b60ff60078601911660ff19825416179055608435600885015560a435600985015560c435600a85015560e435600b8501558051906001600160401b0382116103bd576020600c860191610f5c8484612225565b0190600052602060002060005b8381106110a957505050508051906001600160401b0382116103bd576020600d850191610f968484612225565b0190600052602060002060005b838110611095575050505060006010830155600060118301556012820160ff1981541690556003830192600183015493805493600160401b8510156103bd577f7f69b4d5cb1512b04536fe4f06aa9291143feacfe4f5557083d640b4282aaf3f9561101686600160209801855584612259565b819291549060031b91821b91600019901b1916179055600281019083820361104a575b50505050604051908152a160018055005b61108660028560059461108c975490556003840160018060a01b036001830154166001600160601b0360a01b8254161790550160048301612271565b0161234f565b83808080611039565b600190602084519401938184015501610fa3565b600190602084519401938184015501610f69565b015190508880610ef1565b9250600688016000526020600020906000935b601f198416851061111f576001945083601f19811610611106575b505050811b016006860155610f09565b015160001960f88460031b161c191690558880806110f6565b818101518355602094850194600190930192909101906110db565b60405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081d1bdad95b919d5b99607a1b6044820152606490fd5b50600254811115610e3e565b506001610d9b565b506001610d95565b919250805115806111d7575b806111af575b6111aa90612af8565b610e32565b506111aa60e43580151590816111c8575b5090506111a1565b63bbf81e0091501115876111c0565b5081511561119b565b50600160ff871614610d85565b506001610d6e565b50600460ff86161115610d55565b346101a0576020806003193601126101a05760056004359161122361218e565b82151580611297575b6112379192506121e4565b6000905b826000526005815260039182604060002001908154811015610c11576005936112678261128194612259565b9054911b1c611276338261295d565b611288575b50612123565b915061123b565b6112919061247e565b8561127b565b5060025483111561122c565b346101a05760003660031901126101a0576020600254604051908152f35b346101a05760403660031901126101a0576004356024356001600160401b0381116101a0576112f4903690600401611b69565b906112fd61218e565b336000908152600080516020612b4583398151915260209081526040909120546113299060ff166120df565b8160005260048152604060002090600092600e8301935b8551811015610c115761137e906001600160a01b0361135f82896123ea565b511680600052868552604060002080549182611383575b505050612123565b611340565b7f95b643abc95498df2a9c463038c8025773e0bd2ca83b559f702ca3f79f710eef92600060409355600f890188526000838120556113c660108a0191825461240e565b905581519086825287820152a1878080611376565b346101a05760003660031901126101a0576020600354604051908152f35b346101a057602061141261140c36611b3c565b906126b3565b604051908152f35b346101a05760403660031901126101a0576040600435611438611b10565b816000526004602052600e83600020019060018060a01b031690816000526020528260002054916000526004602052600f836000200190600052602052816000205482519182526020820152f35b346101a05760403660031901126101a05761149f611b10565b336001600160a01b038216036114bb5761019e9060043561200e565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b346101a0576020806003193601126101a0576004359061153661218e565b8160005260048152604060002060ff601282015416600481101561083957600161156091146123ad565b600e81013360005280835261157b6040600020541515612668565b336000528252600f6040600020549101825260406000205410156115a257610c118261247e565b6064906040519062461bcd60e51b82526004820152601a60248201527f416c6c206d6f6e657920686173206265656e20636c61696d65640000000000006044820152fd5b346101a05760403660031901126101a057600435611602611b10565b81600052600060205261161c600160406000200154611cda565b81600052600060205260406000209060018060a01b0316908160005260205260ff604060002054161561164b57005b8160005260006020526040600020816000526020526040600020600160ff1982541617905533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4005b346101a05760203660031901126101a05760043560005260006020526020600160406000200154604051908152f35b346101a05760403660031901126101a0576020610c826116e6611b10565b60043561295d565b346101a05760203660031901126101a05761170761218e565b336000908152600080516020612b4583398151915260205260409020546117309060ff166120df565b60043560005260046020526012604060002001805460ff8116906004821015610839576108216002809314156123ad565b346101a05760203660031901126101a0576004356000526005602052604060002080546117be6117a0600260018060a01b036001860154169401611a6a565b604051938493845260208401526060604084015260608301906119a9565b0390f35b346101a05760203660031901126101a0576117db61218e565b336000908152600080516020612b4583398151915260205260409020546118049060ff166120df565b60043560005260046020526012604060002001805460ff8116906004821015610839576108216001600393146123ad565b346101a05760203660031901126101a05760043560005260046020526040600020600160a01b60019003815416600782015460ff166008830154600984015493600a81015491600b82015491601081015494601182015493601283015460ff1695600684016118a390611a6a565b996118b0600c8601611c8b565b94600d016118bd90611c8b565b956040519b8c9b8c528b6101806020819201528c016118db916119a9565b9460408c015260608b015260808a015260a089015260c088015286810360e0880152611906916119ce565b858103610100870152611918916119ce565b9261012085015261014084015261016083016117be91611a02565b346101a05760203660031901126101a0576004359063ffffffff60e01b82168092036101a057602091637965db0b60e01b8114908115611975575b5015158152f35b6301ffc9a760e01b1490508361196e565b60005b8381106119995750506000910152565b8181015183820152602001611989565b906020916119c281518092818552858086019101611986565b601f01601f1916010190565b90815180825260208080930193019160005b8281106119ee575050505090565b8351855293810193928101926001016119e0565b9060048210156108395752565b90600182811c92168015611a3f575b6020831014611a2957565b634e487b7160e01b600052602260045260246000fd5b91607f1691611a1e565b90601f801991011681019081106001600160401b038211176103bd57604052565b9060405191826000825492611a7e84611a0f565b908184526001948581169081600014611aed5750600114611aaa575b5050611aa892500383611a49565b565b9093915060005260209081600020936000915b818310611ad5575050611aa893508201013880611a9a565b85548884018501529485019487945091830191611abd565b915050611aa894506020925060ff191682840152151560051b8201013880611a9a565b602435906001600160a01b03821682036101a057565b600435906001600160a01b03821682036101a057565b60409060031901126101a0576004359060243590565b6001600160401b0381116103bd5760051b60200190565b81601f820112156101a057803591611b8083611b52565b92611b8e6040519485611a49565b808452602092838086019260051b8201019283116101a0578301905b828210611bb8575050505090565b81356001600160a01b03811681036101a0578152908301908301611baa565b81601f820112156101a0578035906001600160401b0382116103bd5760405192611c0b601f8401601f191660200185611a49565b828452602083830101116101a057816000926020809301838601378301015290565b81601f820112156101a057803591611c4483611b52565b92611c526040519485611a49565b808452602092838086019260051b8201019283116101a0578301905b828210611c7c575050505090565b81358152908301908301611c6e565b9060405191828154918282526020928383019160005283600020936000905b828210611cc057505050611aa892500383611a49565b855484526001958601958895509381019390910190611caa565b600090808252602090828252604092838120338252835260ff848220541615611d035750505050565b8351916001600160401b0390336060850183811186821017611ffa578752602a85528585019187368437855115611fe65760308353855191600192831015611fd2576078602188015360295b838111611f685750611f265790875193608085019085821090821117611f1257885260428452868401946060368737845115611efe57603086538451821015611efe5790607860218601536041915b818311611e9057505050611e4e57611e4a938693611e2e93611e1f604894611df69a519a8b957f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008c8801525180926037880190611986565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190611986565b01036028810187520185611a49565b5192839262461bcd60e51b8452600484015260248301906119a9565b0390fd5b60648587519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015611eea576f181899199a1a9b1b9c1cb0b131b232b360811b901a611ec085886120b8565b5360041c928015611ed657600019019190611d9e565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b634e487b7160e01b86526041600452602486fd5b60648789519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b90600f81166010811015611fbe576f181899199a1a9b1b9c1cb0b131b232b360811b901a611f96838a6120b8565b5360041c908015611faa5760001901611d4f565b634e487b7160e01b87526011600452602487fd5b634e487b7160e01b88526032600452602488fd5b634e487b7160e01b86526032600452602486fd5b634e487b7160e01b85526032600452602485fd5b634e487b7160e01b85526041600452602485fd5b9060009180835282602052604083209160018060a01b03169182845260205260ff60408420541661203e57505050565b80835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4565b8181029291811591840414171561209557565b634e487b7160e01b600052601160045260246000fd5b9190820180921161209557565b9081518110156120c9570160200190565b634e487b7160e01b600052603260045260246000fd5b156120e657565b60405162461bcd60e51b81526020600482015260156024820152745265737472696374656420746f2061646d696e732160581b6044820152606490fd5b60001981146120955760010190565b81811061213d575050565b60008155600101612132565b9190601f811161215857505050565b611aa8926000526020600020906020601f840160051c83019310612184575b601f0160051c0190612132565b9091508190612177565b60026001541461219f576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b156121eb57565b60405162461bcd60e51b8152602060048201526012602482015271125b9d985b1a59081c1c9bda9958dd081a5960721b6044820152606490fd5b90600160401b81116103bd5781549080835581811061224357505050565b611aa89260005260206000209182019101612132565b80548210156120c95760005260206000200190600090565b9080821461234b576122838154611a0f565b906001600160401b0382116103bd5781906122a8826122a28654611a0f565b86612149565b600090601f83116001146122df576000926122d4575b50508160011b916000199060031b1c1916179055565b0154905038806122be565b81526020808220858352818320935090601f1985169083905b828210612332575050908460019594939210612319575b505050811b019055565b015460001960f88460031b161c1916905538808061230f565b84958192958501548155600180910196019401906122f8565b5050565b81811461234b578154916001600160401b0383116103bd576123718383612225565b60005260206000209060005260206000208154916000925b848410612397575050505050565b6001809192019384549281850155019290612389565b156123b457565b60405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21030b1ba34b7b760911b6044820152606490fd5b80518210156120c95760209160051b010190565b9061271091820391821161209557565b9190820391821161209557565b1561242257565b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f75676820756e6c6f636b20746f6b656e20746f20636c61696d6044820152fd5b908160209103126101a0575180151581036101a05790565b6000818152602060048152604090818320600881015442106125ca576127106124c76124aa42886126b3565b6124b581151561241b565b338752600e8401855285872054612082565b046124f4600f8301913387528285526124e486882054821161241b565b338752828552858720549061240e565b8254855163a9059cbb60e01b8152336004820152602481018390529196919085908290604490829086906001600160a01b03165af180156125c05792866011937fe62fd1e9a2836e68bd2b4b71ac7c6b688833ac1e4faea5675b290d57ee5d6e949a98969360809a98966125a3575b5033815282865261257788838320546120ab565b92338252865220550161258b8482546120ab565b905581519384523390840152820152306060820152a1565b6125b990873d8911610528576105188183611a49565b5038612563565b86513d84823e3d90fd5b50606491519062461bcd60e51b82526004820152600c60248201526b496e76616c69642054696d6560a01b6044820152fd5b8115612606570490565b634e487b7160e01b600052601260045260246000fd5b1561262357565b60405162461bcd60e51b815260206004820152601760248201527f5265737472696374656420746f207472656173757279210000000000000000006044820152606490fd5b1561266f57565b606460405162461bcd60e51b815260206004820152602060248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f6044820152fd5b6000908152600460205260408120916126ce600c8401611c8b565b906126db600d8501611c8b565b8394600881015460ff6007830154166002811460001461279857506009820154612704916120ab565b831015612726575b505050505b5061271080821015612721575090565b905090565b94600a61273a9293949795960154906120ab565b92845b86518110156127895761275081886123ea565b5161275b82856123ea565b5190851015612774575b5061276f90612123565b61273d565b6127829061276f92966120ab565b9490612765565b5094505050903880808061270c565b9290600195949295938481146000146128515750808310156127c0575b505050505050612711565b60096127d98799600a6127e295969798990154906120ab565b980154906120ab565b8210156127f1575b80806127b5565b84835b6127ff575b506127ea565b845181101561284c5761281281866123ea565b5161281d82846123ea565b5190841015612837575b5061283190612123565b836127f4565b6128459061283192986120ab565b9690612827565b6127f9565b92945094925050600381146000146128f7575082821015612875575b505050612711565b909193612887600a83015480926120ab565b92839560098401549161289a83836120ab565b8110156128aa575b50505061286d565b6128eb969750926128d66128d0600b946128cb6128dc956128e5999861240e565b61240e565b916123fe565b90612082565b910154906125fc565b906120ab565b903880808080806128a2565b9192909160041461290a57505050612711565b60098201549061291a82826120ab565b841015612928575b5061286d565b6129539495506128dc61294a84936128cb600b94600a6128e59801549861240e565b6128d6866123fe565b9038808080612922565b6000918183526004602052604083209060ff6012830154166004811015612a1e57600103612a185760088201544210612a1857600e82019060018060a01b031692838552816020526040852054928315612a1057600f01928360205260408620541015612a09576129cf9042906126b3565b908115612a0957612710916129ee918587526020526040862054612082565b0491835260205260408220541015612a065750600190565b90565b5050505090565b505050505090565b50505090565b634e487b7160e01b85526021600452602485fd5b9081151580612aa0575b612a45906121e4565b60005b8260005260056020526003806040600020018054831015612a9657612a7c91612a72848693612259565b9054911b1c61295d565b612a8e57612a8990612123565b612a48565b505050600190565b5050505050600090565b50600254821115612a3c565b15612ab357565b60405162461bcd60e51b815260206004820152601760248201527f496e76616c696420696e70757420706172616d657465720000000000000000006044820152606490fd5b15612aff57565b60405162461bcd60e51b815260206004820152601960248201527f496e76616c69642076657374696e6720706172616d65746572000000000000006044820152606490fdfead3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5a2646970667358221220f23b879d7f733d5bb85d73ff0d826e674fc85155b15db5e96f01270f1f20af5364736f6c634300081300332f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d000000000000000000000000f42a2f22176d04fc01a474c8c85a346948960e0200000000000000000000000000c614c2ec381b6c3de8bb0b5f5bb8f56625b93c
Deployed Bytecode
0x61012080604052600436101561001457600080fd5b60003560e01c90816301ffc9a71461193357508063068bcd8d146118355780630ad24528146117c2578063107046bd14611761578063136439dd146116ee578063138cdfaa146116c8578063248a9ca3146116995780632f2ff15d146115e657806331c7364f1461151857806336568abe146114865780633679345e1461141a578063376ae06f146113f95780634ce272ee146113db5780634f3300ce146112c157806363184726146112a35780636930fd2a146112035780636d96c17e14610c8c5780637bf44ae614610c5c57806389335faf14610a745780638dcde8a1146108d457806391d148541461088757806392ad11cd1461084f57806395805dad146107a6578063a217fddf1461078a578063ac4afa38146105a6578063b88d09f6146103d3578063c5cca334146101e0578063d11a57ec146101a55763d547741f1461015f57600080fd5b346101a05760403660031901126101a05761019e60043561017e611b10565b90806000526000602052610199600160406000200154611cda565b61200e565b005b600080fd5b346101a05760003660031901126101a05760206040517fe1dcbdb91df27212a29bc27177c840cf2f819ecf2187432e1fac86c2dd5dfca98152f35b346101a05760403660031901126101a0576101f9611b26565b6001600160401b036024358181116101a057610219903690600401611bd7565b61022161218e565b336000908152600080516020612b4583398151915260209081526040909120549092906102509060ff166120df565b6002549161025d83612123565b6002558260005260058452604060002091838355600283019082519081116103bd576102938161028d8454611a0f565b84612149565b85601f821160011461033257966103189392826001937f6af90a00b679a98273753aedfee03d06a6de517cf61599a5e4ee39e51fbc4fd59a600091610327575b50600019600383901b1c191690841b1790555b818060a01b03169301836001600160601b0360a01b8254161790556060604051958695865285015260608401906119a9565b9060408301520390a160018055005b90508501518b6102d3565b601f1982169083600052876000209160005b8181106103a65750837f6af90a00b679a98273753aedfee03d06a6de517cf61599a5e4ee39e51fbc4fd59a9361031897969360019687941061038d575b5050811b0190556102e6565b87015160001960f88460031b161c191690558b80610381565b91928960018192868a015181550194019201610344565b634e487b7160e01b600052604160045260246000fd5b346101a0576103e136611b3c565b906103ea61218e565b3360009081527f9e5c930214a7bc8a78d251e617445bcdba028aed2ede5828cc6cd6c8261656f5602090815260409091205490919061042b9060ff1661261c565b610436831515612668565b6000526004815260018060a01b0360406000205416916040516370a0823160e01b81523060048201528281602481875afa801561052f578291600091610575575b501061053b5760405163a9059cbb60e01b815233600482015260248101829052928290849060449082906000905af191821561052f577f4f0e631c7ea5f055e8486b5c246aece5a40c23fe27cfb250fcc0fef0918b08d8936104f893610501575b505060408051308152336020820152908101919091529081906060820190565b0390a160018055005b8161052092903d10610528575b6105188183611a49565b810190612466565b5083806104d8565b503d61050e565b6040513d6000823e3d90fd5b60405162461bcd60e51b815260048101839052601260248201527146756e6420696e73756666696369656e742160701b6044820152606490fd5b809250848092503d831161059f575b61058e8183611a49565b810103126101a05781905185610477565b503d610584565b346101a05760203660031901126101a0576004356000526004602052604060002060018060a01b0381541660e05260018101549060405180608052608081018181106001600160401b038211176103bd576040526002820154905260018060a01b036003820154169160206080510192835261062460048301611a6a565b9260406080510193845261063a60058401611c8b565b9360606080510194855261065060068501611a6a565b60ff60078601541660c0526008850154956009860154916106df600a88015494600b8901549660108a01549860ff601260118d01549c015416610100526040518060a05260e0519052602060a051015261018080604060a0510152608051519060a051015260018060a01b039051166101a060a05101525160806101c060a051015261020060a05101906119a9565b91519060a0516101e061017f19828603019101526020808351948581520192019260005b818110610774575050610721925060a05160608184039101526119a9565b9560c051608060a051015260a08051015260c060a051015260e060a051015261010060a051015261012060a051015261014060a051015261076b61016060a0510161010051611a02565b60a05180910390f35b8451845260209485019490930192600101610703565b346101a05760003660031901126101a057602060405160008152f35b346101a05760203660031901126101a0576107bf61218e565b336000908152600080516020612b4583398151915260205260409020546107e89060ff166120df565b60043560005260046020526012604060002001805460ff811690600482101561083957610821826001931590811561082e575b506123ad565b60ff191617905560018055005b60029150148561081b565b634e487b7160e01b600052602160045260246000fd5b346101a05760203660031901126101a05760043560005260046020526040806000206011601082015491015482519182526020820152f35b346101a05760403660031901126101a0576108a0611b10565b600435600052600060205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b346101a0576108e236611b3c565b906108eb61218e565b3360009081527f9e5c930214a7bc8a78d251e617445bcdba028aed2ede5828cc6cd6c8261656f5602090815260409091205490919061092c9060ff1661261c565b610937831515612668565b6000526004815260018060a01b0360406000205416916040516370a0823160e01b81523360048201528281602481875afa801561052f578291600091610a43575b50106109fe576040516323b872dd60e01b815233600482015230602482015260448101829052928290849060649082906000905af191821561052f577f75b1c78f08195fb37b28a69cdb6d3ee669fffa8cb3c0337c24c4e69923a2c916936104f89361050157505060408051308152336020820152908101919091529081906060820190565b60405162461bcd60e51b815260048101839052601760248201527f4572726f723a206e6f7420656e6f75676820546f6b656e0000000000000000006044820152606490fd5b809250848092503d8311610a6d575b610a5c8183611a49565b810103126101a05781905185610978565b503d610a52565b346101a0576060806003193601126101a057600435906001600160401b03906024358281116101a057610aab903690600401611c2d565b916044359081116101a057610ac4903690600401611b69565b90610acd61218e565b336000908152600080516020612b458339815191526020908152604090912054909490610afc9060ff166120df565b8251845103610c175760008181526004865260408120600e8101969590915b8551811015610c1157610bc6907f4f1bde33bc9f5b8310628ac9b28c78df1d5427706aba8596273f8669db69a9ce866001600160a01b03610b5c848b6123ea565b5116610b6884876123ea565b5160008281528d8d52604090205415610bcb5760108801610b8a8282546120ab565b9055816000528c8c52610ba2816040600020546120ab565b826000528d8d526040600020555b604051918983528c8301526040820152a1612123565b610b1b565b60108801610bda8282546120ab565b9055816000528c8c52610bf2816040600020546120ab565b826000528d8d52604060002055600f88018c5260006040812055610bb0565b60018055005b60405162461bcd60e51b815260048101869052601c60248201527f496e70757420617272617973206c656e677468206d69736d61746368000000006044820152606490fd5b346101a05760403660031901126101a0576020610c82610c7a611b10565b600435612a32565b6040519015158152f35b346101a0576101403660031901126101a057610ca6611b26565b6024356001600160401b0381116101a057610cc5903690600401611bd7565b906064359160ff831683036101a057610104356001600160401b0381116101a057610cf4903690600401611c2d565b90610124356001600160401b0381116101a057610d15903690600401611c2d565b91610d1e61218e565b336000908152600080516020612b458339815191526020526040902054610d479060ff166120df565b600160ff86161015806111f5575b610d5e906123ad565b612710928360c4351115806111ed575b610d7790612aac565b600260ff87161480156111e0575b1561118f57815181511480611187575b8061117f575b610da9909691949596612af8565b60c4359360009160009760a43595608435975b86518b1015610e1e57610ddd610e0d91610dd68d886123ea565b51906120ab565b95610e07610deb8d8a6123ea565b5191610df78b8d6120ab565b8310159081610e14575b50612aac565b9a612123565b9994610dbc565b905082118e610e01565b929950965096919450610e32925014612af8565b60443580151580611173575b610e47906121e4565b600090815260056020526040902060018101549095906001600160a01b039081169086160361113a5760035493610e7d85612123565b60035584600052600460205260406000209585600188015560018060a01b03166001600160601b0360a01b8754161786558051906001600160401b0382116103bd578190610edb82610ed260068b0154611a0f565b60068b01612149565b602090601f83116001146110c8576000926110bd575b50508160011b916000199060031b1c19161760068601555b60ff60078601911660ff19825416179055608435600885015560a435600985015560c435600a85015560e435600b8501558051906001600160401b0382116103bd576020600c860191610f5c8484612225565b0190600052602060002060005b8381106110a957505050508051906001600160401b0382116103bd576020600d850191610f968484612225565b0190600052602060002060005b838110611095575050505060006010830155600060118301556012820160ff1981541690556003830192600183015493805493600160401b8510156103bd577f7f69b4d5cb1512b04536fe4f06aa9291143feacfe4f5557083d640b4282aaf3f9561101686600160209801855584612259565b819291549060031b91821b91600019901b1916179055600281019083820361104a575b50505050604051908152a160018055005b61108660028560059461108c975490556003840160018060a01b036001830154166001600160601b0360a01b8254161790550160048301612271565b0161234f565b83808080611039565b600190602084519401938184015501610fa3565b600190602084519401938184015501610f69565b015190508880610ef1565b9250600688016000526020600020906000935b601f198416851061111f576001945083601f19811610611106575b505050811b016006860155610f09565b015160001960f88460031b161c191690558880806110f6565b818101518355602094850194600190930192909101906110db565b60405162461bcd60e51b8152602060048201526011602482015270125b9d985b1a59081d1bdad95b919d5b99607a1b6044820152606490fd5b50600254811115610e3e565b506001610d9b565b506001610d95565b919250805115806111d7575b806111af575b6111aa90612af8565b610e32565b506111aa60e43580151590816111c8575b5090506111a1565b63bbf81e0091501115876111c0565b5081511561119b565b50600160ff871614610d85565b506001610d6e565b50600460ff86161115610d55565b346101a0576020806003193601126101a05760056004359161122361218e565b82151580611297575b6112379192506121e4565b6000905b826000526005815260039182604060002001908154811015610c11576005936112678261128194612259565b9054911b1c611276338261295d565b611288575b50612123565b915061123b565b6112919061247e565b8561127b565b5060025483111561122c565b346101a05760003660031901126101a0576020600254604051908152f35b346101a05760403660031901126101a0576004356024356001600160401b0381116101a0576112f4903690600401611b69565b906112fd61218e565b336000908152600080516020612b4583398151915260209081526040909120546113299060ff166120df565b8160005260048152604060002090600092600e8301935b8551811015610c115761137e906001600160a01b0361135f82896123ea565b511680600052868552604060002080549182611383575b505050612123565b611340565b7f95b643abc95498df2a9c463038c8025773e0bd2ca83b559f702ca3f79f710eef92600060409355600f890188526000838120556113c660108a0191825461240e565b905581519086825287820152a1878080611376565b346101a05760003660031901126101a0576020600354604051908152f35b346101a057602061141261140c36611b3c565b906126b3565b604051908152f35b346101a05760403660031901126101a0576040600435611438611b10565b816000526004602052600e83600020019060018060a01b031690816000526020528260002054916000526004602052600f836000200190600052602052816000205482519182526020820152f35b346101a05760403660031901126101a05761149f611b10565b336001600160a01b038216036114bb5761019e9060043561200e565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b346101a0576020806003193601126101a0576004359061153661218e565b8160005260048152604060002060ff601282015416600481101561083957600161156091146123ad565b600e81013360005280835261157b6040600020541515612668565b336000528252600f6040600020549101825260406000205410156115a257610c118261247e565b6064906040519062461bcd60e51b82526004820152601a60248201527f416c6c206d6f6e657920686173206265656e20636c61696d65640000000000006044820152fd5b346101a05760403660031901126101a057600435611602611b10565b81600052600060205261161c600160406000200154611cda565b81600052600060205260406000209060018060a01b0316908160005260205260ff604060002054161561164b57005b8160005260006020526040600020816000526020526040600020600160ff1982541617905533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4005b346101a05760203660031901126101a05760043560005260006020526020600160406000200154604051908152f35b346101a05760403660031901126101a0576020610c826116e6611b10565b60043561295d565b346101a05760203660031901126101a05761170761218e565b336000908152600080516020612b4583398151915260205260409020546117309060ff166120df565b60043560005260046020526012604060002001805460ff8116906004821015610839576108216002809314156123ad565b346101a05760203660031901126101a0576004356000526005602052604060002080546117be6117a0600260018060a01b036001860154169401611a6a565b604051938493845260208401526060604084015260608301906119a9565b0390f35b346101a05760203660031901126101a0576117db61218e565b336000908152600080516020612b4583398151915260205260409020546118049060ff166120df565b60043560005260046020526012604060002001805460ff8116906004821015610839576108216001600393146123ad565b346101a05760203660031901126101a05760043560005260046020526040600020600160a01b60019003815416600782015460ff166008830154600984015493600a81015491600b82015491601081015494601182015493601283015460ff1695600684016118a390611a6a565b996118b0600c8601611c8b565b94600d016118bd90611c8b565b956040519b8c9b8c528b6101806020819201528c016118db916119a9565b9460408c015260608b015260808a015260a089015260c088015286810360e0880152611906916119ce565b858103610100870152611918916119ce565b9261012085015261014084015261016083016117be91611a02565b346101a05760203660031901126101a0576004359063ffffffff60e01b82168092036101a057602091637965db0b60e01b8114908115611975575b5015158152f35b6301ffc9a760e01b1490508361196e565b60005b8381106119995750506000910152565b8181015183820152602001611989565b906020916119c281518092818552858086019101611986565b601f01601f1916010190565b90815180825260208080930193019160005b8281106119ee575050505090565b8351855293810193928101926001016119e0565b9060048210156108395752565b90600182811c92168015611a3f575b6020831014611a2957565b634e487b7160e01b600052602260045260246000fd5b91607f1691611a1e565b90601f801991011681019081106001600160401b038211176103bd57604052565b9060405191826000825492611a7e84611a0f565b908184526001948581169081600014611aed5750600114611aaa575b5050611aa892500383611a49565b565b9093915060005260209081600020936000915b818310611ad5575050611aa893508201013880611a9a565b85548884018501529485019487945091830191611abd565b915050611aa894506020925060ff191682840152151560051b8201013880611a9a565b602435906001600160a01b03821682036101a057565b600435906001600160a01b03821682036101a057565b60409060031901126101a0576004359060243590565b6001600160401b0381116103bd5760051b60200190565b81601f820112156101a057803591611b8083611b52565b92611b8e6040519485611a49565b808452602092838086019260051b8201019283116101a0578301905b828210611bb8575050505090565b81356001600160a01b03811681036101a0578152908301908301611baa565b81601f820112156101a0578035906001600160401b0382116103bd5760405192611c0b601f8401601f191660200185611a49565b828452602083830101116101a057816000926020809301838601378301015290565b81601f820112156101a057803591611c4483611b52565b92611c526040519485611a49565b808452602092838086019260051b8201019283116101a0578301905b828210611c7c575050505090565b81358152908301908301611c6e565b9060405191828154918282526020928383019160005283600020936000905b828210611cc057505050611aa892500383611a49565b855484526001958601958895509381019390910190611caa565b600090808252602090828252604092838120338252835260ff848220541615611d035750505050565b8351916001600160401b0390336060850183811186821017611ffa578752602a85528585019187368437855115611fe65760308353855191600192831015611fd2576078602188015360295b838111611f685750611f265790875193608085019085821090821117611f1257885260428452868401946060368737845115611efe57603086538451821015611efe5790607860218601536041915b818311611e9057505050611e4e57611e4a938693611e2e93611e1f604894611df69a519a8b957f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008c8801525180926037880190611986565b8401917001034b99036b4b9b9b4b733903937b6329607d1b603784015251809386840190611986565b01036028810187520185611a49565b5192839262461bcd60e51b8452600484015260248301906119a9565b0390fd5b60648587519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015611eea576f181899199a1a9b1b9c1cb0b131b232b360811b901a611ec085886120b8565b5360041c928015611ed657600019019190611d9e565b634e487b7160e01b82526011600452602482fd5b634e487b7160e01b83526032600452602483fd5b634e487b7160e01b81526032600452602490fd5b634e487b7160e01b86526041600452602486fd5b60648789519062461bcd60e51b825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b90600f81166010811015611fbe576f181899199a1a9b1b9c1cb0b131b232b360811b901a611f96838a6120b8565b5360041c908015611faa5760001901611d4f565b634e487b7160e01b87526011600452602487fd5b634e487b7160e01b88526032600452602488fd5b634e487b7160e01b86526032600452602486fd5b634e487b7160e01b85526032600452602485fd5b634e487b7160e01b85526041600452602485fd5b9060009180835282602052604083209160018060a01b03169182845260205260ff60408420541661203e57505050565b80835282602052604083208284526020526040832060ff1981541690557ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b339380a4565b8181029291811591840414171561209557565b634e487b7160e01b600052601160045260246000fd5b9190820180921161209557565b9081518110156120c9570160200190565b634e487b7160e01b600052603260045260246000fd5b156120e657565b60405162461bcd60e51b81526020600482015260156024820152745265737472696374656420746f2061646d696e732160581b6044820152606490fd5b60001981146120955760010190565b81811061213d575050565b60008155600101612132565b9190601f811161215857505050565b611aa8926000526020600020906020601f840160051c83019310612184575b601f0160051c0190612132565b9091508190612177565b60026001541461219f576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b156121eb57565b60405162461bcd60e51b8152602060048201526012602482015271125b9d985b1a59081c1c9bda9958dd081a5960721b6044820152606490fd5b90600160401b81116103bd5781549080835581811061224357505050565b611aa89260005260206000209182019101612132565b80548210156120c95760005260206000200190600090565b9080821461234b576122838154611a0f565b906001600160401b0382116103bd5781906122a8826122a28654611a0f565b86612149565b600090601f83116001146122df576000926122d4575b50508160011b916000199060031b1c1916179055565b0154905038806122be565b81526020808220858352818320935090601f1985169083905b828210612332575050908460019594939210612319575b505050811b019055565b015460001960f88460031b161c1916905538808061230f565b84958192958501548155600180910196019401906122f8565b5050565b81811461234b578154916001600160401b0383116103bd576123718383612225565b60005260206000209060005260206000208154916000925b848410612397575050505050565b6001809192019384549281850155019290612389565b156123b457565b60405162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b21030b1ba34b7b760911b6044820152606490fd5b80518210156120c95760209160051b010190565b9061271091820391821161209557565b9190820391821161209557565b1561242257565b606460405162461bcd60e51b815260206004820152602060248201527f4e6f7420656e6f75676820756e6c6f636b20746f6b656e20746f20636c61696d6044820152fd5b908160209103126101a0575180151581036101a05790565b6000818152602060048152604090818320600881015442106125ca576127106124c76124aa42886126b3565b6124b581151561241b565b338752600e8401855285872054612082565b046124f4600f8301913387528285526124e486882054821161241b565b338752828552858720549061240e565b8254855163a9059cbb60e01b8152336004820152602481018390529196919085908290604490829086906001600160a01b03165af180156125c05792866011937fe62fd1e9a2836e68bd2b4b71ac7c6b688833ac1e4faea5675b290d57ee5d6e949a98969360809a98966125a3575b5033815282865261257788838320546120ab565b92338252865220550161258b8482546120ab565b905581519384523390840152820152306060820152a1565b6125b990873d8911610528576105188183611a49565b5038612563565b86513d84823e3d90fd5b50606491519062461bcd60e51b82526004820152600c60248201526b496e76616c69642054696d6560a01b6044820152fd5b8115612606570490565b634e487b7160e01b600052601260045260246000fd5b1561262357565b60405162461bcd60e51b815260206004820152601760248201527f5265737472696374656420746f207472656173757279210000000000000000006044820152606490fd5b1561266f57565b606460405162461bcd60e51b815260206004820152602060248201527f416d6f756e74206d7573742062652067726561746572207468616e207a65726f6044820152fd5b6000908152600460205260408120916126ce600c8401611c8b565b906126db600d8501611c8b565b8394600881015460ff6007830154166002811460001461279857506009820154612704916120ab565b831015612726575b505050505b5061271080821015612721575090565b905090565b94600a61273a9293949795960154906120ab565b92845b86518110156127895761275081886123ea565b5161275b82856123ea565b5190851015612774575b5061276f90612123565b61273d565b6127829061276f92966120ab565b9490612765565b5094505050903880808061270c565b9290600195949295938481146000146128515750808310156127c0575b505050505050612711565b60096127d98799600a6127e295969798990154906120ab565b980154906120ab565b8210156127f1575b80806127b5565b84835b6127ff575b506127ea565b845181101561284c5761281281866123ea565b5161281d82846123ea565b5190841015612837575b5061283190612123565b836127f4565b6128459061283192986120ab565b9690612827565b6127f9565b92945094925050600381146000146128f7575082821015612875575b505050612711565b909193612887600a83015480926120ab565b92839560098401549161289a83836120ab565b8110156128aa575b50505061286d565b6128eb969750926128d66128d0600b946128cb6128dc956128e5999861240e565b61240e565b916123fe565b90612082565b910154906125fc565b906120ab565b903880808080806128a2565b9192909160041461290a57505050612711565b60098201549061291a82826120ab565b841015612928575b5061286d565b6129539495506128dc61294a84936128cb600b94600a6128e59801549861240e565b6128d6866123fe565b9038808080612922565b6000918183526004602052604083209060ff6012830154166004811015612a1e57600103612a185760088201544210612a1857600e82019060018060a01b031692838552816020526040852054928315612a1057600f01928360205260408620541015612a09576129cf9042906126b3565b908115612a0957612710916129ee918587526020526040862054612082565b0491835260205260408220541015612a065750600190565b90565b5050505090565b505050505090565b50505090565b634e487b7160e01b85526021600452602485fd5b9081151580612aa0575b612a45906121e4565b60005b8260005260056020526003806040600020018054831015612a9657612a7c91612a72848693612259565b9054911b1c61295d565b612a8e57612a8990612123565b612a48565b505050600190565b5050505050600090565b50600254821115612a3c565b15612ab357565b60405162461bcd60e51b815260206004820152601760248201527f496e76616c696420696e70757420706172616d657465720000000000000000006044820152606490fd5b15612aff57565b60405162461bcd60e51b815260206004820152601960248201527f496e76616c69642076657374696e6720706172616d65746572000000000000006044820152606490fdfead3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5a2646970667358221220f23b879d7f733d5bb85d73ff0d826e674fc85155b15db5e96f01270f1f20af5364736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f42a2f22176d04fc01a474c8c85a346948960e0200000000000000000000000000c614c2ec381b6c3de8bb0b5f5bb8f56625b93c
-----Decoded View---------------
Arg [0] : admin (address): 0xF42a2f22176D04FC01a474C8C85A346948960E02
Arg [1] : treasury (address): 0x00c614C2EC381b6c3dE8BB0B5F5BB8F56625B93C
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f42a2f22176d04fc01a474c8c85a346948960e02
Arg [1] : 00000000000000000000000000c614c2ec381b6c3de8bb0b5f5bb8f56625b93c
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.008205 | 4,667.6514 | $38.3 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.