ETH Price: $3,378.84 (-1.90%)
Gas: 1 Gwei

Contract

0xc2e660C62F72c2ad35AcE6DB78a616215E2F2222
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Approve201717962024-06-25 22:51:232 days ago1719355883IN
Zunami Protocol: zunETH Token
0 ETH0.000160883.45932245
Approve201477902024-06-22 14:17:596 days ago1719065879IN
Zunami Protocol: zunETH Token
0 ETH0.000250295.38444132
Approve201477342024-06-22 14:06:476 days ago1719065207IN
Zunami Protocol: zunETH Token
0 ETH0.000187474.03315999
Approve201477282024-06-22 14:05:356 days ago1719065135IN
Zunami Protocol: zunETH Token
0 ETH0.000089613.65608129
Approve201388712024-06-21 8:22:357 days ago1718958155IN
Zunami Protocol: zunETH Token
0 ETH0.000285286.13410297
Approve201294072024-06-20 0:36:358 days ago1718843795IN
Zunami Protocol: zunETH Token
0 ETH0.000226444.83891302
Approve201227842024-06-19 2:22:359 days ago1718763755IN
Zunami Protocol: zunETH Token
0 ETH0.000297096.38801607
Approve201223252024-06-19 0:50:119 days ago1718758211IN
Zunami Protocol: zunETH Token
0 ETH0.000240495.17110422
Approve201112452024-06-17 11:36:1111 days ago1718624171IN
Zunami Protocol: zunETH Token
0 ETH0.000209864.4847601
Approve201104292024-06-17 8:51:2311 days ago1718614283IN
Zunami Protocol: zunETH Token
0 ETH0.000169733.62702662
Approve201050352024-06-16 14:44:5912 days ago1718549099IN
Zunami Protocol: zunETH Token
0 ETH0.00018583.97057008
Approve201025622024-06-16 6:28:4712 days ago1718519327IN
Zunami Protocol: zunETH Token
0 ETH0.000151413.23561945
Approve201022732024-06-16 5:30:5912 days ago1718515859IN
Zunami Protocol: zunETH Token
0 ETH0.000121662.6
Approve200969322024-06-15 11:35:4713 days ago1718451347IN
Zunami Protocol: zunETH Token
0 ETH0.000160623.43254648
Approve200969242024-06-15 11:34:1113 days ago1718451251IN
Zunami Protocol: zunETH Token
0 ETH0.000153933.30983377
Approve200949922024-06-15 5:03:4713 days ago1718427827IN
Zunami Protocol: zunETH Token
0 ETH0.000251145.36672291
Approve200931082024-06-14 22:43:4713 days ago1718405027IN
Zunami Protocol: zunETH Token
0 ETH0.000249315.36071906
Approve200887462024-06-14 8:07:1114 days ago1718352431IN
Zunami Protocol: zunETH Token
0 ETH0.0006345413.64381675
Approve200680602024-06-11 10:42:3517 days ago1718102555IN
Zunami Protocol: zunETH Token
0 ETH0.0005989112.88431348
Approve200171132024-06-04 7:57:4724 days ago1717487867IN
Zunami Protocol: zunETH Token
0 ETH0.000282316.03291864
Approve199999232024-06-01 22:21:2326 days ago1717280483IN
Zunami Protocol: zunETH Token
0 ETH0.000240045.16136659
Approve199805222024-05-30 5:17:4729 days ago1717046267IN
Zunami Protocol: zunETH Token
0 ETH0.000171587
Approve199804272024-05-30 4:58:3529 days ago1717045115IN
Zunami Protocol: zunETH Token
0 ETH0.000171587
Approve199393012024-05-24 10:59:3535 days ago1716548375IN
Zunami Protocol: zunETH Token
0 ETH0.000320876.85690504
Approve199319282024-05-23 10:16:3536 days ago1716459395IN
Zunami Protocol: zunETH Token
0 ETH0.000354927.63149112
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZunamiPoolZunETH

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 18 : ZunamiPoolZunETH.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import '../../ZunamiPool.sol';
import '../../utils/Constants.sol';

contract ZunamiPoolZunETH is ZunamiPool {
    uint256 public constant ZUNAMI_WETH_TOKEN_ID = 0;
    uint256 public constant ZUNAMI_FRXETH_TOKEN_ID = 1;

    constructor() ZunamiPool('Zunami ETH', 'zunETH') {
        address[POOL_ASSETS] memory tokens;
        tokens[ZUNAMI_WETH_TOKEN_ID] = Constants.WETH_ADDRESS;
        tokens[ZUNAMI_FRXETH_TOKEN_ID] = Constants.FRX_ETH_ADDRESS;

        uint256[POOL_ASSETS] memory tokenDecimalMultipliers;
        tokenDecimalMultipliers[ZUNAMI_WETH_TOKEN_ID] = 1;
        tokenDecimalMultipliers[ZUNAMI_FRXETH_TOKEN_ID] = 1;

        _setTokens(tokens, tokenDecimalMultipliers);
    }
}

File 2 of 18 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

File 3 of 18 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

File 4 of 18 : draft-IERC6093.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 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 ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-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 ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 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 5 of 18 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 */
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}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `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:
     * ```
     * 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 6 of 18 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 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 7 of 18 : IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 8 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

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

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

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

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

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

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

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

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

File 9 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

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

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

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

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

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

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}

File 10 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

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

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

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

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

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

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

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

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

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

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

File 11 of 18 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (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;
    }
}

File 12 of 18 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 13 of 18 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

File 14 of 18 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    bool private _paused;

    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    /**
     * @dev The operation failed because the contract is paused.
     */
    error EnforcedPause();

    /**
     * @dev The operation failed because the contract is not paused.
     */
    error ExpectedPause();

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        if (paused()) {
            revert EnforcedPause();
        }
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        if (!paused()) {
            revert ExpectedPause();
        }
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 15 of 18 : IPool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import { IStrategy } from './IStrategy.sol';

interface IPool is IERC20 {
    error WrongDeposit(uint256 sid, uint256[5] amounts);
    error AbsentStrategy(uint256 sid);
    error NotStartedStrategy(uint256 sid);
    error DisabledStrategy(uint256 sid);
    error WrongAmount();
    error WrongWithdrawParams(uint256 sid);
    error WrongRatio();
    error ZeroAddress();
    error DuplicatedStrategy();
    error IncorrectArguments();
    error WrongWithdrawPercent();
    error WrongReceiver();
    error IncorrectSid();
    error WrongTokens();
    error WrongDecimalMultipliers();

    struct StrategyInfo {
        IStrategy strategy;
        uint256 startTime;
        uint256 minted;
        bool enabled;
    }

    event Deposited(
        address indexed depositor,
        uint256 deposited,
        uint256[5] amounts,
        uint256 indexed sid
    );

    event Withdrawn(address indexed withdrawer, uint256 withdrawn, uint256 indexed sid);

    event FailedWithdrawal(address indexed withdrawer, uint256[5] amounts, uint256 withdrawn);

    event AddedStrategy(uint256 indexed sid, address indexed strategyAddr, uint256 startTime);
    event ClaimedRewards(address indexed receiver, IERC20[] rewardTokens);
    event ClaimedExtraGains(address indexed receiver, uint256 amount);
    event EnabledStrategy(address indexed pool);
    event DisableStrategy(address indexed pool);
    event UpdatedToken(
        uint256 indexed tid,
        address indexed token,
        uint256 tokenDecimalMultiplier,
        address tokenOld
    );

    function tokens() external view returns (IERC20[5] memory);

    function token(uint256 tid) external view returns (IERC20);

    function tokenDecimalsMultipliers() external view returns (uint256[5] memory);

    function strategyInfo(uint256 sid) external view returns (StrategyInfo memory);

    function claimRewards(address receiver, IERC20[] memory rewardTokens) external;

    function totalHoldings() external view returns (uint256);

    function strategyCount() external view returns (uint256);

    function deposit(
        uint256 sid,
        uint256[5] memory amounts,
        address receiver
    ) external returns (uint256);

    function depositStrategy(uint256 sid, uint256[5] memory amounts) external returns (uint256);

    function withdraw(
        uint256 sid,
        uint256 stableAmount,
        uint256[5] memory minTokenAmounts,
        address receiver
    ) external;

    function mintAndClaimExtraGains(address receiver) external;
}

File 16 of 18 : IStrategy.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import { IERC20 } from '@openzeppelin/contracts/token/ERC20/IERC20.sol';

interface IStrategy {
    function deposit(uint256[5] memory amounts) external returns (uint256);

    function withdraw(
        address receiver,
        uint256 userDepositRatio, // multiplied by 1e18
        uint256[5] memory minTokenAmounts
    ) external returns (bool);

    function withdrawAll(uint256[5] memory minTokenAmounts) external;

    function totalHoldings() external view returns (uint256);

    function claimRewards(address receiver, IERC20[] memory rewardTokens) external;

    function calcTokenAmount(
        uint256[5] memory tokenAmounts,
        bool isDeposit
    ) external view returns (uint256 sharesAmount);
}

File 17 of 18 : Constants.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

