Feature Tip: Add private address tag to any address under My Name Tag !
Overview
Max Total Supply
1,397,610.365419688899764618 zunUSD
Holders
62 ( -3.226%)
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
0.000000000000000004 zunUSDValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Source Code Verified (Exact Match)
Contract Name:
ZunamiPoolZunUSD
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ^0.8.23; import '../../ZunamiPool.sol'; import '../../utils/Constants.sol'; contract ZunamiPoolZunUSD is ZunamiPool { uint256 public constant ZUNAMI_DAI_TOKEN_ID = 0; uint256 public constant ZUNAMI_USDC_TOKEN_ID = 1; uint256 public constant ZUNAMI_USDT_TOKEN_ID = 2; constructor() ZunamiPool('Zunami USD', 'zunUSD') { address[POOL_ASSETS] memory tokens; tokens[ZUNAMI_DAI_TOKEN_ID] = Constants.DAI_ADDRESS; tokens[ZUNAMI_USDC_TOKEN_ID] = Constants.USDC_ADDRESS; tokens[ZUNAMI_USDT_TOKEN_ID] = Constants.USDT_ADDRESS; uint256[POOL_ASSETS] memory tokenDecimalMultipliers; tokenDecimalMultipliers[ZUNAMI_DAI_TOKEN_ID] = 1; tokenDecimalMultipliers[ZUNAMI_USDC_TOKEN_ID] = 1e12; tokenDecimalMultipliers[ZUNAMI_USDT_TOKEN_ID] = 1e12; _setTokens(tokens, tokenDecimalMultipliers); } }
// 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; } } }
// 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; }
// 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); }
// 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); } } } }
// 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); }
// 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); }
// 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); }
// 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; } }
// 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(); } } }
// 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; } }
// 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; } }
// 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); }
// 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()); } }
// 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; }
//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); }
//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 = address(0); 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 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 = address(0); address internal constant CRV_zunUSD_crvUSD_LP_ADDRESS = address(0); address internal constant CVX_zunUSD_crvUSD_REWARDS_ADDRESS = address(0); uint256 internal constant CVX_zunUSD_crvUSD_PID = 0; }
//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)); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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_DAI_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZUNAMI_USDC_TOKEN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZUNAMI_USDT_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"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040518060400160405280600a815260200169169d5b985b5a481554d160b21b815250604051806040016040528060068152602001651e9d5b9554d160d21b815250818181600390816200006791906200054a565b5060046200007682826200054a565b50506005805460ff19169055506200009060003362000149565b50620000bd7f5358bcfd81d1ef3da152b1755e1c3c6739686fa7e83dbcad0071568cc4b73a633362000149565b505050620000ca62000485565b736b175474e89094c44da98b954eedeac495271d0f815273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48602082015273dac17f958d2ee523a2206206994597c13d831ec760408201526200011f62000485565b6001815264e8d4a51000602082018190526040820152620001418282620001fc565b50506200062c565b60008281526006602090815260408083206001600160a01b038516845290915281205460ff16620001f25760008381526006602090815260408083206001600160a01b03861684529091529020805460ff19166001179055620001a93390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001620001f6565b5060005b92915050565b6000805b60058110156200047f578180156200023b575060008482600581106200022a576200022a62000616565b60200201516001600160a01b031614155b156200025a57604051631d37a6fd60e11b815260040160405180910390fd5b600084826005811062000271576200027162000616565b60200201516001600160a01b0316036200028a57600191505b6000848260058110620002a157620002a162000616565b60200201516001600160a01b031614158015620002d55750828160058110620002ce57620002ce62000616565b6020020151155b806200032757506000848260058110620002f357620002f362000616565b60200201516001600160a01b03161480156200032757508281600581106200031f576200031f62000616565b602002015115155b15620003465760405163bfa45dc560e01b815260040160405180910390fd5b6000600882600581106200035e576200035e62000616565b01546001600160a01b0316905084826005811062000380576200038062000616565b6020020151600883600581106200039b576200039b62000616565b0180546001600160a01b0319166001600160a01b0392909216919091179055838260058110620003cf57620003cf62000616565b6020020151600d8360058110620003ea57620003ea62000616565b015584826005811062000401576200040162000616565b60200201516001600160a01b0316827ff747b83f770806e3d1cf3aa94c1cbd9bebc565cd5a9fc5ec4668d7304321a86e86856005811062000446576200044662000616565b6020020151846040516200046d9291909182526001600160a01b0316602082015260400190565b60405180910390a35060010162000200565b50505050565b6040518060a001604052806005906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620004ce57607f821691505b602082108103620004ef57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000545576000816000526020600020601f850160051c81016020861015620005205750805b601f850160051c820191505b8181101562000541578281556001016200052c565b5050505b505050565b81516001600160401b03811115620005665762000566620004a3565b6200057e81620005778454620004b9565b84620004f5565b602080601f831160018114620005b657600084156200059d5750858301515b600019600386901b1c1916600185901b17855562000541565b600085815260208120601f198616915b82811015620005e757888601518255948401946001909101908401620005c6565b5085821015620006065787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b612fa3806200063c6000396000f3fe608060405234801561001057600080fd5b50600436106102d65760003560e01c806375451b4f11610182578063a9059cbb116100e9578063bec5b698116100a2578063d5f651a41161007c578063d5f651a414610583578063dd62ed3e1461062c578063e9ec2e9914610665578063f46a30201461066d57600080fd5b8063bec5b69814610608578063cefbb92214610611578063d547741f1461061957600080fd5b8063a9059cbb14610570578063ad5e347214610583578063b549be3c14610592578063b6e432a9146105a5578063ba9a7a56146105ae578063bb91c339146105b757600080fd5b806395d89b411161013b57806395d89b41146105255780639d63848a1461052d5780639d9a779c14610542578063a217fddf14610555578063a5e9dee41461055d578063a65e71621461055557600080fd5b806375451b4f146104da5780637aedb990146104e25780638091f3bf146104f55780638456cb59146105025780638c8f292f1461050a57806391d148541461051257600080fd5b806323b872dd116102415780633f4ba83a116101fa5780635c975abb116101d45780635c975abb1461047e5780636766ea0f146104895780636e76fc8f1461049c57806370a08231146104b157600080fd5b80633f4ba83a146104635780633ff032071461046b5780635920192a1461047557600080fd5b806323b872dd146103df578063248a9ca3146103f25780632f2ff15d14610415578063313ce5671461042857806336568abe1461043d578063391f8b961461045057600080fd5b80630ab5f869116102935780630ab5f869146103835780630d4b88071461039657806318160ddd146103a95780632026ffa3146103b157806322068b44146103c4578063223e5479146103cc57600080fd5b806301339c21146102db57806301ffc9a7146102e5578063044215c61461030d57806306fdde0314610338578063092c5b3b1461034d578063095ea7b314610370575b600080fd5b6102e3610682565b005b6102f86102f3366004612730565b61069d565b60405190151581526020015b60405180910390f35b61032061031b36600461275a565b6106d4565b6040516001600160a01b039091168152602001610304565b6103406106fa565b6040516103049190612797565b610362600080516020612f2e83398151915281565b604051908152602001610304565b6102f861037e3660046127df565b61078c565b6103626103913660046128cb565b6107a4565b6102e36103a436600461298b565b6107ec565b600254610362565b6102e36103bf366004612a82565b610b1b565b600754610362565b6102e36103da366004612b31565b610c81565b6102f86103ed366004612b4e565b610e83565b61036261040036600461275a565b60009081526006602052604090206001015490565b6102e3610423366004612b8f565b610ea9565b60125b60405160ff9091168152602001610304565b6102e361044b366004612b8f565b610ed4565b6102e361045e366004612bbf565b610f0c565b6102e3610f21565b6103626201518081565b61032061dead81565b60055460ff166102f8565b610362610497366004612c39565b610f37565b610362600080516020612f4e83398151915281565b6103626104bf366004612b31565b6001600160a01b031660009081526020819052604090205490565b61042b600581565b6102e36104f036600461275a565b610fb2565b6014546102f89060ff1681565b6102e3611082565b610362600281565b6102f8610520366004612b8f565b6110a2565b6103406110cd565b6105356110dc565b6040516103049190612c7a565b6102e361055036600461275a565b611121565b610362600081565b6102e361056b366004612b31565b6111e4565b6102f861057e3660046127df565b611211565b610362670de0b6b3a764000081565b6102e36105a0366004612cb4565b61121f565b61036260135481565b6103626103e881565b6105ca6105c536600461275a565b6113bf565b604051610304919081516001600160a01b03168152602080830151908201526040808301519082015260609182015115159181019190915260800190565b61036260125481565b610362600181565b6102e3610627366004612b8f565b61144b565b61036261063a366004612cfe565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610362611470565b610675611579565b6040516103049190612d4f565b600061068d816115b4565b506014805460ff19166001179055565b60006001600160e01b03198216637965db0b60e01b14806106ce57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000600882600581106106e9576106e9612d5d565b01546001600160a01b031692915050565b60606003805461070990612d73565b80601f016020809104026020016040519081016040528092919081815260200182805461073590612d73565b80156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b60003361079a8185856115be565b5060019392505050565b60006107ae6115cb565b600080516020612f2e8339815191526107c6816115b4565b6107cf846115f1565b6107d884611616565b6107e2848461165e565b91505b5092915050565b600080516020612f4e833981519152610804816115b4565b83518551146108265760405163f9e0bc9b60e01b815260040160405180910390fd5b600754831061084857604051631964c57360e11b815260040160405180910390fd5b610851836115f1565b61085a8361179f565b60008060005b87518110156108d65787818151811061087b5761087b612d5d565b602002602001015192506108c28388838151811061089b5761089b612d5d565b60200260200101518784815181106108b5576108b5612d5d565b60200260200101516117e9565b6108cc9083612dc3565b9150600101610860565b5080600786815481106108eb576108eb612d5d565b9060005260206000209060040201600201600082825461090b9190612dc3565b909155506109199050612712565b60005b6005811015610a515760006008826005811061093a5761093a612d5d565b01546001600160a01b03169050806109525750610a51565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba9190612dd6565b8383600581106109cc576109cc612d5d565b602002015260008383600581106109e5576109e5612d5d565b60200201511115610a4857610a4860078981548110610a0657610a06612d5d565b60009182526020909120600490910201546001600160a01b0316848460058110610a3257610a32612d5d565b60200201516001600160a01b0384169190611a38565b5060010161091c565b5060078681548110610a6557610a65612d5d565b600091825260209091206004918202015460405163b67d611d60e01b81526001600160a01b039091169163b67d611d91610aa191859101612d4f565b6020604051808303816000875af1158015610ac0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae49190612dd6565b600003610b115785816040516331ea9deb60e11b8152600401610b08929190612def565b60405180910390fd5b5050505050505050565b600080516020612f2e833981519152610b33816115b4565b610b3b611a8a565b610b4483611bbe565b60005b600754811015610c3a57600060078281548110610b6657610b66612d5d565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff1615156060820152915015801590610bc8575080606001515b15610c31578051604051632026ffa360e01b81526001600160a01b0390911690632026ffa390610bfe9088908890600401612e48565b600060405180830381600087803b158015610c1857600080fd5b505af1158015610c2c573d6000803e3d6000fd5b505050505b50600101610b47565b50826001600160a01b03167fc40901f1d03c33b46234c92521befa858a2264a718b553a3d1d2fd284ad4424083604051610c749190612e6c565b60405180910390a2505050565b6000610c8c816115b4565b6001600160a01b038216610cb35760405163d92e233d60e01b815260040160405180910390fd5b60005b600754811015610d185760078181548110610cd357610cd3612d5d565b60009182526020909120600490910201546001600160a01b0390811690841603610d10576040516303ee72d760e51b815260040160405180910390fd5b600101610cb6565b5060145460009060ff16610d2d576000610d32565b620151805b610d3c9042612dc3565b604080516080810182526001600160a01b038681168083526020830185815260009484018581526001606086018181526007805480840182559881905296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600490990298890180546001600160a01b031916919097161790955591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689870155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a86015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b909401805460ff19169415159490941790935590549293509091610e4a9190612e7f565b6040518381527f3a64755f61c73ed1f60bd0a9660e9cb66aa01817ea10d5b44d216a3ff95cca0e906020015b60405180910390a3505050565b600033610e91858285611c8d565b610e9c858585611d05565b60019150505b9392505050565b600082815260066020526040902060010154610ec4816115b4565b610ece8383611d64565b50505050565b6001600160a01b0381163314610efd5760405163334bd91960e11b815260040160405180910390fd5b610f078282611df8565b505050565b6000610f17816115b4565b610f078383611e65565b6000610f2c816115b4565b610f346120b7565b50565b6000610f416115cb565b600080516020612f2e833981519152610f59816115b4565b610f62856115f1565b610f6b85611616565b610f748561179f565b6001600160a01b038316610f86573392505b610f8e611a8a565b6000610f9a868661165e565b9050610fa884828789612109565b9695505050505050565b600080516020612f4e833981519152610fca816115b4565b6007548210610fec5760405163a458994160e01b815260040160405180910390fd5b60006007838154811061100157611001612d5d565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061103c5761103c612d5d565b600091825260208220600490910201546040516001600160a01b03909116917f8b35b417b16faa66c73c967944e5e1e2a14e1b75b0c047b18ac49c8e5f84799a91a25050565b600080516020612f4e83398151915261109a816115b4565b610f346121f1565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606004805461070990612d73565b6110e4612712565b6040805160a08101918290529060089060059082845b81546001600160a01b031681526001909101906020018083116110fa575050505050905090565b600061112c816115b4565b600754821061114e5760405163a458994160e01b815260040160405180910390fd5b60016007838154811061116357611163612d5d565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061119e5761119e612d5d565b600091825260208220600490910201546040516001600160a01b03909116917f532492ef4d4edd78444556c1b5038901e11c232361675fe6d5e6bea2f0864e1991a25050565b600080516020612f2e8339815191526111fc816115b4565b611204611a8a565b61120d82611bbe565b5050565b60003361079a818585611d05565b6112276115cb565b600080516020612f2e83398151915261123f816115b4565b611248856115f1565b61125185611616565b61125a8561179f565b60006007868154811061126f5761126f612d5d565b600091825260208220600490910201546001600160a01b031691506112913390565b9050856112b3826001600160a01b031660009081526020819052604090205490565b10156112d2576040516349986e7360e01b815260040160405180910390fd5b6112da611a8a565b6001600160a01b0380831690636d9164c6908616156112f957856112fb565b825b6113298960078c8154811061131257611312612d5d565b90600052602060002090600402016002015461222e565b886040518463ffffffff1660e01b815260040161134893929190612e92565b6020604051808303816000875af1158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190612eb6565b6113ab5760405163ee9684e760e01b815260048101889052602401610b08565b6113b6818789612281565b50505050505050565b604080516080810182526000808252602082018190529181018290526060810191909152600782815481106113f6576113f6612d5d565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018101549383019390935260028301549082015260039091015460ff161515606082015292915050565b600082815260066020526040902060010154611466816115b4565b610ece8383611df8565b60075460009081805b828110156107e55760006007828154811061149657611496612d5d565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff16151560608201529150158015906114f8575080606001515b156115705780600001516001600160a01b031663e9ec2e996040518163ffffffff1660e01b8152600401602060405180830381865afa15801561153f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115639190612dd6565b61156d9084612dc3565b92505b50600101611479565b611581612712565b6040805160a081019182905290600d9060059082845b815481526020019060010190808311611597575050505050905090565b610f348133612301565b610f07838383600161233a565b60055460ff16156115ef5760405163d93c066560e01b815260040160405180910390fd5b565b6007548110610f34576040516306796a2560e21b815260048101829052602401610b08565b6007818154811061162957611629612d5d565b906000526020600020906004020160010154421015610f3457604051631744fd1760e21b815260048101829052602401610b08565b6000806007848154811061167457611674612d5d565b600091825260208220600490910201546001600160a01b031691505b60058110156117005760008482600581106116ad576116ad612d5d565b602002015111156116f8576116f8828583600581106116ce576116ce612d5d565b6020020151600884600581106116e6576116e6612d5d565b01546001600160a01b03169190611a38565b600101611690565b50611709611a8a565b60405163b67d611d60e01b81526001600160a01b0382169063b67d611d90611735908690600401612d4f565b6020604051808303816000875af1158015611754573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117789190612dd6565b9150816000036107e55783836040516331ea9deb60e11b8152600401610b08929190612def565b600781815481106117b2576117b2612d5d565b600091825260209091206003600490920201015460ff16610f345760405163277d558560e21b815260048101829052602401610b08565b60008215806117ff5750670de0b6b3a764000083115b1561181d576040516397a41b9760e01b815260040160405180910390fd5b670de0b6b3a76400008303611903576007848154811061183f5761183f612d5d565b906000526020600020906004020160020154905060006007858154811061186857611868612d5d565b9060005260206000209060040201600201819055506007848154811061189057611890612d5d565b6000918252602090912060049182020154604051632069ee2560e21b81526001600160a01b03909116916381a7b894916118cc91869101612d4f565b600060405180830381600087803b1580156118e657600080fd5b505af11580156118fa573d6000803e3d6000fd5b50505050610ea2565b670de0b6b3a7640000836007868154811061192057611920612d5d565b90600052602060002090600402016002015461193c9190612ed8565b6119469190612eef565b9050806007858154811061195c5761195c612d5d565b9060005260206000209060040201600201600082825461197c9190612e7f565b9091555050600780548590811061199557611995612d5d565b60009182526020909120600491820201546040516336c8b26360e11b81526001600160a01b0390911691636d9164c6916119d59130918891889101612e92565b6020604051808303816000875af11580156119f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a189190612eb6565b610ea25760405163ee9684e760e01b815260048101859052602401610b08565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610f0790849061240f565b4360135403611a9557565b60008060005b600754811015611b8c57600060078281548110611aba57611aba612d5d565b9060005260206000209060040201905060008160020154118015611ae25750600381015460ff165b15611b825780546040805163e9ec2e9960e01b815290516000926001600160a01b03169163e9ec2e999160048083019260209291908290030181865afa158015611b30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b549190612dd6565b6002830154909150808211611b6b57505050611b84565b600283018054919092039081019091559384019392505b505b600101611a9b565b5081600003611b99575050565b8160126000828254611bab9190612dc3565b90915550504360135561120d3083612472565b601254600003611bcb5750565b60128054600090915560405163a9059cbb60e01b81526001600160a01b038316600482015260248101829052309063a9059cbb906044016020604051808303816000875af1158015611c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c459190612eb6565b50816001600160a01b03167f679522ada03e2aff72b5376caa48a92d6cf1520bc5816e47488103cf974a3e2e82604051611c8191815260200190565b60405180910390a25050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610ece5781811015611cf657604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b08565b610ece8484848403600061233a565b6001600160a01b038316611d2f57604051634b637e8f60e11b815260006004820152602401610b08565b6001600160a01b038216611d595760405163ec442f0560e01b815260006004820152602401610b08565b610f078383836124a4565b6000611d7083836110a2565b611df05760008381526006602090815260408083206001600160a01b03861684529091529020805460ff19166001179055611da83390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016106ce565b5060006106ce565b6000611e0483836110a2565b15611df05760008381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016106ce565b6000805b6005811015610ece57818015611e9f57506000848260058110611e8e57611e8e612d5d565b60200201516001600160a01b031614155b15611ebd57604051631d37a6fd60e11b815260040160405180910390fd5b6000848260058110611ed157611ed1612d5d565b60200201516001600160a01b031603611ee957600191505b6000848260058110611efd57611efd612d5d565b60200201516001600160a01b031614158015611f2d5750828160058110611f2657611f26612d5d565b6020020151155b80611f7757506000848260058110611f4757611f47612d5d565b60200201516001600160a01b0316148015611f775750828160058110611f6f57611f6f612d5d565b602002015115155b15611f955760405163bfa45dc560e01b815260040160405180910390fd5b600060088260058110611faa57611faa612d5d565b01546001600160a01b03169050848260058110611fc957611fc9612d5d565b602002015160088360058110611fe157611fe1612d5d565b0180546001600160a01b0319166001600160a01b039290921691909117905583826005811061201257612012612d5d565b6020020151600d836005811061202a5761202a612d5d565b015584826005811061203e5761203e612d5d565b60200201516001600160a01b0316827ff747b83f770806e3d1cf3aa94c1cbd9bebc565cd5a9fc5ec4668d7304321a86e86856005811061208057612080612d5d565b6020020151846040516120a69291909182526001600160a01b0316602082015260400190565b60405180910390a350600101611e69565b6120bf6125c1565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60008061211560025490565b60000361214e576103e8851161213e576040516349986e7360e01b815260040160405180910390fd5b506103e861214e61dead82612472565b600061215a8287612e7f565b90506121668782612472565b856007858154811061217a5761217a612d5d565b9060005260206000209060040201600201600082825461219a9190612dc3565b9250508190555083876001600160a01b03167fa17ff9bbea81293417e3fe6571f199f77815934a9ca09121a83a4603cd83f3b788886040516121dd929190612def565b60405180910390a39150505b949350505050565b6121f96115cb565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120ec3390565b600081612243670de0b6b3a764000085612ed8565b61224d9190612eef565b90508015806122635750670de0b6b3a764000081115b156106ce57604051634aa3778b60e01b815260040160405180910390fd5b61228b83836125e4565b816007828154811061229f5761229f612d5d565b906000526020600020906004020160020160008282546122bf9190612e7f565b909155505060405182815281906001600160a01b038516907f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc690602001610e76565b61230b82826110a2565b61120d5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610b08565b6001600160a01b0384166123645760405163e602df0560e01b815260006004820152602401610b08565b6001600160a01b03831661238e57604051634a1406b160e11b815260006004820152602401610b08565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610ece57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161240191815260200190565b60405180910390a350505050565b60006124246001600160a01b0384168361261a565b905080516000141580156124495750808060200190518101906124479190612eb6565b155b15610f0757604051635274afe760e01b81526001600160a01b0384166004820152602401610b08565b6001600160a01b03821661249c5760405163ec442f0560e01b815260006004820152602401610b08565b61120d600083835b6001600160a01b0383166124cf5780600260008282546124c49190612dc3565b909155506125419050565b6001600160a01b038316600090815260208190526040902054818110156125225760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610b08565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661255d5760028054829003905561257c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e7691815260200190565b60055460ff166115ef57604051638dfc202b60e01b815260040160405180910390fd5b6001600160a01b03821661260e57604051634b637e8f60e11b815260006004820152602401610b08565b61120d826000836124a4565b6060610ea28383600084600080856001600160a01b031684866040516126409190612f11565b60006040518083038185875af1925050503d806000811461267d576040519150601f19603f3d011682016040523d82523d6000602084013e612682565b606091505b5091509150610fa88683836060826126a25761269d826126e9565b610ea2565b81511580156126b957506001600160a01b0384163b155b156126e257604051639996b31560e01b81526001600160a01b0385166004820152602401610b08565b5080610ea2565b8051156126f95780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b60006020828403121561274257600080fd5b81356001600160e01b031981168114610ea257600080fd5b60006020828403121561276c57600080fd5b5035919050565b60005b8381101561278e578181015183820152602001612776565b50506000910152565b60208152600082518060208401526127b6816040850160208701612773565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f3457600080fd5b600080604083850312156127f257600080fd5b82356127fd816127ca565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156128445761284461280b565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156128735761287361280b565b604052919050565b600082601f83011261288c57600080fd5b612894612821565b8060a08401858111156128a657600080fd5b845b818110156128c05780358452602093840193016128a8565b509095945050505050565b60008060c083850312156128de57600080fd5b823591506128ef846020850161287b565b90509250929050565b600067ffffffffffffffff8211156129125761291261280b565b5060051b60200190565b600082601f83011261292d57600080fd5b8135602061294261293d836128f8565b61284a565b8083825260208201915060208460051b87010193508684111561296457600080fd5b602086015b848110156129805780358352918301918301612969565b509695505050505050565b600080600080608085870312156129a157600080fd5b843567ffffffffffffffff808211156129b957600080fd5b6129c58883890161291c565b9550602091506020870135818111156129dd57600080fd5b6129e989828a0161291c565b95505060408701359350606087013581811115612a0557600080fd5b87019050601f81018813612a1857600080fd5b8035612a2661293d826128f8565b8082825260208201915060a0602060a0850286010193508b841115612a4a57600080fd5b6020850194505b83851015612a7257612a638c8661287b565b83529384019391850191612a51565b50979a9699509497505050505050565b60008060408385031215612a9557600080fd5b8235612aa0816127ca565b915060208381013567ffffffffffffffff811115612abd57600080fd5b8401601f81018613612ace57600080fd5b8035612adc61293d826128f8565b81815260059190911b82018301908381019088831115612afb57600080fd5b928401925b82841015612b22578335612b13816127ca565b82529284019290840190612b00565b80955050505050509250929050565b600060208284031215612b4357600080fd5b8135610ea2816127ca565b600080600060608486031215612b6357600080fd5b8335612b6e816127ca565b92506020840135612b7e816127ca565b929592945050506040919091013590565b60008060408385031215612ba257600080fd5b823591506020830135612bb4816127ca565b809150509250929050565b6000806101408385031215612bd357600080fd5b83601f840112612be257600080fd5b612bea612821565b8060a0850186811115612bfc57600080fd5b855b81811015612c1f578035612c11816127ca565b845260209384019301612bfe565b50819450612c2d878261287b565b93505050509250929050565b600080600060e08486031215612c4e57600080fd5b83359250612c5f856020860161287b565b915060c0840135612c6f816127ca565b809150509250925092565b60a08101818360005b6005811015612cab5781516001600160a01b0316835260209283019290910190600101612c83565b50505092915050565b6000806000806101008587031215612ccb57600080fd5b8435935060208501359250612ce3866040870161287b565b915060e0850135612cf3816127ca565b939692955090935050565b60008060408385031215612d1157600080fd5b8235612d1c816127ca565b91506020830135612bb4816127ca565b8060005b6005811015610ece578151845260209384019390910190600101612d30565b60a081016106ce8284612d2c565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680612d8757607f821691505b602082108103612da757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106ce576106ce612dad565b600060208284031215612de857600080fd5b5051919050565b82815260c08101610ea26020830184612d2c565b60008151808452602080850194506020840160005b83811015612e3d5781516001600160a01b031687529582019590820190600101612e18565b509495945050505050565b6001600160a01b03831681526040602082018190526000906121e990830184612e03565b602081526000610ea26020830184612e03565b818103818111156106ce576106ce612dad565b6001600160a01b03841681526020810183905260e081016121e96040830184612d2c565b600060208284031215612ec857600080fd5b81518015158114610ea257600080fd5b80820281158282048414176106ce576106ce612dad565b600082612f0c57634e487b7160e01b600052601260045260246000fd5b500490565b60008251612f23818460208701612773565b919091019291505056fe7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c5702233575358bcfd81d1ef3da152b1755e1c3c6739686fa7e83dbcad0071568cc4b73a63a264697066735822122085c927df46c14fec45f5fff8aa86e17b1a3f432bb02d327ad40c8493e8a8a08b64736f6c63430008170033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102d65760003560e01c806375451b4f11610182578063a9059cbb116100e9578063bec5b698116100a2578063d5f651a41161007c578063d5f651a414610583578063dd62ed3e1461062c578063e9ec2e9914610665578063f46a30201461066d57600080fd5b8063bec5b69814610608578063cefbb92214610611578063d547741f1461061957600080fd5b8063a9059cbb14610570578063ad5e347214610583578063b549be3c14610592578063b6e432a9146105a5578063ba9a7a56146105ae578063bb91c339146105b757600080fd5b806395d89b411161013b57806395d89b41146105255780639d63848a1461052d5780639d9a779c14610542578063a217fddf14610555578063a5e9dee41461055d578063a65e71621461055557600080fd5b806375451b4f146104da5780637aedb990146104e25780638091f3bf146104f55780638456cb59146105025780638c8f292f1461050a57806391d148541461051257600080fd5b806323b872dd116102415780633f4ba83a116101fa5780635c975abb116101d45780635c975abb1461047e5780636766ea0f146104895780636e76fc8f1461049c57806370a08231146104b157600080fd5b80633f4ba83a146104635780633ff032071461046b5780635920192a1461047557600080fd5b806323b872dd146103df578063248a9ca3146103f25780632f2ff15d14610415578063313ce5671461042857806336568abe1461043d578063391f8b961461045057600080fd5b80630ab5f869116102935780630ab5f869146103835780630d4b88071461039657806318160ddd146103a95780632026ffa3146103b157806322068b44146103c4578063223e5479146103cc57600080fd5b806301339c21146102db57806301ffc9a7146102e5578063044215c61461030d57806306fdde0314610338578063092c5b3b1461034d578063095ea7b314610370575b600080fd5b6102e3610682565b005b6102f86102f3366004612730565b61069d565b60405190151581526020015b60405180910390f35b61032061031b36600461275a565b6106d4565b6040516001600160a01b039091168152602001610304565b6103406106fa565b6040516103049190612797565b610362600080516020612f2e83398151915281565b604051908152602001610304565b6102f861037e3660046127df565b61078c565b6103626103913660046128cb565b6107a4565b6102e36103a436600461298b565b6107ec565b600254610362565b6102e36103bf366004612a82565b610b1b565b600754610362565b6102e36103da366004612b31565b610c81565b6102f86103ed366004612b4e565b610e83565b61036261040036600461275a565b60009081526006602052604090206001015490565b6102e3610423366004612b8f565b610ea9565b60125b60405160ff9091168152602001610304565b6102e361044b366004612b8f565b610ed4565b6102e361045e366004612bbf565b610f0c565b6102e3610f21565b6103626201518081565b61032061dead81565b60055460ff166102f8565b610362610497366004612c39565b610f37565b610362600080516020612f4e83398151915281565b6103626104bf366004612b31565b6001600160a01b031660009081526020819052604090205490565b61042b600581565b6102e36104f036600461275a565b610fb2565b6014546102f89060ff1681565b6102e3611082565b610362600281565b6102f8610520366004612b8f565b6110a2565b6103406110cd565b6105356110dc565b6040516103049190612c7a565b6102e361055036600461275a565b611121565b610362600081565b6102e361056b366004612b31565b6111e4565b6102f861057e3660046127df565b611211565b610362670de0b6b3a764000081565b6102e36105a0366004612cb4565b61121f565b61036260135481565b6103626103e881565b6105ca6105c536600461275a565b6113bf565b604051610304919081516001600160a01b03168152602080830151908201526040808301519082015260609182015115159181019190915260800190565b61036260125481565b610362600181565b6102e3610627366004612b8f565b61144b565b61036261063a366004612cfe565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610362611470565b610675611579565b6040516103049190612d4f565b600061068d816115b4565b506014805460ff19166001179055565b60006001600160e01b03198216637965db0b60e01b14806106ce57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000600882600581106106e9576106e9612d5d565b01546001600160a01b031692915050565b60606003805461070990612d73565b80601f016020809104026020016040519081016040528092919081815260200182805461073590612d73565b80156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b60003361079a8185856115be565b5060019392505050565b60006107ae6115cb565b600080516020612f2e8339815191526107c6816115b4565b6107cf846115f1565b6107d884611616565b6107e2848461165e565b91505b5092915050565b600080516020612f4e833981519152610804816115b4565b83518551146108265760405163f9e0bc9b60e01b815260040160405180910390fd5b600754831061084857604051631964c57360e11b815260040160405180910390fd5b610851836115f1565b61085a8361179f565b60008060005b87518110156108d65787818151811061087b5761087b612d5d565b602002602001015192506108c28388838151811061089b5761089b612d5d565b60200260200101518784815181106108b5576108b5612d5d565b60200260200101516117e9565b6108cc9083612dc3565b9150600101610860565b5080600786815481106108eb576108eb612d5d565b9060005260206000209060040201600201600082825461090b9190612dc3565b909155506109199050612712565b60005b6005811015610a515760006008826005811061093a5761093a612d5d565b01546001600160a01b03169050806109525750610a51565b6040516370a0823160e01b81523060048201526001600160a01b038216906370a0823190602401602060405180830381865afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba9190612dd6565b8383600581106109cc576109cc612d5d565b602002015260008383600581106109e5576109e5612d5d565b60200201511115610a4857610a4860078981548110610a0657610a06612d5d565b60009182526020909120600490910201546001600160a01b0316848460058110610a3257610a32612d5d565b60200201516001600160a01b0384169190611a38565b5060010161091c565b5060078681548110610a6557610a65612d5d565b600091825260209091206004918202015460405163b67d611d60e01b81526001600160a01b039091169163b67d611d91610aa191859101612d4f565b6020604051808303816000875af1158015610ac0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae49190612dd6565b600003610b115785816040516331ea9deb60e11b8152600401610b08929190612def565b60405180910390fd5b5050505050505050565b600080516020612f2e833981519152610b33816115b4565b610b3b611a8a565b610b4483611bbe565b60005b600754811015610c3a57600060078281548110610b6657610b66612d5d565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff1615156060820152915015801590610bc8575080606001515b15610c31578051604051632026ffa360e01b81526001600160a01b0390911690632026ffa390610bfe9088908890600401612e48565b600060405180830381600087803b158015610c1857600080fd5b505af1158015610c2c573d6000803e3d6000fd5b505050505b50600101610b47565b50826001600160a01b03167fc40901f1d03c33b46234c92521befa858a2264a718b553a3d1d2fd284ad4424083604051610c749190612e6c565b60405180910390a2505050565b6000610c8c816115b4565b6001600160a01b038216610cb35760405163d92e233d60e01b815260040160405180910390fd5b60005b600754811015610d185760078181548110610cd357610cd3612d5d565b60009182526020909120600490910201546001600160a01b0390811690841603610d10576040516303ee72d760e51b815260040160405180910390fd5b600101610cb6565b5060145460009060ff16610d2d576000610d32565b620151805b610d3c9042612dc3565b604080516080810182526001600160a01b038681168083526020830185815260009484018581526001606086018181526007805480840182559881905296517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688600490990298890180546001600160a01b031916919097161790955591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c689870155517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68a86015591517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68b909401805460ff19169415159490941790935590549293509091610e4a9190612e7f565b6040518381527f3a64755f61c73ed1f60bd0a9660e9cb66aa01817ea10d5b44d216a3ff95cca0e906020015b60405180910390a3505050565b600033610e91858285611c8d565b610e9c858585611d05565b60019150505b9392505050565b600082815260066020526040902060010154610ec4816115b4565b610ece8383611d64565b50505050565b6001600160a01b0381163314610efd5760405163334bd91960e11b815260040160405180910390fd5b610f078282611df8565b505050565b6000610f17816115b4565b610f078383611e65565b6000610f2c816115b4565b610f346120b7565b50565b6000610f416115cb565b600080516020612f2e833981519152610f59816115b4565b610f62856115f1565b610f6b85611616565b610f748561179f565b6001600160a01b038316610f86573392505b610f8e611a8a565b6000610f9a868661165e565b9050610fa884828789612109565b9695505050505050565b600080516020612f4e833981519152610fca816115b4565b6007548210610fec5760405163a458994160e01b815260040160405180910390fd5b60006007838154811061100157611001612d5d565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061103c5761103c612d5d565b600091825260208220600490910201546040516001600160a01b03909116917f8b35b417b16faa66c73c967944e5e1e2a14e1b75b0c047b18ac49c8e5f84799a91a25050565b600080516020612f4e83398151915261109a816115b4565b610f346121f1565b60009182526006602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606004805461070990612d73565b6110e4612712565b6040805160a08101918290529060089060059082845b81546001600160a01b031681526001909101906020018083116110fa575050505050905090565b600061112c816115b4565b600754821061114e5760405163a458994160e01b815260040160405180910390fd5b60016007838154811061116357611163612d5d565b906000526020600020906004020160030160006101000a81548160ff0219169083151502179055506007828154811061119e5761119e612d5d565b600091825260208220600490910201546040516001600160a01b03909116917f532492ef4d4edd78444556c1b5038901e11c232361675fe6d5e6bea2f0864e1991a25050565b600080516020612f2e8339815191526111fc816115b4565b611204611a8a565b61120d82611bbe565b5050565b60003361079a818585611d05565b6112276115cb565b600080516020612f2e83398151915261123f816115b4565b611248856115f1565b61125185611616565b61125a8561179f565b60006007868154811061126f5761126f612d5d565b600091825260208220600490910201546001600160a01b031691506112913390565b9050856112b3826001600160a01b031660009081526020819052604090205490565b10156112d2576040516349986e7360e01b815260040160405180910390fd5b6112da611a8a565b6001600160a01b0380831690636d9164c6908616156112f957856112fb565b825b6113298960078c8154811061131257611312612d5d565b90600052602060002090600402016002015461222e565b886040518463ffffffff1660e01b815260040161134893929190612e92565b6020604051808303816000875af1158015611367573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138b9190612eb6565b6113ab5760405163ee9684e760e01b815260048101889052602401610b08565b6113b6818789612281565b50505050505050565b604080516080810182526000808252602082018190529181018290526060810191909152600782815481106113f6576113f6612d5d565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018101549383019390935260028301549082015260039091015460ff161515606082015292915050565b600082815260066020526040902060010154611466816115b4565b610ece8383611df8565b60075460009081805b828110156107e55760006007828154811061149657611496612d5d565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015490820181905260039092015460ff16151560608201529150158015906114f8575080606001515b156115705780600001516001600160a01b031663e9ec2e996040518163ffffffff1660e01b8152600401602060405180830381865afa15801561153f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115639190612dd6565b61156d9084612dc3565b92505b50600101611479565b611581612712565b6040805160a081019182905290600d9060059082845b815481526020019060010190808311611597575050505050905090565b610f348133612301565b610f07838383600161233a565b60055460ff16156115ef5760405163d93c066560e01b815260040160405180910390fd5b565b6007548110610f34576040516306796a2560e21b815260048101829052602401610b08565b6007818154811061162957611629612d5d565b906000526020600020906004020160010154421015610f3457604051631744fd1760e21b815260048101829052602401610b08565b6000806007848154811061167457611674612d5d565b600091825260208220600490910201546001600160a01b031691505b60058110156117005760008482600581106116ad576116ad612d5d565b602002015111156116f8576116f8828583600581106116ce576116ce612d5d565b6020020151600884600581106116e6576116e6612d5d565b01546001600160a01b03169190611a38565b600101611690565b50611709611a8a565b60405163b67d611d60e01b81526001600160a01b0382169063b67d611d90611735908690600401612d4f565b6020604051808303816000875af1158015611754573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117789190612dd6565b9150816000036107e55783836040516331ea9deb60e11b8152600401610b08929190612def565b600781815481106117b2576117b2612d5d565b600091825260209091206003600490920201015460ff16610f345760405163277d558560e21b815260048101829052602401610b08565b60008215806117ff5750670de0b6b3a764000083115b1561181d576040516397a41b9760e01b815260040160405180910390fd5b670de0b6b3a76400008303611903576007848154811061183f5761183f612d5d565b906000526020600020906004020160020154905060006007858154811061186857611868612d5d565b9060005260206000209060040201600201819055506007848154811061189057611890612d5d565b6000918252602090912060049182020154604051632069ee2560e21b81526001600160a01b03909116916381a7b894916118cc91869101612d4f565b600060405180830381600087803b1580156118e657600080fd5b505af11580156118fa573d6000803e3d6000fd5b50505050610ea2565b670de0b6b3a7640000836007868154811061192057611920612d5d565b90600052602060002090600402016002015461193c9190612ed8565b6119469190612eef565b9050806007858154811061195c5761195c612d5d565b9060005260206000209060040201600201600082825461197c9190612e7f565b9091555050600780548590811061199557611995612d5d565b60009182526020909120600491820201546040516336c8b26360e11b81526001600160a01b0390911691636d9164c6916119d59130918891889101612e92565b6020604051808303816000875af11580156119f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a189190612eb6565b610ea25760405163ee9684e760e01b815260048101859052602401610b08565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610f0790849061240f565b4360135403611a9557565b60008060005b600754811015611b8c57600060078281548110611aba57611aba612d5d565b9060005260206000209060040201905060008160020154118015611ae25750600381015460ff165b15611b825780546040805163e9ec2e9960e01b815290516000926001600160a01b03169163e9ec2e999160048083019260209291908290030181865afa158015611b30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b549190612dd6565b6002830154909150808211611b6b57505050611b84565b600283018054919092039081019091559384019392505b505b600101611a9b565b5081600003611b99575050565b8160126000828254611bab9190612dc3565b90915550504360135561120d3083612472565b601254600003611bcb5750565b60128054600090915560405163a9059cbb60e01b81526001600160a01b038316600482015260248101829052309063a9059cbb906044016020604051808303816000875af1158015611c21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c459190612eb6565b50816001600160a01b03167f679522ada03e2aff72b5376caa48a92d6cf1520bc5816e47488103cf974a3e2e82604051611c8191815260200190565b60405180910390a25050565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114610ece5781811015611cf657604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b08565b610ece8484848403600061233a565b6001600160a01b038316611d2f57604051634b637e8f60e11b815260006004820152602401610b08565b6001600160a01b038216611d595760405163ec442f0560e01b815260006004820152602401610b08565b610f078383836124a4565b6000611d7083836110a2565b611df05760008381526006602090815260408083206001600160a01b03861684529091529020805460ff19166001179055611da83390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016106ce565b5060006106ce565b6000611e0483836110a2565b15611df05760008381526006602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016106ce565b6000805b6005811015610ece57818015611e9f57506000848260058110611e8e57611e8e612d5d565b60200201516001600160a01b031614155b15611ebd57604051631d37a6fd60e11b815260040160405180910390fd5b6000848260058110611ed157611ed1612d5d565b60200201516001600160a01b031603611ee957600191505b6000848260058110611efd57611efd612d5d565b60200201516001600160a01b031614158015611f2d5750828160058110611f2657611f26612d5d565b6020020151155b80611f7757506000848260058110611f4757611f47612d5d565b60200201516001600160a01b0316148015611f775750828160058110611f6f57611f6f612d5d565b602002015115155b15611f955760405163bfa45dc560e01b815260040160405180910390fd5b600060088260058110611faa57611faa612d5d565b01546001600160a01b03169050848260058110611fc957611fc9612d5d565b602002015160088360058110611fe157611fe1612d5d565b0180546001600160a01b0319166001600160a01b039290921691909117905583826005811061201257612012612d5d565b6020020151600d836005811061202a5761202a612d5d565b015584826005811061203e5761203e612d5d565b60200201516001600160a01b0316827ff747b83f770806e3d1cf3aa94c1cbd9bebc565cd5a9fc5ec4668d7304321a86e86856005811061208057612080612d5d565b6020020151846040516120a69291909182526001600160a01b0316602082015260400190565b60405180910390a350600101611e69565b6120bf6125c1565b6005805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60008061211560025490565b60000361214e576103e8851161213e576040516349986e7360e01b815260040160405180910390fd5b506103e861214e61dead82612472565b600061215a8287612e7f565b90506121668782612472565b856007858154811061217a5761217a612d5d565b9060005260206000209060040201600201600082825461219a9190612dc3565b9250508190555083876001600160a01b03167fa17ff9bbea81293417e3fe6571f199f77815934a9ca09121a83a4603cd83f3b788886040516121dd929190612def565b60405180910390a39150505b949350505050565b6121f96115cb565b6005805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586120ec3390565b600081612243670de0b6b3a764000085612ed8565b61224d9190612eef565b90508015806122635750670de0b6b3a764000081115b156106ce57604051634aa3778b60e01b815260040160405180910390fd5b61228b83836125e4565b816007828154811061229f5761229f612d5d565b906000526020600020906004020160020160008282546122bf9190612e7f565b909155505060405182815281906001600160a01b038516907f92ccf450a286a957af52509bc1c9939d1a6a481783e142e41e2499f0bb66ebc690602001610e76565b61230b82826110a2565b61120d5760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610b08565b6001600160a01b0384166123645760405163e602df0560e01b815260006004820152602401610b08565b6001600160a01b03831661238e57604051634a1406b160e11b815260006004820152602401610b08565b6001600160a01b0380851660009081526001602090815260408083209387168352929052208290558015610ece57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161240191815260200190565b60405180910390a350505050565b60006124246001600160a01b0384168361261a565b905080516000141580156124495750808060200190518101906124479190612eb6565b155b15610f0757604051635274afe760e01b81526001600160a01b0384166004820152602401610b08565b6001600160a01b03821661249c5760405163ec442f0560e01b815260006004820152602401610b08565b61120d600083835b6001600160a01b0383166124cf5780600260008282546124c49190612dc3565b909155506125419050565b6001600160a01b038316600090815260208190526040902054818110156125225760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610b08565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661255d5760028054829003905561257c565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610e7691815260200190565b60055460ff166115ef57604051638dfc202b60e01b815260040160405180910390fd5b6001600160a01b03821661260e57604051634b637e8f60e11b815260006004820152602401610b08565b61120d826000836124a4565b6060610ea28383600084600080856001600160a01b031684866040516126409190612f11565b60006040518083038185875af1925050503d806000811461267d576040519150601f19603f3d011682016040523d82523d6000602084013e612682565b606091505b5091509150610fa88683836060826126a25761269d826126e9565b610ea2565b81511580156126b957506001600160a01b0384163b155b156126e257604051639996b31560e01b81526001600160a01b0385166004820152602401610b08565b5080610ea2565b8051156126f95780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6040518060a001604052806005906020820280368337509192915050565b60006020828403121561274257600080fd5b81356001600160e01b031981168114610ea257600080fd5b60006020828403121561276c57600080fd5b5035919050565b60005b8381101561278e578181015183820152602001612776565b50506000910152565b60208152600082518060208401526127b6816040850160208701612773565b601f01601f19169190910160400192915050565b6001600160a01b0381168114610f3457600080fd5b600080604083850312156127f257600080fd5b82356127fd816127ca565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff811182821017156128445761284461280b565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156128735761287361280b565b604052919050565b600082601f83011261288c57600080fd5b612894612821565b8060a08401858111156128a657600080fd5b845b818110156128c05780358452602093840193016128a8565b509095945050505050565b60008060c083850312156128de57600080fd5b823591506128ef846020850161287b565b90509250929050565b600067ffffffffffffffff8211156129125761291261280b565b5060051b60200190565b600082601f83011261292d57600080fd5b8135602061294261293d836128f8565b61284a565b8083825260208201915060208460051b87010193508684111561296457600080fd5b602086015b848110156129805780358352918301918301612969565b509695505050505050565b600080600080608085870312156129a157600080fd5b843567ffffffffffffffff808211156129b957600080fd5b6129c58883890161291c565b9550602091506020870135818111156129dd57600080fd5b6129e989828a0161291c565b95505060408701359350606087013581811115612a0557600080fd5b87019050601f81018813612a1857600080fd5b8035612a2661293d826128f8565b8082825260208201915060a0602060a0850286010193508b841115612a4a57600080fd5b6020850194505b83851015612a7257612a638c8661287b565b83529384019391850191612a51565b50979a9699509497505050505050565b60008060408385031215612a9557600080fd5b8235612aa0816127ca565b915060208381013567ffffffffffffffff811115612abd57600080fd5b8401601f81018613612ace57600080fd5b8035612adc61293d826128f8565b81815260059190911b82018301908381019088831115612afb57600080fd5b928401925b82841015612b22578335612b13816127ca565b82529284019290840190612b00565b80955050505050509250929050565b600060208284031215612b4357600080fd5b8135610ea2816127ca565b600080600060608486031215612b6357600080fd5b8335612b6e816127ca565b92506020840135612b7e816127ca565b929592945050506040919091013590565b60008060408385031215612ba257600080fd5b823591506020830135612bb4816127ca565b809150509250929050565b6000806101408385031215612bd357600080fd5b83601f840112612be257600080fd5b612bea612821565b8060a0850186811115612bfc57600080fd5b855b81811015612c1f578035612c11816127ca565b845260209384019301612bfe565b50819450612c2d878261287b565b93505050509250929050565b600080600060e08486031215612c4e57600080fd5b83359250612c5f856020860161287b565b915060c0840135612c6f816127ca565b809150509250925092565b60a08101818360005b6005811015612cab5781516001600160a01b0316835260209283019290910190600101612c83565b50505092915050565b6000806000806101008587031215612ccb57600080fd5b8435935060208501359250612ce3866040870161287b565b915060e0850135612cf3816127ca565b939692955090935050565b60008060408385031215612d1157600080fd5b8235612d1c816127ca565b91506020830135612bb4816127ca565b8060005b6005811015610ece578151845260209384019390910190600101612d30565b60a081016106ce8284612d2c565b634e487b7160e01b600052603260045260246000fd5b600181811c90821680612d8757607f821691505b602082108103612da757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156106ce576106ce612dad565b600060208284031215612de857600080fd5b5051919050565b82815260c08101610ea26020830184612d2c565b60008151808452602080850194506020840160005b83811015612e3d5781516001600160a01b031687529582019590820190600101612e18565b509495945050505050565b6001600160a01b03831681526040602082018190526000906121e990830184612e03565b602081526000610ea26020830184612e03565b818103818111156106ce576106ce612dad565b6001600160a01b03841681526020810183905260e081016121e96040830184612d2c565b600060208284031215612ec857600080fd5b81518015158114610ea257600080fd5b80820281158282048414176106ce576106ce612dad565b600082612f0c57634e487b7160e01b600052601260045260246000fd5b500490565b60008251612f23818460208701612773565b919091019291505056fe7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c5702233575358bcfd81d1ef3da152b1755e1c3c6739686fa7e83dbcad0071568cc4b73a63a264697066735822122085c927df46c14fec45f5fff8aa86e17b1a3f432bb02d327ad40c8493e8a8a08b64736f6c63430008170033
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.