false
true
0

Contract Address Details

0x855f771267BDB6C3CB50eAeE1331C01A45992422

Contract Name
FinBuyAndBurn
Creator
0x894ab1–0a4e78 at 0xc8bb6e–b456ac
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
13 Transactions
Transfers
0 Transfers
Gas Used
0
Last Balance Update
26060394
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
FinBuyAndBurn




Optimization enabled
true
Compiler version
v0.8.20+commit.a1b79de6




Optimization runs
200
EVM Version
paris




Verified at
2025-01-21T05:57:29.065610Z

Constructor Arguments

0x0000000000000000000000003c75cb212e3a70c407c05be35ae4f12e2195e6e60000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d2000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a27

Arg [0] (address) : 0x3c75cb212e3a70c407c05be35ae4f12e2195e6e6
Arg [1] (address) : 0x1c81b4358246d3088ab4361ab755f3d8d4dd62d2
Arg [2] (address) : 0xa1077a294dde1b09bb078844df40758a5d0f9a27

              

Contract source code

// SPDX-License-Identifier: MIT

// File @openzeppelin/contracts/utils/Context.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

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


// File @openzeppelin/contracts/access/Ownable.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

/**
 * @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.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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);
    }
}


// File @openzeppelin/contracts/utils/introspection/IERC165.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[ERC].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}


// File @openzeppelin/contracts/interfaces/IERC165.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)

pragma solidity ^0.8.20;


// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}


// File @openzeppelin/contracts/interfaces/IERC20.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;


// File @openzeppelin/contracts/interfaces/IERC1363.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)

pragma solidity ^0.8.20;


/**
 * @title IERC1363
 * @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
 *
 * Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
 * after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
 */
interface IERC1363 is IERC20, IERC165 {
    /*
     * Note: the ERC-165 identifier for this interface is 0xb0202a11.
     * 0xb0202a11 ===
     *   bytes4(keccak256('transferAndCall(address,uint256)')) ^
     *   bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
     *   bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256)')) ^
     *   bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
     */

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
     * and then calls {IERC1363Receiver-onTransferReceived} on `to`.
     * @param from The address which you want to send tokens from.
     * @param to The address which you want to transfer to.
     * @param value The amount of tokens to be transferred.
     * @param data Additional data with no specified format, sent in call to `to`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value) external returns (bool);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     * @param data Additional data with no specified format, sent in call to `spender`.
     * @return A boolean value indicating whether the operation succeeded unless throwing.
     */
    function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}


// File @openzeppelin/contracts/interfaces/draft-IERC6093.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC-20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC-721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC-1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}


// File @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface for the optional metadata functions from the ERC-20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}


// File @openzeppelin/contracts/token/ERC20/ERC20.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;




/**
 * @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}.
 *
 * 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 ERC-20
 * applications.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

    mapping(address account => mapping(address spender => 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.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual 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 returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual 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 `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` 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 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Skips emitting an {Approval} event indicating an allowance update. This is not
     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
     *
     * 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 `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` 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.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` 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.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     *
     * ```solidity
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}


// File @openzeppelin/contracts/utils/Errors.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of common custom errors used in multiple contracts
 *
 * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
 * It is recommended to avoid relying on the error API for critical functionality.
 *
 * _Available since v5.1._
 */
library Errors {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error InsufficientBalance(uint256 balance, uint256 needed);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedCall();

    /**
     * @dev The deployment failed.
     */
    error FailedDeployment();

    /**
     * @dev A necessary precompile is missing.
     */
    error MissingPrecompile(address);
}


// File @openzeppelin/contracts/utils/Address.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert Errors.InsufficientBalance(address(this).balance, amount);
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert Errors.FailedCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {Errors.FailedCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert Errors.InsufficientBalance(address(this).balance, value);
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case
     * of an unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {Errors.FailedCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            assembly ("memory-safe") {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert Errors.FailedCall();
        }
    }
}


// File @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;



/**
 * @title SafeERC20
 * @dev Wrappers around ERC-20 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 {
    /**
     * @dev An operation with an ERC-20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     *
     * IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
     * smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
     * this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
     * that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     *
     * NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
     * only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
     * set here.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            safeTransfer(token, to, value);
        } else if (!token.transferAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
     * has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * Reverts if the returned value is other than `true`.
     */
    function transferFromAndCallRelaxed(
        IERC1363 token,
        address from,
        address to,
        uint256 value,
        bytes memory data
    ) internal {
        if (to.code.length == 0) {
            safeTransferFrom(token, from, to, value);
        } else if (!token.transferFromAndCall(from, to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
     * code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
     * targeting contracts.
     *
     * NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
     * Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
     * once without retrying, and relies on the returned value to be true.
     *
     * Reverts if the returned value is other than `true`.
     */
    function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
        if (to.code.length == 0) {
            forceApprove(token, to, value);
        } else if (!token.approveAndCall(to, value, data)) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            // bubble errors
            if iszero(success) {
                let ptr := mload(0x40)
                returndatacopy(ptr, 0, returndatasize())
                revert(ptr, returndatasize())
            }
            returnSize := returndatasize()
            returnValue := mload(0)
        }

        if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        bool success;
        uint256 returnSize;
        uint256 returnValue;
        assembly ("memory-safe") {
            success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
            returnSize := returndatasize()
            returnValue := mload(0)
        }
        return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
    }
}


// File @openzeppelin/contracts/utils/ReentrancyGuard.sol@v5.1.0

// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)

pragma solidity ^0.8.20;

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

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

    uint256 private _status;

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

    constructor() {
        _status = NOT_ENTERED;
    }

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

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

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

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

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


