Token migration announcement. XPower token contract has migrated to a new address.
Overview
AVAX Balance
AVAX Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Multichain Info
No addresses found
Latest 25 from a total of 1,338 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Approve | 37903239 | 493 days ago | IN | 0 AVAX | 0.00072962 | ||||
Approve | 37903111 | 493 days ago | IN | 0 AVAX | 0.00072962 | ||||
Approve | 37903100 | 493 days ago | IN | 0 AVAX | 0.00072962 | ||||
Approve | 37903080 | 493 days ago | IN | 0 AVAX | 0.00072962 | ||||
Renounce Role | 37502039 | 503 days ago | IN | 0 AVAX | 0.00121176 | ||||
Seal All | 37502036 | 503 days ago | IN | 0 AVAX | 0.0014045 | ||||
Grant Role | 37502016 | 503 days ago | IN | 0 AVAX | 0.00313707 | ||||
Approve | 37261738 | 508 days ago | IN | 0 AVAX | 0.00136636 | ||||
Approve | 34331014 | 578 days ago | IN | 0 AVAX | 0.00123672 | ||||
Transfer Ownersh... | 34163752 | 583 days ago | IN | 0 AVAX | 0.00075996 | ||||
Approve | 33963469 | 588 days ago | IN | 0 AVAX | 0.01999057 | ||||
Approve | 33276094 | 604 days ago | IN | 0 AVAX | 0.00123672 | ||||
Mint | 33241528 | 604 days ago | IN | 0 AVAX | 0.00382599 | ||||
Init | 33241521 | 604 days ago | IN | 0 AVAX | 0.00178424 | ||||
Mint | 33240075 | 604 days ago | IN | 0 AVAX | 0.00382599 | ||||
Init | 33240069 | 604 days ago | IN | 0 AVAX | 0.00178424 | ||||
Approve | 33230195 | 605 days ago | IN | 0 AVAX | 0.00123672 | ||||
Mint | 33229536 | 605 days ago | IN | 0 AVAX | 0.004279 | ||||
Init | 33229421 | 605 days ago | IN | 0 AVAX | 0.00072331 | ||||
Mint | 33229141 | 605 days ago | IN | 0 AVAX | 0.00074785 | ||||
Init | 33229135 | 605 days ago | IN | 0 AVAX | 0.00178424 | ||||
Approve | 27902280 | 730 days ago | IN | 0 AVAX | 0.00123672 | ||||
Approve | 27881643 | 731 days ago | IN | 0 AVAX | 0.00123672 | ||||
Approve | 27881498 | 731 days ago | IN | 0 AVAX | 0.0006992 | ||||
Approve | 27881478 | 731 days ago | IN | 0 AVAX | 0.0006992 |
Loading...
Loading
Contract Name:
XPowerLoki
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 // solhint-disable not-rely-on-time // solhint-disable no-empty-blocks pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "./base/Migratable.sol"; import "./base/FeeTracker.sol"; import "./libs/Constants.sol"; import "./libs/Polynomials.sol"; import "./libs/Interpolators.sol"; /** * Abstract base class for the XPower THOR, LOKI and ODIN proof-of-work tokens. * It verifies, that the nonce & the block-hash do result in a positive amount, * (as specified by the sub-classes). After the verification, the corresponding * amount of tokens are minted for the beneficiary (plus the treasury). */ abstract contract XPower is ERC20, ERC20Burnable, MoeMigratable, FeeTracker, XPowerSupervised, Ownable { using EnumerableSet for EnumerableSet.UintSet; using Polynomials for Polynomial; /** set of nonce-hashes already minted for */ EnumerableSet.UintSet private _hashes; /** map from block-hashes to timestamps */ mapping(bytes32 => uint256) internal _timestamps; /** map from intervals to block-hashes */ mapping(uint256 => bytes32) internal _blockHashes; /** @param symbol short token symbol */ /** @param moeBase addresses of old contracts */ /** @param deadlineIn seconds to end-of-migration */ constructor( string memory symbol, address[] memory moeBase, uint256 deadlineIn ) // ERC20 constructor: name, symbol ERC20("XPower", symbol) // Migratable: old contract, rel. deadline [seconds] Migratable(moeBase, deadlineIn) {} /** emitted on caching most recent block-hash */ event Init(bytes32 blockHash, uint256 timestamp); /** cache most recent block-hash */ function init() public { uint256 interval = currentInterval(); if (uint256(_blockHashes[interval]) == 0) { bytes32 blockHash = blockhash(block.number - 1); require(blockHash > 0, "invalid block-hash"); uint256 timestamp = block.timestamp; require(timestamp > 0, "invalid timestamp"); _timestamps[blockHash] = timestamp; _blockHashes[interval] = blockHash; emit Init(blockHash, timestamp); } else { bytes32 blockHash = _blockHashes[interval]; uint256 timestamp = _timestamps[blockHash]; emit Init(blockHash, timestamp); } } /** mint tokens for to-beneficiary, block-hash & nonce */ function mint(address to, bytes32 blockHash, uint256 nonce) public tracked { // check block-hash to be in current interval _requireCurrent(blockHash, currentInterval()); // calculate nonce-hash for to, block-hash & nonce bytes32 nonceHash = _hashOf(to, blockHash, nonce); require(!_hashes.contains(uint256(nonceHash)), "duplicate nonce-hash"); // calculate number of zeros of nonce-hash uint256 zeros = _zerosOf(nonceHash); require(zeros > 0, "empty nonce-hash"); // calculate amount of tokens of zeros uint256 amount = _amountOf(zeros); // ensure unique nonce-hash (once-only use) _hashes.add(uint256(nonceHash)); // mint tokens for owner (i.e. project treasury) uint256 treasure = shareOf(amount); if (treasure > 0) _mint(owner(), treasure); // mint tokens for to-beneficiary (e.g. nonce provider) _mint(to, amount); } /** @return block-hash (for given interval) */ function blockHashOf(uint256 interval) public view returns (bytes32) { return _blockHashes[interval]; } /** @return current interval [hour] */ function currentInterval() public view returns (uint256) { uint256 interval = block.timestamp / (1 hours); require(interval > 0, "invalid interval"); return interval; } /** check whether block-hash has been cached (for given interval) */ function _requireCurrent(bytes32 blockHash, uint256 interval) internal view { require(blockHash > 0, "invalid block-hash"); uint256 timestamp = _timestamps[blockHash]; if (timestamp / (1 hours) != interval) { revert("expired block-hash"); } } /** @return hash of contract, to-beneficiary, block-hash & nonce */ function _hashOf(address to, bytes32 blockHash, uint256 nonce) internal view virtual returns (bytes32) { return keccak256(abi.encode(address(this), to, blockHash, nonce)); } /** @return leading-zeros (for given nonce-hash) */ function _zerosOf(bytes32 nonceHash) internal pure returns (uint8) { if (nonceHash > 0) { return uint8(63 - (Math.log2(uint256(nonceHash)) >> 2)); } return 64; } /** @return amount (for given level) */ function _amountOf(uint256 level) internal view virtual returns (uint256); /** interpolation anchor of treasury-share: amount => value */ mapping(uint256 => uint256) private _shareSourceValue; /** interpolation anchor of treasury-share: amount => timestamp */ mapping(uint256 => uint256) private _shareSourceStamp; /** parametrization of treasury-share */ uint256[] private _share = [0, 0, 2, 1, 0, 0]; /** @return interpolated share w/1-year lag (for amount) */ function shareOf(uint256 amount) public view returns (uint256) { if (_shareSourceStamp[amount] == 0) { return shareTargetOf(amount); } uint256 nowStamp = block.timestamp; uint256 srcStamp = _shareSourceStamp[amount]; uint256 tgtStamp = srcStamp + Constants.YEAR; uint256 srcValue = _shareSourceValue[amount]; uint256 tgtValue = shareTargetOf(amount); return Interpolators.linear(srcStamp, srcValue, tgtStamp, tgtValue, nowStamp); } /** @return treasury-share (for given amount) */ function shareTargetOf(uint256 amount) public view returns (uint256) { return shareTargetOf(amount, _share); } /** @return treasury-share (for given amount & parametrization) */ function shareTargetOf(uint256 amount, uint256[] memory array) private pure returns (uint256) { return Polynomial(array).evalClamped(amount); } /** @return treasury-share parameters */ function getTreasuryShare() public view returns (uint256[] memory) { return _share; } /** set treasury-share parameters */ function setTreasuryShare(uint256[] memory array) public onlyRole(TREASURY_SHARE_ROLE) { require(array.length == 6, "invalid array.length"); // eliminate possibility of division-by-zero require(array[2] > 0, "invalid array[2] == 0"); // eliminate possibility of all-zero values require(array[3] > 0, "invalid array[3] == 0"); for (uint256 zeros = 0; zeros <= 64; zeros++) { uint256 amount = _amountOf(zeros); // check share reparametrization of value uint256 lastValue = shareTargetOf(amount); uint256 nextValue = shareTargetOf(amount, array); _checkShareValue(nextValue, lastValue); _shareSourceValue[amount] = shareOf(amount); // check share reparametrization of stamp uint256 lastStamp = _shareSourceStamp[amount]; uint256 nextStamp = block.timestamp; _checkShareStamp(nextStamp, lastStamp); _shareSourceStamp[amount] = nextStamp; } _share = array; } /** validate treasury-share change: 0.5 <= next / last <= 2.0 or next <= amountOf(1) */ function _checkShareValue(uint256 nextValue, uint256 lastValue) private view { if (nextValue < lastValue) { require(lastValue <= 2 * nextValue, "invalid change: too small"); } if (nextValue > lastValue && lastValue > 0) { require(nextValue <= 2 * lastValue, "invalid change: too large"); } if (nextValue > lastValue && lastValue == 0) { require(nextValue <= _amountOf(1), "invalid change: too large"); } } /** validate treasury-share change: invocation frequency at most at once per month */ function _checkShareStamp(uint256 nextStamp, uint256 lastStamp) private pure { if (lastStamp > 0) { require(nextStamp - lastStamp > Constants.MONTH, "invalid change: too frequent"); } } /** @return true if this contract implements the interface defined by interfaceId */ function supportsInterface( bytes4 interfaceId ) public view virtual override(MoeMigratable, Supervised) returns (bool) { return super.supportsInterface(interfaceId); } /** @return prefix of token */ function prefix() public pure virtual returns (uint256); } /** * Allow mining & minting for THOR proof-of-work tokens, where the rewarded * amount equals to *only* |leading-zeros(nonce-hash)|. */ contract XPowerThor is XPower { /** @param moeBase addresses of old contracts */ /** @param deadlineIn seconds to end-of-migration */ constructor(address[] memory moeBase, uint256 deadlineIn) XPower("THOR", moeBase, deadlineIn) {} /** @return amount (for given level) */ function _amountOf(uint256 level) internal view override returns (uint256) { return level * 10 ** decimals(); } /** @return prefix of token */ function prefix() public pure override returns (uint256) { return 1; } } /** * Allow mining & minting for LOKI proof-of-work tokens, where the rewarded * amount equals to 2 ^ |leading-zeros(nonce-hash)| - 1. */ contract XPowerLoki is XPower { /** @param moeBase addresses of old contracts */ /** @param deadlineIn seconds to end-of-migration */ constructor(address[] memory moeBase, uint256 deadlineIn) XPower("LOKI", moeBase, deadlineIn) {} /** @return amount (for given level) */ function _amountOf(uint256 level) internal view override returns (uint256) { return (2 ** level - 1) * 10 ** decimals(); } /** @return prefix of token */ function prefix() public pure override returns (uint256) { return 2; } } /** * Allow mining & minting for ODIN proof-of-work tokens, where the rewarded * amount equals to 16 ^ |leading-zeros(nonce-hash)| - 1. */ contract XPowerOdin is XPower { /** @param moeBase addresses of old contracts */ /** @param deadlineIn seconds to end-of-migration */ constructor(address[] memory moeBase, uint256 deadlineIn) XPower("ODIN", moeBase, deadlineIn) {} /** @return amount (for given level) */ function _amountOf(uint256 level) internal view override returns (uint256) { return (16 ** level - 1) * 10 ** decimals(); } /** @return prefix of token */ function prefix() public pure override returns (uint256) { return 3; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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: * * ``` * 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}: * * ``` * 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. */ 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 (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// 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 v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol) pragma solidity ^0.8.0; import "../ERC20.sol"; import "../../../utils/Context.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { _spendAllowance(account, _msgSender(), amount); _burn(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount ) external returns (bool); }
// 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.8.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) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 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 10, 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 * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.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 `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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; /** * Allows tracking of fees using cumulative moving-averages: * > * > avg[n+1] = (fee[n+1] + n*avg[n]) / (n+1) * > */ abstract contract FeeTracker { /** cumulative moving-averages: gas & gas-price */ uint256[2] private _average; /** cumulative moving-averages: overhead ~ 1.29 */ uint256 private constant MUL = 1_2962089748866155; uint256 private constant DIV = 1_0000000000000000; /** gas & gas-price tracker */ modifier tracked() { uint256 gas = gasleft(); _; _update(gas - gasleft(), tx.gasprice); } /** @return fee-estimate and averages over gas & gas-price */ function fees() public view returns (uint256[] memory) { uint256[] memory array = new uint256[](3); uint256 gasPrice = _average[1]; array[2] = gasPrice; uint256 gasValue = _average[0]; array[1] = gasValue; uint256 feeValue = gasPrice * gasValue; array[0] = (MUL * feeValue) / DIV; return array; } /** update averages over gas & gas-price */ function _update(uint256 gasValue, uint256 gasPrice) private { uint256 value = _average[0]; if (value > 0) { _average[0] = (gasValue + value * 0xf) >> 4; } else { _average[0] = (gasValue); } uint256 price = _average[1]; if (price > 0) { _average[1] = (gasPrice + price * 0xf) >> 4; } else { _average[1] = (gasPrice); } } }
// SPDX-License-Identifier: GPL-3.0 // solhint-disable not-rely-on-time pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; import "./Supervised.sol"; /** * Allows migration of tokens from an old contract upto a certain deadline. * Further, it is possible to close down the migration window earlier than * the specified deadline. */ abstract contract Migratable is ERC20, ERC20Burnable, Supervised { /** burnable ERC20 tokens */ ERC20Burnable[] private _base; /** base address to index map */ mapping(address => uint) private _index; /** timestamp of migration deadline */ uint256 private _deadlineBy; /** flag to seal migrations */ bool[] private _sealed; /** number of migrated tokens */ uint256 private _migrated; /** @param base addresses of old contracts */ /** @param deadlineIn seconds to end-of-migration */ constructor(address[] memory base, uint256 deadlineIn) { _deadlineBy = block.timestamp + deadlineIn; _base = new ERC20Burnable[](base.length); _sealed = new bool[](base.length); for (uint256 i = 0; i < base.length; i++) { _base[i] = ERC20Burnable(base[i]); _index[base[i]] = i; } } /** @return index of base address */ function oldIndexOf(address base) public view returns (uint256) { return _index[base]; } /** migrate old amount of ERC20 tokens */ function migrate(uint256 oldAmount, uint256[] memory index) public returns (uint256) { return migrateFrom(msg.sender, oldAmount, index); } /** migrate old amount of ERC20 tokens (for account) */ function migrateFrom(address account, uint256 oldAmount, uint256[] memory index) public virtual returns (uint256) { uint256 newAmount = _premigrate(account, oldAmount, index[0]); _mint(account, newAmount); return newAmount; } /** migrate old amount of ERC20 tokens (w/o minting new ones) */ function _premigrate(address account, uint256 oldAmount, uint256 index) internal returns (uint256) { require(!_sealed[index], "migration sealed"); uint256 timestamp = block.timestamp; require(_deadlineBy >= timestamp, "deadline passed"); _base[index].burnFrom(account, oldAmount); require(oldAmount > 0, "non-positive amount"); uint256 newAmount = newUnits(oldAmount, index); _migrated += newAmount; return newAmount; } /** @return forward converted new amount w.r.t. decimals */ function newUnits(uint256 oldAmount, uint256 index) public view returns (uint256) { if (decimals() >= _base[index].decimals()) { return oldAmount * (10 ** (decimals() - _base[index].decimals())); } else { return oldAmount / (10 ** (_base[index].decimals() - decimals())); } } /** @return backward converted old amount w.r.t. decimals */ function oldUnits(uint256 newAmount, uint256 index) public view returns (uint256) { if (decimals() >= _base[index].decimals()) { return newAmount / (10 ** (decimals() - _base[index].decimals())); } else { return newAmount * (10 ** (_base[index].decimals() - decimals())); } } /** @return number of migrated tokens */ function migrated() public view returns (uint256) { return _migrated; } /** seal migration (manually) */ function _seal(uint256 index) internal { _sealed[index] = true; } /** seal-all migration (manually) */ function _sealAll() internal { for (uint256 i = 0; i < _sealed.length; i++) { _seal(i); } } /** @return seal flags (for all bases) */ function seals() public view returns (bool[] memory) { return _sealed; } /** @return true if this contract implements the interface defined by interfaceId */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC20).interfaceId || interfaceId == type(IERC20Metadata).interfaceId || super.supportsInterface(interfaceId); } } /** * Allows migration of MOE tokens from an old contract upto a certain deadline. */ abstract contract MoeMigratable is Migratable, MoeMigratableSupervised { /** seal migration (manually) */ function seal(uint256 index) public onlyRole(MOE_SEAL_ROLE) { _seal(index); } /** seal-all migration (manually) */ function sealAll() public onlyRole(MOE_SEAL_ROLE) { _sealAll(); } /** @return true if this contract implements the interface defined by interfaceId */ function supportsInterface(bytes4 interfaceId) public view virtual override(Migratable, Supervised) returns (bool) { return super.supportsInterface(interfaceId); } } /** * Allows migration of SOV tokens from an old contract upto a certain deadline. */ abstract contract SovMigratable is Migratable, SovMigratableSupervised { /** migratable MOE tokens */ MoeMigratable private _moe; /** @param moe address of MOE tokens */ /** @param base addresses of old contracts */ /** @param deadlineIn seconds to end-of-migration */ constructor(address moe, address[] memory base, uint256 deadlineIn) Migratable(base, deadlineIn) { _moe = MoeMigratable(moe); } /** migrate old amount of SOV tokens (for account) */ /// /// @dev assumes old (XPower/APower) == new (XPower/APower) w.r.t. decimals /// function migrateFrom(address account, uint256 oldAmount, uint256[] memory index) public override returns (uint256) { uint256[] memory moeIndex = _shift(index); assert(moeIndex.length + 1 == index.length); uint256 newAmountSov = newUnits(oldAmount, index[0]); uint256 migAmountSov = _premigrate(account, oldAmount, index[0]); assert(migAmountSov == newAmountSov); uint256 newAmountMoe = moeUnits(newAmountSov); uint256 oldAmountMoe = _moe.oldUnits(newAmountMoe, moeIndex[0]); uint256 migAmountMoe = _moe.migrateFrom(account, oldAmountMoe, moeIndex); assert(migAmountMoe == newAmountMoe); _moe.transferFrom(account, (address)(this), migAmountMoe); _mint(account, newAmountSov); return newAmountSov; } /** @return cross-converted MOE amount w.r.t. decimals */ function moeUnits(uint256 sovAmount) public view returns (uint256) { if (decimals() >= _moe.decimals()) { return sovAmount / (10 ** (decimals() - _moe.decimals())); } else { return sovAmount * (10 ** (_moe.decimals() - decimals())); } } /** @return cross-converted SOV amount w.r.t. decimals */ function sovUnits(uint256 moeAmount) public view returns (uint256) { if (decimals() >= _moe.decimals()) { return moeAmount * (10 ** (decimals() - _moe.decimals())); } else { return moeAmount / (10 ** (_moe.decimals() - decimals())); } } /** seal migration (manually) */ function seal(uint256 index) public onlyRole(SOV_SEAL_ROLE) { _seal(index); } /** seal-all migration (manually) */ function sealAll() public onlyRole(SOV_SEAL_ROLE) { _sealAll(); } /** @return true if this contract implements the interface defined by interfaceId */ function supportsInterface(bytes4 interfaceId) public view virtual override(Migratable, Supervised) returns (bool) { return super.supportsInterface(interfaceId); } /** @return shifted array (by a single position to the left) */ function _shift(uint256[] memory source) private pure returns (uint256[] memory) { uint256[] memory target = new uint256[](source.length - 1); for (uint256 i = 0; i < target.length; i++) { target[i] = source[i + 1]; } return target; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; abstract contract Supervised is AccessControlEnumerable { constructor() { _grantRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** @return true if this contract implements the interface defined by interfaceId */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return super.supportsInterface(interfaceId); } } abstract contract XPowerSupervised is Supervised { /** role grants right to change treasury's share per mint */ bytes32 public constant TREASURY_SHARE_ROLE = keccak256("TREASURY_SHARE_ROLE"); bytes32 public constant TREASURY_SHARE_ADMIN_ROLE = keccak256("TREASURY_SHARE_ADMIN_ROLE"); constructor() { _setRoleAdmin(TREASURY_SHARE_ROLE, TREASURY_SHARE_ADMIN_ROLE); _grantRole(TREASURY_SHARE_ADMIN_ROLE, msg.sender); } } abstract contract MoeTreasurySupervised is Supervised { /** role grants right to change APR parametrization */ bytes32 public constant APR_ROLE = keccak256("APR_ROLE"); bytes32 public constant APR_ADMIN_ROLE = keccak256("APR_ADMIN_ROLE"); /** role grants right to change APR bonus parametrization */ bytes32 public constant APR_BONUS_ROLE = keccak256("APR_BONUS_ROLE"); bytes32 public constant APR_BONUS_ADMIN_ROLE = keccak256("APR_BONUS_ADMIN_ROLE"); constructor() { _setRoleAdmin(APR_ROLE, APR_ADMIN_ROLE); _grantRole(APR_ADMIN_ROLE, msg.sender); _setRoleAdmin(APR_BONUS_ROLE, APR_BONUS_ADMIN_ROLE); _grantRole(APR_BONUS_ADMIN_ROLE, msg.sender); } } abstract contract MoeMigratableSupervised is Supervised { /** role grants right to seal MOE migration */ bytes32 public constant MOE_SEAL_ROLE = keccak256("MOE_SEAL_ROLE"); bytes32 public constant MOE_SEAL_ADMIN_ROLE = keccak256("MOE_SEAL_ADMIN_ROLE"); constructor() { _setRoleAdmin(MOE_SEAL_ROLE, MOE_SEAL_ADMIN_ROLE); _grantRole(MOE_SEAL_ADMIN_ROLE, msg.sender); } } abstract contract SovMigratableSupervised is Supervised { /** role grants right to seal SOV migration */ bytes32 public constant SOV_SEAL_ROLE = keccak256("SOV_SEAL_ROLE"); bytes32 public constant SOV_SEAL_ADMIN_ROLE = keccak256("SOV_SEAL_ADMIN_ROLE"); constructor() { _setRoleAdmin(SOV_SEAL_ROLE, SOV_SEAL_ADMIN_ROLE); _grantRole(SOV_SEAL_ADMIN_ROLE, msg.sender); } } abstract contract NftMigratableSupervised is Supervised { /** role grants right to seal NFT migration */ bytes32 public constant NFT_SEAL_ROLE = keccak256("NFT_SEAL_ROLE"); bytes32 public constant NFT_SEAL_ADMIN_ROLE = keccak256("NFT_SEAL_ADMIN_ROLE"); constructor() { _setRoleAdmin(NFT_SEAL_ROLE, NFT_SEAL_ADMIN_ROLE); _grantRole(NFT_SEAL_ADMIN_ROLE, msg.sender); } } abstract contract URIMalleableSupervised is Supervised { /** role grants right to change metadata URIs */ bytes32 public constant URI_DATA_ROLE = keccak256("URI_DATA_ROLE"); bytes32 public constant URI_DATA_ADMIN_ROLE = keccak256("URI_DATA_ADMIN_ROLE"); constructor() { _setRoleAdmin(URI_DATA_ROLE, URI_DATA_ADMIN_ROLE); _grantRole(URI_DATA_ADMIN_ROLE, msg.sender); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; library Constants { /** a century in [seconds] (approximation) */ uint256 internal constant CENTURY = 365_25 days; /** a year in [seconds] (approximation) */ uint256 internal constant YEAR = CENTURY / 100; /** a month [seconds] (approximation) */ uint256 internal constant MONTH = YEAR / 12; }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; library Interpolators { /** @return interpolate linearly v=t*(v1-v0)/(t1-t0) with v in [v0, v1] */ function linear(uint256 t0, uint256 v0, uint256 t1, uint256 v1, uint256 t) internal pure returns (uint256) { require(t1 >= t0, "invalid timeline"); if (t <= t0 || t0 == t1) { return v0; } if (t >= t1) { return v1; } uint256 dt = t1 - t0; assert(dt > 0); if (v1 > v0) { return (dt * v0 + (t - t0) * (v1 - v0)) / dt; } if (v0 > v1) { return (dt * v0 - (t - t0) * (v0 - v1)) / dt; } return v0; } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; struct Polynomial { uint256[] array; } library Polynomials { /** * @return value evaluated with (value+[5-4])*[3/2]+[1-0] * * Evaluates a `value` using a linear function -- defined by * the provided polynomial coefficients. */ function eval(Polynomial memory p, uint256 value) internal pure returns (uint256) { uint256 delta = sub(value + p.array[5], p.array[4]); uint256 ratio = div(delta * p.array[3], p.array[2]); return sub(ratio + p.array[1], p.array[0]); } /** * @return value evaluated with (value+[5-4])*[3/2]+[1-0] * * Evaluates a `value` using a linear function -- defined by * the provided polynomial coefficients. Negative underflows * are avoided by clamping at `0`. Further, division-by-zero * panics are prevented by clamping at `type(uint256).max`. */ function evalClamped(Polynomial memory p, uint256 value) internal pure returns (uint256) { uint256 delta = subClamped(value + p.array[5], p.array[4]); uint256 ratio = divClamped(delta * p.array[3], p.array[2]); return subClamped(ratio + p.array[1], p.array[0]); } function sub(uint256 lhs, uint256 rhs) private pure returns (uint256) { return lhs - rhs; // allow less-than-0 error } function subClamped(uint256 lhs, uint256 rhs) private pure returns (uint256) { return lhs > rhs ? lhs - rhs : 0; // avoid less-than-0 error } function div(uint256 lhs, uint256 rhs) private pure returns (uint256) { return lhs / rhs; // allow div-by-0 error } function divClamped(uint256 lhs, uint256 rhs) private pure returns (uint256) { return rhs > 0 ? lhs / rhs : type(uint256).max; // avoid div-by-0 error } }
{ "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
Contract ABI
API[{"inputs":[{"internalType":"address[]","name":"moeBase","type":"address[]"},{"internalType":"uint256","name":"deadlineIn","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Init","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":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":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MOE_SEAL_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MOE_SEAL_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY_SHARE_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY_SHARE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"interval","type":"uint256"}],"name":"blockHashOf","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fees","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTreasuryShare","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"init","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"oldAmount","type":"uint256"},{"internalType":"uint256[]","name":"index","type":"uint256[]"}],"name":"migrate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"oldAmount","type":"uint256"},{"internalType":"uint256[]","name":"index","type":"uint256[]"}],"name":"migrateFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"migrated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"oldAmount","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"newUnits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"base","type":"address"}],"name":"oldIndexOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newAmount","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"oldUnits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"prefix","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"index","type":"uint256"}],"name":"seal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sealAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seals","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"array","type":"uint256[]"}],"name":"setTreasuryShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"shareOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"shareTargetOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101406040526000608081815260a0829052600260c052600160e052610100829052610120919091526200003890601590600662000533565b503480156200004657600080fd5b5060405162003a7238038062003a728339810160408190526200006991620006cc565b604051806040016040528060048152602001634c4f4b4960e01b81525082828181604051806040016040528060068152602001652c2837bbb2b960d11b815250858160039081620000bb919062000834565b506004620000ca828262000834565b50620000dc915060009050336200033c565b620000e8814262000916565b60095581516001600160401b0381111562000107576200010762000699565b60405190808252806020026020018201604052801562000131578160200160208202803683370190505b508051620001489160079160209091019062000588565b5081516001600160401b0381111562000165576200016562000699565b6040519080825280602002602001820160405280156200018f578160200160208202803683370190505b508051620001a691600a91602090910190620005e0565b5060005b82518110156200027157828181518110620001c957620001c96200092c565b602002602001015160078281548110620001e757620001e76200092c565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555080600860008584815181106200022f576200022f6200092c565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080620002689062000942565b915050620001aa565b505050620002b57faa06a9d3e3ec1501dfa4c06793f24ccddc527fa3089263f11fd78652bb9bafdb60008051602062003a328339815191526200037f60201b60201c565b620002d060008051602062003a32833981519152336200033c565b6200030b7ffaf7695f60bc6df80a9a6a1674eb3a25a97bffeb33335a6c9c5fffdaa1c2277360008051602062003a528339815191526200037f565b6200032660008051602062003a52833981519152336200033c565b6200033133620003ca565b50505050506200095e565b6200035382826200041c60201b620015e91760201c565b60008281526006602090815260409091206200037a9183906200166f620004c1821b17901c565b505050565b600082815260056020526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b600e80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008281526005602090815260408083206001600160a01b038516845290915290205460ff16620004bd5760008281526005602090815260408083206001600160a01b03851684529091529020805460ff191660011790556200047c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000620004d8836001600160a01b038416620004e1565b90505b92915050565b60008181526001830160205260408120546200052a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620004db565b506000620004db565b82805482825590600052602060002090810192821562000576579160200282015b8281111562000576578251829060ff1690559160200191906001019062000554565b506200058492915062000682565b5090565b82805482825590600052602060002090810192821562000576579160200282015b828111156200057657825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620005a9565b82805482825590600052602060002090601f01602090048101928215620005765791602002820160005b838211156200064957835183826101000a81548160ff02191690831515021790555092602001926001016020816000010492830192600103026200060a565b8015620006785782816101000a81549060ff021916905560010160208160000104928301926001030262000649565b5050620005849291505b5b8082111562000584576000815560010162000683565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b0381168114620006c757600080fd5b919050565b60008060408385031215620006e057600080fd5b82516001600160401b0380821115620006f857600080fd5b818501915085601f8301126200070d57600080fd5b815160208282111562000724576200072462000699565b8160051b604051601f19603f830116810181811086821117156200074c576200074c62000699565b6040529283528183019350848101820192898411156200076b57600080fd5b948201945b8386101562000794576200078486620006af565b8552948201949382019362000770565b97909101519698969750505050505050565b600181811c90821680620007bb57607f821691505b602082108103620007dc57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200037a57600081815260208120601f850160051c810160208610156200080b5750805b601f850160051c820191505b818110156200082c5782815560010162000817565b505050505050565b81516001600160401b0381111562000850576200085062000699565b6200086881620008618454620007a6565b84620007e2565b602080601f831160018114620008a05760008415620008875750858301515b600019600386901b1c1916600185901b1785556200082c565b600085815260208120601f198616915b82811015620008d157888601518255948401946001909101908401620008b0565b5085821015620008f05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b80820180821115620004db57620004db62000900565b634e487b7160e01b600052603260045260246000fd5b60006001820162000957576200095762000900565b5060010190565b6130c4806200096e6000396000f3fe608060405234801561001057600080fd5b50600436106102a05760003560e01c806375dadb3211610167578063a9059cbb116100ce578063dd62ed3e11610087578063dd62ed3e1461060e578063e1c7392a14610621578063e93b35cf14610629578063f2fde38b1461063c578063f544c35e1461064f578063fad1919a1461067857600080fd5b8063a9059cbb14610574578063bb14047014610587578063c89dcfce146105ae578063ca15c873146105c1578063d547741f146105d4578063d565b5ae146105e757600080fd5b80639010d07c116101205780639010d07c1461052357806391d148541461053657806395d89b41146105495780639af1d35a14610551578063a217fddf14610559578063a457c2d71461056157600080fd5b806375dadb32146104a95780637766912d146104b0578063796441bb146104c357806379cc6790146104d857806386fe212d146104eb5780638da5cb5b146104fe57600080fd5b80632c678c641161020b57806339444ffe116101c457806339444ffe1461042c578063395093511461043f57806342966c68146104525780636c9efc911461046557806370a0823114610478578063715018a6146104a157600080fd5b80632c678c64146103d45780632f2ff15d146103dc578063313ce567146103ef578063320974b2146103fe578063363487bc1461041157806336568abe1461041957600080fd5b80630c7fa13e1161025d5780630c7fa13e146103525780630e12aafe1461035c57806318160ddd1461038357806323b872dd1461038b578063248a9ca31461039e57806326ca291b146103c157600080fd5b806301ffc9a7146102a557806306fdde03146102cd578063080e1301146102e257806308560eca14610303578063095ea7b3146103185780630a99e88a1461032b575b600080fd5b6102b86102b33660046129e9565b610698565b60405190151581526020015b60405180910390f35b6102d56106a9565b6040516102c49190612a37565b6102f56102f0366004612b10565b61073b565b6040519081526020016102c4565b61030b61074f565b6040516102c49190612b57565b6102b8610326366004612bb4565b6107c6565b6102f57faa06a9d3e3ec1501dfa4c06793f24ccddc527fa3089263f11fd78652bb9bafdb81565b61035a6107de565b005b6102f57f75de9fdf4d2ce86f3bd7c71d26e2f2292f9d0cf58a5dee2b8115bfb4bba3299481565b6002546102f5565b6102b8610399366004612bde565b610813565b6102f56103ac366004612c1a565b60009081526005602052604090206001015490565b6102f56103cf366004612c1a565b610837565b600b546102f5565b61035a6103ea366004612c33565b6108b4565b604051601281526020016102c4565b6102f561040c366004612c1a565b6108de565b6102f561093a565b61035a610427366004612c33565b610998565b6102f561043a366004612c5f565b610a16565b6102b861044d366004612bb4565b610bfb565b61035a610460366004612c1a565b610c1d565b6102f5610473366004612c5f565b610c27565b6102f5610486366004612c81565b6001600160a01b031660009081526020819052604090205490565b61035a610dcb565b60026102f5565b6102f56104be366004612c9c565b610ddf565b6104cb610e1b565b6040516102c49190612cf3565b61035a6104e6366004612bb4565b610e72565b61035a6104f9366004612c1a565b610e87565b600e546001600160a01b03165b6040516001600160a01b0390911681526020016102c4565b61050b610531366004612c5f565b610eba565b6102b8610544366004612c33565b610ed2565b6102d5610efd565b6104cb610f0c565b6102f5600081565b6102b861056f366004612bb4565b610fd5565b6102b8610582366004612bb4565b611050565b6102f57f7df1fa30796d39d0e882422146943ee011c6f6b410f211570cc3a712e3e51e6a81565b61035a6105bc366004612d2b565b61105e565b6102f56105cf366004612c1a565b6111c7565b61035a6105e2366004612c33565b6111de565b6102f57ffaf7695f60bc6df80a9a6a1674eb3a25a97bffeb33335a6c9c5fffdaa1c2277381565b6102f561061c366004612d5e565b611203565b61035a61122e565b61035a610637366004612d88565b611393565b61035a61064a366004612c81565b611573565b6102f561065d366004612c81565b6001600160a01b031660009081526008602052604090205490565b6102f5610686366004612c1a565b60009081526012602052604090205490565b60006106a382611684565b92915050565b6060600380546106b890612dbd565b80601f01602080910402602001604051908101604052809291908181526020018280546106e490612dbd565b80156107315780601f1061070657610100808354040283529160200191610731565b820191906000526020600020905b81548152906001019060200180831161071457829003601f168201915b5050505050905090565b6000610748338484610ddf565b9392505050565b6060600a80548060200260200160405190810160405280929190818152602001828054801561073157602002820191906000526020600020906000905b825461010083900a900460ff16151581526020600192830181810494850194909303909202910180841161078c5790505050505050905090565b6000336107d481858561168f565b5060019392505050565b7faa06a9d3e3ec1501dfa4c06793f24ccddc527fa3089263f11fd78652bb9bafdb610808816117b3565b6108106117bd565b50565b6000336108218582856117e5565b61082c858585611859565b506001949350505050565b6000818152601460205260408120548103610855576106a3826108de565b6000828152601460205260408120544291610875606463bc191380612e0d565b61087f9083612e2f565b60008681526013602052604081205491925061089a876108de565b90506108a984838584896119fd565b979650505050505050565b6000828152600560205260409020600101546108cf816117b3565b6108d98383611b1e565b505050565b60006106a382601580548060200260200160405190810160405280929190818152602001828054801561093057602002820191906000526020600020905b81548152602001906001019080831161091c575b5050505050611b40565b600080610949610e1042612e0d565b9050600081116109935760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081a5b9d195c9d985b60821b60448201526064015b60405180910390fd5b919050565b6001600160a01b0381163314610a085760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161098a565b610a128282611b5b565b5050565b600060078281548110610a2b57610a2b612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9d9190612e58565b60ff16601210610b555760078281548110610aba57610aba612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610b08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2c9190612e58565b60125b610b399190612e7b565b610b4490600a612f78565b610b4e9084612e0d565b90506106a3565b601260078381548110610b6a57610b6a612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdc9190612e58565b610be69190612e7b565b610bf190600a612f78565b610b4e9084612f87565b6000336107d4818585610c0e8383611203565b610c189190612e2f565b61168f565b6108103382611b7d565b600060078281548110610c3c57610c3c612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610c8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cae9190612e58565b60ff16601210610d445760078281548110610ccb57610ccb612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3d9190612e58565b6012610bdc565b601260078381548110610d5957610d59612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610da7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2f9190612e58565b610dd3611caf565b610ddd6000611d09565b565b600080610e07858585600081518110610dfa57610dfa612e42565b6020026020010151611d5b565b9050610e138582611f0d565b949350505050565b6060601580548060200260200160405190810160405280929190818152602001828054801561073157602002820191906000526020600020905b815481526020019060010190808311610e55575050505050905090565b610e7d8233836117e5565b610a128282611b7d565b7faa06a9d3e3ec1501dfa4c06793f24ccddc527fa3089263f11fd78652bb9bafdb610eb1816117b3565b610a1282611fcc565b6000828152600660205260408120610748908361200d565b60009182526005602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600480546106b890612dbd565b60408051600380825260808201909252606091600091906020820184803683375050600d5482519293509182915083906002908110610f4d57610f4d612e42565b6020908102919091010152600c548251819084906001908110610f7257610f72612e42565b60209081029190910101526000610f898284612f87565b9050662386f26fc10000610fa482662e0cf3b307246b612f87565b610fae9190612e0d565b84600081518110610fc157610fc1612e42565b602090810291909101015250919392505050565b60003381610fe38286611203565b9050838110156110435760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161098a565b61082c828686840361168f565b6000336107d4818585611859565b60005a90506110748361106f61093a565b612019565b60408051306020808301919091526001600160a01b038716828401526060820186905260808083018690528351808403909101815260a090920190925280519101206110c1600f826120b9565b156111055760405162461bcd60e51b81526020600482015260146024820152730c8eae0d8d2c6c2e8ca40dcdedcc6ca5ad0c2e6d60631b604482015260640161098a565b6000611110826120d1565b60ff169050600081116111585760405162461bcd60e51b815260206004820152601060248201526f0cadae0e8f240dcdedcc6ca5ad0c2e6d60831b604482015260640161098a565b6000611163826120f8565b9050611170600f84612127565b50600061117c82610837565b9050801561119f5761119f611199600e546001600160a01b031690565b82611f0d565b6111a98883611f0d565b505050506111c15a6111bb9083612f9e565b3a612133565b50505050565b60008181526006602052604081206106a390612195565b6000828152600560205260409020600101546111f9816117b3565b6108d98383611b5b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600061123861093a565b6000818152601260205260408120549192500361134157600061125c600143612f9e565b409050806112a15760405162461bcd60e51b81526020600482015260126024820152710d2dcecc2d8d2c840c4d8dec6d65ad0c2e6d60731b604482015260640161098a565b42806112e35760405162461bcd60e51b81526020600482015260116024820152700696e76616c69642074696d657374616d7607c1b604482015260640161098a565b6000828152601160209081526040808320849055858352601282529182902084905581518481529081018390527f2c6c5a9e4f0ddd70b42bd7fcac74128409018755c234dc0d2d29c66eb6335c9a91015b60405180910390a1505050565b6000818152601260209081526040808320548084526011835292819020548151848152928301819052917f2c6c5a9e4f0ddd70b42bd7fcac74128409018755c234dc0d2d29c66eb6335c9a9101611334565b7ffaf7695f60bc6df80a9a6a1674eb3a25a97bffeb33335a6c9c5fffdaa1c227736113bd816117b3565b81516006146114055760405162461bcd60e51b81526020600482015260146024820152730d2dcecc2d8d2c840c2e4e4c2f25cd8cadccee8d60631b604482015260640161098a565b60008260028151811061141a5761141a612e42565b6020026020010151116114675760405162461bcd60e51b81526020600482015260156024820152740696e76616c69642061727261795b325d203d3d203605c1b604482015260640161098a565b60008260038151811061147c5761147c612e42565b6020026020010151116114c95760405162461bcd60e51b81526020600482015260156024820152740696e76616c69642061727261795b335d203d3d203605c1b604482015260640161098a565b60005b6040811161155f5760006114df826120f8565b905060006114ec826108de565b905060006114fa8387611b40565b9050611506818361219f565b61150f83610837565b6000848152601360209081526040808320939093556014905220544261153581836122d2565b6000948552601460205260409094209390935550829150611557905081612fb1565b9150506114cc565b5081516108d9906015906020850190612989565b61157b611caf565b6001600160a01b0381166115e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161098a565b61081081611d09565b6115f38282610ed2565b610a125760008281526005602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561162b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610748836001600160a01b03841661234a565b60006106a382612399565b6001600160a01b0383166116f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161098a565b6001600160a01b0382166117525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161098a565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b61081081336123d9565b60005b600a54811015610810576117d381611fcc565b806117dd81612fb1565b9150506117c0565b60006117f18484611203565b905060001981146111c1578181101561184c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161098a565b6111c1848484840361168f565b6001600160a01b0383166118bd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161098a565b6001600160a01b03821661191f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161098a565b6001600160a01b038316600090815260208190526040902054818110156119975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161098a565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36111c1565b600085841015611a425760405162461bcd60e51b815260206004820152601060248201526f696e76616c69642074696d656c696e6560801b604482015260640161098a565b8582111580611a5057508386145b15611a5c575083611b15565b838210611a6a575081611b15565b6000611a768786612f9e565b905060008111611a8857611a88612fca565b85841115611ad55780611a9b8786612f9e565b611aa58986612f9e565b611aaf9190612f87565b611ab98884612f87565b611ac39190612e2f565b611acd9190612e0d565b915050611b15565b83861115611b105780611ae88588612f9e565b611af28986612f9e565b611afc9190612f87565b611b068884612f87565b611ac39190612f9e565b859150505b95945050505050565b611b2882826115e9565b60008281526006602052604090206108d9908261166f565b60408051602081019091528181526000906107489084612432565b611b658282612519565b60008281526006602052604090206108d99082612580565b6001600160a01b038216611bdd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161098a565b6001600160a01b03821660009081526020819052604090205481811015611c515760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161098a565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600e546001600160a01b03163314610ddd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161098a565b600e80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600a8281548110611d7057611d70612e42565b90600052602060002090602091828204019190069054906101000a900460ff1615611dd05760405162461bcd60e51b815260206004820152601060248201526f1b5a59dc985d1a5bdb881cd9585b195960821b604482015260640161098a565b6009544290811115611e165760405162461bcd60e51b815260206004820152600f60248201526e191958591b1a5b99481c185cdcd959608a1b604482015260640161098a565b60078381548110611e2957611e29612e42565b60009182526020909120015460405163079cc67960e41b81526001600160a01b03878116600483015260248201879052909116906379cc679090604401600060405180830381600087803b158015611e8057600080fd5b505af1158015611e94573d6000803e3d6000fd5b5050505060008411611ede5760405162461bcd60e51b81526020600482015260136024820152721b9bdb8b5c1bdcda5d1a5d9948185b5bdd5b9d606a1b604482015260640161098a565b6000611eea8585610c27565b905080600b6000828254611efe9190612e2f565b90915550909695505050505050565b6001600160a01b038216611f635760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161098a565b8060026000828254611f759190612e2f565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600a8281548110611fe157611fe1612e42565b90600052602060002090602091828204019190066101000a81548160ff02191690831515021790555050565b60006107488383612595565b8161205b5760405162461bcd60e51b81526020600482015260126024820152710d2dcecc2d8d2c840c4d8dec6d65ad0c2e6d60731b604482015260640161098a565b60008281526011602052604090205481612077610e1083612e0d565b146108d95760405162461bcd60e51b81526020600482015260126024820152710caf0e0d2e4cac840c4d8dec6d65ad0c2e6d60731b604482015260640161098a565b60008181526001830160205260408120541515610748565b600081156120f05760026120e4836125bf565b6106a3911c603f612f9e565b506040919050565b60006121066012600a612f78565b6001612113846002612fe0565b61211d9190612f9e565b6106a39190612f87565b6000610748838361234a565b600c54801561215d57600461214982600f612f87565b6121539085612e2f565b901c600c55612163565b600c8390555b600d54801561218d57600461217982600f612f87565b6121839085612e2f565b901c600d556111c1565b5050600d5550565b60006106a3825490565b80821015612201576121b2826002612f87565b8111156122015760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964206368616e67653a20746f6f20736d616c6c00000000000000604482015260640161098a565b80821180156122105750600081115b1561226b57612220816002612f87565b82111561226b5760405162461bcd60e51b8152602060048201526019602482015278696e76616c6964206368616e67653a20746f6f206c6172676560381b604482015260640161098a565b8082118015612278575080155b15610a125761228760016120f8565b821115610a125760405162461bcd60e51b8152602060048201526019602482015278696e76616c6964206368616e67653a20746f6f206c6172676560381b604482015260640161098a565b8015610a1257600c6122e9606463bc191380612e0d565b6122f39190612e0d565b6122fd8284612f9e565b11610a125760405162461bcd60e51b815260206004820152601c60248201527f696e76616c6964206368616e67653a20746f6f206672657175656e7400000000604482015260640161098a565b6000818152600183016020526040812054612391575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106a3565b5060006106a3565b60006001600160e01b031982166336372b0760e01b14806123ca57506001600160e01b0319821663a219a02560e01b145b806106a357506106a382612653565b6123e38282610ed2565b610a12576123f08161265e565b6123fb836020612670565b60405160200161240c929190612fec565b60408051601f198184030181529082905262461bcd60e51b825261098a91600401612a37565b600080612484846000015160058151811061244f5761244f612e42565b6020026020010151846124629190612e2f565b85518051600490811061247757612477612e42565b602002602001015161280c565b905060006124d785600001516003815181106124a2576124a2612e42565b6020026020010151836124b59190612f87565b8651805160029081106124ca576124ca612e42565b6020026020010151612826565b9050611b1585600001516001815181106124f3576124f3612e42565b6020026020010151826125069190612e2f565b8651805160009061247757612477612e42565b6125238282610ed2565b15610a125760008281526005602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610748836001600160a01b038416612841565b60008260000182815481106125ac576125ac612e42565b9060005260206000200154905092915050565b600080608083901c156125d457608092831c92015b604083901c156125e657604092831c92015b602083901c156125f857602092831c92015b601083901c1561260a57601092831c92015b600883901c1561261c57600892831c92015b600483901c1561262e57600492831c92015b600283901c1561264057600292831c92015b600183901c156106a35760010192915050565b60006106a382612934565b60606106a36001600160a01b03831660145b6060600061267f836002612f87565b61268a906002612e2f565b67ffffffffffffffff8111156126a2576126a2612a6a565b6040519080825280601f01601f1916602001820160405280156126cc576020820181803683370190505b509050600360fc1b816000815181106126e7576126e7612e42565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061271657612716612e42565b60200101906001600160f81b031916908160001a905350600061273a846002612f87565b612745906001612e2f565b90505b60018111156127bd576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061277957612779612e42565b1a60f81b82828151811061278f5761278f612e42565b60200101906001600160f81b031916908160001a90535060049490941c936127b681613061565b9050612748565b5083156107485760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161098a565b600081831161281c576000610748565b6107488284612f9e565b600080821161283757600019610748565b6107488284612e0d565b6000818152600183016020526040812054801561292a576000612865600183612f9e565b855490915060009061287990600190612f9e565b90508181146128de57600086600001828154811061289957612899612e42565b90600052602060002001549050808760000184815481106128bc576128bc612e42565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806128ef576128ef613078565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106a3565b60009150506106a3565b60006001600160e01b03198216635a05180f60e01b14806106a357506106a38260006001600160e01b03198216637965db0b60e01b14806106a357506301ffc9a760e01b6001600160e01b03198316146106a3565b8280548282559060005260206000209081019282156129c4579160200282015b828111156129c45782518255916020019190600101906129a9565b506129d09291506129d4565b5090565b5b808211156129d057600081556001016129d5565b6000602082840312156129fb57600080fd5b81356001600160e01b03198116811461074857600080fd5b60005b83811015612a2e578181015183820152602001612a16565b50506000910152565b6020815260008251806020840152612a56816040850160208701612a13565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612a9157600080fd5b8135602067ffffffffffffffff80831115612aae57612aae612a6a565b8260051b604051601f19603f83011681018181108482111715612ad357612ad3612a6a565b604052938452858101830193838101925087851115612af157600080fd5b83870191505b848210156108a957813583529183019190830190612af7565b60008060408385031215612b2357600080fd5b82359150602083013567ffffffffffffffff811115612b4157600080fd5b612b4d85828601612a80565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612b91578351151583529284019291840191600101612b73565b50909695505050505050565b80356001600160a01b038116811461099357600080fd5b60008060408385031215612bc757600080fd5b612bd083612b9d565b946020939093013593505050565b600080600060608486031215612bf357600080fd5b612bfc84612b9d565b9250612c0a60208501612b9d565b9150604084013590509250925092565b600060208284031215612c2c57600080fd5b5035919050565b60008060408385031215612c4657600080fd5b82359150612c5660208401612b9d565b90509250929050565b60008060408385031215612c7257600080fd5b50508035926020909101359150565b600060208284031215612c9357600080fd5b61074882612b9d565b600080600060608486031215612cb157600080fd5b612cba84612b9d565b925060208401359150604084013567ffffffffffffffff811115612cdd57600080fd5b612ce986828701612a80565b9150509250925092565b6020808252825182820181905260009190848201906040850190845b81811015612b9157835183529284019291840191600101612d0f565b600080600060608486031215612d4057600080fd5b612d4984612b9d565b95602085013595506040909401359392505050565b60008060408385031215612d7157600080fd5b612d7a83612b9d565b9150612c5660208401612b9d565b600060208284031215612d9a57600080fd5b813567ffffffffffffffff811115612db157600080fd5b610e1384828501612a80565b600181811c90821680612dd157607f821691505b602082108103612df157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082612e2a57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156106a3576106a3612df7565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612e6a57600080fd5b815160ff8116811461074857600080fd5b60ff82811682821603908111156106a3576106a3612df7565b600181815b80851115612ecf578160001904821115612eb557612eb5612df7565b80851615612ec257918102915b93841c9390800290612e99565b509250929050565b600082612ee6575060016106a3565b81612ef3575060006106a3565b8160018114612f095760028114612f1357612f2f565b60019150506106a3565b60ff841115612f2457612f24612df7565b50506001821b6106a3565b5060208310610133831016604e8410600b8410161715612f52575081810a6106a3565b612f5c8383612e94565b8060001904821115612f7057612f70612df7565b029392505050565b600061074860ff841683612ed7565b80820281158282048414176106a3576106a3612df7565b818103818111156106a3576106a3612df7565b600060018201612fc357612fc3612df7565b5060010190565b634e487b7160e01b600052600160045260246000fd5b60006107488383612ed7565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613024816017850160208801612a13565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613055816028840160208801612a13565b01602801949350505050565b60008161307057613070612df7565b506000190190565b634e487b7160e01b600052603160045260246000fdfea264697066735822122056b22df6bb94f69f2d0ba796973ec891ca88603dad81e9239ef14ae8cdcdafb964736f6c634300081100337df1fa30796d39d0e882422146943ee011c6f6b410f211570cc3a712e3e51e6a75de9fdf4d2ce86f3bd7c71d26e2f2292f9d0cf58a5dee2b8115bfb4bba3299400000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000007861f800000000000000000000000000000000000000000000000000000000000000007000000000000000000000000c63e3b6d0a2d382a74b13d19426b65c0aa5f36480000000000000000000000002c5c3374c216bd8c36d598c40d990eb2a2250ccd0000000000000000000000001ab7b945f50d33cf387fb74eb5f7a092ad03dc810000000000000000000000004353cac32924b45c01c2880f65e75b3795ddfd60000000000000000000000000f0f11d6d86346c541ba2ef2f48ad7a58255cd52b0000000000000000000000000f310c35c006a86bd0df6595b1856ce8ef06bbd3000000000000000000000000551b372ad7a7b85bab113b273fd4c7924dff4071
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102a05760003560e01c806375dadb3211610167578063a9059cbb116100ce578063dd62ed3e11610087578063dd62ed3e1461060e578063e1c7392a14610621578063e93b35cf14610629578063f2fde38b1461063c578063f544c35e1461064f578063fad1919a1461067857600080fd5b8063a9059cbb14610574578063bb14047014610587578063c89dcfce146105ae578063ca15c873146105c1578063d547741f146105d4578063d565b5ae146105e757600080fd5b80639010d07c116101205780639010d07c1461052357806391d148541461053657806395d89b41146105495780639af1d35a14610551578063a217fddf14610559578063a457c2d71461056157600080fd5b806375dadb32146104a95780637766912d146104b0578063796441bb146104c357806379cc6790146104d857806386fe212d146104eb5780638da5cb5b146104fe57600080fd5b80632c678c641161020b57806339444ffe116101c457806339444ffe1461042c578063395093511461043f57806342966c68146104525780636c9efc911461046557806370a0823114610478578063715018a6146104a157600080fd5b80632c678c64146103d45780632f2ff15d146103dc578063313ce567146103ef578063320974b2146103fe578063363487bc1461041157806336568abe1461041957600080fd5b80630c7fa13e1161025d5780630c7fa13e146103525780630e12aafe1461035c57806318160ddd1461038357806323b872dd1461038b578063248a9ca31461039e57806326ca291b146103c157600080fd5b806301ffc9a7146102a557806306fdde03146102cd578063080e1301146102e257806308560eca14610303578063095ea7b3146103185780630a99e88a1461032b575b600080fd5b6102b86102b33660046129e9565b610698565b60405190151581526020015b60405180910390f35b6102d56106a9565b6040516102c49190612a37565b6102f56102f0366004612b10565b61073b565b6040519081526020016102c4565b61030b61074f565b6040516102c49190612b57565b6102b8610326366004612bb4565b6107c6565b6102f57faa06a9d3e3ec1501dfa4c06793f24ccddc527fa3089263f11fd78652bb9bafdb81565b61035a6107de565b005b6102f57f75de9fdf4d2ce86f3bd7c71d26e2f2292f9d0cf58a5dee2b8115bfb4bba3299481565b6002546102f5565b6102b8610399366004612bde565b610813565b6102f56103ac366004612c1a565b60009081526005602052604090206001015490565b6102f56103cf366004612c1a565b610837565b600b546102f5565b61035a6103ea366004612c33565b6108b4565b604051601281526020016102c4565b6102f561040c366004612c1a565b6108de565b6102f561093a565b61035a610427366004612c33565b610998565b6102f561043a366004612c5f565b610a16565b6102b861044d366004612bb4565b610bfb565b61035a610460366004612c1a565b610c1d565b6102f5610473366004612c5f565b610c27565b6102f5610486366004612c81565b6001600160a01b031660009081526020819052604090205490565b61035a610dcb565b60026102f5565b6102f56104be366004612c9c565b610ddf565b6104cb610e1b565b6040516102c49190612cf3565b61035a6104e6366004612bb4565b610e72565b61035a6104f9366004612c1a565b610e87565b600e546001600160a01b03165b6040516001600160a01b0390911681526020016102c4565b61050b610531366004612c5f565b610eba565b6102b8610544366004612c33565b610ed2565b6102d5610efd565b6104cb610f0c565b6102f5600081565b6102b861056f366004612bb4565b610fd5565b6102b8610582366004612bb4565b611050565b6102f57f7df1fa30796d39d0e882422146943ee011c6f6b410f211570cc3a712e3e51e6a81565b61035a6105bc366004612d2b565b61105e565b6102f56105cf366004612c1a565b6111c7565b61035a6105e2366004612c33565b6111de565b6102f57ffaf7695f60bc6df80a9a6a1674eb3a25a97bffeb33335a6c9c5fffdaa1c2277381565b6102f561061c366004612d5e565b611203565b61035a61122e565b61035a610637366004612d88565b611393565b61035a61064a366004612c81565b611573565b6102f561065d366004612c81565b6001600160a01b031660009081526008602052604090205490565b6102f5610686366004612c1a565b60009081526012602052604090205490565b60006106a382611684565b92915050565b6060600380546106b890612dbd565b80601f01602080910402602001604051908101604052809291908181526020018280546106e490612dbd565b80156107315780601f1061070657610100808354040283529160200191610731565b820191906000526020600020905b81548152906001019060200180831161071457829003601f168201915b5050505050905090565b6000610748338484610ddf565b9392505050565b6060600a80548060200260200160405190810160405280929190818152602001828054801561073157602002820191906000526020600020906000905b825461010083900a900460ff16151581526020600192830181810494850194909303909202910180841161078c5790505050505050905090565b6000336107d481858561168f565b5060019392505050565b7faa06a9d3e3ec1501dfa4c06793f24ccddc527fa3089263f11fd78652bb9bafdb610808816117b3565b6108106117bd565b50565b6000336108218582856117e5565b61082c858585611859565b506001949350505050565b6000818152601460205260408120548103610855576106a3826108de565b6000828152601460205260408120544291610875606463bc191380612e0d565b61087f9083612e2f565b60008681526013602052604081205491925061089a876108de565b90506108a984838584896119fd565b979650505050505050565b6000828152600560205260409020600101546108cf816117b3565b6108d98383611b1e565b505050565b60006106a382601580548060200260200160405190810160405280929190818152602001828054801561093057602002820191906000526020600020905b81548152602001906001019080831161091c575b5050505050611b40565b600080610949610e1042612e0d565b9050600081116109935760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081a5b9d195c9d985b60821b60448201526064015b60405180910390fd5b919050565b6001600160a01b0381163314610a085760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161098a565b610a128282611b5b565b5050565b600060078281548110610a2b57610a2b612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610a79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9d9190612e58565b60ff16601210610b555760078281548110610aba57610aba612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610b08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2c9190612e58565b60125b610b399190612e7b565b610b4490600a612f78565b610b4e9084612e0d565b90506106a3565b601260078381548110610b6a57610b6a612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610bb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdc9190612e58565b610be69190612e7b565b610bf190600a612f78565b610b4e9084612f87565b6000336107d4818585610c0e8383611203565b610c189190612e2f565b61168f565b6108103382611b7d565b600060078281548110610c3c57610c3c612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610c8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cae9190612e58565b60ff16601210610d445760078281548110610ccb57610ccb612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3d9190612e58565b6012610bdc565b601260078381548110610d5957610d59612e42565b600091825260209182902001546040805163313ce56760e01b815290516001600160a01b039092169263313ce567926004808401938290030181865afa158015610da7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2f9190612e58565b610dd3611caf565b610ddd6000611d09565b565b600080610e07858585600081518110610dfa57610dfa612e42565b6020026020010151611d5b565b9050610e138582611f0d565b949350505050565b6060601580548060200260200160405190810160405280929190818152602001828054801561073157602002820191906000526020600020905b815481526020019060010190808311610e55575050505050905090565b610e7d8233836117e5565b610a128282611b7d565b7faa06a9d3e3ec1501dfa4c06793f24ccddc527fa3089263f11fd78652bb9bafdb610eb1816117b3565b610a1282611fcc565b6000828152600660205260408120610748908361200d565b60009182526005602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600480546106b890612dbd565b60408051600380825260808201909252606091600091906020820184803683375050600d5482519293509182915083906002908110610f4d57610f4d612e42565b6020908102919091010152600c548251819084906001908110610f7257610f72612e42565b60209081029190910101526000610f898284612f87565b9050662386f26fc10000610fa482662e0cf3b307246b612f87565b610fae9190612e0d565b84600081518110610fc157610fc1612e42565b602090810291909101015250919392505050565b60003381610fe38286611203565b9050838110156110435760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161098a565b61082c828686840361168f565b6000336107d4818585611859565b60005a90506110748361106f61093a565b612019565b60408051306020808301919091526001600160a01b038716828401526060820186905260808083018690528351808403909101815260a090920190925280519101206110c1600f826120b9565b156111055760405162461bcd60e51b81526020600482015260146024820152730c8eae0d8d2c6c2e8ca40dcdedcc6ca5ad0c2e6d60631b604482015260640161098a565b6000611110826120d1565b60ff169050600081116111585760405162461bcd60e51b815260206004820152601060248201526f0cadae0e8f240dcdedcc6ca5ad0c2e6d60831b604482015260640161098a565b6000611163826120f8565b9050611170600f84612127565b50600061117c82610837565b9050801561119f5761119f611199600e546001600160a01b031690565b82611f0d565b6111a98883611f0d565b505050506111c15a6111bb9083612f9e565b3a612133565b50505050565b60008181526006602052604081206106a390612195565b6000828152600560205260409020600101546111f9816117b3565b6108d98383611b5b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600061123861093a565b6000818152601260205260408120549192500361134157600061125c600143612f9e565b409050806112a15760405162461bcd60e51b81526020600482015260126024820152710d2dcecc2d8d2c840c4d8dec6d65ad0c2e6d60731b604482015260640161098a565b42806112e35760405162461bcd60e51b81526020600482015260116024820152700696e76616c69642074696d657374616d7607c1b604482015260640161098a565b6000828152601160209081526040808320849055858352601282529182902084905581518481529081018390527f2c6c5a9e4f0ddd70b42bd7fcac74128409018755c234dc0d2d29c66eb6335c9a91015b60405180910390a1505050565b6000818152601260209081526040808320548084526011835292819020548151848152928301819052917f2c6c5a9e4f0ddd70b42bd7fcac74128409018755c234dc0d2d29c66eb6335c9a9101611334565b7ffaf7695f60bc6df80a9a6a1674eb3a25a97bffeb33335a6c9c5fffdaa1c227736113bd816117b3565b81516006146114055760405162461bcd60e51b81526020600482015260146024820152730d2dcecc2d8d2c840c2e4e4c2f25cd8cadccee8d60631b604482015260640161098a565b60008260028151811061141a5761141a612e42565b6020026020010151116114675760405162461bcd60e51b81526020600482015260156024820152740696e76616c69642061727261795b325d203d3d203605c1b604482015260640161098a565b60008260038151811061147c5761147c612e42565b6020026020010151116114c95760405162461bcd60e51b81526020600482015260156024820152740696e76616c69642061727261795b335d203d3d203605c1b604482015260640161098a565b60005b6040811161155f5760006114df826120f8565b905060006114ec826108de565b905060006114fa8387611b40565b9050611506818361219f565b61150f83610837565b6000848152601360209081526040808320939093556014905220544261153581836122d2565b6000948552601460205260409094209390935550829150611557905081612fb1565b9150506114cc565b5081516108d9906015906020850190612989565b61157b611caf565b6001600160a01b0381166115e05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161098a565b61081081611d09565b6115f38282610ed2565b610a125760008281526005602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561162b3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610748836001600160a01b03841661234a565b60006106a382612399565b6001600160a01b0383166116f15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161098a565b6001600160a01b0382166117525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161098a565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b61081081336123d9565b60005b600a54811015610810576117d381611fcc565b806117dd81612fb1565b9150506117c0565b60006117f18484611203565b905060001981146111c1578181101561184c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161098a565b6111c1848484840361168f565b6001600160a01b0383166118bd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161098a565b6001600160a01b03821661191f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161098a565b6001600160a01b038316600090815260208190526040902054818110156119975760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161098a565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36111c1565b600085841015611a425760405162461bcd60e51b815260206004820152601060248201526f696e76616c69642074696d656c696e6560801b604482015260640161098a565b8582111580611a5057508386145b15611a5c575083611b15565b838210611a6a575081611b15565b6000611a768786612f9e565b905060008111611a8857611a88612fca565b85841115611ad55780611a9b8786612f9e565b611aa58986612f9e565b611aaf9190612f87565b611ab98884612f87565b611ac39190612e2f565b611acd9190612e0d565b915050611b15565b83861115611b105780611ae88588612f9e565b611af28986612f9e565b611afc9190612f87565b611b068884612f87565b611ac39190612f9e565b859150505b95945050505050565b611b2882826115e9565b60008281526006602052604090206108d9908261166f565b60408051602081019091528181526000906107489084612432565b611b658282612519565b60008281526006602052604090206108d99082612580565b6001600160a01b038216611bdd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161098a565b6001600160a01b03821660009081526020819052604090205481811015611c515760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161098a565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600e546001600160a01b03163314610ddd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161098a565b600e80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000600a8281548110611d7057611d70612e42565b90600052602060002090602091828204019190069054906101000a900460ff1615611dd05760405162461bcd60e51b815260206004820152601060248201526f1b5a59dc985d1a5bdb881cd9585b195960821b604482015260640161098a565b6009544290811115611e165760405162461bcd60e51b815260206004820152600f60248201526e191958591b1a5b99481c185cdcd959608a1b604482015260640161098a565b60078381548110611e2957611e29612e42565b60009182526020909120015460405163079cc67960e41b81526001600160a01b03878116600483015260248201879052909116906379cc679090604401600060405180830381600087803b158015611e8057600080fd5b505af1158015611e94573d6000803e3d6000fd5b5050505060008411611ede5760405162461bcd60e51b81526020600482015260136024820152721b9bdb8b5c1bdcda5d1a5d9948185b5bdd5b9d606a1b604482015260640161098a565b6000611eea8585610c27565b905080600b6000828254611efe9190612e2f565b90915550909695505050505050565b6001600160a01b038216611f635760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161098a565b8060026000828254611f759190612e2f565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600a8281548110611fe157611fe1612e42565b90600052602060002090602091828204019190066101000a81548160ff02191690831515021790555050565b60006107488383612595565b8161205b5760405162461bcd60e51b81526020600482015260126024820152710d2dcecc2d8d2c840c4d8dec6d65ad0c2e6d60731b604482015260640161098a565b60008281526011602052604090205481612077610e1083612e0d565b146108d95760405162461bcd60e51b81526020600482015260126024820152710caf0e0d2e4cac840c4d8dec6d65ad0c2e6d60731b604482015260640161098a565b60008181526001830160205260408120541515610748565b600081156120f05760026120e4836125bf565b6106a3911c603f612f9e565b506040919050565b60006121066012600a612f78565b6001612113846002612fe0565b61211d9190612f9e565b6106a39190612f87565b6000610748838361234a565b600c54801561215d57600461214982600f612f87565b6121539085612e2f565b901c600c55612163565b600c8390555b600d54801561218d57600461217982600f612f87565b6121839085612e2f565b901c600d556111c1565b5050600d5550565b60006106a3825490565b80821015612201576121b2826002612f87565b8111156122015760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964206368616e67653a20746f6f20736d616c6c00000000000000604482015260640161098a565b80821180156122105750600081115b1561226b57612220816002612f87565b82111561226b5760405162461bcd60e51b8152602060048201526019602482015278696e76616c6964206368616e67653a20746f6f206c6172676560381b604482015260640161098a565b8082118015612278575080155b15610a125761228760016120f8565b821115610a125760405162461bcd60e51b8152602060048201526019602482015278696e76616c6964206368616e67653a20746f6f206c6172676560381b604482015260640161098a565b8015610a1257600c6122e9606463bc191380612e0d565b6122f39190612e0d565b6122fd8284612f9e565b11610a125760405162461bcd60e51b815260206004820152601c60248201527f696e76616c6964206368616e67653a20746f6f206672657175656e7400000000604482015260640161098a565b6000818152600183016020526040812054612391575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556106a3565b5060006106a3565b60006001600160e01b031982166336372b0760e01b14806123ca57506001600160e01b0319821663a219a02560e01b145b806106a357506106a382612653565b6123e38282610ed2565b610a12576123f08161265e565b6123fb836020612670565b60405160200161240c929190612fec565b60408051601f198184030181529082905262461bcd60e51b825261098a91600401612a37565b600080612484846000015160058151811061244f5761244f612e42565b6020026020010151846124629190612e2f565b85518051600490811061247757612477612e42565b602002602001015161280c565b905060006124d785600001516003815181106124a2576124a2612e42565b6020026020010151836124b59190612f87565b8651805160029081106124ca576124ca612e42565b6020026020010151612826565b9050611b1585600001516001815181106124f3576124f3612e42565b6020026020010151826125069190612e2f565b8651805160009061247757612477612e42565b6125238282610ed2565b15610a125760008281526005602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610748836001600160a01b038416612841565b60008260000182815481106125ac576125ac612e42565b9060005260206000200154905092915050565b600080608083901c156125d457608092831c92015b604083901c156125e657604092831c92015b602083901c156125f857602092831c92015b601083901c1561260a57601092831c92015b600883901c1561261c57600892831c92015b600483901c1561262e57600492831c92015b600283901c1561264057600292831c92015b600183901c156106a35760010192915050565b60006106a382612934565b60606106a36001600160a01b03831660145b6060600061267f836002612f87565b61268a906002612e2f565b67ffffffffffffffff8111156126a2576126a2612a6a565b6040519080825280601f01601f1916602001820160405280156126cc576020820181803683370190505b509050600360fc1b816000815181106126e7576126e7612e42565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061271657612716612e42565b60200101906001600160f81b031916908160001a905350600061273a846002612f87565b612745906001612e2f565b90505b60018111156127bd576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061277957612779612e42565b1a60f81b82828151811061278f5761278f612e42565b60200101906001600160f81b031916908160001a90535060049490941c936127b681613061565b9050612748565b5083156107485760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161098a565b600081831161281c576000610748565b6107488284612f9e565b600080821161283757600019610748565b6107488284612e0d565b6000818152600183016020526040812054801561292a576000612865600183612f9e565b855490915060009061287990600190612f9e565b90508181146128de57600086600001828154811061289957612899612e42565b90600052602060002001549050808760000184815481106128bc576128bc612e42565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806128ef576128ef613078565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506106a3565b60009150506106a3565b60006001600160e01b03198216635a05180f60e01b14806106a357506106a38260006001600160e01b03198216637965db0b60e01b14806106a357506301ffc9a760e01b6001600160e01b03198316146106a3565b8280548282559060005260206000209081019282156129c4579160200282015b828111156129c45782518255916020019190600101906129a9565b506129d09291506129d4565b5090565b5b808211156129d057600081556001016129d5565b6000602082840312156129fb57600080fd5b81356001600160e01b03198116811461074857600080fd5b60005b83811015612a2e578181015183820152602001612a16565b50506000910152565b6020815260008251806020840152612a56816040850160208701612a13565b601f01601f19169190910160400192915050565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612a9157600080fd5b8135602067ffffffffffffffff80831115612aae57612aae612a6a565b8260051b604051601f19603f83011681018181108482111715612ad357612ad3612a6a565b604052938452858101830193838101925087851115612af157600080fd5b83870191505b848210156108a957813583529183019190830190612af7565b60008060408385031215612b2357600080fd5b82359150602083013567ffffffffffffffff811115612b4157600080fd5b612b4d85828601612a80565b9150509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612b91578351151583529284019291840191600101612b73565b50909695505050505050565b80356001600160a01b038116811461099357600080fd5b60008060408385031215612bc757600080fd5b612bd083612b9d565b946020939093013593505050565b600080600060608486031215612bf357600080fd5b612bfc84612b9d565b9250612c0a60208501612b9d565b9150604084013590509250925092565b600060208284031215612c2c57600080fd5b5035919050565b60008060408385031215612c4657600080fd5b82359150612c5660208401612b9d565b90509250929050565b60008060408385031215612c7257600080fd5b50508035926020909101359150565b600060208284031215612c9357600080fd5b61074882612b9d565b600080600060608486031215612cb157600080fd5b612cba84612b9d565b925060208401359150604084013567ffffffffffffffff811115612cdd57600080fd5b612ce986828701612a80565b9150509250925092565b6020808252825182820181905260009190848201906040850190845b81811015612b9157835183529284019291840191600101612d0f565b600080600060608486031215612d4057600080fd5b612d4984612b9d565b95602085013595506040909401359392505050565b60008060408385031215612d7157600080fd5b612d7a83612b9d565b9150612c5660208401612b9d565b600060208284031215612d9a57600080fd5b813567ffffffffffffffff811115612db157600080fd5b610e1384828501612a80565b600181811c90821680612dd157607f821691505b602082108103612df157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082612e2a57634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156106a3576106a3612df7565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612e6a57600080fd5b815160ff8116811461074857600080fd5b60ff82811682821603908111156106a3576106a3612df7565b600181815b80851115612ecf578160001904821115612eb557612eb5612df7565b80851615612ec257918102915b93841c9390800290612e99565b509250929050565b600082612ee6575060016106a3565b81612ef3575060006106a3565b8160018114612f095760028114612f1357612f2f565b60019150506106a3565b60ff841115612f2457612f24612df7565b50506001821b6106a3565b5060208310610133831016604e8410600b8410161715612f52575081810a6106a3565b612f5c8383612e94565b8060001904821115612f7057612f70612df7565b029392505050565b600061074860ff841683612ed7565b80820281158282048414176106a3576106a3612df7565b818103818111156106a3576106a3612df7565b600060018201612fc357612fc3612df7565b5060010190565b634e487b7160e01b600052600160045260246000fd5b60006107488383612ed7565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613024816017850160208801612a13565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613055816028840160208801612a13565b01602801949350505050565b60008161307057613070612df7565b506000190190565b634e487b7160e01b600052603160045260246000fdfea264697066735822122056b22df6bb94f69f2d0ba796973ec891ca88603dad81e9239ef14ae8cdcdafb964736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000007861f800000000000000000000000000000000000000000000000000000000000000007000000000000000000000000c63e3b6d0a2d382a74b13d19426b65c0aa5f36480000000000000000000000002c5c3374c216bd8c36d598c40d990eb2a2250ccd0000000000000000000000001ab7b945f50d33cf387fb74eb5f7a092ad03dc810000000000000000000000004353cac32924b45c01c2880f65e75b3795ddfd60000000000000000000000000f0f11d6d86346c541ba2ef2f48ad7a58255cd52b0000000000000000000000000f310c35c006a86bd0df6595b1856ce8ef06bbd3000000000000000000000000551b372ad7a7b85bab113b273fd4c7924dff4071
-----Decoded View---------------
Arg [0] : moeBase (address[]): 0xc63e3B6D0a2d382A74B13D19426b65C0aa5F3648,0x2c5C3374c216BD8C36d598C40d990Eb2a2250cCD,0x1Ab7b945f50D33cF387Fb74eB5f7a092aD03dc81,0x4353CaC32924b45C01c2880F65E75B3795DDFd60,0xF0F11D6d86346C541bA2eF2f48ad7A58255Cd52B,0x0f310C35C006a86BD0Df6595B1856ce8Ef06Bbd3,0x551b372ad7A7b85BaB113B273fd4c7924dfF4071
Arg [1] : deadlineIn (uint256): 126230400
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000000000000000000000000000000000000007861f80
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [3] : 000000000000000000000000c63e3b6d0a2d382a74b13d19426b65c0aa5f3648
Arg [4] : 0000000000000000000000002c5c3374c216bd8c36d598c40d990eb2a2250ccd
Arg [5] : 0000000000000000000000001ab7b945f50d33cf387fb74eb5f7a092ad03dc81
Arg [6] : 0000000000000000000000004353cac32924b45c01c2880f65e75b3795ddfd60
Arg [7] : 000000000000000000000000f0f11d6d86346c541ba2ef2f48ad7a58255cd52b
Arg [8] : 0000000000000000000000000f310c35c006a86bd0df6595b1856ce8ef06bbd3
Arg [9] : 000000000000000000000000551b372ad7a7b85bab113b273fd4c7924dff4071
Loading...
Loading
OVERVIEW
XPower token contract has migrated to 0x1e6AB3d65Ad983202ebD92575aA5a168D0D6EBC9Loading...
Loading
Loading...
Loading
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.