library Constants {
    address internal constant CRVUSD_ADDRESS = 0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E;
    address internal constant USDC_ADDRESS = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
    address internal constant USDT_ADDRESS = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
    address internal constant DAI_ADDRESS = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
    address internal constant FRX_ETH_ADDRESS = 0x5E8422345238F34275888049021821E8E08CAa1f;
    address internal constant WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
    address internal constant CVX_ADDRESS = 0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B;
    address internal constant CRV_ADDRESS = 0xD533a949740bb3306d119CC777fa900bA034cd52;
    address internal constant FXS_ADDRESS = 0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0;
    address internal constant SPELL_ADDRESS = 0x090185f2135308BaD17527004364eBcC2D37e5F6;
    address internal constant SDT_ADDRESS = 0x73968b9a57c6E53d41345FD57a6E6ae27d6CDB2F;
    address internal constant SFRXETH_ADDRESS = 0xac3E018457B222d93114458476f3E3416Abbe38F;
    // Will be added after deployment of zunUSD v2 pool
    address internal constant ZUNUSD_ADDRESS = 0x8C0D76C9B18779665475F3E212D9Ca1Ed6A1A0e6;
    // Will be added after deployment of zunUSD v2 pool controller
    address internal constant zunUSD_CONTROLLER_ADDRESS =
        0x618eee502CDF6b46A2199C21D1411f3F6065c940;
    // Will be added after deployment of zunETH v2 pool
    address internal constant zunETH_ADDRESS = 0xc2e660C62F72c2ad35AcE6DB78a616215E2F2222;
    address internal constant zunETH_CONTROLLER_ADDRESS = 0x54A00DA65c79DDCe24E7fe4691737FD70F7797DF;

    address public constant CHAINLINK_FEED_REGISTRY_ETH_ADDRESS =
        0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    address internal constant CRV_3POOL_ADDRESS = 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7;
    address internal constant CRV_3POOL_LP_ADDRESS = 0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490;

    address internal constant CRV_TRICRYPTO2_ADDRESS = 0xD51a44d3FaE010294C616388b506AcdA1bfAAE46;

    address internal constant ETH_frxETH_ADDRESS = 0xa1F8A6807c402E4A15ef4EBa36528A3FED24E577;
    address internal constant ETH_frxETH_LP_ADDRESS = 0xf43211935C781D5ca1a41d2041F397B8A7366C7A;

    address internal constant WETH_frxETH_ADDRESS = 0x9c3B46C0Ceb5B9e304FCd6D88Fc50f7DD24B31Bc;
    address internal constant WETH_frxETH_LP_ADDRESS = 0x9c3B46C0Ceb5B9e304FCd6D88Fc50f7DD24B31Bc;

    address internal constant CRV_FRAX_USDC_POOL_ADDRESS =
        0xDcEF968d416a41Cdac0ED8702fAC8128A64241A2;
    address internal constant CRV_FRAX_USDC_POOL_LP_ADDRESS =
        0x3175Df0976dFA876431C2E9eE6Bc45b65d3473CC;

    address internal constant SDT_CRVUSD_USDT_VAULT_ADDRESS =
        0x37b24ac19504C0c6FC1ADc8deb5D24f5C4F6A2f2;
    address internal constant CRV_CRVUSD_USDT_LP_ADDRESS =
        0x390f3595bCa2Df7d23783dFd126427CCeb997BF4;
    address internal constant CRV_CRVUSD_USDT_ADDRESS = 0x390f3595bCa2Df7d23783dFd126427CCeb997BF4;

    address internal constant SDT_CRVUSD_USDC_VAULT_ADDRESS =
        0xb618EA40cb1F5b08839Ba228C8dd58AC3DCA12F3;
    address internal constant CRV_CRVUSD_USDC_LP_ADDRESS =
        0x4DEcE678ceceb27446b35C672dC7d61F30bAD69E;
    address internal constant CRV_CRVUSD_USDC_ADDRESS = 0x4DEcE678ceceb27446b35C672dC7d61F30bAD69E;

    address internal constant CRV_BOOSTER_ADDRESS = 0xF403C135812408BFbE8713b5A23a04b3D48AAE31;

    address internal constant CRV_ETH_stETH_ADDRESS = 0x21E27a5E5513D6e65C4f830167390997aA84843a;
    address internal constant CRV_ETH_stETH_LP_ADDRESS = 0x21E27a5E5513D6e65C4f830167390997aA84843a;
    address internal constant CVX_ETH_stETH_REWARDS_ADDRESS =
        0x6B27D7BC63F1999D14fF9bA900069ee516669ee8;
    uint256 internal constant CVX_ETH_stETH_PID = 177;

    // Will be added after deployment of zunUSD v2 pool and curve pool for zunUSD
    address internal constant CRV_zunUSD_crvFRAX_ADDRESS = address(0);
    address internal constant CRV_zunUSD_crvFRAX_LP_ADDRESS = address(0);
    address internal constant CVX_zunUSD_crvFRAX_REWARDS_ADDRESS = address(0);
    uint256 internal constant CVX_zunUSD_crvFRAX_PID = 0;

    address internal constant CRV_zunUSD_crvUSD_ADDRESS =
        0x8C24b3213FD851db80245FCCc42c40B94Ac9a745;
    address internal constant CRV_zunUSD_crvUSD_LP_ADDRESS =
        0x8C24b3213FD851db80245FCCc42c40B94Ac9a745;
    address internal constant CVX_zunUSD_crvUSD_REWARDS_ADDRESS =
        0xB0408d1477554268Ece9b0a40290C345196fBf1B;
    uint256 internal constant CVX_zunUSD_crvUSD_PID = 309;

    address internal constant CRV_USDT_crvUSD_ADDRESS = 0x390f3595bCa2Df7d23783dFd126427CCeb997BF4;
}

File 18 of 18 : ZunamiPool.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';
import '@openzeppelin/contracts/utils/Pausable.sol';
import '@openzeppelin/contracts/access/AccessControl.sol';
import './interfaces/IStrategy.sol';
import './interfaces/IPool.sol';

/**
 *
 * @title Zunami Protocol v2
 *
 */
