Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
18378544 | 470 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
PINT
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2023-10-18 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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); } // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @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); } // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } } /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; } /** * @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]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * 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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { 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}. * * All two of these values are immutable: they can only be set once during * construction. */ function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _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 default value returned by this function, unless * it's 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 {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[45] private __gap; } // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/ERC20Permit.sol) // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) /** * @dev Standard math utilities missing in the Solidity language. */ library MathUpgradeable { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } } // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMathUpgradeable { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } } /** * @dev String operations. */ library StringsUpgradeable { 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 = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMathUpgradeable.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } } /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } } // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol) // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol) interface IERC5267Upgradeable { /** * @dev MAY be emitted to signal that the domain could have changed. */ event EIP712DomainChanged(); /** * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712 * signature. */ function eip712Domain() external view returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ); } /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. * * _Available since v3.4._ * * @custom:storage-size 52 */ abstract contract EIP712Upgradeable is Initializable, IERC5267Upgradeable { bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); /// @custom:oz-renamed-from _HASHED_NAME bytes32 private _hashedName; /// @custom:oz-renamed-from _HASHED_VERSION bytes32 private _hashedVersion; string private _name; string private _version; /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ function __EIP712_init(string memory name, string memory version) internal onlyInitializing { __EIP712_init_unchained(name, version); } function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing { _name = name; _version = version; // Reset prior values in storage if upgrading _hashedName = 0; _hashedVersion = 0; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { return _buildDomainSeparator(); } function _buildDomainSeparator() private view returns (bytes32) { return keccak256(abi.encode(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash); } /** * @dev See {EIP-5267}. * * _Available since v4.9._ */ function eip712Domain() public view virtual override returns ( bytes1 fields, string memory name, string memory version, uint256 chainId, address verifyingContract, bytes32 salt, uint256[] memory extensions ) { // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized // and the EIP712 domain is not reliable, as it will be missing name and version. require(_hashedName == 0 && _hashedVersion == 0, "EIP712: Uninitialized"); return ( hex"0f", // 01111 _EIP712Name(), _EIP712Version(), block.chainid, address(this), bytes32(0), new uint256[](0) ); } /** * @dev The name parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712Name() internal virtual view returns (string memory) { return _name; } /** * @dev The version parameter for the EIP712 domain. * * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs * are a concern. */ function _EIP712Version() internal virtual view returns (string memory) { return _version; } /** * @dev The hash of the name parameter for the EIP712 domain. * * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead. */ function _EIP712NameHash() internal view returns (bytes32) { string memory name = _EIP712Name(); if (bytes(name).length > 0) { return keccak256(bytes(name)); } else { // If the name is empty, the contract may have been upgraded without initializing the new storage. // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design. bytes32 hashedName = _hashedName; if (hashedName != 0) { return hashedName; } else { return keccak256(""); } } } /** * @dev The hash of the version parameter for the EIP712 domain. * * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead. */ function _EIP712VersionHash() internal view returns (bytes32) { string memory version = _EIP712Version(); if (bytes(version).length > 0) { return keccak256(bytes(version)); } else { // If the version is empty, the contract may have been upgraded without initializing the new storage. // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design. bytes32 hashedVersion = _hashedVersion; if (hashedVersion != 0) { return hashedVersion; } else { return keccak256(""); } } } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[48] private __gap; } // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library CountersUpgradeable { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } } /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ * * @custom:storage-size 51 */ abstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable { using CountersUpgradeable for CountersUpgradeable.Counter; mapping(address => CountersUpgradeable.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private constant _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`. * However, to ensure consistency with the upgradeable transpiler, we will continue * to reserve a slot. * @custom:oz-renamed-from _PERMIT_TYPEHASH */ // solhint-disable-next-line var-name-mixedcase bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT; /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ function __ERC20Permit_init(string memory name) internal onlyInitializing { __EIP712_init_unchained(name, "1"); } function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {} /** * @dev See {IERC20Permit-permit}. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSAUpgradeable.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { CountersUpgradeable.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) /** * @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); } // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol) // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling 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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; } contract PINT is OwnableUpgradeable, ERC20Upgradeable, ERC20PermitUpgradeable { using SafeERC20 for IERC20; using SafeMath for uint256; IUniswapV2Factory constant factory = IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f); IUniswapV2Router02 constant router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address constant treasury = address(0xEC3de41D5eAD4cebFfD656f7FC9d1a8d8Ff0f8c0); IWETH constant weth = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); address public immutable pair; address public immutable ve; address public constant deadAddress = address(0xdead); bool private swapping; bool public veEnabled; uint256 public maxTransactionAmount; uint256 public swapTokensAtAmount; uint256 public maxWallet; bool public limitsInEffect; bool public tradingActive; bool public swapEnabled; bool public blacklistRenounced = false; // Anti-bot and anti-whale mappings and variables mapping(address => bool) blacklisted; uint256 public buyTotalFees; uint256 public buyRevShareFee; uint256 public buyLiquidityFee; uint256 public buyTeamFee; uint256 public sellTotalFees; uint256 public sellRevShareFee; uint256 public sellLiquidityFee; uint256 public sellTeamFee; uint256 public tokensForRevShare; uint256 public tokensForLiquidity; uint256 public tokensForTreasury; /******************/ // exclude from fees and max transaction amount mapping(address => bool) private _isExcludedFromFees; mapping(address => bool) public _isExcludedMaxTransactionAmount; // store addresses that a automatic market maker pairs. Any transfer *to* these addresses // could be subject to a maximum transfer amount mapping(address => bool) public automatedMarketMakerPairs; bool public preMigrationPhase; mapping(address => bool) public preMigrationTransferrable; event UpdateUniswapV2Router( address indexed newAddress, address indexed oldAddress ); event ExcludeFromFees(address indexed account, bool isExcluded); event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); constructor(address _pair, address _ve) { pair = _pair; ve = _ve; } function initialize() public initializer { __ERC20_init_unchained("PINT", "PINT"); __ERC20Permit_init_unchained("PINT"); __Ownable_init(); limitsInEffect = true; preMigrationPhase = true; excludeFromMaxTransaction(address(router), true); excludeFromMaxTransaction(address(pair), true); _setAutomatedMarketMakerPair(address(pair), true); uint256 _buyRevShareFee = 2; uint256 _buyLiquidityFee = 1; uint256 _buyTeamFee = 2; uint256 _sellRevShareFee = 2; uint256 _sellLiquidityFee = 1; uint256 _sellTeamFee = 2; uint256 totalSupply = 1_000_000_000 * 1e18; maxTransactionAmount = 10_000_000 * 1e18; // 1% maxWallet = 10_000_000 * 1e18; // 1% swapTokensAtAmount = (totalSupply * 5) / 10000; // 0.05% buyRevShareFee = _buyRevShareFee; buyLiquidityFee = _buyLiquidityFee; buyTeamFee = _buyTeamFee; buyTotalFees = buyRevShareFee + buyLiquidityFee + buyTeamFee; sellRevShareFee = _sellRevShareFee; sellLiquidityFee = _sellLiquidityFee; sellTeamFee = _sellTeamFee; sellTotalFees = sellRevShareFee + sellLiquidityFee + sellTeamFee; // exclude from paying fees or having max transaction amount excludeFromFees(treasury, true); excludeFromFees(address(this), true); excludeFromFees(address(0xdead), true); excludeFromMaxTransaction(treasury, true); excludeFromMaxTransaction(address(this), true); excludeFromMaxTransaction(address(0xdead), true); preMigrationTransferrable[treasury] = true; transferOwnership(treasury); /* _mint is an internal function in ERC20.sol that is only called here, and CANNOT be called ever again */ _mint(treasury, totalSupply); } receive() external payable {} // once enabled, can never be turned off function enableTrading() external onlyOwner { tradingActive = true; swapEnabled = true; preMigrationPhase = false; } // remove limits after token is stable function removeLimits() external onlyOwner returns (bool) { limitsInEffect = false; return true; } // change the minimum amount of tokens to sell from fees function updateSwapTokensAtAmount( uint256 newAmount ) external onlyOwner returns (bool) { require( newAmount >= (totalSupply() * 1) / 100000, "Swap amount cannot be lower than 0.001% total supply." ); require( newAmount <= (totalSupply() * 5) / 1000, "Swap amount cannot be higher than 0.5% total supply." ); swapTokensAtAmount = newAmount; return true; } function updateMaxTxnAmount(uint256 newNum) external onlyOwner { require( newNum >= ((totalSupply() * 5) / 1000) / 1e18, "Cannot set maxTransactionAmount lower than 0.5%" ); maxTransactionAmount = newNum * (10 ** 18); } function updateMaxWalletAmount(uint256 newNum) external onlyOwner { require( newNum >= ((totalSupply() * 10) / 1000) / 1e18, "Cannot set maxWallet lower than 1.0%" ); maxWallet = newNum * (10 ** 18); } function excludeFromMaxTransaction( address updAds, bool isEx ) public onlyOwner { _isExcludedMaxTransactionAmount[updAds] = isEx; } // only use to disable contract sales if absolutely necessary (emergency use only) function updateSwapEnabled(bool enabled) external onlyOwner { swapEnabled = enabled; } function updateBuyFees( uint256 _revShareFee, uint256 _liquidityFee, uint256 _teamFee ) external onlyOwner { buyRevShareFee = _revShareFee; buyLiquidityFee = _liquidityFee; buyTeamFee = _teamFee; buyTotalFees = buyRevShareFee + buyLiquidityFee + buyTeamFee; require(buyTotalFees <= 5, "Buy fees must be <= 5."); } function updateSellFees( uint256 _revShareFee, uint256 _liquidityFee, uint256 _teamFee ) external onlyOwner { sellRevShareFee = _revShareFee; sellLiquidityFee = _liquidityFee; sellTeamFee = _teamFee; sellTotalFees = sellRevShareFee + sellLiquidityFee + sellTeamFee; require(sellTotalFees <= 5, "Sell fees must be <= 5."); } function excludeFromFees(address account, bool excluded) public onlyOwner { _isExcludedFromFees[account] = excluded; emit ExcludeFromFees(account, excluded); } function setAutomatedMarketMakerPair( address _pair, bool value ) public onlyOwner { require( pair != _pair, "The pair cannot be removed from automatedMarketMakerPairs" ); _setAutomatedMarketMakerPair(_pair, value); } function _setAutomatedMarketMakerPair(address _pair, bool value) private { automatedMarketMakerPairs[_pair] = value; emit SetAutomatedMarketMakerPair(_pair, value); } function isExcludedFromFees(address account) public view returns (bool) { return _isExcludedFromFees[account]; } function isBlacklisted(address account) public view returns (bool) { return blacklisted[account]; } function _transfer( address from, address to, uint256 amount ) internal override { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(!blacklisted[from], "Sender blacklisted"); require(!blacklisted[to], "Receiver blacklisted"); if (preMigrationPhase) { require( preMigrationTransferrable[from], "Not authorized to transfer pre-migration." ); } if (amount == 0) { super._transfer(from, to, 0); return; } if (limitsInEffect) { if ( from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping ) { if (!tradingActive) { require( _isExcludedFromFees[from] || _isExcludedFromFees[to], "Trading is not active." ); } //when buy if ( automatedMarketMakerPairs[from] && !_isExcludedMaxTransactionAmount[to] ) { require( amount <= maxTransactionAmount, "Buy transfer amount exceeds the maxTransactionAmount." ); require( amount + balanceOf(to) <= maxWallet, "Max wallet exceeded" ); } //when sell else if ( automatedMarketMakerPairs[to] && !_isExcludedMaxTransactionAmount[from] ) { require( amount <= maxTransactionAmount, "Sell transfer amount exceeds the maxTransactionAmount." ); } else if (!_isExcludedMaxTransactionAmount[to]) { require( amount + balanceOf(to) <= maxWallet, "Max wallet exceeded" ); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= swapTokensAtAmount; if ( canSwap && swapEnabled && !swapping && !automatedMarketMakerPairs[from] && !_isExcludedFromFees[from] && !_isExcludedFromFees[to] ) { swapping = true; swapBack(); swapping = false; } bool takeFee = !swapping; // if any account belongs to _isExcludedFromFee account then remove the fee if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) { takeFee = false; } uint256 fees = 0; // only take fees on buys/sells, do not take on wallet transfers if (takeFee) { // on sell if (automatedMarketMakerPairs[to] && sellTotalFees > 0) { fees = amount.mul(sellTotalFees).div(100); tokensForLiquidity += (fees * sellLiquidityFee) / sellTotalFees; tokensForTreasury += (fees * sellTeamFee) / sellTotalFees; tokensForRevShare += (fees * sellRevShareFee) / sellTotalFees; } // on buy else if (automatedMarketMakerPairs[from] && buyTotalFees > 0) { fees = amount.mul(buyTotalFees).div(100); tokensForLiquidity += (fees * buyLiquidityFee) / buyTotalFees; tokensForTreasury += (fees * buyTeamFee) / buyTotalFees; tokensForRevShare += (fees * buyRevShareFee) / buyTotalFees; } if (fees > 0) { super._transfer(from, address(this), fees); } amount -= fees; } super._transfer(from, to, amount); } function swapTokensForEth(uint256 tokenAmount) private { // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = router.WETH(); _approve(address(this), address(router), tokenAmount); // make the swap router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function enableStaking() public onlyOwner { veEnabled = true; } function disableStaking() public onlyOwner { veEnabled = false; } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios // add the liquidity IWETH(weth).deposit{value: ethAmount}(); IERC20(address(weth)).safeTransfer(address(pair), ethAmount); this.transfer(address(veEnabled ? ve : treasury), tokenAmount); IUniswapV2Pair(pair).sync(); } function swapBack() private { uint256 contractBalance = balanceOf(address(this)); uint256 totalTokensToSwap = tokensForLiquidity + tokensForRevShare + tokensForTreasury; if (contractBalance == 0 || totalTokensToSwap == 0) { return; } if (contractBalance > swapTokensAtAmount * 20) { contractBalance = swapTokensAtAmount * 20; } // Halve the amount of liquidity tokens uint256 liquidityTokens = (contractBalance * tokensForLiquidity) / totalTokensToSwap / 2; uint256 amountToSwapForETH = contractBalance.sub(liquidityTokens); uint256 initialETHBalance = address(this).balance; swapTokensForEth(amountToSwapForETH); uint256 ethBalance = address(this).balance.sub(initialETHBalance); uint256 ethForRevShare = ethBalance.mul(tokensForRevShare).div( totalTokensToSwap - (tokensForLiquidity / 2) ); uint256 ethForTreasury = ethBalance.mul(tokensForTreasury).div( totalTokensToSwap - (tokensForLiquidity / 2) ); uint256 ethForLiquidity = ethBalance - ethForRevShare - ethForTreasury; tokensForLiquidity = 0; tokensForRevShare = 0; tokensForTreasury = 0; if (liquidityTokens > 0 && ethForLiquidity > 0) { addLiquidity(liquidityTokens, ethForLiquidity + ethForRevShare); emit SwapAndLiquify( amountToSwapForETH, ethForLiquidity, tokensForLiquidity ); } if (ethForTreasury > 0) { (bool success, ) = treasury.call{value: ethForTreasury}(""); require(success); } } function withdrawStuckPINT() external onlyOwner { uint256 balance = IERC20(address(this)).balanceOf(address(this)); IERC20(address(this)).transfer(msg.sender, balance); payable(msg.sender).transfer(address(this).balance); } function withdrawStuckToken( address _token, address _to ) external onlyOwner { require(_token != address(0), "_token address cannot be 0"); uint256 _contractBalance = IERC20(_token).balanceOf(address(this)); IERC20(_token).transfer(_to, _contractBalance); } function withdrawStuckEth(address toAddr) external onlyOwner { (bool success, ) = toAddr.call{value: address(this).balance}(""); require(success); } // @dev team renounce blacklist commands function renounceBlacklist() public onlyOwner { blacklistRenounced = true; } function blacklist(address _addr) public onlyOwner { require(!blacklistRenounced, "Team has revoked blacklist rights"); require( _addr != address(pair) && _addr != address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D), "Cannot blacklist token's v2 router or v2 pool." ); blacklisted[_addr] = true; } // @dev blacklist v3 pools; can unblacklist() down the road to suit project and community function blacklistLiquidityPool(address lpAddress) public onlyOwner { require(!blacklistRenounced, "Team has revoked blacklist rights"); require( lpAddress != address(pair) && lpAddress != address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D), "Cannot blacklist token's v2 router or v2 pool." ); blacklisted[lpAddress] = true; } // @dev unblacklist address; not affected by blacklistRenounced incase team wants to unblacklist v3 pools down the road function unblacklist(address _addr) public onlyOwner { blacklisted[_addr] = false; } function setPreMigrationTransferable( address _addr, bool isAuthorized ) public onlyOwner { preMigrationTransferrable[_addr] = isAuthorized; excludeFromFees(_addr, isAuthorized); excludeFromMaxTransaction(_addr, isAuthorized); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"address","name":"_ve","type":"address"}],"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":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"isExcluded","type":"bool"}],"name":"ExcludeFromFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","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":"address","name":"pair","type":"address"},{"indexed":true,"internalType":"bool","name":"value","type":"bool"}],"name":"SetAutomatedMarketMakerPair","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokensSwapped","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ethReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokensIntoLiquidity","type":"uint256"}],"name":"SwapAndLiquify","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newAddress","type":"address"},{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"}],"name":"UpdateUniswapV2Router","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"_isExcludedMaxTransactionAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"","type":"address"}],"name":"automatedMarketMakerPairs","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"blacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lpAddress","type":"address"}],"name":"blacklistLiquidityPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"blacklistRenounced","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyLiquidityFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyRevShareFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTeamFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyTotalFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"deadAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"disableStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"excluded","type":"bool"}],"name":"excludeFromFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"updAds","type":"address"},{"internalType":"bool","name":"isEx","type":"bool"}],"name":"excludeFromMaxTransaction","outputs":[],"stateMutability":"nonpayable","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":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isBlacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isExcludedFromFees","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitsInEffect","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTransactionAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","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":"pair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"preMigrationPhase","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"preMigrationTransferrable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"removeLimits","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceBlacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellLiquidityFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sellRevShareFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sellTeamFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sellTotalFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setAutomatedMarketMakerPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"bool","name":"isAuthorized","type":"bool"}],"name":"setPreMigrationTransferable","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapTokensAtAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensForLiquidity","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensForRevShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensForTreasury","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tradingActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"unblacklist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_revShareFee","type":"uint256"},{"internalType":"uint256","name":"_liquidityFee","type":"uint256"},{"internalType":"uint256","name":"_teamFee","type":"uint256"}],"name":"updateBuyFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newNum","type":"uint256"}],"name":"updateMaxTxnAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newNum","type":"uint256"}],"name":"updateMaxWalletAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_revShareFee","type":"uint256"},{"internalType":"uint256","name":"_liquidityFee","type":"uint256"},{"internalType":"uint256","name":"_teamFee","type":"uint256"}],"name":"updateSellFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"updateSwapEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"updateSwapTokensAtAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ve","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"veEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"toAddr","type":"address"}],"name":"withdrawStuckEth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawStuckPINT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"withdrawStuckToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c0604052610102805463ff000000191690553480156200001e575f80fd5b5060405162003e3938038062003e39833981016040819052620000419162000075565b6001600160a01b039182166080521660a052620000ab565b80516001600160a01b038116811462000070575f80fd5b919050565b5f806040838503121562000087575f80fd5b620000928362000059565b9150620000a26020840162000059565b90509250929050565b60805160a051613d3b620000fe5f395f8181610504015261331c01525f8181610910015281816110ce015281816110f9015281816113f201528181611c75015281816132c001526133ad0152613d3b5ff3fe6080604052600436106103e2575f3560e01c806384b0196e116101ff578063c18bc19511610113578063dd62ed3e116100a8578063f2fde38b11610078578063f2fde38b14610b61578063f637434214610b80578063f8b45b0514610b96578063f9f92be414610b16578063fe575a8714610bac575f80fd5b8063dd62ed3e14610af7578063e19b282314610b16578063e2f4560514610b35578063f11a24d314610b4b575f80fd5b8063d257b34f116100e3578063d257b34f14610a8d578063d505accf14610aac578063d729715f14610acb578063d85ba06314610ae1575f80fd5b8063c18bc19514610a2f578063c8c8ebe414610a4e578063cc2ffe7c14610a63578063d11aca6214610a79575f80fd5b8063a8aa1b3111610194578063b787510b11610164578063b787510b1461099f578063bbc0c742146109b3578063bc205ad3146109d2578063c0246668146109f1578063c17b5b8c14610a10575f80fd5b8063a8aa1b31146108ff578063a9059cbb14610932578063aa0e438814610951578063b62496f514610970575f80fd5b806395d89b41116101cf57806395d89b41146108975780639a7a23d6146108ab5780639c2e4ac6146108ca578063a457c2d7146108e0575f80fd5b806384b0196e146108205780638a8c523c146108475780638da5cb5b1461085b578063924de9b714610878575f80fd5b806339509351116102f657806370a082311161028b57806375e3661e1161025b57806375e3661e146107905780637ca8448a146107af5780637ecebe00146107ce5780638095d564146107ed5780638129fc1c1461080c575f80fd5b806370a0823114610715578063715018a614610749578063751039fc1461075d5780637571336a14610771575f80fd5b80634fbee193116102c65780634fbee193146106935780635f189361146106cb5780636a486a8e146106df5780636ddd1713146106f5575f80fd5b8063395093511461060a5780633dc599ff146106295780634a62bb651461064a5780634e29e52314610664575f80fd5b80631f8507161161037757806327c8f8351161034757806327c8f8351461059457806328696de2146105a95780632a5af8b7146105bd578063313ce567146105db5780633644e515146105f6575f80fd5b80631f850716146104f3578063203e727e1461053e57806323b872dd1461055f57806324b9f3c11461057e575f80fd5b8063156c2f35116103b2578063156c2f351461048f57806318160ddd146104b357806319eab042146104c75780631a8145bb146104dd575f80fd5b806306fdde03146103ed578063095ea7b3146104175780630e922ca71461044657806310d5de5314610460575f80fd5b366103e957005b5f80fd5b3480156103f8575f80fd5b50610401610be4565b60405161040e9190613703565b60405180910390f35b348015610422575f80fd5b50610436610431366004613729565b610c74565b604051901515815260200161040e565b348015610451575f80fd5b50610112546104369060ff1681565b34801561046b575f80fd5b5061043661047a366004613753565b6101106020525f908152604090205460ff1681565b34801561049a575f80fd5b506104a56101055481565b60405190815260200161040e565b3480156104be575f80fd5b506067546104a5565b3480156104d2575f80fd5b506104a56101095481565b3480156104e8575f80fd5b506104a561010d5481565b3480156104fe575f80fd5b506105267f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161040e565b348015610549575f80fd5b5061055d61055836600461376e565b610c8d565b005b34801561056a575f80fd5b50610436610579366004613785565b610d4d565b348015610589575f80fd5b506104a561010c5481565b34801561059f575f80fd5b5061052661dead81565b3480156105b4575f80fd5b5061055d610d70565b3480156105c8575f80fd5b5060fe5461043690610100900460ff1681565b3480156105e6575f80fd5b506040516012815260200161040e565b348015610601575f80fd5b506104a5610d85565b348015610615575f80fd5b50610436610624366004613729565b610d93565b348015610634575f80fd5b5061010254610436906301000000900460ff1681565b348015610655575f80fd5b50610102546104369060ff1681565b34801561066f575f80fd5b5061043661067e366004613753565b6101136020525f908152604090205460ff1681565b34801561069e575f80fd5b506104366106ad366004613753565b6001600160a01b03165f90815261010f602052604090205460ff1690565b3480156106d6575f80fd5b5061055d610db4565b3480156106ea575f80fd5b506104a56101085481565b348015610700575f80fd5b50610102546104369062010000900460ff1681565b348015610720575f80fd5b506104a561072f366004613753565b6001600160a01b03165f9081526065602052604090205490565b348015610754575f80fd5b5061055d610dd2565b348015610768575f80fd5b50610436610de5565b34801561077c575f80fd5b5061055d61078b3660046137d0565b610dff565b34801561079b575f80fd5b5061055d6107aa366004613753565b610e32565b3480156107ba575f80fd5b5061055d6107c9366004613753565b610e5b565b3480156107d9575f80fd5b506104a56107e8366004613753565b610ec2565b3480156107f8575f80fd5b5061055d610807366004613807565b610edf565b348015610817575f80fd5b5061055d610f62565b34801561082b575f80fd5b506108346112ea565b60405161040e9796959493929190613830565b348015610852575f80fd5b5061055d611383565b348015610866575f80fd5b506033546001600160a01b0316610526565b348015610883575f80fd5b5061055d6108923660046138c4565b6113aa565b3480156108a2575f80fd5b506104016113cf565b3480156108b6575f80fd5b5061055d6108c53660046137d0565b6113de565b3480156108d5575f80fd5b506104a56101075481565b3480156108eb575f80fd5b506104366108fa366004613729565b611497565b34801561090a575f80fd5b506105267f000000000000000000000000000000000000000000000000000000000000000081565b34801561093d575f80fd5b5061043661094c366004613729565b611511565b34801561095c575f80fd5b5061055d61096b3660046137d0565b61151e565b34801561097b575f80fd5b5061043661098a366004613753565b6101116020525f908152604090205460ff1681565b3480156109aa575f80fd5b5061055d61155e565b3480156109be575f80fd5b506101025461043690610100900460ff1681565b3480156109dd575f80fd5b5061055d6109ec3660046138df565b611657565b3480156109fc575f80fd5b5061055d610a0b3660046137d0565b611797565b348015610a1b575f80fd5b5061055d610a2a366004613807565b6117fe565b348015610a3a575f80fd5b5061055d610a4936600461376e565b611883565b348015610a59575f80fd5b506104a560ff5481565b348015610a6e575f80fd5b506104a561010e5481565b348015610a84575f80fd5b5061055d611933565b348015610a98575f80fd5b50610436610aa736600461376e565b61194c565b348015610ab7575f80fd5b5061055d610ac636600461390b565b611a7b565b348015610ad6575f80fd5b506104a561010b5481565b348015610aec575f80fd5b506104a56101045481565b348015610b02575f80fd5b506104a5610b113660046138df565b611bdc565b348015610b21575f80fd5b5061055d610b30366004613753565b611c06565b348015610b40575f80fd5b506104a56101005481565b348015610b56575f80fd5b506104a56101065481565b348015610b6c575f80fd5b5061055d610b7b366004613753565b611d59565b348015610b8b575f80fd5b506104a561010a5481565b348015610ba1575f80fd5b506104a56101015481565b348015610bb7575f80fd5b50610436610bc6366004613753565b6001600160a01b03165f908152610103602052604090205460ff1690565b606060688054610bf39061397c565b80601f0160208091040260200160405190810160405280929190818152602001828054610c1f9061397c565b8015610c6a5780601f10610c4157610100808354040283529160200191610c6a565b820191905f5260205f20905b815481529060010190602001808311610c4d57829003601f168201915b5050505050905090565b5f33610c81818585611dcf565b60019150505b92915050565b610c95611ef2565b670de0b6b3a76400006103e8610caa60675490565b610cb59060056139c2565b610cbf91906139d9565b610cc991906139d9565b811015610d355760405162461bcd60e51b815260206004820152602f60248201527f43616e6e6f7420736574206d61785472616e73616374696f6e416d6f756e742060448201526e6c6f776572207468616e20302e352560881b60648201526084015b60405180910390fd5b610d4781670de0b6b3a76400006139c2565b60ff5550565b5f33610d5a858285611f4c565b610d65858585611fbe565b506001949350505050565b610d78611ef2565b60fe805461ff0019169055565b5f610d8e6127fc565b905090565b5f33610c81818585610da58383611bdc565b610daf91906139f8565b611dcf565b610dbc611ef2565b610102805463ff00000019166301000000179055565b610dda611ef2565b610de35f612805565b565b5f610dee611ef2565b50610102805460ff19169055600190565b610e07611ef2565b6001600160a01b03919091165f90815261011060205260409020805460ff1916911515919091179055565b610e3a611ef2565b6001600160a01b03165f90815261010360205260409020805460ff19169055565b610e63611ef2565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f8114610eac576040519150601f19603f3d011682016040523d82523d5f602084013e610eb1565b606091505b5050905080610ebe575f80fd5b5050565b6001600160a01b0381165f90815260cb6020526040812054610c87565b610ee7611ef2565b61010583905561010682905561010781905580610f0483856139f8565b610f0e91906139f8565b61010481905560051015610f5d5760405162461bcd60e51b8152602060048201526016602482015275213abc903332b2b99036bab9ba103132901e1e901a9760511b6044820152606401610d2c565b505050565b5f54610100900460ff1615808015610f8057505f54600160ff909116105b80610f995750303b158015610f9957505f5460ff166001145b610ffc5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610d2c565b5f805460ff19166001179055801561101d575f805461ff0019166101001790555b61105f604051806040016040528060048152602001631412539560e21b815250604051806040016040528060048152602001631412539560e21b815250612856565b611084604051806040016040528060048152602001631412539560e21b815250612895565b61108c6128bb565b6101028054600160ff1991821681179092556101128054909116821790556110c990737a250d5630b4cf539739df2c5dacb4c659f2488d90610dff565b6110f47f00000000000000000000000000000000000000000000000000000000000000006001610dff565b61111f7f000000000000000000000000000000000000000000000000000000000000000060016128e9565b6a084595161401484a00000060ff8190556101015560026001818082816b033b2e3c9fd0803ce80000006127106111578260056139c2565b61116191906139d9565b610100556101058790556101068690556101078590558461118287896139f8565b61118c91906139f8565b6101045561010984905561010a83905561010b829055816111ad84866139f8565b6111b791906139f8565b610108556111da73ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c06001611797565b6111e5306001611797565b6111f261dead6001611797565b61121173ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c06001610dff565b61121c306001610dff565b61122961dead6001610dff565b73ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c05f8190526101136020527f781104449b143e435fb102fc142c9f59e2f929290c8f8e6bb569be4278b55cfc805460ff1916600117905561127d90611d59565b61129b73ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c08261293d565b5050505050505080156112e7575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b5f6060805f805f60606097545f801b1480156113065750609854155b61134a5760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610d2c565b6113526129fc565b61135a612a0b565b604080515f80825260208201909252600f60f81b9b939a50919850469750309650945092509050565b61138b611ef2565b610102805462ffff00191662010100179055610112805460ff19169055565b6113b2611ef2565b6101028054911515620100000262ff000019909216919091179055565b606060698054610bf39061397c565b6113e6611ef2565b816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03160361148d5760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610d2c565b610ebe82826128e9565b5f33816114a48286611bdc565b9050838110156115045760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610d2c565b610d658286868403611dcf565b5f33610c81818585611fbe565b611526611ef2565b6001600160a01b0382165f90815261011360205260409020805460ff19168215151790556115548282611797565b610ebe8282610dff565b611566611ef2565b6040516370a0823160e01b815230600482018190525f916370a0823190602401602060405180830381865afa1580156115a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c59190613a1f565b60405163a9059cbb60e01b815233600482015260248101829052909150309063a9059cbb906044016020604051808303815f875af1158015611609573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061162d9190613a36565b5060405133904780156108fc02915f818181858888f19350505050158015610ebe573d5f803e3d5ffd5b61165f611ef2565b6001600160a01b0382166116b55760405162461bcd60e51b815260206004820152601a60248201527f5f746f6b656e20616464726573732063616e6e6f7420626520300000000000006044820152606401610d2c565b6040516370a0823160e01b81523060048201525f906001600160a01b038416906370a0823190602401602060405180830381865afa1580156116f9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061171d9190613a1f565b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390529192509084169063a9059cbb906044016020604051808303815f875af115801561176d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117919190613a36565b50505050565b61179f611ef2565b6001600160a01b0382165f81815261010f6020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b611806611ef2565b61010983905561010a82905561010b8190558061182383856139f8565b61182d91906139f8565b61010881905560051015610f5d5760405162461bcd60e51b815260206004820152601760248201527f53656c6c2066656573206d757374206265203c3d20352e0000000000000000006044820152606401610d2c565b61188b611ef2565b670de0b6b3a76400006103e86118a060675490565b6118ab90600a6139c2565b6118b591906139d9565b6118bf91906139d9565b81101561191a5760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f7420736574206d617857616c6c6574206c6f776572207468616e20604482015263312e302560e01b6064820152608401610d2c565b61192c81670de0b6b3a76400006139c2565b6101015550565b61193b611ef2565b60fe805461ff001916610100179055565b5f611955611ef2565b620186a061196260675490565b61196d9060016139c2565b61197791906139d9565b8210156119e45760405162461bcd60e51b815260206004820152603560248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60448201527410181718181892903a37ba30b61039bab838363c9760591b6064820152608401610d2c565b6103e86119f060675490565b6119fb9060056139c2565b611a0591906139d9565b821115611a715760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b6064820152608401610d2c565b5061010055600190565b83421115611acb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610d2c565b5f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888611af98c612a1a565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090505f611b5382612a41565b90505f611b6282878787612a6d565b9050896001600160a01b0316816001600160a01b031614611bc55760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610d2c565b611bd08a8a8a611dcf565b50505050505050505050565b6001600160a01b039182165f90815260666020908152604080832093909416825291909152205490565b611c0e611ef2565b610102546301000000900460ff1615611c735760405162461bcd60e51b815260206004820152602160248201527f5465616d20686173207265766f6b656420626c61636b6c6973742072696768746044820152607360f81b6064820152608401610d2c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b031614158015611cd257506001600160a01b038116737a250d5630b4cf539739df2c5dacb4c659f2488d14155b611d355760405162461bcd60e51b815260206004820152602e60248201527f43616e6e6f7420626c61636b6c69737420746f6b656e277320763220726f757460448201526d32b91037b9103b19103837b7b61760911b6064820152608401610d2c565b6001600160a01b03165f90815261010360205260409020805460ff19166001179055565b611d61611ef2565b6001600160a01b038116611dc65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d2c565b6112e781612805565b6001600160a01b038316611e315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610d2c565b6001600160a01b038216611e925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610d2c565b6001600160a01b038381165f8181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6033546001600160a01b03163314610de35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d2c565b5f611f578484611bdc565b90505f1981146117915781811015611fb15760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610d2c565b6117918484848403611dcf565b6001600160a01b038316611fe45760405162461bcd60e51b8152600401610d2c90613a51565b6001600160a01b03821661200a5760405162461bcd60e51b8152600401610d2c90613a96565b6001600160a01b0383165f908152610103602052604090205460ff16156120685760405162461bcd60e51b815260206004820152601260248201527114d95b99195c88189b1858dadb1a5cdd195960721b6044820152606401610d2c565b6001600160a01b0382165f908152610103602052604090205460ff16156120c85760405162461bcd60e51b8152602060048201526014602482015273149958d95a5d995c88189b1858dadb1a5cdd195960621b6044820152606401610d2c565b6101125460ff161561214e576001600160a01b0383165f908152610113602052604090205460ff1661214e5760405162461bcd60e51b815260206004820152602960248201527f4e6f7420617574686f72697a656420746f207472616e73666572207072652d6d60448201526834b3b930ba34b7b71760b91b6064820152608401610d2c565b805f0361216057610f5d83835f612a95565b6101025460ff16156124d1576033546001600160a01b0384811691161480159061219857506033546001600160a01b03838116911614155b80156121ac57506001600160a01b03821615155b80156121c357506001600160a01b03821661dead14155b80156121d2575060fe5460ff16155b156124d15761010254610100900460ff1661226b576001600160a01b0383165f90815261010f602052604090205460ff168061222657506001600160a01b0382165f90815261010f602052604090205460ff165b61226b5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610d2c565b6001600160a01b0383165f908152610111602052604090205460ff1680156122ac57506001600160a01b0382165f908152610110602052604090205460ff16155b156123905760ff548111156123215760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610d2c565b610101546001600160a01b0383165f9081526065602052604090205461234790836139f8565b111561238b5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610d2c565b6124d1565b6001600160a01b0382165f908152610111602052604090205460ff1680156123d157506001600160a01b0383165f908152610110602052604090205460ff16155b156124475760ff5481111561238b5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610d2c565b6001600160a01b0382165f908152610110602052604090205460ff166124d157610101546001600160a01b0383165f9081526065602052604090205461248d90836139f8565b11156124d15760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610d2c565b305f9081526065602052604090205461010054811080159081906124fe57506101025462010000900460ff165b801561250d575060fe5460ff16155b801561253257506001600160a01b0385165f908152610111602052604090205460ff16155b801561255757506001600160a01b0385165f90815261010f602052604090205460ff16155b801561257c57506001600160a01b0384165f90815261010f602052604090205460ff16155b156125a15760fe805460ff19166001179055612596612bc4565b60fe805460ff191690555b60fe546001600160a01b0386165f90815261010f602052604090205460ff918216159116806125e857506001600160a01b0385165f90815261010f602052604090205460ff165b156125f057505f5b5f81156127e8576001600160a01b0386165f908152610111602052604090205460ff16801561262157505f61010854115b156126e65761264760646126416101085488612de990919063ffffffff16565b90612dfb565b90506101085461010a548261265c91906139c2565b61266691906139d9565b61010d5f82825461267791906139f8565b90915550506101085461010b5461268e90836139c2565b61269891906139d9565b61010e5f8282546126a991906139f8565b909155505061010854610109546126c090836139c2565b6126ca91906139d9565b61010c5f8282546126db91906139f8565b909155506127ca9050565b6001600160a01b0387165f908152610111602052604090205460ff16801561271057505f61010454115b156127ca5761273060646126416101045488612de990919063ffffffff16565b905061010454610106548261274591906139c2565b61274f91906139d9565b61010d5f82825461276091906139f8565b9091555050610104546101075461277790836139c2565b61278191906139d9565b61010e5f82825461279291906139f8565b909155505061010454610105546127a990836139c2565b6127b391906139d9565b61010c5f8282546127c491906139f8565b90915550505b80156127db576127db873083612a95565b6127e58186613ad9565b94505b6127f3878787612a95565b50505050505050565b5f610d8e612e06565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff1661287c5760405162461bcd60e51b8152600401610d2c90613aec565b60686128888382613b7c565b506069610f5d8282613b7c565b5f54610100900460ff166112e75760405162461bcd60e51b8152600401610d2c90613aec565b5f54610100900460ff166128e15760405162461bcd60e51b8152600401610d2c90613aec565b610de3612e79565b6001600160a01b0382165f8181526101116020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b6001600160a01b0382166129935760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610d2c565b8060675f8282546129a491906139f8565b90915550506001600160a01b0382165f818152606560209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b606060998054610bf39061397c565b6060609a8054610bf39061397c565b6001600160a01b0381165f90815260cb602052604090208054600181018255905b50919050565b5f610c87612a4d6127fc565b8360405161190160f01b8152600281019290925260228201526042902090565b5f805f612a7c87878787612ea8565b91509150612a8981612f65565b5090505b949350505050565b6001600160a01b038316612abb5760405162461bcd60e51b8152600401610d2c90613a51565b6001600160a01b038216612ae15760405162461bcd60e51b8152600401610d2c90613a96565b6001600160a01b0383165f9081526065602052604090205481811015612b585760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610d2c565b6001600160a01b038085165f8181526065602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612bb79086815260200190565b60405180910390a3611791565b305f9081526065602052604081205490505f61010e5461010c5461010d54612bec91906139f8565b612bf691906139f8565b9050811580612c03575080155b15612c0c575050565b61010054612c1b9060146139c2565b821115612c345761010054612c319060146139c2565b91505b5f60028261010d5485612c4791906139c2565b612c5191906139d9565b612c5b91906139d9565b90505f612c6884836130ae565b905047612c74826130b9565b5f612c7f47836130ae565b90505f612cae600261010d54612c9591906139d9565b612c9f9088613ad9565b61010c54612641908590612de9565b90505f612cdd600261010d54612cc491906139d9565b612cce9089613ad9565b61010e54612641908690612de9565b90505f81612ceb8486613ad9565b612cf59190613ad9565b5f61010d81905561010c81905561010e5590508615801590612d1657505f81115b15612d7357612d2e87612d2985846139f8565b613242565b61010d54604080518881526020810184905280820192909252517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a15b8115612dde576040515f9073ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c09084908381818185875af1925050503d805f8114612dcc576040519150601f19603f3d011682016040523d82523d5f602084013e612dd1565b606091505b5050905080611bd0575f80fd5b505050505050505050565b5f612df482846139c2565b9392505050565b5f612df482846139d9565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f612e30613403565b612e3861345b565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f54610100900460ff16612e9f5760405162461bcd60e51b8152600401610d2c90613aec565b610de333612805565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612edd57505f90506003612f5c565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612f2e573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116612f56575f60019250925050612f5c565b91505f90505b94509492505050565b5f816004811115612f7857612f78613c38565b03612f805750565b6001816004811115612f9457612f94613c38565b03612fe15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610d2c565b6002816004811115612ff557612ff5613c38565b036130425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610d2c565b600381600481111561305657613056613c38565b036112e75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610d2c565b5f612df48284613ad9565b6040805160028082526060820183525f9260208301908036833701905050905030815f815181106130ec576130ec613c4c565b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561315c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131809190613c60565b8160018151811061319357613193613c4c565b60200260200101906001600160a01b031690816001600160a01b0316815250506131d230737a250d5630b4cf539739df2c5dacb4c659f2488d84611dcf565b60405163791ac94760e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac947906132119085905f90869030904290600401613c7b565b5f604051808303815f87803b158015613228575f80fd5b505af115801561323a573d5f803e3d5ffd5b505050505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b15801561328f575f80fd5b505af11580156132a1573d5f803e3d5ffd5b506132e9935073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc292507f0000000000000000000000000000000000000000000000000000000000000000915084905061348b565b60fe54309063a9059cbb90610100900460ff1661331a5773ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c061333c565b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af1158015613386573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133aa9190613a36565b507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fff6cae96040518163ffffffff1660e01b81526004015f604051808303815f87803b158015613228575f80fd5b5f8061340d6129fc565b805190915015613424578051602090910120919050565b60975480156134335792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b5f80613465612a0b565b80519091501561347c578051602090910120919050565b60985480156134335792915050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152610f5d928692915f9161351a918516908490613599565b905080515f148061353a57508080602001905181019061353a9190613a36565b610f5d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610d2c565b6060612a8d84845f85855f80866001600160a01b031685876040516135be9190613cea565b5f6040518083038185875af1925050503d805f81146135f8576040519150601f19603f3d011682016040523d82523d5f602084013e6135fd565b606091505b509150915061360e87838387613619565b979650505050505050565b606083156136875782515f03613680576001600160a01b0385163b6136805760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d2c565b5081612a8d565b612a8d838381511561369c5781518083602001fd5b8060405162461bcd60e51b8152600401610d2c9190613703565b5f5b838110156136d05781810151838201526020016136b8565b50505f910152565b5f81518084526136ef8160208601602086016136b6565b601f01601f19169290920160200192915050565b602081525f612df460208301846136d8565b6001600160a01b03811681146112e7575f80fd5b5f806040838503121561373a575f80fd5b823561374581613715565b946020939093013593505050565b5f60208284031215613763575f80fd5b8135612df481613715565b5f6020828403121561377e575f80fd5b5035919050565b5f805f60608486031215613797575f80fd5b83356137a281613715565b925060208401356137b281613715565b929592945050506040919091013590565b80151581146112e7575f80fd5b5f80604083850312156137e1575f80fd5b82356137ec81613715565b915060208301356137fc816137c3565b809150509250929050565b5f805f60608486031215613819575f80fd5b505081359360208301359350604090920135919050565b60ff60f81b881681525f602060e08184015261384f60e084018a6136d8565b8381036040850152613861818a6136d8565b606085018990526001600160a01b038816608086015260a0850187905284810360c086015285518082528387019250908301905f5b818110156138b257835183529284019291840191600101613896565b50909c9b505050505050505050505050565b5f602082840312156138d4575f80fd5b8135612df4816137c3565b5f80604083850312156138f0575f80fd5b82356138fb81613715565b915060208301356137fc81613715565b5f805f805f805f60e0888a031215613921575f80fd5b873561392c81613715565b9650602088013561393c81613715565b95506040880135945060608801359350608088013560ff8116811461395f575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b600181811c9082168061399057607f821691505b602082108103612a3b57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610c8757610c876139ae565b5f826139f357634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115610c8757610c876139ae565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215613a2f575f80fd5b5051919050565b5f60208284031215613a46575f80fd5b8151612df4816137c3565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b81810381811115610c8757610c876139ae565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610f5d575f81815260208120601f850160051c81016020861015613b5d5750805b601f850160051c820191505b8181101561323a57828155600101613b69565b815167ffffffffffffffff811115613b9657613b96613a0b565b613baa81613ba4845461397c565b84613b37565b602080601f831160018114613bdd575f8415613bc65750858301515b5f19600386901b1c1916600185901b17855561323a565b5f85815260208120601f198616915b82811015613c0b57888601518255948401946001909101908401613bec565b5085821015613c2857878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215613c70575f80fd5b8151612df481613715565b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b81811015613cc95784516001600160a01b031683529383019391830191600101613ca4565b50506001600160a01b03969096166060850152505050608001529392505050565b5f8251613cfb8184602087016136b6565b919091019291505056fea2646970667358221220da2197517199dd83941547ca816f1603489ecb8516ef65bdef7333c223bfc0ea64736f6c6343000815003300000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be320000000000000000000000001e8352e5d5e9ef7a68432a39118082653e8a9758
Deployed Bytecode
0x6080604052600436106103e2575f3560e01c806384b0196e116101ff578063c18bc19511610113578063dd62ed3e116100a8578063f2fde38b11610078578063f2fde38b14610b61578063f637434214610b80578063f8b45b0514610b96578063f9f92be414610b16578063fe575a8714610bac575f80fd5b8063dd62ed3e14610af7578063e19b282314610b16578063e2f4560514610b35578063f11a24d314610b4b575f80fd5b8063d257b34f116100e3578063d257b34f14610a8d578063d505accf14610aac578063d729715f14610acb578063d85ba06314610ae1575f80fd5b8063c18bc19514610a2f578063c8c8ebe414610a4e578063cc2ffe7c14610a63578063d11aca6214610a79575f80fd5b8063a8aa1b3111610194578063b787510b11610164578063b787510b1461099f578063bbc0c742146109b3578063bc205ad3146109d2578063c0246668146109f1578063c17b5b8c14610a10575f80fd5b8063a8aa1b31146108ff578063a9059cbb14610932578063aa0e438814610951578063b62496f514610970575f80fd5b806395d89b41116101cf57806395d89b41146108975780639a7a23d6146108ab5780639c2e4ac6146108ca578063a457c2d7146108e0575f80fd5b806384b0196e146108205780638a8c523c146108475780638da5cb5b1461085b578063924de9b714610878575f80fd5b806339509351116102f657806370a082311161028b57806375e3661e1161025b57806375e3661e146107905780637ca8448a146107af5780637ecebe00146107ce5780638095d564146107ed5780638129fc1c1461080c575f80fd5b806370a0823114610715578063715018a614610749578063751039fc1461075d5780637571336a14610771575f80fd5b80634fbee193116102c65780634fbee193146106935780635f189361146106cb5780636a486a8e146106df5780636ddd1713146106f5575f80fd5b8063395093511461060a5780633dc599ff146106295780634a62bb651461064a5780634e29e52314610664575f80fd5b80631f8507161161037757806327c8f8351161034757806327c8f8351461059457806328696de2146105a95780632a5af8b7146105bd578063313ce567146105db5780633644e515146105f6575f80fd5b80631f850716146104f3578063203e727e1461053e57806323b872dd1461055f57806324b9f3c11461057e575f80fd5b8063156c2f35116103b2578063156c2f351461048f57806318160ddd146104b357806319eab042146104c75780631a8145bb146104dd575f80fd5b806306fdde03146103ed578063095ea7b3146104175780630e922ca71461044657806310d5de5314610460575f80fd5b366103e957005b5f80fd5b3480156103f8575f80fd5b50610401610be4565b60405161040e9190613703565b60405180910390f35b348015610422575f80fd5b50610436610431366004613729565b610c74565b604051901515815260200161040e565b348015610451575f80fd5b50610112546104369060ff1681565b34801561046b575f80fd5b5061043661047a366004613753565b6101106020525f908152604090205460ff1681565b34801561049a575f80fd5b506104a56101055481565b60405190815260200161040e565b3480156104be575f80fd5b506067546104a5565b3480156104d2575f80fd5b506104a56101095481565b3480156104e8575f80fd5b506104a561010d5481565b3480156104fe575f80fd5b506105267f0000000000000000000000001e8352e5d5e9ef7a68432a39118082653e8a975881565b6040516001600160a01b03909116815260200161040e565b348015610549575f80fd5b5061055d61055836600461376e565b610c8d565b005b34801561056a575f80fd5b50610436610579366004613785565b610d4d565b348015610589575f80fd5b506104a561010c5481565b34801561059f575f80fd5b5061052661dead81565b3480156105b4575f80fd5b5061055d610d70565b3480156105c8575f80fd5b5060fe5461043690610100900460ff1681565b3480156105e6575f80fd5b506040516012815260200161040e565b348015610601575f80fd5b506104a5610d85565b348015610615575f80fd5b50610436610624366004613729565b610d93565b348015610634575f80fd5b5061010254610436906301000000900460ff1681565b348015610655575f80fd5b50610102546104369060ff1681565b34801561066f575f80fd5b5061043661067e366004613753565b6101136020525f908152604090205460ff1681565b34801561069e575f80fd5b506104366106ad366004613753565b6001600160a01b03165f90815261010f602052604090205460ff1690565b3480156106d6575f80fd5b5061055d610db4565b3480156106ea575f80fd5b506104a56101085481565b348015610700575f80fd5b50610102546104369062010000900460ff1681565b348015610720575f80fd5b506104a561072f366004613753565b6001600160a01b03165f9081526065602052604090205490565b348015610754575f80fd5b5061055d610dd2565b348015610768575f80fd5b50610436610de5565b34801561077c575f80fd5b5061055d61078b3660046137d0565b610dff565b34801561079b575f80fd5b5061055d6107aa366004613753565b610e32565b3480156107ba575f80fd5b5061055d6107c9366004613753565b610e5b565b3480156107d9575f80fd5b506104a56107e8366004613753565b610ec2565b3480156107f8575f80fd5b5061055d610807366004613807565b610edf565b348015610817575f80fd5b5061055d610f62565b34801561082b575f80fd5b506108346112ea565b60405161040e9796959493929190613830565b348015610852575f80fd5b5061055d611383565b348015610866575f80fd5b506033546001600160a01b0316610526565b348015610883575f80fd5b5061055d6108923660046138c4565b6113aa565b3480156108a2575f80fd5b506104016113cf565b3480156108b6575f80fd5b5061055d6108c53660046137d0565b6113de565b3480156108d5575f80fd5b506104a56101075481565b3480156108eb575f80fd5b506104366108fa366004613729565b611497565b34801561090a575f80fd5b506105267f00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be3281565b34801561093d575f80fd5b5061043661094c366004613729565b611511565b34801561095c575f80fd5b5061055d61096b3660046137d0565b61151e565b34801561097b575f80fd5b5061043661098a366004613753565b6101116020525f908152604090205460ff1681565b3480156109aa575f80fd5b5061055d61155e565b3480156109be575f80fd5b506101025461043690610100900460ff1681565b3480156109dd575f80fd5b5061055d6109ec3660046138df565b611657565b3480156109fc575f80fd5b5061055d610a0b3660046137d0565b611797565b348015610a1b575f80fd5b5061055d610a2a366004613807565b6117fe565b348015610a3a575f80fd5b5061055d610a4936600461376e565b611883565b348015610a59575f80fd5b506104a560ff5481565b348015610a6e575f80fd5b506104a561010e5481565b348015610a84575f80fd5b5061055d611933565b348015610a98575f80fd5b50610436610aa736600461376e565b61194c565b348015610ab7575f80fd5b5061055d610ac636600461390b565b611a7b565b348015610ad6575f80fd5b506104a561010b5481565b348015610aec575f80fd5b506104a56101045481565b348015610b02575f80fd5b506104a5610b113660046138df565b611bdc565b348015610b21575f80fd5b5061055d610b30366004613753565b611c06565b348015610b40575f80fd5b506104a56101005481565b348015610b56575f80fd5b506104a56101065481565b348015610b6c575f80fd5b5061055d610b7b366004613753565b611d59565b348015610b8b575f80fd5b506104a561010a5481565b348015610ba1575f80fd5b506104a56101015481565b348015610bb7575f80fd5b50610436610bc6366004613753565b6001600160a01b03165f908152610103602052604090205460ff1690565b606060688054610bf39061397c565b80601f0160208091040260200160405190810160405280929190818152602001828054610c1f9061397c565b8015610c6a5780601f10610c4157610100808354040283529160200191610c6a565b820191905f5260205f20905b815481529060010190602001808311610c4d57829003601f168201915b5050505050905090565b5f33610c81818585611dcf565b60019150505b92915050565b610c95611ef2565b670de0b6b3a76400006103e8610caa60675490565b610cb59060056139c2565b610cbf91906139d9565b610cc991906139d9565b811015610d355760405162461bcd60e51b815260206004820152602f60248201527f43616e6e6f7420736574206d61785472616e73616374696f6e416d6f756e742060448201526e6c6f776572207468616e20302e352560881b60648201526084015b60405180910390fd5b610d4781670de0b6b3a76400006139c2565b60ff5550565b5f33610d5a858285611f4c565b610d65858585611fbe565b506001949350505050565b610d78611ef2565b60fe805461ff0019169055565b5f610d8e6127fc565b905090565b5f33610c81818585610da58383611bdc565b610daf91906139f8565b611dcf565b610dbc611ef2565b610102805463ff00000019166301000000179055565b610dda611ef2565b610de35f612805565b565b5f610dee611ef2565b50610102805460ff19169055600190565b610e07611ef2565b6001600160a01b03919091165f90815261011060205260409020805460ff1916911515919091179055565b610e3a611ef2565b6001600160a01b03165f90815261010360205260409020805460ff19169055565b610e63611ef2565b5f816001600160a01b0316476040515f6040518083038185875af1925050503d805f8114610eac576040519150601f19603f3d011682016040523d82523d5f602084013e610eb1565b606091505b5050905080610ebe575f80fd5b5050565b6001600160a01b0381165f90815260cb6020526040812054610c87565b610ee7611ef2565b61010583905561010682905561010781905580610f0483856139f8565b610f0e91906139f8565b61010481905560051015610f5d5760405162461bcd60e51b8152602060048201526016602482015275213abc903332b2b99036bab9ba103132901e1e901a9760511b6044820152606401610d2c565b505050565b5f54610100900460ff1615808015610f8057505f54600160ff909116105b80610f995750303b158015610f9957505f5460ff166001145b610ffc5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610d2c565b5f805460ff19166001179055801561101d575f805461ff0019166101001790555b61105f604051806040016040528060048152602001631412539560e21b815250604051806040016040528060048152602001631412539560e21b815250612856565b611084604051806040016040528060048152602001631412539560e21b815250612895565b61108c6128bb565b6101028054600160ff1991821681179092556101128054909116821790556110c990737a250d5630b4cf539739df2c5dacb4c659f2488d90610dff565b6110f47f00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be326001610dff565b61111f7f00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be3260016128e9565b6a084595161401484a00000060ff8190556101015560026001818082816b033b2e3c9fd0803ce80000006127106111578260056139c2565b61116191906139d9565b610100556101058790556101068690556101078590558461118287896139f8565b61118c91906139f8565b6101045561010984905561010a83905561010b829055816111ad84866139f8565b6111b791906139f8565b610108556111da73ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c06001611797565b6111e5306001611797565b6111f261dead6001611797565b61121173ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c06001610dff565b61121c306001610dff565b61122961dead6001610dff565b73ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c05f8190526101136020527f781104449b143e435fb102fc142c9f59e2f929290c8f8e6bb569be4278b55cfc805460ff1916600117905561127d90611d59565b61129b73ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c08261293d565b5050505050505080156112e7575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b5f6060805f805f60606097545f801b1480156113065750609854155b61134a5760405162461bcd60e51b81526020600482015260156024820152741152540dcc4c8e88155b9a5b9a5d1a585b1a5e9959605a1b6044820152606401610d2c565b6113526129fc565b61135a612a0b565b604080515f80825260208201909252600f60f81b9b939a50919850469750309650945092509050565b61138b611ef2565b610102805462ffff00191662010100179055610112805460ff19169055565b6113b2611ef2565b6101028054911515620100000262ff000019909216919091179055565b606060698054610bf39061397c565b6113e6611ef2565b816001600160a01b03167f00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be326001600160a01b03160361148d5760405162461bcd60e51b815260206004820152603960248201527f54686520706169722063616e6e6f742062652072656d6f7665642066726f6d2060448201527f6175746f6d617465644d61726b65744d616b65725061697273000000000000006064820152608401610d2c565b610ebe82826128e9565b5f33816114a48286611bdc565b9050838110156115045760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610d2c565b610d658286868403611dcf565b5f33610c81818585611fbe565b611526611ef2565b6001600160a01b0382165f90815261011360205260409020805460ff19168215151790556115548282611797565b610ebe8282610dff565b611566611ef2565b6040516370a0823160e01b815230600482018190525f916370a0823190602401602060405180830381865afa1580156115a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115c59190613a1f565b60405163a9059cbb60e01b815233600482015260248101829052909150309063a9059cbb906044016020604051808303815f875af1158015611609573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061162d9190613a36565b5060405133904780156108fc02915f818181858888f19350505050158015610ebe573d5f803e3d5ffd5b61165f611ef2565b6001600160a01b0382166116b55760405162461bcd60e51b815260206004820152601a60248201527f5f746f6b656e20616464726573732063616e6e6f7420626520300000000000006044820152606401610d2c565b6040516370a0823160e01b81523060048201525f906001600160a01b038416906370a0823190602401602060405180830381865afa1580156116f9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061171d9190613a1f565b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018390529192509084169063a9059cbb906044016020604051808303815f875af115801561176d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906117919190613a36565b50505050565b61179f611ef2565b6001600160a01b0382165f81815261010f6020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b611806611ef2565b61010983905561010a82905561010b8190558061182383856139f8565b61182d91906139f8565b61010881905560051015610f5d5760405162461bcd60e51b815260206004820152601760248201527f53656c6c2066656573206d757374206265203c3d20352e0000000000000000006044820152606401610d2c565b61188b611ef2565b670de0b6b3a76400006103e86118a060675490565b6118ab90600a6139c2565b6118b591906139d9565b6118bf91906139d9565b81101561191a5760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f7420736574206d617857616c6c6574206c6f776572207468616e20604482015263312e302560e01b6064820152608401610d2c565b61192c81670de0b6b3a76400006139c2565b6101015550565b61193b611ef2565b60fe805461ff001916610100179055565b5f611955611ef2565b620186a061196260675490565b61196d9060016139c2565b61197791906139d9565b8210156119e45760405162461bcd60e51b815260206004820152603560248201527f5377617020616d6f756e742063616e6e6f74206265206c6f776572207468616e60448201527410181718181892903a37ba30b61039bab838363c9760591b6064820152608401610d2c565b6103e86119f060675490565b6119fb9060056139c2565b611a0591906139d9565b821115611a715760405162461bcd60e51b815260206004820152603460248201527f5377617020616d6f756e742063616e6e6f742062652068696768657220746861604482015273371018171a92903a37ba30b61039bab838363c9760611b6064820152608401610d2c565b5061010055600190565b83421115611acb5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610d2c565b5f7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888611af98c612a1a565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090505f611b5382612a41565b90505f611b6282878787612a6d565b9050896001600160a01b0316816001600160a01b031614611bc55760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610d2c565b611bd08a8a8a611dcf565b50505050505050505050565b6001600160a01b039182165f90815260666020908152604080832093909416825291909152205490565b611c0e611ef2565b610102546301000000900460ff1615611c735760405162461bcd60e51b815260206004820152602160248201527f5465616d20686173207265766f6b656420626c61636b6c6973742072696768746044820152607360f81b6064820152608401610d2c565b7f00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be326001600160a01b0316816001600160a01b031614158015611cd257506001600160a01b038116737a250d5630b4cf539739df2c5dacb4c659f2488d14155b611d355760405162461bcd60e51b815260206004820152602e60248201527f43616e6e6f7420626c61636b6c69737420746f6b656e277320763220726f757460448201526d32b91037b9103b19103837b7b61760911b6064820152608401610d2c565b6001600160a01b03165f90815261010360205260409020805460ff19166001179055565b611d61611ef2565b6001600160a01b038116611dc65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610d2c565b6112e781612805565b6001600160a01b038316611e315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610d2c565b6001600160a01b038216611e925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610d2c565b6001600160a01b038381165f8181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6033546001600160a01b03163314610de35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610d2c565b5f611f578484611bdc565b90505f1981146117915781811015611fb15760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610d2c565b6117918484848403611dcf565b6001600160a01b038316611fe45760405162461bcd60e51b8152600401610d2c90613a51565b6001600160a01b03821661200a5760405162461bcd60e51b8152600401610d2c90613a96565b6001600160a01b0383165f908152610103602052604090205460ff16156120685760405162461bcd60e51b815260206004820152601260248201527114d95b99195c88189b1858dadb1a5cdd195960721b6044820152606401610d2c565b6001600160a01b0382165f908152610103602052604090205460ff16156120c85760405162461bcd60e51b8152602060048201526014602482015273149958d95a5d995c88189b1858dadb1a5cdd195960621b6044820152606401610d2c565b6101125460ff161561214e576001600160a01b0383165f908152610113602052604090205460ff1661214e5760405162461bcd60e51b815260206004820152602960248201527f4e6f7420617574686f72697a656420746f207472616e73666572207072652d6d60448201526834b3b930ba34b7b71760b91b6064820152608401610d2c565b805f0361216057610f5d83835f612a95565b6101025460ff16156124d1576033546001600160a01b0384811691161480159061219857506033546001600160a01b03838116911614155b80156121ac57506001600160a01b03821615155b80156121c357506001600160a01b03821661dead14155b80156121d2575060fe5460ff16155b156124d15761010254610100900460ff1661226b576001600160a01b0383165f90815261010f602052604090205460ff168061222657506001600160a01b0382165f90815261010f602052604090205460ff165b61226b5760405162461bcd60e51b81526020600482015260166024820152752a3930b234b7339034b9903737ba1030b1ba34bb329760511b6044820152606401610d2c565b6001600160a01b0383165f908152610111602052604090205460ff1680156122ac57506001600160a01b0382165f908152610110602052604090205460ff16155b156123905760ff548111156123215760405162461bcd60e51b815260206004820152603560248201527f427579207472616e7366657220616d6f756e742065786365656473207468652060448201527436b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760591b6064820152608401610d2c565b610101546001600160a01b0383165f9081526065602052604090205461234790836139f8565b111561238b5760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610d2c565b6124d1565b6001600160a01b0382165f908152610111602052604090205460ff1680156123d157506001600160a01b0383165f908152610110602052604090205460ff16155b156124475760ff5481111561238b5760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610d2c565b6001600160a01b0382165f908152610110602052604090205460ff166124d157610101546001600160a01b0383165f9081526065602052604090205461248d90836139f8565b11156124d15760405162461bcd60e51b815260206004820152601360248201527213585e081dd85b1b195d08195e18d959591959606a1b6044820152606401610d2c565b305f9081526065602052604090205461010054811080159081906124fe57506101025462010000900460ff165b801561250d575060fe5460ff16155b801561253257506001600160a01b0385165f908152610111602052604090205460ff16155b801561255757506001600160a01b0385165f90815261010f602052604090205460ff16155b801561257c57506001600160a01b0384165f90815261010f602052604090205460ff16155b156125a15760fe805460ff19166001179055612596612bc4565b60fe805460ff191690555b60fe546001600160a01b0386165f90815261010f602052604090205460ff918216159116806125e857506001600160a01b0385165f90815261010f602052604090205460ff165b156125f057505f5b5f81156127e8576001600160a01b0386165f908152610111602052604090205460ff16801561262157505f61010854115b156126e65761264760646126416101085488612de990919063ffffffff16565b90612dfb565b90506101085461010a548261265c91906139c2565b61266691906139d9565b61010d5f82825461267791906139f8565b90915550506101085461010b5461268e90836139c2565b61269891906139d9565b61010e5f8282546126a991906139f8565b909155505061010854610109546126c090836139c2565b6126ca91906139d9565b61010c5f8282546126db91906139f8565b909155506127ca9050565b6001600160a01b0387165f908152610111602052604090205460ff16801561271057505f61010454115b156127ca5761273060646126416101045488612de990919063ffffffff16565b905061010454610106548261274591906139c2565b61274f91906139d9565b61010d5f82825461276091906139f8565b9091555050610104546101075461277790836139c2565b61278191906139d9565b61010e5f82825461279291906139f8565b909155505061010454610105546127a990836139c2565b6127b391906139d9565b61010c5f8282546127c491906139f8565b90915550505b80156127db576127db873083612a95565b6127e58186613ad9565b94505b6127f3878787612a95565b50505050505050565b5f610d8e612e06565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f54610100900460ff1661287c5760405162461bcd60e51b8152600401610d2c90613aec565b60686128888382613b7c565b506069610f5d8282613b7c565b5f54610100900460ff166112e75760405162461bcd60e51b8152600401610d2c90613aec565b5f54610100900460ff166128e15760405162461bcd60e51b8152600401610d2c90613aec565b610de3612e79565b6001600160a01b0382165f8181526101116020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b6001600160a01b0382166129935760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610d2c565b8060675f8282546129a491906139f8565b90915550506001600160a01b0382165f818152606560209081526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b606060998054610bf39061397c565b6060609a8054610bf39061397c565b6001600160a01b0381165f90815260cb602052604090208054600181018255905b50919050565b5f610c87612a4d6127fc565b8360405161190160f01b8152600281019290925260228201526042902090565b5f805f612a7c87878787612ea8565b91509150612a8981612f65565b5090505b949350505050565b6001600160a01b038316612abb5760405162461bcd60e51b8152600401610d2c90613a51565b6001600160a01b038216612ae15760405162461bcd60e51b8152600401610d2c90613a96565b6001600160a01b0383165f9081526065602052604090205481811015612b585760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610d2c565b6001600160a01b038085165f8181526065602052604080822086860390559286168082529083902080548601905591517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612bb79086815260200190565b60405180910390a3611791565b305f9081526065602052604081205490505f61010e5461010c5461010d54612bec91906139f8565b612bf691906139f8565b9050811580612c03575080155b15612c0c575050565b61010054612c1b9060146139c2565b821115612c345761010054612c319060146139c2565b91505b5f60028261010d5485612c4791906139c2565b612c5191906139d9565b612c5b91906139d9565b90505f612c6884836130ae565b905047612c74826130b9565b5f612c7f47836130ae565b90505f612cae600261010d54612c9591906139d9565b612c9f9088613ad9565b61010c54612641908590612de9565b90505f612cdd600261010d54612cc491906139d9565b612cce9089613ad9565b61010e54612641908690612de9565b90505f81612ceb8486613ad9565b612cf59190613ad9565b5f61010d81905561010c81905561010e5590508615801590612d1657505f81115b15612d7357612d2e87612d2985846139f8565b613242565b61010d54604080518881526020810184905280820192909252517f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619181900360600190a15b8115612dde576040515f9073ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c09084908381818185875af1925050503d805f8114612dcc576040519150601f19603f3d011682016040523d82523d5f602084013e612dd1565b606091505b5050905080611bd0575f80fd5b505050505050505050565b5f612df482846139c2565b9392505050565b5f612df482846139d9565b5f7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f612e30613403565b612e3861345b565b60408051602081019490945283019190915260608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b5f54610100900460ff16612e9f5760405162461bcd60e51b8152600401610d2c90613aec565b610de333612805565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612edd57505f90506003612f5c565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612f2e573d5f803e3d5ffd5b5050604051601f1901519150506001600160a01b038116612f56575f60019250925050612f5c565b91505f90505b94509492505050565b5f816004811115612f7857612f78613c38565b03612f805750565b6001816004811115612f9457612f94613c38565b03612fe15760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610d2c565b6002816004811115612ff557612ff5613c38565b036130425760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610d2c565b600381600481111561305657613056613c38565b036112e75760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610d2c565b5f612df48284613ad9565b6040805160028082526060820183525f9260208301908036833701905050905030815f815181106130ec576130ec613c4c565b60200260200101906001600160a01b031690816001600160a01b031681525050737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561315c573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906131809190613c60565b8160018151811061319357613193613c4c565b60200260200101906001600160a01b031690816001600160a01b0316815250506131d230737a250d5630b4cf539739df2c5dacb4c659f2488d84611dcf565b60405163791ac94760e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac947906132119085905f90869030904290600401613c7b565b5f604051808303815f87803b158015613228575f80fd5b505af115801561323a573d5f803e3d5ffd5b505050505050565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004015f604051808303818588803b15801561328f575f80fd5b505af11580156132a1573d5f803e3d5ffd5b506132e9935073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc292507f00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be32915084905061348b565b60fe54309063a9059cbb90610100900460ff1661331a5773ec3de41d5ead4cebffd656f7fc9d1a8d8ff0f8c061333c565b7f0000000000000000000000001e8352e5d5e9ef7a68432a39118082653e8a97585b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018590526044016020604051808303815f875af1158015613386573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906133aa9190613a36565b507f00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be326001600160a01b031663fff6cae96040518163ffffffff1660e01b81526004015f604051808303815f87803b158015613228575f80fd5b5f8061340d6129fc565b805190915015613424578051602090910120919050565b60975480156134335792915050565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709250505090565b5f80613465612a0b565b80519091501561347c578051602090910120919050565b60985480156134335792915050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656490840152610f5d928692915f9161351a918516908490613599565b905080515f148061353a57508080602001905181019061353a9190613a36565b610f5d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610d2c565b6060612a8d84845f85855f80866001600160a01b031685876040516135be9190613cea565b5f6040518083038185875af1925050503d805f81146135f8576040519150601f19603f3d011682016040523d82523d5f602084013e6135fd565b606091505b509150915061360e87838387613619565b979650505050505050565b606083156136875782515f03613680576001600160a01b0385163b6136805760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d2c565b5081612a8d565b612a8d838381511561369c5781518083602001fd5b8060405162461bcd60e51b8152600401610d2c9190613703565b5f5b838110156136d05781810151838201526020016136b8565b50505f910152565b5f81518084526136ef8160208601602086016136b6565b601f01601f19169290920160200192915050565b602081525f612df460208301846136d8565b6001600160a01b03811681146112e7575f80fd5b5f806040838503121561373a575f80fd5b823561374581613715565b946020939093013593505050565b5f60208284031215613763575f80fd5b8135612df481613715565b5f6020828403121561377e575f80fd5b5035919050565b5f805f60608486031215613797575f80fd5b83356137a281613715565b925060208401356137b281613715565b929592945050506040919091013590565b80151581146112e7575f80fd5b5f80604083850312156137e1575f80fd5b82356137ec81613715565b915060208301356137fc816137c3565b809150509250929050565b5f805f60608486031215613819575f80fd5b505081359360208301359350604090920135919050565b60ff60f81b881681525f602060e08184015261384f60e084018a6136d8565b8381036040850152613861818a6136d8565b606085018990526001600160a01b038816608086015260a0850187905284810360c086015285518082528387019250908301905f5b818110156138b257835183529284019291840191600101613896565b50909c9b505050505050505050505050565b5f602082840312156138d4575f80fd5b8135612df4816137c3565b5f80604083850312156138f0575f80fd5b82356138fb81613715565b915060208301356137fc81613715565b5f805f805f805f60e0888a031215613921575f80fd5b873561392c81613715565b9650602088013561393c81613715565b95506040880135945060608801359350608088013560ff8116811461395f575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b600181811c9082168061399057607f821691505b602082108103612a3b57634e487b7160e01b5f52602260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610c8757610c876139ae565b5f826139f357634e487b7160e01b5f52601260045260245ffd5b500490565b80820180821115610c8757610c876139ae565b634e487b7160e01b5f52604160045260245ffd5b5f60208284031215613a2f575f80fd5b5051919050565b5f60208284031215613a46575f80fd5b8151612df4816137c3565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b81810381811115610c8757610c876139ae565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b601f821115610f5d575f81815260208120601f850160051c81016020861015613b5d5750805b601f850160051c820191505b8181101561323a57828155600101613b69565b815167ffffffffffffffff811115613b9657613b96613a0b565b613baa81613ba4845461397c565b84613b37565b602080601f831160018114613bdd575f8415613bc65750858301515b5f19600386901b1c1916600185901b17855561323a565b5f85815260208120601f198616915b82811015613c0b57888601518255948401946001909101908401613bec565b5085821015613c2857878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52602160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b5f60208284031215613c70575f80fd5b8151612df481613715565b5f60a082018783526020878185015260a0604085015281875180845260c08601915082890193505f5b81811015613cc95784516001600160a01b031683529383019391830191600101613ca4565b50506001600160a01b03969096166060850152505050608001529392505050565b5f8251613cfb8184602087016136b6565b919091019291505056fea2646970667358221220da2197517199dd83941547ca816f1603489ecb8516ef65bdef7333c223bfc0ea64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be320000000000000000000000001e8352e5d5e9ef7a68432a39118082653e8a9758
-----Decoded View---------------
Arg [0] : _pair (address): 0x48EC41e7C8245842a3E0e3B2ff9774d25bb3bE32
Arg [1] : _ve (address): 0x1e8352E5d5E9Ef7A68432A39118082653e8a9758
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 00000000000000000000000048ec41e7c8245842a3e0e3b2ff9774d25bb3be32
Arg [1] : 0000000000000000000000001e8352e5d5e9ef7a68432a39118082653e8a9758
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.