// File contracts/FinBuyAndBurn.sol

// Original license: SPDX_License_Identifier: MIT
pragma solidity 0.8.20;




interface IPulseXPair {
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function transfer(address to, uint value) external returns (bool);
    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 burn(address to, address senderOrigin) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
}

interface IPulseXFactory {
    function getPair(address tokenA, address tokenB) external view returns (address pair);
}

contract FinBuyAndBurn is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    IPulseXFactory public immutable factory;
    address public immutable FINVESTA;
    address public immutable WPLS;
    uint256 private totalFinBurned;
    uint public bountyFee; // in basis points (parts per 10,000) - default is 10 or 0.1% - max of 5000 or 50%
    uint public slippage;

    // set of addresses that can perform certain functions
    mapping(address => bool) public isAuth;
    address[] public authorized;
    bool public anyAuth;

    modifier onlyAuth() {
        require(isAuth[_msgSender()], "FinBuyAndBurn: FORBIDDEN");
        _;
    }

    modifier onlyEOA() {
        require(msg.sender == tx.origin, "FinBuyAndBurn: must use EOA");
        _;
    }

    mapping(address => address) internal _bridges;
    mapping(address => uint) internal converted;
    mapping(address => bool) public overridePreventSwap;
    mapping(address => bool) public slippageOverrode;

    event LogBridgeSet(address indexed token, address indexed bridge);
    event LogBurn(
        address indexed server,
        address indexed token,
        uint256 paidBounty,
        uint256 amountBurned
    );
    event ToggleAnyAuth();
    event LogOverridePreventSwap(address _adr);
    event LogSlippageOverrode(address _adr);

    constructor(
        address _factory,
        address _finvesta,
        address _WPLS
    ) Ownable(msg.sender) {
        factory = IPulseXFactory(_factory);
        FINVESTA = _finvesta;
        WPLS = _WPLS;
        isAuth[msg.sender] = true;
        authorized.push(msg.sender);
        bountyFee = 10;
        slippage = 9;
        anyAuth = false;
    }

    // Get total burned FINVESTA
    function totalBurned() public view returns (uint256) {
       return totalFinBurned;
    }

    // Begin Owner functions
    function addAuth(address _auth) external onlyOwner {
        isAuth[_auth] = true;
        authorized.push(_auth);
    }

    function revokeAuth(address _auth) external onlyOwner {
        isAuth[_auth] = false;
    }

    function toggleAnyAuth() external onlyOwner {
        anyAuth = !anyAuth;
        emit ToggleAnyAuth();
    }

    function setBounty(uint _amount) external onlyOwner {
        require(_amount <= 5000, "setBounty: bounty too high");
        bountyFee = _amount;
    }

    function bridgeFor(address token) public view returns (address bridge) {
        bridge = _bridges[token];
        if (bridge == address(0)) {
            bridge = WPLS;
        }
    }

    // onlyAuth type functions
    function overrideSlippage(address _token) external onlyAuth {
        slippageOverrode[_token] = !slippageOverrode[_token];
        emit LogSlippageOverrode(_token);
    }

    function toggleOverridePreventSwap(address _token) external onlyAuth {
        overridePreventSwap[_token] = !overridePreventSwap[_token];
        emit LogOverridePreventSwap(_token);
    }

    function setSlippage(uint _amt) external onlyAuth {
        require(_amt < 20, "slippage too high");
        slippage = _amt;
    }

    function setBridge(address token, address bridge) external onlyAuth {
        require(
            token != FINVESTA && token != WPLS && token != bridge,
            "FinBuyAndBurn: Invalid bridge"
        );
        _bridges[token] = bridge;
        emit LogBridgeSet(token, bridge);
    }

    function isLpToken(address possibleLP) internal view returns (bool valid) {
        (bool success0, bytes memory result0) = possibleLP.staticcall(abi.encodeWithSelector(IPulseXPair.token0.selector));
        if (success0 && result0.length != 0) {
            (bool success1, bytes memory result1) = possibleLP.staticcall(abi.encodeWithSelector(IPulseXPair.token1.selector));
            if (success1 && result1.length != 0) {
                address token0 = abi.decode(result0, (address));
                address token1 = abi.decode(result1, (address));
                address validPair;
                (validPair, valid) = _getValidPair(token0, token1);
                return valid && validPair == possibleLP;
            }
            return false;
        } else {
            return false;
        }
    }

    function _getValidPair(address token0, address token1) internal view returns (address, bool) {
        (address t0, address t1) = token0 < token1 ? (token0, token1) : (token1, token0);
        address realPair = factory.getPair(t0, t1);
        return (realPair, realPair != address(0));
    }

    function convertLps(
        address[] calldata tokens0,
        address[] calldata tokens1
    ) external onlyEOA nonReentrant returns (uint256) {
        require(anyAuth || isAuth[_msgSender()], "FinBuyAndBurn: FORBIDDEN");
        uint len = tokens0.length;
        uint i;
        require(len == tokens1.length, "FinBuyAndBurn: list mismatch");
        for (i = 0; i < len; i++) {
            (address token0, address token1) = (tokens0[i], tokens1[i]);
            require(token0 != token1, "FinBuyAndBurn: tokens match");
            (address lp, bool valid) = _getValidPair(token0, token1);
            require(valid, "FinBuyAndBurn: Invalid pair");
            IPulseXPair pair = IPulseXPair(lp);
            uint256 bal = pair.balanceOf(address(this));
            if (bal > 0) {
                pair.transfer(lp, bal);
                pair.burn(address(this), address(this));
            }
        }
        converted[WPLS] = block.number;
        for (i = 0; i < len; i++) {
            (address token0, address token1) = (tokens0[i], tokens1[i]);
            if (block.number > converted[token0]) {
                _convertStep(token0, IERC20(token0).balanceOf(address(this)));
                converted[token0] = block.number;
            }
            if (block.number > converted[token1]) {
                _convertStep(token1, IERC20(token1).balanceOf(address(this)));
                converted[token1] = block.number;
            }
        }
        uint256 wplsBal = IERC20(WPLS).balanceOf(address(this));
        if (wplsBal > 0) {
            _swap(WPLS, FINVESTA, wplsBal, address(this));
        }
        uint256 finBal = IERC20(FINVESTA).balanceOf(address(this));
        if (finBal > 0) {
            uint256 bounty = (finBal * bountyFee) / 10000;
            uint256 amount = finBal - bounty;
            IERC20(FINVESTA).safeTransfer(_msgSender(), bounty);
            IERC20(FINVESTA).safeTransfer(0x0000000000000000000000000000000000000369, amount);
            totalFinBurned += amount;
            emit LogBurn(_msgSender(), FINVESTA, bounty, amount);
            return bounty;
        }
        return 0;
    }

    function _convertStep(
        address token,
        uint256 amount0
    ) internal {
        uint256 amount = amount0;
        if (amount0 > 0 && token != FINVESTA && token != WPLS) {
            bool isLP = isLpToken(token);
            if (!isLP && !overridePreventSwap[token]) {
                address bridge = bridgeFor(token);
                amount = _swap(token, bridge, amount0, address(this));
                _convertStep(bridge, amount);
            }
        }
    }

    function _swap(
        address fromToken,
        address toToken,
        uint256 amountIn,
        address to
    ) internal returns (uint256 amountOut) {
        IPulseXPair pair = IPulseXPair(factory.getPair(fromToken, toToken));
        require(address(pair) != address(0), "FinBuyAndBurn: Cannot convert");
        (uint256 reserve0, uint256 reserve1, ) = pair.getReserves();
        (uint reserveInput, uint reserveOutput) = fromToken == pair.token0() ? (reserve0, reserve1) : (reserve1, reserve0);
        IERC20(fromToken).safeTransfer(address(pair), amountIn);
        uint amountInput = IERC20(fromToken).balanceOf(address(pair)) - reserveInput;
        require(slippageOverrode[fromToken] || reserveInput / amountInput > slippage, "FinBuyAndBurn: high slippage");
        amountOut = _getAmountOut(amountInput, reserveInput, reserveOutput);
        (uint amount0Out, uint amount1Out) = fromToken == pair.token0() ? (uint(0), amountOut) : (amountOut, uint(0));
        pair.swap(amount0Out, amount1Out, to, new bytes(0));
    }

    function _getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'FinBuyAndBurn: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'FinBuyAndBurn: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = (amountIn * 9971);
        uint numerator = amountInWithFee * reserveOut;
        uint denominator = (reserveIn * 10000) + amountInWithFee;
        amountOut = numerator / denominator;
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_factory","internalType":"address"},{"type":"address","name":"_finvesta","internalType":"address"},{"type":"address","name":"_WPLS","internalType":"address"}]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"error","name":"ReentrancyGuardReentrantCall","inputs":[]},{"type":"error","name":"SafeERC20FailedOperation","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"event","name":"LogBridgeSet","inputs":[{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"address","name":"bridge","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"LogBurn","inputs":[{"type":"address","name":"server","internalType":"address","indexed":true},{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"uint256","name":"paidBounty","internalType":"uint256","indexed":false},{"type":"uint256","name":"amountBurned","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"LogOverridePreventSwap","inputs":[{"type":"address","name":"_adr","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"LogSlippageOverrode","inputs":[{"type":"address","name":"_adr","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"ToggleAnyAuth","inputs":[],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"FINVESTA","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"WPLS","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addAuth","inputs":[{"type":"address","name":"_auth","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"anyAuth","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"authorized","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"bountyFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"bridge","internalType":"address"}],"name":"bridgeFor","inputs":[{"type":"address","name":"token","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"convertLps","inputs":[{"type":"address[]","name":"tokens0","internalType":"address[]"},{"type":"address[]","name":"tokens1","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IPulseXFactory"}],"name":"factory","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isAuth","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"overridePreventSwap","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"overrideSlippage","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeAuth","inputs":[{"type":"address","name":"_auth","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBounty","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBridge","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"address","name":"bridge","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSlippage","inputs":[{"type":"uint256","name":"_amt","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"slippage","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"slippageOverrode","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"toggleAnyAuth","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"toggleOverridePreventSwap","inputs":[{"type":"address","name":"_token","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalBurned","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

Verify & Publish
0x60e06040523480156200001157600080fd5b50604051620020be380380620020be833981016040819052620000349162000169565b33806200005b57604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200006681620000fc565b5060018080556001600160a01b0393841660805291831660a05290911660c052336000818152600560205260408120805460ff1990811685179091556006805494850181559091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90920180546001600160a01b0319169091179055600a6003556009600455600780549091169055620001b3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200016457600080fd5b919050565b6000806000606084860312156200017f57600080fd5b6200018a846200014c565b92506200019a602085016200014c565b9150620001aa604085016200014c565b90509250925092565b60805160a05160c051611e726200024c60003960008181610323015281816105e70152818161070001528181610aac01528181610c8701528181610d0701526112560152600081816101fe015281816105aa01528181610d2801528181610d6801528181610e1501528181610e5101528181610ea901526112180152600081816102be0152818161118501526113230152611e726000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c80639d22ae8c116100c3578063e19d32361161007c578063e19d3236146102fb578063ef8ef56f1461031e578063f0fa55a914610345578063f2fde38b14610358578063f8171dfa1461036b578063f87c49381461037e57600080fd5b80639d22ae8c1461028a578063a101f7cd1461029d578063a761a939146102a6578063c45a0155146102b9578063ca215cdc146102e0578063d89135cd146102f357600080fd5b80635422224e116101155780635422224e146102205780635d87d3631461023357806363d6b23e14610246578063715018a61461024e57806372b625f0146102565780638da5cb5b1461027957600080fd5b8063016e65451461015d5780630d48669a146101725780631d01548e146101a25780632520e7ff146101bf5780633e032a3b146101e25780634524813f146101f9575b600080fd5b61017061016b366004611ac1565b610391565b005b610185610180366004611ae5565b610429565b6040516001600160a01b0390911681526020015b60405180910390f35b6007546101af9060ff1681565b6040519015158152602001610199565b6101af6101cd366004611ac1565b60056020526000908152604090205460ff1681565b6101eb60045481565b604051908152602001610199565b6101857f000000000000000000000000000000000000000000000000000000000000000081565b61017061022e366004611ac1565b610453565b610170610241366004611ae5565b6104c1565b610170610520565b610170610565565b6101af610264366004611ac1565b600a6020526000908152604090205460ff1681565b6000546001600160a01b0316610185565b610170610298366004611afe565b610579565b6101eb60035481565b6101856102b4366004611ac1565b6106dd565b6101857f000000000000000000000000000000000000000000000000000000000000000081565b6101eb6102ee366004611b7c565b610725565b6002546101eb565b6101af610309366004611ac1565b600b6020526000908152604090205460ff1681565b6101857f000000000000000000000000000000000000000000000000000000000000000081565b610170610353366004611ae5565b610f1e565b610170610366366004611ac1565b610f96565b610170610379366004611ac1565b610fd4565b61017061038c366004611ac1565b610ffd565b3360009081526005602052604090205460ff166103c95760405162461bcd60e51b81526004016103c090611be8565b60405180910390fd5b6001600160a01b0381166000818152600a6020908152604091829020805460ff81161560ff1990911617905590519182527f9e02380d3a8512a13a9f7b0d44e9fe895a2a21b6ed53dca6a28d7f562956f05791015b60405180910390a150565b6006818154811061043957600080fd5b6000918252602090912001546001600160a01b0316905081565b61045b611085565b6001600160a01b03166000818152600560205260408120805460ff191660019081179091556006805491820181559091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319169091179055565b6104c9611085565b61138881111561051b5760405162461bcd60e51b815260206004820152601a60248201527f736574426f756e74793a20626f756e747920746f6f206869676800000000000060448201526064016103c0565b600355565b610528611085565b6007805460ff19811660ff909116151790556040517fa8f163eced6b62efa0899037b314429cbcdf6028c78b6e13316c8069554b143d90600090a1565b61056d611085565b61057760006110b2565b565b3360009081526005602052604090205460ff166105a85760405162461bcd60e51b81526004016103c090611be8565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415801561061c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b801561063a5750806001600160a01b0316826001600160a01b031614155b6106865760405162461bcd60e51b815260206004820152601d60248201527f46696e427579416e644275726e3a20496e76616c69642062726964676500000060448201526064016103c0565b6001600160a01b0382811660008181526008602052604080822080546001600160a01b0319169486169485179055517f2e103aa707acc565f9a1547341914802b2bfe977fd79c595209f248ae4b006139190a35050565b6001600160a01b03808216600090815260086020526040902054168061072057507f00000000000000000000000000000000000000000000000000000000000000005b919050565b60003332146107765760405162461bcd60e51b815260206004820152601b60248201527f46696e427579416e644275726e3a206d7573742075736520454f41000000000060448201526064016103c0565b61077e611102565b60075460ff168061079e57503360009081526005602052604090205460ff165b6107ba5760405162461bcd60e51b81526004016103c090611be8565b83600083821461080c5760405162461bcd60e51b815260206004820152601c60248201527f46696e427579416e644275726e3a206c697374206d69736d617463680000000060448201526064016103c0565b5060005b81811015610aa15760008088888481811061082d5761082d611c1f565b90506020020160208101906108429190611ac1565b87878581811061085457610854611c1f565b90506020020160208101906108699190611ac1565b91509150806001600160a01b0316826001600160a01b0316036108ce5760405162461bcd60e51b815260206004820152601b60248201527f46696e427579416e644275726e3a20746f6b656e73206d61746368000000000060448201526064016103c0565b6000806108db848461112c565b915091508061092c5760405162461bcd60e51b815260206004820152601b60248201527f46696e427579416e644275726e3a20496e76616c69642070616972000000000060448201526064016103c0565b6040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109999190611c35565b90508015610a885760405163a9059cbb60e01b81526001600160a01b0385811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af11580156109f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a149190611c4e565b506040516327fc84a360e01b8152306004820181905260248201526001600160a01b038316906327fc84a39060440160408051808303816000875af1158015610a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a859190611c70565b50505b5050505050508080610a9990611caa565b915050610810565b506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660009081526009602052604081204390555b81811015610c6f57600080888884818110610afb57610afb611c1f565b9050602002016020810190610b109190611ac1565b878785818110610b2257610b22611c1f565b9050602002016020810190610b379190611ac1565b6001600160a01b0382166000908152600960205260409020549193509150431115610bec576040516370a0823160e01b8152306004820152610bd09083906001600160a01b038216906370a08231906024015b602060405180830381865afa158015610ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcb9190611c35565b61120b565b6001600160a01b03821660009081526009602052604090204390555b6001600160a01b038116600090815260096020526040902054431115610c5a576040516370a0823160e01b8152306004820152610c3e9082906001600160a01b038216906370a0823190602401610b8a565b6001600160a01b03811660009081526009602052604090204390555b50508080610c6790611caa565b915050610ade565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfa9190611c35565b90508015610d5057610d4e7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000083306112f7565b505b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610db7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddb9190611c35565b90508015610f0457600061271060035483610df69190611cc3565b610e009190611ce0565b90506000610e0e8284611d02565b9050610e447f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163384611717565b610e7a6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661036983611717565b8060026000828254610e8c9190611d15565b909155505060408051838152602081018390526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169133917f50d636f39b9f390a6d6268fbe77fd545259208985002e2a955629f63a9e58bad910160405180910390a3509450610f0d9350505050565b60009450505050505b610f1660018055565b949350505050565b3360009081526005602052604090205460ff16610f4d5760405162461bcd60e51b81526004016103c090611be8565b60148110610f915760405162461bcd60e51b81526020600482015260116024820152700e6d8d2e0e0c2ceca40e8dede40d0d2ced607b1b60448201526064016103c0565b600455565b610f9e611085565b6001600160a01b038116610fc857604051631e4fbdf760e01b8152600060048201526024016103c0565b610fd1816110b2565b50565b610fdc611085565b6001600160a01b03166000908152600560205260409020805460ff19169055565b3360009081526005602052604090205460ff1661102c5760405162461bcd60e51b81526004016103c090611be8565b6001600160a01b0381166000818152600b6020908152604091829020805460ff81161560ff1990911617905590519182527fbb282aa752df4e6fee49be253bb0063563473a33117712e477e7bebf6ec9bb77910161041e565b6000546001600160a01b031633146105775760405163118cdaa760e01b81523360048201526024016103c0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001540361112557604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600080600080846001600160a01b0316866001600160a01b031610611152578486611155565b85855b60405163e6a4390560e01b81526001600160a01b03808416600483015280831660248301529294509092506000917f0000000000000000000000000000000000000000000000000000000000000000169063e6a4390590604401602060405180830381865afa1580156111cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f09190611d28565b94505050506001600160a01b038216151590505b9250929050565b80801580159061124d57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614155b801561128b57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614155b156112f257600061129b84611769565b9050801580156112c457506001600160a01b0384166000908152600a602052604090205460ff16155b156112f05760006112d4856106dd565b90506112e2858286306112f7565b92506112ee818461120b565b505b505b505050565b60405163e6a4390560e01b81526001600160a01b038581166004830152848116602483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063e6a4390590604401602060405180830381865afa15801561136a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138e9190611d28565b90506001600160a01b0381166113e65760405162461bcd60e51b815260206004820152601d60248201527f46696e427579416e644275726e3a2043616e6e6f7420636f6e7665727400000060448201526064016103c0565b600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611427573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144b9190611d5c565b506001600160701b031691506001600160701b03169150600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c79190611d28565b6001600160a01b03168a6001600160a01b0316146114e65782846114e9565b83835b90925090506115026001600160a01b038b16868a611717565b6040516370a0823160e01b81526001600160a01b03868116600483015260009184918d16906370a0823190602401602060405180830381865afa15801561154d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115719190611c35565b61157b9190611d02565b6001600160a01b038c166000908152600b602052604090205490915060ff16806115af57506004546115ad8285611ce0565b115b6115fb5760405162461bcd60e51b815260206004820152601c60248201527f46696e427579416e644275726e3a206869676820736c6970706167650000000060448201526064016103c0565b611606818484611921565b9650600080876001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611649573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166d9190611d28565b6001600160a01b03168d6001600160a01b03161461168d57886000611691565b6000895b6040805160008152602081019182905263022c0d9f60e01b90915291935091506001600160a01b0389169063022c0d9f906116d590859085908f9060248101611dd0565b600060405180830381600087803b1580156116ef57600080fd5b505af1158015611703573d6000803e3d6000fd5b505050505050505050505050949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526112f2908490611a3b565b60408051600481526024810182526020810180516001600160e01b0316630dfe168160e01b1790529051600091829182916001600160a01b038616916117af9190611e20565b600060405180830381855afa9150503d80600081146117ea576040519150601f19603f3d011682016040523d82523d6000602084013e6117ef565b606091505b50915091508180156118015750805115155b156119175760408051600481526024810182526020810180516001600160e01b031663d21220a760e01b179052905160009182916001600160a01b0388169161184991611e20565b600060405180830381855afa9150503d8060008114611884576040519150601f19603f3d011682016040523d82523d6000602084013e611889565b606091505b509150915081801561189b5750805115155b1561190b576000838060200190518101906118b69190611d28565b90506000828060200190518101906118ce9190611d28565b905060006118dc838361112c565b985090508780156118fe5750886001600160a01b0316816001600160a01b0316145b9998505050505050505050565b50600095945050505050565b5060009392505050565b60008084116119835760405162461bcd60e51b815260206004820152602860248201527f46696e427579416e644275726e3a20494e53554646494349454e545f494e50556044820152671517d05353d5539560c21b60648201526084016103c0565b6000831180156119935750600082115b6119ed5760405162461bcd60e51b815260206004820152602560248201527f46696e427579416e644275726e3a20494e53554646494349454e545f4c495155604482015264494449545960d81b60648201526084016103c0565b60006119fb856126f3611cc3565b90506000611a098483611cc3565b9050600082611a1a87612710611cc3565b611a249190611d15565b9050611a308183611ce0565b979650505050505050565b600080602060008451602086016000885af180611a5e576040513d6000823e3d81fd5b50506000513d91508115611a76578060011415611a83565b6001600160a01b0384163b155b156112f057604051635274afe760e01b81526001600160a01b03851660048201526024016103c0565b6001600160a01b0381168114610fd157600080fd5b600060208284031215611ad357600080fd5b8135611ade81611aac565b9392505050565b600060208284031215611af757600080fd5b5035919050565b60008060408385031215611b1157600080fd5b8235611b1c81611aac565b91506020830135611b2c81611aac565b809150509250929050565b60008083601f840112611b4957600080fd5b50813567ffffffffffffffff811115611b6157600080fd5b6020830191508360208260051b850101111561120457600080fd5b60008060008060408587031215611b9257600080fd5b843567ffffffffffffffff80821115611baa57600080fd5b611bb688838901611b37565b90965094506020870135915080821115611bcf57600080fd5b50611bdc87828801611b37565b95989497509550505050565b60208082526018908201527f46696e427579416e644275726e3a20464f5242494444454e0000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c4757600080fd5b5051919050565b600060208284031215611c6057600080fd5b81518015158114611ade57600080fd5b60008060408385031215611c8357600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b600060018201611cbc57611cbc611c94565b5060010190565b8082028115828204841417611cda57611cda611c94565b92915050565b600082611cfd57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115611cda57611cda611c94565b80820180821115611cda57611cda611c94565b600060208284031215611d3a57600080fd5b8151611ade81611aac565b80516001600160701b038116811461072057600080fd5b600080600060608486031215611d7157600080fd5b611d7a84611d45565b9250611d8860208501611d45565b9150604084015163ffffffff81168114611da157600080fd5b809150509250925092565b60005b83811015611dc7578181015183820152602001611daf565b50506000910152565b84815283602082015260018060a01b03831660408201526080606082015260008251806080840152611e098160a0850160208701611dac565b601f01601f19169190910160a00195945050505050565b60008251611e32818460208701611dac565b919091019291505056fea2646970667358221220fa58262027d85bbf566a1d7d1b95448d3ddd197d93c027b7752f3221af3f2ecd64736f6c634300081400330000000000000000000000003c75cb212e3a70c407c05be35ae4f12e2195e6e60000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d2000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a27

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101585760003560e01c80639d22ae8c116100c3578063e19d32361161007c578063e19d3236146102fb578063ef8ef56f1461031e578063f0fa55a914610345578063f2fde38b14610358578063f8171dfa1461036b578063f87c49381461037e57600080fd5b80639d22ae8c1461028a578063a101f7cd1461029d578063a761a939146102a6578063c45a0155146102b9578063ca215cdc146102e0578063d89135cd146102f357600080fd5b80635422224e116101155780635422224e146102205780635d87d3631461023357806363d6b23e14610246578063715018a61461024e57806372b625f0146102565780638da5cb5b1461027957600080fd5b8063016e65451461015d5780630d48669a146101725780631d01548e146101a25780632520e7ff146101bf5780633e032a3b146101e25780634524813f146101f9575b600080fd5b61017061016b366004611ac1565b610391565b005b610185610180366004611ae5565b610429565b6040516001600160a01b0390911681526020015b60405180910390f35b6007546101af9060ff1681565b6040519015158152602001610199565b6101af6101cd366004611ac1565b60056020526000908152604090205460ff1681565b6101eb60045481565b604051908152602001610199565b6101857f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d281565b61017061022e366004611ac1565b610453565b610170610241366004611ae5565b6104c1565b610170610520565b610170610565565b6101af610264366004611ac1565b600a6020526000908152604090205460ff1681565b6000546001600160a01b0316610185565b610170610298366004611afe565b610579565b6101eb60035481565b6101856102b4366004611ac1565b6106dd565b6101857f0000000000000000000000003c75cb212e3a70c407c05be35ae4f12e2195e6e681565b6101eb6102ee366004611b7c565b610725565b6002546101eb565b6101af610309366004611ac1565b600b6020526000908152604090205460ff1681565b6101857f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a2781565b610170610353366004611ae5565b610f1e565b610170610366366004611ac1565b610f96565b610170610379366004611ac1565b610fd4565b61017061038c366004611ac1565b610ffd565b3360009081526005602052604090205460ff166103c95760405162461bcd60e51b81526004016103c090611be8565b60405180910390fd5b6001600160a01b0381166000818152600a6020908152604091829020805460ff81161560ff1990911617905590519182527f9e02380d3a8512a13a9f7b0d44e9fe895a2a21b6ed53dca6a28d7f562956f05791015b60405180910390a150565b6006818154811061043957600080fd5b6000918252602090912001546001600160a01b0316905081565b61045b611085565b6001600160a01b03166000818152600560205260408120805460ff191660019081179091556006805491820181559091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319169091179055565b6104c9611085565b61138881111561051b5760405162461bcd60e51b815260206004820152601a60248201527f736574426f756e74793a20626f756e747920746f6f206869676800000000000060448201526064016103c0565b600355565b610528611085565b6007805460ff19811660ff909116151790556040517fa8f163eced6b62efa0899037b314429cbcdf6028c78b6e13316c8069554b143d90600090a1565b61056d611085565b61057760006110b2565b565b3360009081526005602052604090205460ff166105a85760405162461bcd60e51b81526004016103c090611be8565b7f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d26001600160a01b0316826001600160a01b03161415801561061c57507f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b0316826001600160a01b031614155b801561063a5750806001600160a01b0316826001600160a01b031614155b6106865760405162461bcd60e51b815260206004820152601d60248201527f46696e427579416e644275726e3a20496e76616c69642062726964676500000060448201526064016103c0565b6001600160a01b0382811660008181526008602052604080822080546001600160a01b0319169486169485179055517f2e103aa707acc565f9a1547341914802b2bfe977fd79c595209f248ae4b006139190a35050565b6001600160a01b03808216600090815260086020526040902054168061072057507f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a275b919050565b60003332146107765760405162461bcd60e51b815260206004820152601b60248201527f46696e427579416e644275726e3a206d7573742075736520454f41000000000060448201526064016103c0565b61077e611102565b60075460ff168061079e57503360009081526005602052604090205460ff165b6107ba5760405162461bcd60e51b81526004016103c090611be8565b83600083821461080c5760405162461bcd60e51b815260206004820152601c60248201527f46696e427579416e644275726e3a206c697374206d69736d617463680000000060448201526064016103c0565b5060005b81811015610aa15760008088888481811061082d5761082d611c1f565b90506020020160208101906108429190611ac1565b87878581811061085457610854611c1f565b90506020020160208101906108699190611ac1565b91509150806001600160a01b0316826001600160a01b0316036108ce5760405162461bcd60e51b815260206004820152601b60248201527f46696e427579416e644275726e3a20746f6b656e73206d61746368000000000060448201526064016103c0565b6000806108db848461112c565b915091508061092c5760405162461bcd60e51b815260206004820152601b60248201527f46696e427579416e644275726e3a20496e76616c69642070616972000000000060448201526064016103c0565b6040516370a0823160e01b815230600482015282906000906001600160a01b038316906370a0823190602401602060405180830381865afa158015610975573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109999190611c35565b90508015610a885760405163a9059cbb60e01b81526001600160a01b0385811660048301526024820183905283169063a9059cbb906044016020604051808303816000875af11580156109f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a149190611c4e565b506040516327fc84a360e01b8152306004820181905260248201526001600160a01b038316906327fc84a39060440160408051808303816000875af1158015610a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a859190611c70565b50505b5050505050508080610a9990611caa565b915050610810565b506001600160a01b037f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a271660009081526009602052604081204390555b81811015610c6f57600080888884818110610afb57610afb611c1f565b9050602002016020810190610b109190611ac1565b878785818110610b2257610b22611c1f565b9050602002016020810190610b379190611ac1565b6001600160a01b0382166000908152600960205260409020549193509150431115610bec576040516370a0823160e01b8152306004820152610bd09083906001600160a01b038216906370a08231906024015b602060405180830381865afa158015610ba7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcb9190611c35565b61120b565b6001600160a01b03821660009081526009602052604090204390555b6001600160a01b038116600090815260096020526040902054431115610c5a576040516370a0823160e01b8152306004820152610c3e9082906001600160a01b038216906370a0823190602401610b8a565b6001600160a01b03811660009081526009602052604090204390555b50508080610c6790611caa565b915050610ade565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b0316906370a0823190602401602060405180830381865afa158015610cd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfa9190611c35565b90508015610d5057610d4e7f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a277f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d283306112f7565b505b6040516370a0823160e01b81523060048201526000907f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d26001600160a01b0316906370a0823190602401602060405180830381865afa158015610db7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddb9190611c35565b90508015610f0457600061271060035483610df69190611cc3565b610e009190611ce0565b90506000610e0e8284611d02565b9050610e447f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d26001600160a01b03163384611717565b610e7a6001600160a01b037f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d21661036983611717565b8060026000828254610e8c9190611d15565b909155505060408051838152602081018390526001600160a01b037f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d2169133917f50d636f39b9f390a6d6268fbe77fd545259208985002e2a955629f63a9e58bad910160405180910390a3509450610f0d9350505050565b60009450505050505b610f1660018055565b949350505050565b3360009081526005602052604090205460ff16610f4d5760405162461bcd60e51b81526004016103c090611be8565b60148110610f915760405162461bcd60e51b81526020600482015260116024820152700e6d8d2e0e0c2ceca40e8dede40d0d2ced607b1b60448201526064016103c0565b600455565b610f9e611085565b6001600160a01b038116610fc857604051631e4fbdf760e01b8152600060048201526024016103c0565b610fd1816110b2565b50565b610fdc611085565b6001600160a01b03166000908152600560205260409020805460ff19169055565b3360009081526005602052604090205460ff1661102c5760405162461bcd60e51b81526004016103c090611be8565b6001600160a01b0381166000818152600b6020908152604091829020805460ff81161560ff1990911617905590519182527fbb282aa752df4e6fee49be253bb0063563473a33117712e477e7bebf6ec9bb77910161041e565b6000546001600160a01b031633146105775760405163118cdaa760e01b81523360048201526024016103c0565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60026001540361112557604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600080600080846001600160a01b0316866001600160a01b031610611152578486611155565b85855b60405163e6a4390560e01b81526001600160a01b03808416600483015280831660248301529294509092506000917f0000000000000000000000003c75cb212e3a70c407c05be35ae4f12e2195e6e6169063e6a4390590604401602060405180830381865afa1580156111cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f09190611d28565b94505050506001600160a01b038216151590505b9250929050565b80801580159061124d57507f0000000000000000000000001c81b4358246d3088ab4361ab755f3d8d4dd62d26001600160a01b0316836001600160a01b031614155b801561128b57507f000000000000000000000000a1077a294dde1b09bb078844df40758a5d0f9a276001600160a01b0316836001600160a01b031614155b156112f257600061129b84611769565b9050801580156112c457506001600160a01b0384166000908152600a602052604090205460ff16155b156112f05760006112d4856106dd565b90506112e2858286306112f7565b92506112ee818461120b565b505b505b505050565b60405163e6a4390560e01b81526001600160a01b038581166004830152848116602483015260009182917f0000000000000000000000003c75cb212e3a70c407c05be35ae4f12e2195e6e6169063e6a4390590604401602060405180830381865afa15801561136a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138e9190611d28565b90506001600160a01b0381166113e65760405162461bcd60e51b815260206004820152601d60248201527f46696e427579416e644275726e3a2043616e6e6f7420636f6e7665727400000060448201526064016103c0565b600080826001600160a01b0316630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015611427573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144b9190611d5c565b506001600160701b031691506001600160701b03169150600080846001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa1580156114a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c79190611d28565b6001600160a01b03168a6001600160a01b0316146114e65782846114e9565b83835b90925090506115026001600160a01b038b16868a611717565b6040516370a0823160e01b81526001600160a01b03868116600483015260009184918d16906370a0823190602401602060405180830381865afa15801561154d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115719190611c35565b61157b9190611d02565b6001600160a01b038c166000908152600b602052604090205490915060ff16806115af57506004546115ad8285611ce0565b115b6115fb5760405162461bcd60e51b815260206004820152601c60248201527f46696e427579416e644275726e3a206869676820736c6970706167650000000060448201526064016103c0565b611606818484611921565b9650600080876001600160a01b0316630dfe16816040518163ffffffff1660e01b8152600401602060405180830381865afa158015611649573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166d9190611d28565b6001600160a01b03168d6001600160a01b03161461168d57886000611691565b6000895b6040805160008152602081019182905263022c0d9f60e01b90915291935091506001600160a01b0389169063022c0d9f906116d590859085908f9060248101611dd0565b600060405180830381600087803b1580156116ef57600080fd5b505af1158015611703573d6000803e3d6000fd5b505050505050505050505050949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526112f2908490611a3b565b60408051600481526024810182526020810180516001600160e01b0316630dfe168160e01b1790529051600091829182916001600160a01b038616916117af9190611e20565b600060405180830381855afa9150503d80600081146117ea576040519150601f19603f3d011682016040523d82523d6000602084013e6117ef565b606091505b50915091508180156118015750805115155b156119175760408051600481526024810182526020810180516001600160e01b031663d21220a760e01b179052905160009182916001600160a01b0388169161184991611e20565b600060405180830381855afa9150503d8060008114611884576040519150601f19603f3d011682016040523d82523d6000602084013e611889565b606091505b509150915081801561189b5750805115155b1561190b576000838060200190518101906118b69190611d28565b90506000828060200190518101906118ce9190611d28565b905060006118dc838361112c565b985090508780156118fe5750886001600160a01b0316816001600160a01b0316145b9998505050505050505050565b50600095945050505050565b5060009392505050565b60008084116119835760405162461bcd60e51b815260206004820152602860248201527f46696e427579416e644275726e3a20494e53554646494349454e545f494e50556044820152671517d05353d5539560c21b60648201526084016103c0565b6000831180156119935750600082115b6119ed5760405162461bcd60e51b815260206004820152602560248201527f46696e427579416e644275726e3a20494e53554646494349454e545f4c495155604482015264494449545960d81b60648201526084016103c0565b60006119fb856126f3611cc3565b90506000611a098483611cc3565b9050600082611a1a87612710611cc3565b611a249190611d15565b9050611a308183611ce0565b979650505050505050565b600080602060008451602086016000885af180611a5e576040513d6000823e3d81fd5b50506000513d91508115611a76578060011415611a83565b6001600160a01b0384163b155b156112f057604051635274afe760e01b81526001600160a01b03851660048201526024016103c0565b6001600160a01b0381168114610fd157600080fd5b600060208284031215611ad357600080fd5b8135611ade81611aac565b9392505050565b600060208284031215611af757600080fd5b5035919050565b60008060408385031215611b1157600080fd5b8235611b1c81611aac565b91506020830135611b2c81611aac565b809150509250929050565b60008083601f840112611b4957600080fd5b50813567ffffffffffffffff811115611b6157600080fd5b6020830191508360208260051b850101111561120457600080fd5b60008060008060408587031215611b9257600080fd5b843567ffffffffffffffff80821115611baa57600080fd5b611bb688838901611b37565b90965094506020870135915080821115611bcf57600080fd5b50611bdc87828801611b37565b95989497509550505050565b60208082526018908201527f46696e427579416e644275726e3a20464f5242494444454e0000000000000000604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611c4757600080fd5b5051919050565b600060208284031215611c6057600080fd5b81518015158114611ade57600080fd5b60008060408385031215611c8357600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b600060018201611cbc57611cbc611c94565b5060010190565b8082028115828204841417611cda57611cda611c94565b92915050565b600082611cfd57634e487b7160e01b600052601260045260246000fd5b500490565b81810381811115611cda57611cda611c94565b80820180821115611cda57611cda611c94565b600060208284031215611d3a57600080fd5b8151611ade81611aac565b80516001600160701b038116811461072057600080fd5b600080600060608486031215611d7157600080fd5b611d7a84611d45565b9250611d8860208501611d45565b9150604084015163ffffffff81168114611da157600080fd5b809150509250925092565b60005b83811015611dc7578181015183820152602001611daf565b50506000910152565b84815283602082015260018060a01b03831660408201526080606082015260008251806080840152611e098160a0850160208701611dac565b601f01601f19169190910160a00195945050505050565b60008251611e32818460208701611dac565b919091019291505056fea2646970667358221220fa58262027d85bbf566a1d7d1b95448d3ddd197d93c027b7752f3221af3f2ecd64736f6c63430008140033