contract ZunamiPool is IPool, ERC20, Pausable, AccessControl {
    using SafeERC20 for IERC20;

    uint8 public constant POOL_ASSETS = 5;

    bytes32 public constant EMERGENCY_ADMIN_ROLE = keccak256('EMERGENCY_ADMIN_ROLE');
    bytes32 public constant CONTROLLER_ROLE = keccak256('CONTROLLER_ROLE');
    uint256 public constant RATIO_MULTIPLIER = 1e18;
    uint256 public constant MIN_LOCK_TIME = 1 days;
    uint256 public constant FUNDS_DENOMINATOR = 1e18;
    uint256 public constant MINIMUM_LIQUIDITY = 1e3;
    address public constant MINIMUM_LIQUIDITY_LOCKER = 0x000000000000000000000000000000000000dEaD;

    StrategyInfo[] private _strategyInfo;

    IERC20[POOL_ASSETS] private _tokens;
    uint256[POOL_ASSETS] private _decimalsMultipliers;

    uint256 public extraGains;
    uint256 public extraGainsMintedBlock;
    bool public launched;

    constructor(string memory name_, string memory symbol_) ERC20(name_, symbol_) {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(EMERGENCY_ADMIN_ROLE, msg.sender);
    }

    function _checkStrategyExisted(uint256 sid) internal view {
        if (sid >= _strategyInfo.length) revert AbsentStrategy(sid);
    }

    function _checkStrategyStarted(uint256 sid) internal view {
        if (block.timestamp < _strategyInfo[sid].startTime) revert NotStartedStrategy(sid);
    }

    function _checkStrategyEnabled(uint256 sid) internal view {
        if (!_strategyInfo[sid].enabled) revert DisabledStrategy(sid);
    }

    function strategyInfo(uint256 sid) external view returns (StrategyInfo memory) {
        return _strategyInfo[sid];
    }

    function tokens() external view returns (IERC20[POOL_ASSETS] memory) {
        return _tokens;
    }

    function token(uint256 tid) external view returns (IERC20) {
        return _tokens[tid];
    }

    function tokenDecimalsMultipliers() external view returns (uint256[POOL_ASSETS] memory) {
        return _decimalsMultipliers;
    }

    function _setTokens(
        address[POOL_ASSETS] memory tokens_,
        uint256[POOL_ASSETS] memory tokenDecimalsMultipliers_
    ) internal {
        bool otherZeros = false;
        for (uint256 i = 0; i < POOL_ASSETS; i++) {
            if (otherZeros && address(tokens_[i]) != address(0)) revert WrongTokens();
            if (address(tokens_[i]) == address(0)) otherZeros = true;
            if (
                (address(tokens_[i]) != address(0) && tokenDecimalsMultipliers_[i] == 0) ||
                (address(tokens_[i]) == address(0) && tokenDecimalsMultipliers_[i] != 0)
            ) revert WrongDecimalMultipliers();
            address oldToken = address(_tokens[i]);
            _tokens[i] = IERC20(tokens_[i]);
            _decimalsMultipliers[i] = tokenDecimalsMultipliers_[i];
            emit UpdatedToken(i, tokens_[i], tokenDecimalsMultipliers_[i], oldToken);
        }
    }

    function setTokens(
        address[POOL_ASSETS] memory tokens_,
        uint256[POOL_ASSETS] memory tokenDecimalMultipliers_
    ) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _setTokens(tokens_, tokenDecimalMultipliers_);
    }

    function pause() external onlyRole(EMERGENCY_ADMIN_ROLE) {
        _pause();
    }

    function unpause() external onlyRole(DEFAULT_ADMIN_ROLE) {
        _unpause();
    }

    function claimRewards(
        address receiver,
        IERC20[] memory rewardTokens
    ) external onlyRole(CONTROLLER_ROLE) {
        _mintExtraGains();
        _claimExtraGains(receiver);

        for (uint256 i = 0; i < _strategyInfo.length; i++) {
            StrategyInfo memory strategyInfo_ = _strategyInfo[i];
            if (strategyInfo_.minted > 0 && strategyInfo_.enabled) {
                strategyInfo_.strategy.claimRewards(receiver, rewardTokens);
            }
        }
        emit ClaimedRewards(receiver, rewardTokens);
    }

    /// @dev mint extra gains if any and weren't minted in this block
    function _mintExtraGains() internal {
        // return if gains were minted in this block
        if (extraGainsMintedBlock == block.number) return;

        uint256 gains;
        uint256 strategyGains_;
        for (uint256 sid = 0; sid < _strategyInfo.length; sid++) {
            StrategyInfo storage strategyInfo_ = _strategyInfo[sid];
            if (strategyInfo_.minted > 0 && strategyInfo_.enabled) {
                uint256 holdings = strategyInfo_.strategy.totalHoldings();
                uint256 minted = strategyInfo_.minted;
                //check if gains are present
                if (holdings <= minted) continue;

                unchecked {
                    strategyGains_ = holdings - minted;
                    strategyInfo_.minted += strategyGains_;
                    gains += strategyGains_;
                }
            }
        }

        if (gains == 0) return;
        extraGains += gains;
        extraGainsMintedBlock = block.number;
        _mint(address(this), gains);
    }

    /// @dev claim extra gains if any
    function _claimExtraGains(address receiver) internal {
        if (extraGains == 0) return;

        uint256 _extraGains = extraGains;
        extraGains = 0;
        IERC20(address(this)).transfer(receiver, _extraGains);
        emit ClaimedExtraGains(receiver, _extraGains);
    }

    function mintAndClaimExtraGains(address receiver) external onlyRole(CONTROLLER_ROLE) {
        _mintExtraGains();
        _claimExtraGains(receiver);
    }

    function totalHoldings() public view returns (uint256) {
        uint256 length = _strategyInfo.length;
        uint256 total;
        for (uint256 sid = 0; sid < length; sid++) {
            StrategyInfo memory strategyInfo_ = _strategyInfo[sid];
            if (strategyInfo_.minted > 0 && strategyInfo_.enabled) {
                total += strategyInfo_.strategy.totalHoldings();
            }
        }
        return total;
    }

    function strategyCount() external view returns (uint256) {
        return _strategyInfo.length;
    }

    function deposit(
        uint256 sid,
        uint256[POOL_ASSETS] memory amounts,
        address receiver
    ) external whenNotPaused onlyRole(CONTROLLER_ROLE) returns (uint256) {
        _checkStrategyExisted(sid);
        _checkStrategyStarted(sid);
        _checkStrategyEnabled(sid);

        if (receiver == address(0)) {
            receiver = _msgSender();
        }

        _mintExtraGains();

        uint256 depositedValue = doDepositStrategy(sid, amounts);
        return processSuccessfulDeposit(receiver, depositedValue, amounts, sid);
    }

    function depositStrategy(
        uint256 sid,
        uint256[POOL_ASSETS] memory amounts
    ) external whenNotPaused onlyRole(CONTROLLER_ROLE) returns (uint256) {
        _checkStrategyExisted(sid);
        _checkStrategyStarted(sid);

        return doDepositStrategy(sid, amounts);
    }

    function doDepositStrategy(
        uint256 sid,
        uint256[POOL_ASSETS] memory amounts
    ) internal returns (uint256 depositedValue) {
        IStrategy strategy = _strategyInfo[sid].strategy;

        for (uint256 i = 0; i < amounts.length; i++) {
            if (amounts[i] > 0) {
                IERC20(_tokens[i]).safeTransfer(address(strategy), amounts[i]);
            }
        }

        _mintExtraGains();

        depositedValue = strategy.deposit(amounts);

        if (depositedValue == 0) revert WrongDeposit(sid, amounts);
    }

    function processSuccessfulDeposit(
        address receiver,
        uint256 depositedValue,
        uint256[POOL_ASSETS] memory depositedTokens,
        uint256 sid
    ) internal returns (uint256) {
        uint256 locked = 0;
        if (totalSupply() == 0) {
            if (depositedValue <= MINIMUM_LIQUIDITY) revert WrongAmount();
            locked = MINIMUM_LIQUIDITY;
            _mint(MINIMUM_LIQUIDITY_LOCKER, MINIMUM_LIQUIDITY); // permanently lock the first MINIMUM_LIQUIDITY tokens
        }
        uint256 depositedValueSubLocked = depositedValue - locked;
        _mint(receiver, depositedValueSubLocked);
        _strategyInfo[sid].minted += depositedValue;

        emit Deposited(receiver, depositedValue, depositedTokens, sid);

        return depositedValueSubLocked;
    }

    function withdraw(
        uint256 sid,
        uint256 stableAmount,
        uint256[POOL_ASSETS] memory tokenAmounts,
        address receiver
    ) external whenNotPaused onlyRole(CONTROLLER_ROLE) {
        _checkStrategyExisted(sid);
        _checkStrategyStarted(sid);
        _checkStrategyEnabled(sid);

        IStrategy strategy = _strategyInfo[sid].strategy;
        address controllerAddr = _msgSender();

        if (balanceOf(controllerAddr) < stableAmount) revert WrongAmount();

        _mintExtraGains();

        if (
            !strategy.withdraw(
                receiver == address(0) ? controllerAddr : receiver,
                calcRatioSafe(stableAmount, _strategyInfo[sid].minted),
                tokenAmounts
            )
        ) revert WrongWithdrawParams(sid);

        processSuccessfulWithdrawal(controllerAddr, stableAmount, sid);
    }

    function processSuccessfulWithdrawal(address user, uint256 stableAmount, uint256 sid) internal {
        _burn(user, stableAmount);
        _strategyInfo[sid].minted -= stableAmount;
        emit Withdrawn(user, stableAmount, sid);
    }

    function calcRatioSafe(
        uint256 outAmount,
        uint256 strategyDeposited
    ) internal pure returns (uint256 ratio) {
        ratio = (outAmount * RATIO_MULTIPLIER) / strategyDeposited;
        if (ratio == 0 || ratio > RATIO_MULTIPLIER) revert WrongRatio();
    }

    /**
     * @dev add a new strategy, deposits in the new strategy are blocked for one day for safety
     * @param _strategyAddr - the new strategy strategy address
     */
    function addStrategy(address _strategyAddr) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_strategyAddr == address(0)) revert ZeroAddress();
        for (uint256 i = 0; i < _strategyInfo.length; i++) {
            if (_strategyAddr == address(_strategyInfo[i].strategy)) revert DuplicatedStrategy();
        }

        uint256 startTime = block.timestamp + (launched ? MIN_LOCK_TIME : 0);
        _strategyInfo.push(
            StrategyInfo({
                strategy: IStrategy(_strategyAddr),
                startTime: startTime,
                minted: 0,
                enabled: true
            })
        );
        emit AddedStrategy(_strategyInfo.length - 1, _strategyAddr, startTime);
    }

    function launch() external onlyRole(DEFAULT_ADMIN_ROLE) {
        launched = true;
    }

    /**
     * @dev dev can transfer funds from few strategy's to one strategy for better APY
     * @param _strategies - array of strategy's, from which funds are withdrawn
     * @param _withdrawalsPercents - A percentage of the funds that should be transferred
     * @param _receiverStrategy - number strategy, to which funds are deposited
     * @param _minAmounts - minimum amount of tokens that should be received from each strategy
     */
    function moveFundsBatch(
        uint256[] memory _strategies,
        uint256[] memory _withdrawalsPercents,
        uint256 _receiverStrategy,
        uint256[POOL_ASSETS][] memory _minAmounts
    ) external onlyRole(EMERGENCY_ADMIN_ROLE) {
        if (_strategies.length != _withdrawalsPercents.length) revert IncorrectArguments();
        if (_receiverStrategy >= _strategyInfo.length) revert WrongReceiver();

        _checkStrategyExisted(_receiverStrategy);
        _checkStrategyEnabled(_receiverStrategy);

        uint256 sid;
        uint256 zunamiStables;
        for (uint256 i = 0; i < _strategies.length; i++) {
            sid = _strategies[i];
            zunamiStables += _moveFunds(sid, _withdrawalsPercents[i], _minAmounts[i]);
        }
        _strategyInfo[_receiverStrategy].minted += zunamiStables;

        uint256[POOL_ASSETS] memory tokensRemainder;
        for (uint256 i = 0; i < POOL_ASSETS; i++) {
            IERC20 token_ = _tokens[i];
            if (address(token_) == address(0)) break;
            tokensRemainder[i] = token_.balanceOf(address(this));
            if (tokensRemainder[i] > 0) {
                token_.safeTransfer(
                    address(_strategyInfo[_receiverStrategy].strategy),
                    tokensRemainder[i]
                );
            }
        }

        if (_strategyInfo[_receiverStrategy].strategy.deposit(tokensRemainder) == 0)
            revert WrongDeposit(_receiverStrategy, tokensRemainder);
    }

    function _moveFunds(
        uint256 sid,
        uint256 withdrawPercent,
        uint256[POOL_ASSETS] memory minAmounts
    ) private returns (uint256 stableAmount) {
        if (withdrawPercent == 0 || withdrawPercent > FUNDS_DENOMINATOR)
            revert WrongWithdrawPercent();

        if (withdrawPercent == FUNDS_DENOMINATOR) {
            stableAmount = _strategyInfo[sid].minted;
            _strategyInfo[sid].minted = 0;
            _strategyInfo[sid].strategy.withdrawAll(minAmounts);
        } else {
            stableAmount = (_strategyInfo[sid].minted * withdrawPercent) / FUNDS_DENOMINATOR;
            _strategyInfo[sid].minted -= stableAmount;

            if (!_strategyInfo[sid].strategy.withdraw(address(this), withdrawPercent, minAmounts))
                revert WrongWithdrawParams(sid);
        }

        return stableAmount;
    }

    function enableStrategy(uint256 _sid) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_sid >= _strategyInfo.length) revert IncorrectSid();

        _strategyInfo[_sid].enabled = true;

        emit EnabledStrategy(address(_strategyInfo[_sid].strategy));
    }

    function disableStrategy(uint256 _sid) external onlyRole(EMERGENCY_ADMIN_ROLE) {
        if (_sid >= _strategyInfo.length) revert IncorrectSid();

        _strategyInfo[_sid].enabled = false;

        emit DisableStrategy(address(_strategyInfo[_sid].strategy));
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"}],"name":"AbsentStrategy","type":"error"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"}],"name":"DisabledStrategy","type":"error"},{"inputs":[],"name":"DuplicatedStrategy","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"IncorrectArguments","type":"error"},{"inputs":[],"name":"IncorrectSid","type":"error"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"}],"name":"NotStartedStrategy","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"WrongAmount","type":"error"},{"inputs":[],"name":"WrongDecimalMultipliers","type":"error"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"},{"internalType":"uint256[5]","name":"amounts","type":"uint256[5]"}],"name":"WrongDeposit","type":"error"},{"inputs":[],"name":"WrongRatio","type":"error"},{"inputs":[],"name":"WrongReceiver","type":"error"},{"inputs":[],"name":"WrongTokens","type":"error"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"}],"name":"WrongWithdrawParams","type":"error"},{"inputs":[],"name":"WrongWithdrawPercent","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"sid","type":"uint256"},{"indexed":true,"internalType":"address","name":"strategyAddr","type":"address"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"AddedStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimedExtraGains","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"contract IERC20[]","name":"rewardTokens","type":"address[]"}],"name":"ClaimedRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":false,"internalType":"uint256","name":"deposited","type":"uint256"},{"indexed":false,"internalType":"uint256[5]","name":"amounts","type":"uint256[5]"},{"indexed":true,"internalType":"uint256","name":"sid","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"DisableStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pool","type":"address"}],"name":"EnabledStrategy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256[5]","name":"amounts","type":"uint256[5]"},{"indexed":false,"internalType":"uint256","name":"withdrawn","type":"uint256"}],"name":"FailedWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tid","type":"uint256"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenDecimalMultiplier","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenOld","type":"address"}],"name":"UpdatedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":false,"internalType":"uint256","name":"withdrawn","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"sid","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"CONTROLLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EMERGENCY_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FUNDS_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_LIQUIDITY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_LIQUIDITY_LOCKER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_LOCK_TIME","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL_ASSETS","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RATIO_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZUNAMI_FRXETH_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZUNAMI_WETH_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_strategyAddr","type":"address"}],"name":"addStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"contract IERC20[]","name":"rewardTokens","type":"address[]"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"},{"internalType":"uint256[5]","name":"amounts","type":"uint256[5]"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"},{"internalType":"uint256[5]","name":"amounts","type":"uint256[5]"}],"name":"depositStrategy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sid","type":"uint256"}],"name":"disableStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sid","type":"uint256"}],"name":"enableStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"extraGains","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"extraGainsMintedBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"launch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"launched","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"mintAndClaimExtraGains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_strategies","type":"uint256[]"},{"internalType":"uint256[]","name":"_withdrawalsPercents","type":"uint256[]"},{"internalType":"uint256","name":"_receiverStrategy","type":"uint256"},{"internalType":"uint256[5][]","name":"_minAmounts","type":"uint256[5][]"}],"name":"moveFundsBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[5]","name":"tokens_","type":"address[5]"},{"internalType":"uint256[5]","name":"tokenDecimalMultipliers_","type":"uint256[5]"}],"name":"setTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"strategyCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"}],"name":"strategyInfo","outputs":[{"components":[{"internalType":"contract IStrategy","name":"strategy","type":"address"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"minted","type":"uint256"},{"internalType":"bool","name":"enabled","type":"bool"}],"internalType":"struct IPool.StrategyInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tid","type":"uint256"}],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenDecimalsMultipliers","outputs":[{"internalType":"uint256[5]","name":"","type":"uint256[5]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokens","outputs":[{"internalType":"contract IERC20[5]","name":"","type":"address[5]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalHoldings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"sid","type":"uint256"},{"internalType":"uint256","name":"stableAmount","type":"uint256"},{"internalType":"uint256[5]","name":"tokenAmounts","type":"uint256[5]"},{"internalType":"address","name":"receiver","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040518060400160405280600a8152602001690b4eadcc2dad2408aa8960b31b815250604051806040016040528060068152602001650f4eadc8aa8960d31b8152508181816003908162000067919062000524565b50600462000076828262000524565b50506005805460ff19169055506200009060003362000123565b50620000bd7f5358bcfd81d1ef3da152b1755e1c3c6739686fa7e83dbcad0071568cc4b73a633362000123565b505050620000ca6200045f565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28152735e8422345238f34275888049021821e8e08caa1f6020820152620001056200045f565b600180825260208201526200011b8282620001d6565b505062000606565b60008281526006602090815260408083206001600160a01b038516845290915281205460ff16620001cc5760008381526006602090815260408083206001600160a01b03861684529091529020805460ff19166001179055620001833390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001620001d0565b5060005b92915050565b6000805b600581101562000459578180156200021557506000848260058110620002045762000204620005f0565b60200201516001600160a01b031614155b156200023457604051631d37a6fd60e11b815260040160405180910390fd5b60008482600581106200024b576200024b620005f0565b60200201516001600160a01b0316036200026457600191505b60008482600581106200027b576200027b620005f0565b60200201516001600160a01b031614158015620002af5750828160058110620002a857620002a8620005f0565b6020020151155b806200030157506000848260058110620002cd57620002cd620005f0565b60200201516001600160a01b0316148015620003015750828160058110620002f957620002f9620005f0565b602002015115155b15620003205760405163bfa45dc560e01b815260040160405180910390fd5b600060088260058110620003385762000338620005f0565b01546001600160a01b031690508482600581106200035a576200035a620005f0565b602002015160088360058110620003755762000375620005f0565b0180546001600160a01b0319166001600160a01b0392909216919091179055838260058110620003a957620003a9620005f0565b6020020151600d8360058110620003c457620003c4620005f0565b0155848260058110620003db57620003db620005f0565b60200201516001600160a01b0316827ff747b83f770806e3d1cf3aa94c1cbd9bebc565cd5a9fc5ec4668d7304321a86e868560058110620004205762000420620005f0565b602002015184604051620004479291909182526001600160a01b0316602082015260400190565b60405180910390a350600101620001da565b50505050565b6040518060a001604052806005906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620004a857607f821691505b602082108103620004c957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200051f576000816000526020600020601f850160051c81016020861015620004fa5750805b601f850160051c820191505b818110156200051b5782815560010162000506565b5050505b505050565b81516001600160401b038111156200054057620005406200047d565b620005588162000551845462000493565b84620004cf565b602080601f831160018114620005905760008415620005775750858301515b600019600386901b1c1916600185901b1785556200051b565b600085815260208120601f198616915b82811015620005c157888601518255948401946001909101908401620005a0565b5085821015620005e05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b612f8080620006166000396000f3fe608060405234801561001057600080fd5b50600436106102bb5760003560e01c80636e76fc8f11610182578063a5e9dee4116100e9578063bb91c339116100a2578063d5f651a41161007c578063d5f651a414610568578063dd62ed3e14610609578063e9ec2e9914610642578063f46a30201461064a57600080fd5b8063bb91c3391461059c578063bec5b698146105ed578063d547741f146105f657600080fd5b8063a5e9dee414610542578063a9059cbb14610555578063ad5e347214610568578063b549be3c14610577578063b6e432a91461058a578063ba9a7a561461059357600080fd5b80638456cb591161013b5780638456cb59146104f757806391d14854146104ff57806395d89b41146105125780639d63848a1461051a5780639d9a779c1461052f578063a217fddf146104ef57600080fd5b80636e76fc8f1461048957806370a082311461049e57806375451b4f146104c75780637aedb990146104cf5780638091f3bf146104e257806382f8aaca146104ef57600080fd5b8063223e547911610226578063391f8b96116101df578063391f8b961461043d5780633f4ba83a146104505780633ff03207146104585780635920192a146104625780635c975abb1461046b5780636766ea0f1461047657600080fd5b8063223e5479146103b957806323b872dd146103cc578063248a9ca3146103df5780632f2ff15d14610402578063313ce5671461041557806336568abe1461042a57600080fd5b80630ab5f869116102785780630ab5f869146103685780630d4b88071461037b57806318160ddd1461038e5780631a9753a8146103965780632026ffa31461039e57806322068b44146103b157600080fd5b806301339c21146102c057806301ffc9a7146102ca578063044215c6146102f257806306fdde031461031d578063092c5b3b14610332578063095ea7b314610355575b600080fd5b6102c861065f565b005b6102dd6102d836600461270d565b61067a565b60405190151581526020015b60405180910390f35b610305610300366004612737565b6106b1565b6040516001600160a01b0390911681526020016102e9565b6103256106d7565b6040516102e99190612774565b610347600080516020612f0b83398151915281565b6040519081526020016102e9565b6102dd6103633660046127bc565b610769565b6103476103763660046128a8565b610781565b6102c8610389366004612968565b6107c9565b600254610347565b610347600181565b6102c86103ac366004612a5f565b610af8565b600754610347565b6102c86103c7366004612b0e565b610c5e565b6102dd6103da366004612b2b565b610e60565b6103476103ed366004612737565b60009081526006602052604090206001015490565b6102c8610410366004612b6c565b610e86565b60125b60405160ff90911681526020016102e9565b6102c8610438366004612b6c565b610eb1565b6102c861044b366004612b9c565b610ee9565b6102c8610efe565b6103476201518081565b61030561dead81565b60055460ff166102dd565b610347610484366004612c16565b610f14565b610347600080516020612f2b83398151915281565b6103476104ac366004612b0e565b6001600160a01b031660009081526020819052604090205490565b610418600581565b6102c86104dd366004612737565b610f8f565b6014546102dd9060ff1681565b610347600081565b6102c861105f565b6102dd61050d366004612b6c565b61107f565b6103256110aa565b6105226110b9565b6040516102e99190612c57565b6102c861053d366004612737565b6110fe565b6102c8610550366004612b0e565b6111c1565b6102dd6105633660046127bc565b6111ee565b610347670de0b6b3a764000081565b6102c8610585366004612c91565b6111fc565b61034760135481565b6103476103e881565b6105af6105aa366004612737565b61139c565b6040516102e9919081516001600160a01b03168152602080830151908201526040808301519082015260609182015115159181019190915260800190565b61034760125481565b6102c8610604366004612b6c565b611428565b610347610617366004612cdb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61034761144d565b610652611556565b6040516102e99190612d2c565b600061066a81611591565b506014805460ff19166001179055565b60006001600160e01b03198216637965db0b60e01b14806106ab57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000600882600581106106c6576106c6612d3a565b01546001600160a01b031692915050565b6060600380546106e690612d50565b80601f016020809104026020016040519081016040528092919081815260200182805461071290612d50565b801561075f5780601f106107345761010080835404028352916020019161075f565b820191906000526020600020905b81548152906001019060200180831161074257829003601f168201915b5050505050905090565b60003361077781858561159b565b5060019392505050565b600061078b6115a8565b600080516020612f0b8339815191526107a381611591565b6107ac846115ce565b6107b5846115f3565b6107bf848461163b565b91505b5092915050565b600080516020612f2b8339815191526107e181611591565b83518551146108035760405163f9e0bc9b60e01b815260040160405180910390fd5b600754831061082557604051631964c57360e11b815260040160405180910390fd5b61082e836115ce565b6108378361177c565b60008060005b87518110156108b35787818151811061085857610858612d3a565b6020026020010151925061089f8388838151811061087857610878612d3a565b602002602001015187848151811061089257610892612d3a565b60200260200101516117c6565b6108a99083612da0565b915060010161083d565b5080600786815481106108c8576108c8612d3a565b906000526020600020906004020160020160008282546108e89190612da0565b909155506108f690506126ef565b60005b6005811015610a2e5760006008826005811061091757610917612d3a565b01546001600160a01b031690508061092f5750610a2e565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015610973573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109979190612db3565b8383600581106109a9576109a9612d3a565b602002015260008383600581106109c2576109c2612d3a565b60200201511115610a2557610a25600789815481106109e3576109e3612d3a565b60009182526020909120600490910201546001600160a01b0316848460058110610a0f57610a0f612d3a565b60200201516001600160a01b0384169190611a15565b506001016108f9565b5060078681548110610a4257610a42612d3a565b600091825260209091206004918202015460405163b67d611d60e01b81526001600160a01b039091169163b67d611d91610a7e91859101612d2c565b6020604051808303816000875af1158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190612db3565b600003610aee5785816040516331ea9deb60e11b8152600401610ae5929190612dcc565b60405180910390fd5b5050505050505050565b600080516020612f0b833981519152610b1081611591565b610b18611a67565b610b2183611b9b565b60005b600754811015610c1757600060078281548110610b4357610b43612d3a565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff1615156060820152915015801590610ba5575080606001515b15610c0e578051604051632026ffa360e01b81526001600160a01b0390911690632026ffa390610bdb9088908890600401612e25565b600060405180830381600087803b158015610bf557600080fd5b505af1158015610c09573d6000803e3d6000fd5b505050505b50600101610b24565b50826001600160a01b03167fc40901f1d03c33b46234c92521befa858a2264a718b553a3d1d2fd284ad4424083604051610c519190612e49565b60405180910390a2505050565b6000610c6981611591565b6001600160a01b038216610c905760405163d92e233d60e01b815260040160405180910390fd5b60005b600754811015610cf55760078181548110610cb057610cb0612d3a565b60009182526020909120600490910201546001600160a01b0390811690841603610ced576040516303ee72d760e51b815260040160405180910390fd5b600101610c93565b5060145460009060ff16610d0a576000610d0f565b620151805b610d199042612da0565b604080516080810182526001600160a01b038681168083526020830185815260009484018581526001606086018181526007805480840182559881905296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600490990298890180546001600160a01b031916919097161790955591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689870155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a86015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b909401805460ff19169415159490941790935590549293509091610e279190612e5c565b6040518381527f3a64755f61c73ed1f60bd0a9660e9cb66aa01817ea10d5b44d216a3ff95cca0e906020015b60405180910390a3505050565b600033610e6e858285611c6a565b610e79858585611ce2565b60019150505b9392505050565b600082815260066020526040902060010154610ea181611591565b610eab8383611d41565b50505050565b6001600160a01b0381163314610eda5760405163334bd91960e11b815260040160405180910390fd5b610ee48282611dd5565b505050565b6000610ef481611591565b610ee48383611e42565b6000610f0981611591565b610f11612094565b50565b6000610f1e6115a8565b600080516020612f0b833981519152610f3681611591565b610f3f856115ce565b610f48856115f3565b610f518561177c565b6001600160a01b038316610f63573392505b610f6b611a67565b6000610f77868661163b565b9050610f85848287896120e6565b9695505050505050565b600080516020612f2b833981519152610fa781611591565b6007548210610fc95760405163a458994160e01b815260040160405180910390fd5b600060078381548110610fde57610fde612d3a565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061101957611019612d3a565b600091825260208220600490910201546040516001600160a01b03909116917f8b35b417b16faa66c73c967944e5e1e2a14e1b75b0c047b18ac49c8e5f84799a91a25050565b600080516020612f2b83398151915261107781611591565b610f116121ce565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600480546106e690612d50565b6110c16126ef565b6040805160a08101918290529060089060059082845b81546001600160a01b031681526001909101906020018083116110d7575050505050905090565b600061110981611591565b600754821061112b5760405163a458994160e01b815260040160405180910390fd5b60016007838154811061114057611140612d3a565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061117b5761117b612d3a565b600091825260208220600490910201546040516001600160a01b03909116917f532492ef4d4edd78444556c1b5038901e11c232361675fe6d5e6bea2f0864e1991a25050565b600080516020612f0b8339815191526111d981611591565b6111e1611a67565b6111ea82611b9b565b5050565b600033610777818585611ce2565b6112046115a8565b600080516020612f0b83398151915261121c81611591565b611225856115ce565b61122e856115f3565b6112378561177c565b60006007868154811061124c5761124c612d3a565b600091825260208220600490910201546001600160a01b0316915061126e3390565b905085611290826001600160a01b031660009081526020819052604090205490565b10156112af576040516349986e7360e01b815260040160405180910390fd5b6112b7611a67565b6001600160a01b0380831690636d9164c6908616156112d657856112d8565b825b6113068960078c815481106112ef576112ef612d3a565b90600052602060002090600402016002015461220b565b886040518463ffffffff1660e01b815260040161132593929190612e6f565b6020604051808303816000875af1158015611344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113689190612e93565b6113885760405163ee9684e760e01b815260048101889052602401610ae5565b61139381878961225e565b50505050505050565b604080516080810182526000808252602082018190529181018290526060810191909152600782815481106113d3576113d3612d3a565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018101549383019390935260028301549082015260039091015460ff161515606082015292915050565b60008281526006602052604090206001015461144381611591565b610eab8383611dd5565b60075460009081805b828110156107c25760006007828154811061147357611473612d3a565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff16151560608201529150158015906114d5575080606001515b1561154d5780600001516001600160a01b031663e9ec2e996040518163ffffffff1660e01b8152600401602060405180830381865afa15801561151c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115409190612db3565b61154a9084612da0565b92505b50600101611456565b61155e6126ef565b6040805160a081019182905290600d9060059082845b815481526020019060010190808311611574575050505050905090565b610f1181336122de565b610ee48383836001612317565b60055460ff16156115cc5760405163d93c066560e01b815260040160405180910390fd5b565b6007548110610f11576040516306796a2560e21b815260048101829052602401610ae5565b6007818154811061160657611606612d3a565b906000526020600020906004020160010154421015610f1157604051631744fd1760e21b815260048101829052602401610ae5565b6000806007848154811061165157611651612d3a565b600091825260208220600490910201546001600160a01b031691505b60058110156116dd57600084826005811061168a5761168a612d3a565b602002015111156116d5576116d5828583600581106116ab576116ab612d3a565b6020020151600884600581106116c3576116c3612d3a565b01546001600160a01b03169190611a15565b60010161166d565b506116e6611a67565b60405163b67d611d60e01b81526001600160a01b0382169063b67d611d90611712908690600401612d2c565b6020604051808303816000875af1158015611731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117559190612db3565b9150816000036107c25783836040516331ea9deb60e11b8152600401610ae5929190612dcc565b6007818154811061178f5761178f612d3a565b600091825260209091206003600490920201015460ff16610f115760405163277d558560e21b815260048101829052602401610ae5565b60008215806117dc5750670de0b6b3a764000083115b156117fa576040516397a41b9760e01b815260040160405180910390fd5b670de0b6b3a764000083036118e0576007848154811061181c5761181c612d3a565b906000526020600020906004020160020154905060006007858154811061184557611845612d3a565b9060005260206000209060040201600201819055506007848154811061186d5761186d612d3a565b6000918252602090912060049182020154604051632069ee2560e21b81526001600160a01b03909116916381a7b894916118a991869101612d2c565b600060405180830381600087803b1580156118c357600080fd5b505af11580156118d7573d6000803e3d6000fd5b50505050610e7f565b670de0b6b3a764000083600786815481106118fd576118fd612d3a565b9060005260206000209060040201600201546119199190612eb5565b6119239190612ecc565b9050806007858154811061193957611939612d3a565b906000526020600020906004020160020160008282546119599190612e5c565b9091555050600780548590811061197257611972612d3a565b60009182526020909120600491820201546040516336c8b26360e11b81526001600160a01b0390911691636d9164c6916119b29130918891889101612e6f565b6020604051808303816000875af11580156119d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f59190612e93565b610e7f5760405163ee9684e760e01b815260048101859052602401610ae5565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ee49084906123ec565b4360135403611a7257565b60008060005b600754811015611b6957600060078281548110611a9757611a97612d3a565b9060005260206000209060040201905060008160020154118015611abf5750600381015460ff165b15611b5f5780546040805163e9ec2e9960e01b815290516000926001600160a01b03169163e9ec2e999160048083019260209291908290030181865afa158015611b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b319190612db3565b6002830154909150808211611b4857505050611b61565b600283018054919092039081019091559384019392505b505b600101611a78565b5081600003611b76575050565b8160126000828254611b889190612da0565b9091555050436013556111ea308361244f565b601254600003611ba85750565b60128054600090915560405163a9059cbb60e01b81526001600160a01b038316600482015260248101829052309063a9059cbb906044016020604051808303816000875af1158015611bfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c229190612e93565b50816001600160a01b03167f679522ada03e2aff72b5376caa48a92d6cf1520bc5816e47488103cf974a3e2e82604051611c5e91815260200190565b60405180910390a25050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eab5781811015611cd357604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610ae5565b610eab84848484036000612317565b6001600160a01b038316611d0c57604051634b637e8f60e11b815260006004820152602401610ae5565b6001600160a01b038216611d365760405163ec442f0560e01b815260006004820152602401610ae5565b610ee4838383612481565b6000611d4d838361107f565b611dcd5760008381526006602090815260408083206001600160a01b03861684529091529020805460ff19166001179055611d853390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016106ab565b5060006106ab565b6000611de1838361107f565b15611dcd5760008381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016106ab565b6000805b6005811015610eab57818015611e7c57506000848260058110611e6b57611e6b612d3a565b60200201516001600160a01b031614155b15611e9a57604051631d37a6fd60e11b815260040160405180910390fd5b6000848260058110611eae57611eae612d3a565b60200201516001600160a01b031603611ec657600191505b6000848260058110611eda57611eda612d3a565b60200201516001600160a01b031614158015611f0a5750828160058110611f0357611f03612d3a565b6020020151155b80611f5457506000848260058110611f2457611f24612d3a565b60200201516001600160a01b0316148015611f545750828160058110611f4c57611f4c612d3a565b602002015115155b15611f725760405163bfa45dc560e01b815260040160405180910390fd5b600060088260058110611f8757611f87612d3a565b01546001600160a01b03169050848260058110611fa657611fa6612d3a565b602002015160088360058110611fbe57611fbe612d3a565b0180546001600160a01b0319166001600160a01b0392909216919091179055838260058110611fef57611fef612d3a565b6020020151600d836005811061200757612007612d3a565b015584826005811061201b5761201b612d3a565b60200201516001600160a01b0316827ff747b83f770806e3d1cf3aa94c1cbd9bebc565cd5a9fc5ec4668d7304321a86e86856005811061205d5761205d612d3a565b6020020151846040516120839291909182526001600160a01b0316602082015260400190565b60405180910390a350600101611e46565b61209c61259e565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000806120f260025490565b60000361212b576103e8851161211b576040516349986e7360e01b815260040160405180910390fd5b506103e861212b61dead8261244f565b60006121378287612e5c565b9050612143878261244f565b856007858154811061215757612157612d3a565b906000526020600020906004020160020160008282546121779190612da0565b9250508190555083876001600160a01b03167fa17ff9bbea81293417e3fe6571f199f77815934a9ca09121a83a4603cd83f3b788886040516121ba929190612dcc565b60405180910390a39150505b949350505050565b6121d66115a8565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120c93390565b600081612220670de0b6b3a764000085612eb5565b61222a9190612ecc565b90508015806122405750670de0b6b3a764000081115b156106ab57604051634aa3778b60e01b815260040160405180910390fd5b61226883836125c1565b816007828154811061227c5761227c612d3a565b9060005260206000209060040201600201600082825461229c9190612e5c565b909155505060405182815281906001600160a01b038516907f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc690602001610e53565b6122e8828261107f565b6111ea5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610ae5565b6001600160a01b0384166123415760405163e602df0560e01b815260006004820152602401610ae5565b6001600160a01b03831661236b57604051634a1406b160e11b815260006004820152602401610ae5565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eab57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516123de91815260200190565b60405180910390a350505050565b60006124016001600160a01b038416836125f7565b905080516000141580156124265750808060200190518101906124249190612e93565b155b15610ee457604051635274afe760e01b81526001600160a01b0384166004820152602401610ae5565b6001600160a01b0382166124795760405163ec442f0560e01b815260006004820152602401610ae5565b6111ea600083835b6001600160a01b0383166124ac5780600260008282546124a19190612da0565b9091555061251e9050565b6001600160a01b038316600090815260208190526040902054818110156124ff5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610ae5565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661253a57600280548290039055612559565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e5391815260200190565b60055460ff166115cc57604051638dfc202b60e01b815260040160405180910390fd5b6001600160a01b0382166125eb57604051634b637e8f60e11b815260006004820152602401610ae5565b6111ea82600083612481565b6060610e7f8383600084600080856001600160a01b0316848660405161261d9190612eee565b60006040518083038185875af1925050503d806000811461265a576040519150601f19603f3d011682016040523d82523d6000602084013e61265f565b606091505b5091509150610f8586838360608261267f5761267a826126c6565b610e7f565b815115801561269657506001600160a01b0384163b155b156126bf57604051639996b31560e01b81526001600160a01b0385166004820152602401610ae5565b5080610e7f565b8051156126d65780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b60006020828403121561271f57600080fd5b81356001600160e01b031981168114610e7f57600080fd5b60006020828403121561274957600080fd5b5035919050565b60005b8381101561276b578181015183820152602001612753565b50506000910152565b6020815260008251806020840152612793816040850160208701612750565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f1157600080fd5b600080604083850312156127cf57600080fd5b82356127da816127a7565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff81118282101715612821576128216127e8565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715612850576128506127e8565b604052919050565b600082601f83011261286957600080fd5b6128716127fe565b8060a084018581111561288357600080fd5b845b8181101561289d578035845260209384019301612885565b509095945050505050565b60008060c083850312156128bb57600080fd5b823591506128cc8460208501612858565b90509250929050565b600067ffffffffffffffff8211156128ef576128ef6127e8565b5060051b60200190565b600082601f83011261290a57600080fd5b8135602061291f61291a836128d5565b612827565b8083825260208201915060208460051b87010193508684111561294157600080fd5b602086015b8481101561295d5780358352918301918301612946565b509695505050505050565b6000806000806080858703121561297e57600080fd5b843567ffffffffffffffff8082111561299657600080fd5b6129a2888389016128f9565b9550602091506020870135818111156129ba57600080fd5b6129c689828a016128f9565b955050604087013593506060870135818111156129e257600080fd5b87019050601f810188136129f557600080fd5b8035612a0361291a826128d5565b8082825260208201915060a0602060a0850286010193508b841115612a2757600080fd5b6020850194505b83851015612a4f57612a408c86612858565b83529384019391850191612a2e565b50979a9699509497505050505050565b60008060408385031215612a7257600080fd5b8235612a7d816127a7565b915060208381013567ffffffffffffffff811115612a9a57600080fd5b8401601f81018613612aab57600080fd5b8035612ab961291a826128d5565b81815260059190911b82018301908381019088831115612ad857600080fd5b928401925b82841015612aff578335612af0816127a7565b82529284019290840190612add565b80955050505050509250929050565b600060208284031215612b2057600080fd5b8135610e7f816127a7565b600080600060608486031215612b4057600080fd5b8335612b4b816127a7565b92506020840135612b5b816127a7565b929592945050506040919091013590565b60008060408385031215612b7f57600080fd5b823591506020830135612b91816127a7565b809150509250929050565b6000806101408385031215612bb057600080fd5b83601f840112612bbf57600080fd5b612bc76127fe565b8060a0850186811115612bd957600080fd5b855b81811015612bfc578035612bee816127a7565b845260209384019301612bdb565b50819450612c0a8782612858565b93505050509250929050565b600080600060e08486031215612c2b57600080fd5b83359250612c3c8560208601612858565b915060c0840135612c4c816127a7565b809150509250925092565b60a08101818360005b6005811015612c885781516001600160a01b0316835260209283019290910190600101612c60565b50505092915050565b6000806000806101008587031215612ca857600080fd5b8435935060208501359250612cc08660408701612858565b915060e0850135612cd0816127a7565b939692955090935050565b60008060408385031215612cee57600080fd5b8235612cf9816127a7565b91506020830135612b91816127a7565b8060005b6005811015610eab578151845260209384019390910190600101612d0d565b60a081016106ab8284612d09565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680612d6457607f821691505b602082108103612d8457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106ab576106ab612d8a565b600060208284031215612dc557600080fd5b5051919050565b82815260c08101610e7f6020830184612d09565b60008151808452602080850194506020840160005b83811015612e1a5781516001600160a01b031687529582019590820190600101612df5565b509495945050505050565b6001600160a01b03831681526040602082018190526000906121c690830184612de0565b602081526000610e7f6020830184612de0565b818103818111156106ab576106ab612d8a565b6001600160a01b03841681526020810183905260e081016121c66040830184612d09565b600060208284031215612ea557600080fd5b81518015158114610e7f57600080fd5b80820281158282048414176106ab576106ab612d8a565b600082612ee957634e487b7160e01b600052601260045260246000fd5b500490565b60008251612f00818460208701612750565b919091019291505056fe7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c5702233575358bcfd81d1ef3da152b1755e1c3c6739686fa7e83dbcad0071568cc4b73a63a2646970667358221220ff79a578aa510f2888487b6038a4421fa1bc03a7f956dada784c39633712842164736f6c63430008170033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102bb5760003560e01c80636e76fc8f11610182578063a5e9dee4116100e9578063bb91c339116100a2578063d5f651a41161007c578063d5f651a414610568578063dd62ed3e14610609578063e9ec2e9914610642578063f46a30201461064a57600080fd5b8063bb91c3391461059c578063bec5b698146105ed578063d547741f146105f657600080fd5b8063a5e9dee414610542578063a9059cbb14610555578063ad5e347214610568578063b549be3c14610577578063b6e432a91461058a578063ba9a7a561461059357600080fd5b80638456cb591161013b5780638456cb59146104f757806391d14854146104ff57806395d89b41146105125780639d63848a1461051a5780639d9a779c1461052f578063a217fddf146104ef57600080fd5b80636e76fc8f1461048957806370a082311461049e57806375451b4f146104c75780637aedb990146104cf5780638091f3bf146104e257806382f8aaca146104ef57600080fd5b8063223e547911610226578063391f8b96116101df578063391f8b961461043d5780633f4ba83a146104505780633ff03207146104585780635920192a146104625780635c975abb1461046b5780636766ea0f1461047657600080fd5b8063223e5479146103b957806323b872dd146103cc578063248a9ca3146103df5780632f2ff15d14610402578063313ce5671461041557806336568abe1461042a57600080fd5b80630ab5f869116102785780630ab5f869146103685780630d4b88071461037b57806318160ddd1461038e5780631a9753a8146103965780632026ffa31461039e57806322068b44146103b157600080fd5b806301339c21146102c057806301ffc9a7146102ca578063044215c6146102f257806306fdde031461031d578063092c5b3b14610332578063095ea7b314610355575b600080fd5b6102c861065f565b005b6102dd6102d836600461270d565b61067a565b60405190151581526020015b60405180910390f35b610305610300366004612737565b6106b1565b6040516001600160a01b0390911681526020016102e9565b6103256106d7565b6040516102e99190612774565b610347600080516020612f0b83398151915281565b6040519081526020016102e9565b6102dd6103633660046127bc565b610769565b6103476103763660046128a8565b610781565b6102c8610389366004612968565b6107c9565b600254610347565b610347600181565b6102c86103ac366004612a5f565b610af8565b600754610347565b6102c86103c7366004612b0e565b610c5e565b6102dd6103da366004612b2b565b610e60565b6103476103ed366004612737565b60009081526006602052604090206001015490565b6102c8610410366004612b6c565b610e86565b60125b60405160ff90911681526020016102e9565b6102c8610438366004612b6c565b610eb1565b6102c861044b366004612b9c565b610ee9565b6102c8610efe565b6103476201518081565b61030561dead81565b60055460ff166102dd565b610347610484366004612c16565b610f14565b610347600080516020612f2b83398151915281565b6103476104ac366004612b0e565b6001600160a01b031660009081526020819052604090205490565b610418600581565b6102c86104dd366004612737565b610f8f565b6014546102dd9060ff1681565b610347600081565b6102c861105f565b6102dd61050d366004612b6c565b61107f565b6103256110aa565b6105226110b9565b6040516102e99190612c57565b6102c861053d366004612737565b6110fe565b6102c8610550366004612b0e565b6111c1565b6102dd6105633660046127bc565b6111ee565b610347670de0b6b3a764000081565b6102c8610585366004612c91565b6111fc565b61034760135481565b6103476103e881565b6105af6105aa366004612737565b61139c565b6040516102e9919081516001600160a01b03168152602080830151908201526040808301519082015260609182015115159181019190915260800190565b61034760125481565b6102c8610604366004612b6c565b611428565b610347610617366004612cdb565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61034761144d565b610652611556565b6040516102e99190612d2c565b600061066a81611591565b506014805460ff19166001179055565b60006001600160e01b03198216637965db0b60e01b14806106ab57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000600882600581106106c6576106c6612d3a565b01546001600160a01b031692915050565b6060600380546106e690612d50565b80601f016020809104026020016040519081016040528092919081815260200182805461071290612d50565b801561075f5780601f106107345761010080835404028352916020019161075f565b820191906000526020600020905b81548152906001019060200180831161074257829003601f168201915b5050505050905090565b60003361077781858561159b565b5060019392505050565b600061078b6115a8565b600080516020612f0b8339815191526107a381611591565b6107ac846115ce565b6107b5846115f3565b6107bf848461163b565b91505b5092915050565b600080516020612f2b8339815191526107e181611591565b83518551146108035760405163f9e0bc9b60e01b815260040160405180910390fd5b600754831061082557604051631964c57360e11b815260040160405180910390fd5b61082e836115ce565b6108378361177c565b60008060005b87518110156108b35787818151811061085857610858612d3a565b6020026020010151925061089f8388838151811061087857610878612d3a565b602002602001015187848151811061089257610892612d3a565b60200260200101516117c6565b6108a99083612da0565b915060010161083d565b5080600786815481106108c8576108c8612d3a565b906000526020600020906004020160020160008282546108e89190612da0565b909155506108f690506126ef565b60005b6005811015610a2e5760006008826005811061091757610917612d3a565b01546001600160a01b031690508061092f5750610a2e565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015610973573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109979190612db3565b8383600581106109a9576109a9612d3a565b602002015260008383600581106109c2576109c2612d3a565b60200201511115610a2557610a25600789815481106109e3576109e3612d3a565b60009182526020909120600490910201546001600160a01b0316848460058110610a0f57610a0f612d3a565b60200201516001600160a01b0384169190611a15565b506001016108f9565b5060078681548110610a4257610a42612d3a565b600091825260209091206004918202015460405163b67d611d60e01b81526001600160a01b039091169163b67d611d91610a7e91859101612d2c565b6020604051808303816000875af1158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac19190612db3565b600003610aee5785816040516331ea9deb60e11b8152600401610ae5929190612dcc565b60405180910390fd5b5050505050505050565b600080516020612f0b833981519152610b1081611591565b610b18611a67565b610b2183611b9b565b60005b600754811015610c1757600060078281548110610b4357610b43612d3a565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff1615156060820152915015801590610ba5575080606001515b15610c0e578051604051632026ffa360e01b81526001600160a01b0390911690632026ffa390610bdb9088908890600401612e25565b600060405180830381600087803b158015610bf557600080fd5b505af1158015610c09573d6000803e3d6000fd5b505050505b50600101610b24565b50826001600160a01b03167fc40901f1d03c33b46234c92521befa858a2264a718b553a3d1d2fd284ad4424083604051610c519190612e49565b60405180910390a2505050565b6000610c6981611591565b6001600160a01b038216610c905760405163d92e233d60e01b815260040160405180910390fd5b60005b600754811015610cf55760078181548110610cb057610cb0612d3a565b60009182526020909120600490910201546001600160a01b0390811690841603610ced576040516303ee72d760e51b815260040160405180910390fd5b600101610c93565b5060145460009060ff16610d0a576000610d0f565b620151805b610d199042612da0565b604080516080810182526001600160a01b038681168083526020830185815260009484018581526001606086018181526007805480840182559881905296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600490990298890180546001600160a01b031916919097161790955591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689870155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a86015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b909401805460ff19169415159490941790935590549293509091610e279190612e5c565b6040518381527f3a64755f61c73ed1f60bd0a9660e9cb66aa01817ea10d5b44d216a3ff95cca0e906020015b60405180910390a3505050565b600033610e6e858285611c6a565b610e79858585611ce2565b60019150505b9392505050565b600082815260066020526040902060010154610ea181611591565b610eab8383611d41565b50505050565b6001600160a01b0381163314610eda5760405163334bd91960e11b815260040160405180910390fd5b610ee48282611dd5565b505050565b6000610ef481611591565b610ee48383611e42565b6000610f0981611591565b610f11612094565b50565b6000610f1e6115a8565b600080516020612f0b833981519152610f3681611591565b610f3f856115ce565b610f48856115f3565b610f518561177c565b6001600160a01b038316610f63573392505b610f6b611a67565b6000610f77868661163b565b9050610f85848287896120e6565b9695505050505050565b600080516020612f2b833981519152610fa781611591565b6007548210610fc95760405163a458994160e01b815260040160405180910390fd5b600060078381548110610fde57610fde612d3a565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061101957611019612d3a565b600091825260208220600490910201546040516001600160a01b03909116917f8b35b417b16faa66c73c967944e5e1e2a14e1b75b0c047b18ac49c8e5f84799a91a25050565b600080516020612f2b83398151915261107781611591565b610f116121ce565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600480546106e690612d50565b6110c16126ef565b6040805160a08101918290529060089060059082845b81546001600160a01b031681526001909101906020018083116110d7575050505050905090565b600061110981611591565b600754821061112b5760405163a458994160e01b815260040160405180910390fd5b60016007838154811061114057611140612d3a565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061117b5761117b612d3a565b600091825260208220600490910201546040516001600160a01b03909116917f532492ef4d4edd78444556c1b5038901e11c232361675fe6d5e6bea2f0864e1991a25050565b600080516020612f0b8339815191526111d981611591565b6111e1611a67565b6111ea82611b9b565b5050565b600033610777818585611ce2565b6112046115a8565b600080516020612f0b83398151915261121c81611591565b611225856115ce565b61122e856115f3565b6112378561177c565b60006007868154811061124c5761124c612d3a565b600091825260208220600490910201546001600160a01b0316915061126e3390565b905085611290826001600160a01b031660009081526020819052604090205490565b10156112af576040516349986e7360e01b815260040160405180910390fd5b6112b7611a67565b6001600160a01b0380831690636d9164c6908616156112d657856112d8565b825b6113068960078c815481106112ef576112ef612d3a565b90600052602060002090600402016002015461220b565b886040518463ffffffff1660e01b815260040161132593929190612e6f565b6020604051808303816000875af1158015611344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113689190612e93565b6113885760405163ee9684e760e01b815260048101889052602401610ae5565b61139381878961225e565b50505050505050565b604080516080810182526000808252602082018190529181018290526060810191909152600782815481106113d3576113d3612d3a565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018101549383019390935260028301549082015260039091015460ff161515606082015292915050565b60008281526006602052604090206001015461144381611591565b610eab8383611dd5565b60075460009081805b828110156107c25760006007828154811061147357611473612d3a565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff16151560608201529150158015906114d5575080606001515b1561154d5780600001516001600160a01b031663e9ec2e996040518163ffffffff1660e01b8152600401602060405180830381865afa15801561151c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115409190612db3565b61154a9084612da0565b92505b50600101611456565b61155e6126ef565b6040805160a081019182905290600d9060059082845b815481526020019060010190808311611574575050505050905090565b610f1181336122de565b610ee48383836001612317565b60055460ff16156115cc5760405163d93c066560e01b815260040160405180910390fd5b565b6007548110610f11576040516306796a2560e21b815260048101829052602401610ae5565b6007818154811061160657611606612d3a565b906000526020600020906004020160010154421015610f1157604051631744fd1760e21b815260048101829052602401610ae5565b6000806007848154811061165157611651612d3a565b600091825260208220600490910201546001600160a01b031691505b60058110156116dd57600084826005811061168a5761168a612d3a565b602002015111156116d5576116d5828583600581106116ab576116ab612d3a565b6020020151600884600581106116c3576116c3612d3a565b01546001600160a01b03169190611a15565b60010161166d565b506116e6611a67565b60405163b67d611d60e01b81526001600160a01b0382169063b67d611d90611712908690600401612d2c565b6020604051808303816000875af1158015611731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117559190612db3565b9150816000036107c25783836040516331ea9deb60e11b8152600401610ae5929190612dcc565b6007818154811061178f5761178f612d3a565b600091825260209091206003600490920201015460ff16610f115760405163277d558560e21b815260048101829052602401610ae5565b60008215806117dc5750670de0b6b3a764000083115b156117fa576040516397a41b9760e01b815260040160405180910390fd5b670de0b6b3a764000083036118e0576007848154811061181c5761181c612d3a565b906000526020600020906004020160020154905060006007858154811061184557611845612d3a565b9060005260206000209060040201600201819055506007848154811061186d5761186d612d3a565b6000918252602090912060049182020154604051632069ee2560e21b81526001600160a01b03909116916381a7b894916118a991869101612d2c565b600060405180830381600087803b1580156118c357600080fd5b505af11580156118d7573d6000803e3d6000fd5b50505050610e7f565b670de0b6b3a764000083600786815481106118fd576118fd612d3a565b9060005260206000209060040201600201546119199190612eb5565b6119239190612ecc565b9050806007858154811061193957611939612d3a565b906000526020600020906004020160020160008282546119599190612e5c565b9091555050600780548590811061197257611972612d3a565b60009182526020909120600491820201546040516336c8b26360e11b81526001600160a01b0390911691636d9164c6916119b29130918891889101612e6f565b6020604051808303816000875af11580156119d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119f59190612e93565b610e7f5760405163ee9684e760e01b815260048101859052602401610ae5565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ee49084906123ec565b4360135403611a7257565b60008060005b600754811015611b6957600060078281548110611a9757611a97612d3a565b9060005260206000209060040201905060008160020154118015611abf5750600381015460ff165b15611b5f5780546040805163e9ec2e9960e01b815290516000926001600160a01b03169163e9ec2e999160048083019260209291908290030181865afa158015611b0d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b319190612db3565b6002830154909150808211611b4857505050611b61565b600283018054919092039081019091559384019392505b505b600101611a78565b5081600003611b76575050565b8160126000828254611b889190612da0565b9091555050436013556111ea308361244f565b601254600003611ba85750565b60128054600090915560405163a9059cbb60e01b81526001600160a01b038316600482015260248101829052309063a9059cbb906044016020604051808303816000875af1158015611bfe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c229190612e93565b50816001600160a01b03167f679522ada03e2aff72b5376caa48a92d6cf1520bc5816e47488103cf974a3e2e82604051611c5e91815260200190565b60405180910390a25050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610eab5781811015611cd357604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610ae5565b610eab84848484036000612317565b6001600160a01b038316611d0c57604051634b637e8f60e11b815260006004820152602401610ae5565b6001600160a01b038216611d365760405163ec442f0560e01b815260006004820152602401610ae5565b610ee4838383612481565b6000611d4d838361107f565b611dcd5760008381526006602090815260408083206001600160a01b03861684529091529020805460ff19166001179055611d853390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016106ab565b5060006106ab565b6000611de1838361107f565b15611dcd5760008381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016106ab565b6000805b6005811015610eab57818015611e7c57506000848260058110611e6b57611e6b612d3a565b60200201516001600160a01b031614155b15611e9a57604051631d37a6fd60e11b815260040160405180910390fd5b6000848260058110611eae57611eae612d3a565b60200201516001600160a01b031603611ec657600191505b6000848260058110611eda57611eda612d3a565b60200201516001600160a01b031614158015611f0a5750828160058110611f0357611f03612d3a565b6020020151155b80611f5457506000848260058110611f2457611f24612d3a565b60200201516001600160a01b0316148015611f545750828160058110611f4c57611f4c612d3a565b602002015115155b15611f725760405163bfa45dc560e01b815260040160405180910390fd5b600060088260058110611f8757611f87612d3a565b01546001600160a01b03169050848260058110611fa657611fa6612d3a565b602002015160088360058110611fbe57611fbe612d3a565b0180546001600160a01b0319166001600160a01b0392909216919091179055838260058110611fef57611fef612d3a565b6020020151600d836005811061200757612007612d3a565b015584826005811061201b5761201b612d3a565b60200201516001600160a01b0316827ff747b83f770806e3d1cf3aa94c1cbd9bebc565cd5a9fc5ec4668d7304321a86e86856005811061205d5761205d612d3a565b6020020151846040516120839291909182526001600160a01b0316602082015260400190565b60405180910390a350600101611e46565b61209c61259e565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6000806120f260025490565b60000361212b576103e8851161211b576040516349986e7360e01b815260040160405180910390fd5b506103e861212b61dead8261244f565b60006121378287612e5c565b9050612143878261244f565b856007858154811061215757612157612d3a565b906000526020600020906004020160020160008282546121779190612da0565b9250508190555083876001600160a01b03167fa17ff9bbea81293417e3fe6571f199f77815934a9ca09121a83a4603cd83f3b788886040516121ba929190612dcc565b60405180910390a39150505b949350505050565b6121d66115a8565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120c93390565b600081612220670de0b6b3a764000085612eb5565b61222a9190612ecc565b90508015806122405750670de0b6b3a764000081115b156106ab57604051634aa3778b60e01b815260040160405180910390fd5b61226883836125c1565b816007828154811061227c5761227c612d3a565b9060005260206000209060040201600201600082825461229c9190612e5c565b909155505060405182815281906001600160a01b038516907f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc690602001610e53565b6122e8828261107f565b6111ea5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610ae5565b6001600160a01b0384166123415760405163e602df0560e01b815260006004820152602401610ae5565b6001600160a01b03831661236b57604051634a1406b160e11b815260006004820152602401610ae5565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610eab57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516123de91815260200190565b60405180910390a350505050565b60006124016001600160a01b038416836125f7565b905080516000141580156124265750808060200190518101906124249190612e93565b155b15610ee457604051635274afe760e01b81526001600160a01b0384166004820152602401610ae5565b6001600160a01b0382166124795760405163ec442f0560e01b815260006004820152602401610ae5565b6111ea600083835b6001600160a01b0383166124ac5780600260008282546124a19190612da0565b9091555061251e9050565b6001600160a01b038316600090815260208190526040902054818110156124ff5760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610ae5565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661253a57600280548290039055612559565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e5391815260200190565b60055460ff166115cc57604051638dfc202b60e01b815260040160405180910390fd5b6001600160a01b0382166125eb57604051634b637e8f60e11b815260006004820152602401610ae5565b6111ea82600083612481565b6060610e7f8383600084600080856001600160a01b0316848660405161261d9190612eee565b60006040518083038185875af1925050503d806000811461265a576040519150601f19603f3d011682016040523d82523d6000602084013e61265f565b606091505b5091509150610f8586838360608261267f5761267a826126c6565b610e7f565b815115801561269657506001600160a01b0384163b155b156126bf57604051639996b31560e01b81526001600160a01b0385166004820152602401610ae5565b5080610e7f565b8051156126d65780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b60006020828403121561271f57600080fd5b81356001600160e01b031981168114610e7f57600080fd5b60006020828403121561274957600080fd5b5035919050565b60005b8381101561276b578181015183820152602001612753565b50506000910152565b6020815260008251806020840152612793816040850160208701612750565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f1157600080fd5b600080604083850312156127cf57600080fd5b82356127da816127a7565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff81118282101715612821576128216127e8565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715612850576128506127e8565b604052919050565b600082601f83011261286957600080fd5b6128716127fe565b8060a084018581111561288357600080fd5b845b8181101561289d578035845260209384019301612885565b509095945050505050565b60008060c083850312156128bb57600080fd5b823591506128cc8460208501612858565b90509250929050565b600067ffffffffffffffff8211156128ef576128ef6127e8565b5060051b60200190565b600082601f83011261290a57600080fd5b8135602061291f61291a836128d5565b612827565b8083825260208201915060208460051b87010193508684111561294157600080fd5b602086015b8481101561295d5780358352918301918301612946565b509695505050505050565b6000806000806080858703121561297e57600080fd5b843567ffffffffffffffff8082111561299657600080fd5b6129a2888389016128f9565b9550602091506020870135818111156129ba57600080fd5b6129c689828a016128f9565b955050604087013593506060870135818111156129e257600080fd5b87019050601f810188136129f557600080fd5b8035612a0361291a826128d5565b8082825260208201915060a0602060a0850286010193508b841115612a2757600080fd5b6020850194505b83851015612a4f57612a408c86612858565b83529384019391850191612a2e565b50979a9699509497505050505050565b60008060408385031215612a7257600080fd5b8235612a7d816127a7565b915060208381013567ffffffffffffffff811115612a9a57600080fd5b8401601f81018613612aab57600080fd5b8035612ab961291a826128d5565b81815260059190911b82018301908381019088831115612ad857600080fd5b928401925b82841015612aff578335612af0816127a7565b82529284019290840190612add565b80955050505050509250929050565b600060208284031215612b2057600080fd5b8135610e7f816127a7565b600080600060608486031215612b4057600080fd5b8335612b4b816127a7565b92506020840135612b5b816127a7565b929592945050506040919091013590565b60008060408385031215612b7f57600080fd5b823591506020830135612b91816127a7565b809150509250929050565b6000806101408385031215612bb057600080fd5b83601f840112612bbf57600080fd5b612bc76127fe565b8060a0850186811115612bd957600080fd5b855b81811015612bfc578035612bee816127a7565b845260209384019301612bdb565b50819450612c0a8782612858565b93505050509250929050565b600080600060e08486031215612c2b57600080fd5b83359250612c3c8560208601612858565b915060c0840135612c4c816127a7565b809150509250925092565b60a08101818360005b6005811015612c885781516001600160a01b0316835260209283019290910190600101612c60565b50505092915050565b6000806000806101008587031215612ca857600080fd5b8435935060208501359250612cc08660408701612858565b915060e0850135612cd0816127a7565b939692955090935050565b60008060408385031215612cee57600080fd5b8235612cf9816127a7565b91506020830135612b91816127a7565b8060005b6005811015610eab578151845260209384019390910190600101612d0d565b60a081016106ab8284612d09565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680612d6457607f821691505b602082108103612d8457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106ab576106ab612d8a565b600060208284031215612dc557600080fd5b5051919050565b82815260c08101610e7f6020830184612d09565b60008151808452602080850194506020840160005b83811015612e1a5781516001600160a01b031687529582019590820190600101612df5565b509495945050505050565b6001600160a01b03831681526040602082018190526000906121c690830184612de0565b602081526000610e7f6020830184612de0565b818103818111156106ab576106ab612d8a565b6001600160a01b03841681526020810183905260e081016121c66040830184612d09565b600060208284031215612ea557600080fd5b81518015158114610e7f57600080fd5b80820281158282048414176106ab576106ab612d8a565b600082612ee957634e487b7160e01b600052601260045260246000fd5b500490565b60008251612f00818460208701612750565b919091019291505056fe7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c5702233575358bcfd81d1ef3da152b1755e1c3c6739686fa7e83dbcad0071568cc4b73a63a2646970667358221220ff79a578aa510f2888487b6038a4421fa1bc03a7f956dada784c39633712842164736f6c63430008170033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

OVERVIEW

Zunami is a decentralized protocol that issues aggregated stablecoins, whose collateral is utilized in omnipools and differentiated among various profit-generating strategies.

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.