Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 73 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Admin Fee | 16997160 | 575 days ago | IN | 0 ETH | 0.00127481 | ||||
Claim Rewards | 16968957 | 579 days ago | IN | 0 ETH | 0.00327466 | ||||
Set Admin Fee Sh... | 16967280 | 579 days ago | IN | 0 ETH | 0.00058191 | ||||
Withdraw | 16961693 | 580 days ago | IN | 0 ETH | 0.00266585 | ||||
Claim Rewards | 16961691 | 580 days ago | IN | 0 ETH | 0.00139866 | ||||
Withdraw | 16961647 | 580 days ago | IN | 0 ETH | 0.00053353 | ||||
Withdraw | 16961645 | 580 days ago | IN | 0 ETH | 0.00340425 | ||||
Withdraw | 16961583 | 580 days ago | IN | 0 ETH | 0.00321896 | ||||
Withdraw | 16960765 | 580 days ago | IN | 0 ETH | 0.00275594 | ||||
Claim Rewards | 16960761 | 580 days ago | IN | 0 ETH | 0.00142877 | ||||
Set Fee Share | 16958128 | 580 days ago | IN | 0 ETH | 0.00051448 | ||||
Withdraw | 16958009 | 580 days ago | IN | 0 ETH | 0.00264995 | ||||
Deposit | 16940252 | 583 days ago | IN | 0 ETH | 0.00687971 | ||||
Deposit | 16929088 | 584 days ago | IN | 0 ETH | 0.00426287 | ||||
Deposit | 16915834 | 586 days ago | IN | 0 ETH | 0.00318595 | ||||
Withdraw | 16912164 | 587 days ago | IN | 0 ETH | 0.00328579 | ||||
Deposit | 16910769 | 587 days ago | IN | 0 ETH | 0.00216184 | ||||
Claim Rewards | 16910765 | 587 days ago | IN | 0 ETH | 0.00123871 | ||||
Deposit | 16898123 | 589 days ago | IN | 0 ETH | 0.00477561 | ||||
Claim Rewards | 16898120 | 589 days ago | IN | 0 ETH | 0.00326428 | ||||
Deposit | 16888752 | 590 days ago | IN | 0 ETH | 0.00203096 | ||||
Deposit | 16885093 | 590 days ago | IN | 0 ETH | 0.00584787 | ||||
Deposit | 16861141 | 594 days ago | IN | 0 ETH | 0.00166871 | ||||
Claim Rewards | 16861136 | 594 days ago | IN | 0 ETH | 0.00107355 | ||||
Withdraw | 16859066 | 594 days ago | IN | 0 ETH | 0.00199598 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | ||||
---|---|---|---|---|---|---|---|
16997160 | 575 days ago | 0 ETH | |||||
16997145 | 575 days ago | 0 ETH | |||||
16997145 | 575 days ago | 0 ETH | |||||
16997145 | 575 days ago | 0 ETH | |||||
16968957 | 579 days ago | 0 ETH | |||||
16961693 | 580 days ago | 0 ETH | |||||
16961693 | 580 days ago | 0 ETH | |||||
16961691 | 580 days ago | 0 ETH | |||||
16961645 | 580 days ago | 0 ETH | |||||
16961645 | 580 days ago | 0 ETH | |||||
16961645 | 580 days ago | 0 ETH | |||||
16961583 | 580 days ago | 0 ETH | |||||
16961583 | 580 days ago | 0 ETH | |||||
16961583 | 580 days ago | 0 ETH | |||||
16960938 | 580 days ago | 0 ETH | |||||
16960938 | 580 days ago | 0 ETH | |||||
16960938 | 580 days ago | 0 ETH | |||||
16960765 | 580 days ago | 0 ETH | |||||
16960765 | 580 days ago | 0 ETH | |||||
16960761 | 580 days ago | 0 ETH | |||||
16958024 | 580 days ago | 0 ETH | |||||
16958024 | 580 days ago | 0 ETH | |||||
16958024 | 580 days ago | 0 ETH | |||||
16958009 | 580 days ago | 0 ETH | |||||
16958009 | 580 days ago | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xCe01bc1b...c3F539172 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Pool
Compiler Version
v0.8.9+commit.e5eed63a
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2023-03-30 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /** * @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; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. It the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. // We also know that `k`, the position of the most significant bit, is such that `msb(a) = 2**k`. // This gives `2**k < a <= 2**(k+1)` → `2**(k/2) <= sqrt(a) < 2 ** (k/2+1)`. // Using an algorithm similar to the msb conmputation, we are able to compute `result = 2**(k/2)` which is a // good first aproximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1; uint256 x = a; if (x >> 128 > 0) { x >>= 128; result <<= 64; } if (x >> 64 > 0) { x >>= 64; result <<= 32; } if (x >> 32 > 0) { x >>= 32; result <<= 16; } if (x >> 16 > 0) { x >>= 16; result <<= 8; } if (x >> 8 > 0) { x >>= 8; result <<= 4; } if (x >> 4 > 0) { x >>= 4; result <<= 2; } if (x >> 2 > 0) { result <<= 1; } // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { uint256 result = sqrt(a); if (rounding == Rounding.Up && result * result < a) { result += 1; } return result; } } /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint248 from uint256, reverting on * overflow (when the input is greater than largest uint248). * * Counterpart to Solidity's `uint248` operator. * * Requirements: * * - input must fit into 248 bits * * _Available since v4.7._ */ function toUint248(uint256 value) internal pure returns (uint248) { require(value <= type(uint248).max, "SafeCast: value doesn't fit in 248 bits"); return uint248(value); } /** * @dev Returns the downcasted uint240 from uint256, reverting on * overflow (when the input is greater than largest uint240). * * Counterpart to Solidity's `uint240` operator. * * Requirements: * * - input must fit into 240 bits * * _Available since v4.7._ */ function toUint240(uint256 value) internal pure returns (uint240) { require(value <= type(uint240).max, "SafeCast: value doesn't fit in 240 bits"); return uint240(value); } /** * @dev Returns the downcasted uint232 from uint256, reverting on * overflow (when the input is greater than largest uint232). * * Counterpart to Solidity's `uint232` operator. * * Requirements: * * - input must fit into 232 bits * * _Available since v4.7._ */ function toUint232(uint256 value) internal pure returns (uint232) { require(value <= type(uint232).max, "SafeCast: value doesn't fit in 232 bits"); return uint232(value); } /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits * * _Available since v4.2._ */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint216 from uint256, reverting on * overflow (when the input is greater than largest uint216). * * Counterpart to Solidity's `uint216` operator. * * Requirements: * * - input must fit into 216 bits * * _Available since v4.7._ */ function toUint216(uint256 value) internal pure returns (uint216) { require(value <= type(uint216).max, "SafeCast: value doesn't fit in 216 bits"); return uint216(value); } /** * @dev Returns the downcasted uint208 from uint256, reverting on * overflow (when the input is greater than largest uint208). * * Counterpart to Solidity's `uint208` operator. * * Requirements: * * - input must fit into 208 bits * * _Available since v4.7._ */ function toUint208(uint256 value) internal pure returns (uint208) { require(value <= type(uint208).max, "SafeCast: value doesn't fit in 208 bits"); return uint208(value); } /** * @dev Returns the downcasted uint200 from uint256, reverting on * overflow (when the input is greater than largest uint200). * * Counterpart to Solidity's `uint200` operator. * * Requirements: * * - input must fit into 200 bits * * _Available since v4.7._ */ function toUint200(uint256 value) internal pure returns (uint200) { require(value <= type(uint200).max, "SafeCast: value doesn't fit in 200 bits"); return uint200(value); } /** * @dev Returns the downcasted uint192 from uint256, reverting on * overflow (when the input is greater than largest uint192). * * Counterpart to Solidity's `uint192` operator. * * Requirements: * * - input must fit into 192 bits * * _Available since v4.7._ */ function toUint192(uint256 value) internal pure returns (uint192) { require(value <= type(uint192).max, "SafeCast: value doesn't fit in 192 bits"); return uint192(value); } /** * @dev Returns the downcasted uint184 from uint256, reverting on * overflow (when the input is greater than largest uint184). * * Counterpart to Solidity's `uint184` operator. * * Requirements: * * - input must fit into 184 bits * * _Available since v4.7._ */ function toUint184(uint256 value) internal pure returns (uint184) { require(value <= type(uint184).max, "SafeCast: value doesn't fit in 184 bits"); return uint184(value); } /** * @dev Returns the downcasted uint176 from uint256, reverting on * overflow (when the input is greater than largest uint176). * * Counterpart to Solidity's `uint176` operator. * * Requirements: * * - input must fit into 176 bits * * _Available since v4.7._ */ function toUint176(uint256 value) internal pure returns (uint176) { require(value <= type(uint176).max, "SafeCast: value doesn't fit in 176 bits"); return uint176(value); } /** * @dev Returns the downcasted uint168 from uint256, reverting on * overflow (when the input is greater than largest uint168). * * Counterpart to Solidity's `uint168` operator. * * Requirements: * * - input must fit into 168 bits * * _Available since v4.7._ */ function toUint168(uint256 value) internal pure returns (uint168) { require(value <= type(uint168).max, "SafeCast: value doesn't fit in 168 bits"); return uint168(value); } /** * @dev Returns the downcasted uint160 from uint256, reverting on * overflow (when the input is greater than largest uint160). * * Counterpart to Solidity's `uint160` operator. * * Requirements: * * - input must fit into 160 bits * * _Available since v4.7._ */ function toUint160(uint256 value) internal pure returns (uint160) { require(value <= type(uint160).max, "SafeCast: value doesn't fit in 160 bits"); return uint160(value); } /** * @dev Returns the downcasted uint152 from uint256, reverting on * overflow (when the input is greater than largest uint152). * * Counterpart to Solidity's `uint152` operator. * * Requirements: * * - input must fit into 152 bits * * _Available since v4.7._ */ function toUint152(uint256 value) internal pure returns (uint152) { require(value <= type(uint152).max, "SafeCast: value doesn't fit in 152 bits"); return uint152(value); } /** * @dev Returns the downcasted uint144 from uint256, reverting on * overflow (when the input is greater than largest uint144). * * Counterpart to Solidity's `uint144` operator. * * Requirements: * * - input must fit into 144 bits * * _Available since v4.7._ */ function toUint144(uint256 value) internal pure returns (uint144) { require(value <= type(uint144).max, "SafeCast: value doesn't fit in 144 bits"); return uint144(value); } /** * @dev Returns the downcasted uint136 from uint256, reverting on * overflow (when the input is greater than largest uint136). * * Counterpart to Solidity's `uint136` operator. * * Requirements: * * - input must fit into 136 bits * * _Available since v4.7._ */ function toUint136(uint256 value) internal pure returns (uint136) { require(value <= type(uint136).max, "SafeCast: value doesn't fit in 136 bits"); return uint136(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v2.5._ */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint120 from uint256, reverting on * overflow (when the input is greater than largest uint120). * * Counterpart to Solidity's `uint120` operator. * * Requirements: * * - input must fit into 120 bits * * _Available since v4.7._ */ function toUint120(uint256 value) internal pure returns (uint120) { require(value <= type(uint120).max, "SafeCast: value doesn't fit in 120 bits"); return uint120(value); } /** * @dev Returns the downcasted uint112 from uint256, reverting on * overflow (when the input is greater than largest uint112). * * Counterpart to Solidity's `uint112` operator. * * Requirements: * * - input must fit into 112 bits * * _Available since v4.7._ */ function toUint112(uint256 value) internal pure returns (uint112) { require(value <= type(uint112).max, "SafeCast: value doesn't fit in 112 bits"); return uint112(value); } /** * @dev Returns the downcasted uint104 from uint256, reverting on * overflow (when the input is greater than largest uint104). * * Counterpart to Solidity's `uint104` operator. * * Requirements: * * - input must fit into 104 bits * * _Available since v4.7._ */ function toUint104(uint256 value) internal pure returns (uint104) { require(value <= type(uint104).max, "SafeCast: value doesn't fit in 104 bits"); return uint104(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits * * _Available since v4.2._ */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint88 from uint256, reverting on * overflow (when the input is greater than largest uint88). * * Counterpart to Solidity's `uint88` operator. * * Requirements: * * - input must fit into 88 bits * * _Available since v4.7._ */ function toUint88(uint256 value) internal pure returns (uint88) { require(value <= type(uint88).max, "SafeCast: value doesn't fit in 88 bits"); return uint88(value); } /** * @dev Returns the downcasted uint80 from uint256, reverting on * overflow (when the input is greater than largest uint80). * * Counterpart to Solidity's `uint80` operator. * * Requirements: * * - input must fit into 80 bits * * _Available since v4.7._ */ function toUint80(uint256 value) internal pure returns (uint80) { require(value <= type(uint80).max, "SafeCast: value doesn't fit in 80 bits"); return uint80(value); } /** * @dev Returns the downcasted uint72 from uint256, reverting on * overflow (when the input is greater than largest uint72). * * Counterpart to Solidity's `uint72` operator. * * Requirements: * * - input must fit into 72 bits * * _Available since v4.7._ */ function toUint72(uint256 value) internal pure returns (uint72) { require(value <= type(uint72).max, "SafeCast: value doesn't fit in 72 bits"); return uint72(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v2.5._ */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint56 from uint256, reverting on * overflow (when the input is greater than largest uint56). * * Counterpart to Solidity's `uint56` operator. * * Requirements: * * - input must fit into 56 bits * * _Available since v4.7._ */ function toUint56(uint256 value) internal pure returns (uint56) { require(value <= type(uint56).max, "SafeCast: value doesn't fit in 56 bits"); return uint56(value); } /** * @dev Returns the downcasted uint48 from uint256, reverting on * overflow (when the input is greater than largest uint48). * * Counterpart to Solidity's `uint48` operator. * * Requirements: * * - input must fit into 48 bits * * _Available since v4.7._ */ function toUint48(uint256 value) internal pure returns (uint48) { require(value <= type(uint48).max, "SafeCast: value doesn't fit in 48 bits"); return uint48(value); } /** * @dev Returns the downcasted uint40 from uint256, reverting on * overflow (when the input is greater than largest uint40). * * Counterpart to Solidity's `uint40` operator. * * Requirements: * * - input must fit into 40 bits * * _Available since v4.7._ */ function toUint40(uint256 value) internal pure returns (uint40) { require(value <= type(uint40).max, "SafeCast: value doesn't fit in 40 bits"); return uint40(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v2.5._ */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint24 from uint256, reverting on * overflow (when the input is greater than largest uint24). * * Counterpart to Solidity's `uint24` operator. * * Requirements: * * - input must fit into 24 bits * * _Available since v4.7._ */ function toUint24(uint256 value) internal pure returns (uint24) { require(value <= type(uint24).max, "SafeCast: value doesn't fit in 24 bits"); return uint24(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v2.5._ */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits * * _Available since v2.5._ */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. * * _Available since v3.0._ */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int248 from int256, reverting on * overflow (when the input is less than smallest int248 or * greater than largest int248). * * Counterpart to Solidity's `int248` operator. * * Requirements: * * - input must fit into 248 bits * * _Available since v4.7._ */ function toInt248(int256 value) internal pure returns (int248) { require(value >= type(int248).min && value <= type(int248).max, "SafeCast: value doesn't fit in 248 bits"); return int248(value); } /** * @dev Returns the downcasted int240 from int256, reverting on * overflow (when the input is less than smallest int240 or * greater than largest int240). * * Counterpart to Solidity's `int240` operator. * * Requirements: * * - input must fit into 240 bits * * _Available since v4.7._ */ function toInt240(int256 value) internal pure returns (int240) { require(value >= type(int240).min && value <= type(int240).max, "SafeCast: value doesn't fit in 240 bits"); return int240(value); } /** * @dev Returns the downcasted int232 from int256, reverting on * overflow (when the input is less than smallest int232 or * greater than largest int232). * * Counterpart to Solidity's `int232` operator. * * Requirements: * * - input must fit into 232 bits * * _Available since v4.7._ */ function toInt232(int256 value) internal pure returns (int232) { require(value >= type(int232).min && value <= type(int232).max, "SafeCast: value doesn't fit in 232 bits"); return int232(value); } /** * @dev Returns the downcasted int224 from int256, reverting on * overflow (when the input is less than smallest int224 or * greater than largest int224). * * Counterpart to Solidity's `int224` operator. * * Requirements: * * - input must fit into 224 bits * * _Available since v4.7._ */ function toInt224(int256 value) internal pure returns (int224) { require(value >= type(int224).min && value <= type(int224).max, "SafeCast: value doesn't fit in 224 bits"); return int224(value); } /** * @dev Returns the downcasted int216 from int256, reverting on * overflow (when the input is less than smallest int216 or * greater than largest int216). * * Counterpart to Solidity's `int216` operator. * * Requirements: * * - input must fit into 216 bits * * _Available since v4.7._ */ function toInt216(int256 value) internal pure returns (int216) { require(value >= type(int216).min && value <= type(int216).max, "SafeCast: value doesn't fit in 216 bits"); return int216(value); } /** * @dev Returns the downcasted int208 from int256, reverting on * overflow (when the input is less than smallest int208 or * greater than largest int208). * * Counterpart to Solidity's `int208` operator. * * Requirements: * * - input must fit into 208 bits * * _Available since v4.7._ */ function toInt208(int256 value) internal pure returns (int208) { require(value >= type(int208).min && value <= type(int208).max, "SafeCast: value doesn't fit in 208 bits"); return int208(value); } /** * @dev Returns the downcasted int200 from int256, reverting on * overflow (when the input is less than smallest int200 or * greater than largest int200). * * Counterpart to Solidity's `int200` operator. * * Requirements: * * - input must fit into 200 bits * * _Available since v4.7._ */ function toInt200(int256 value) internal pure returns (int200) { require(value >= type(int200).min && value <= type(int200).max, "SafeCast: value doesn't fit in 200 bits"); return int200(value); } /** * @dev Returns the downcasted int192 from int256, reverting on * overflow (when the input is less than smallest int192 or * greater than largest int192). * * Counterpart to Solidity's `int192` operator. * * Requirements: * * - input must fit into 192 bits * * _Available since v4.7._ */ function toInt192(int256 value) internal pure returns (int192) { require(value >= type(int192).min && value <= type(int192).max, "SafeCast: value doesn't fit in 192 bits"); return int192(value); } /** * @dev Returns the downcasted int184 from int256, reverting on * overflow (when the input is less than smallest int184 or * greater than largest int184). * * Counterpart to Solidity's `int184` operator. * * Requirements: * * - input must fit into 184 bits * * _Available since v4.7._ */ function toInt184(int256 value) internal pure returns (int184) { require(value >= type(int184).min && value <= type(int184).max, "SafeCast: value doesn't fit in 184 bits"); return int184(value); } /** * @dev Returns the downcasted int176 from int256, reverting on * overflow (when the input is less than smallest int176 or * greater than largest int176). * * Counterpart to Solidity's `int176` operator. * * Requirements: * * - input must fit into 176 bits * * _Available since v4.7._ */ function toInt176(int256 value) internal pure returns (int176) { require(value >= type(int176).min && value <= type(int176).max, "SafeCast: value doesn't fit in 176 bits"); return int176(value); } /** * @dev Returns the downcasted int168 from int256, reverting on * overflow (when the input is less than smallest int168 or * greater than largest int168). * * Counterpart to Solidity's `int168` operator. * * Requirements: * * - input must fit into 168 bits * * _Available since v4.7._ */ function toInt168(int256 value) internal pure returns (int168) { require(value >= type(int168).min && value <= type(int168).max, "SafeCast: value doesn't fit in 168 bits"); return int168(value); } /** * @dev Returns the downcasted int160 from int256, reverting on * overflow (when the input is less than smallest int160 or * greater than largest int160). * * Counterpart to Solidity's `int160` operator. * * Requirements: * * - input must fit into 160 bits * * _Available since v4.7._ */ function toInt160(int256 value) internal pure returns (int160) { require(value >= type(int160).min && value <= type(int160).max, "SafeCast: value doesn't fit in 160 bits"); return int160(value); } /** * @dev Returns the downcasted int152 from int256, reverting on * overflow (when the input is less than smallest int152 or * greater than largest int152). * * Counterpart to Solidity's `int152` operator. * * Requirements: * * - input must fit into 152 bits * * _Available since v4.7._ */ function toInt152(int256 value) internal pure returns (int152) { require(value >= type(int152).min && value <= type(int152).max, "SafeCast: value doesn't fit in 152 bits"); return int152(value); } /** * @dev Returns the downcasted int144 from int256, reverting on * overflow (when the input is less than smallest int144 or * greater than largest int144). * * Counterpart to Solidity's `int144` operator. * * Requirements: * * - input must fit into 144 bits * * _Available since v4.7._ */ function toInt144(int256 value) internal pure returns (int144) { require(value >= type(int144).min && value <= type(int144).max, "SafeCast: value doesn't fit in 144 bits"); return int144(value); } /** * @dev Returns the downcasted int136 from int256, reverting on * overflow (when the input is less than smallest int136 or * greater than largest int136). * * Counterpart to Solidity's `int136` operator. * * Requirements: * * - input must fit into 136 bits * * _Available since v4.7._ */ function toInt136(int256 value) internal pure returns (int136) { require(value >= type(int136).min && value <= type(int136).max, "SafeCast: value doesn't fit in 136 bits"); return int136(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int120 from int256, reverting on * overflow (when the input is less than smallest int120 or * greater than largest int120). * * Counterpart to Solidity's `int120` operator. * * Requirements: * * - input must fit into 120 bits * * _Available since v4.7._ */ function toInt120(int256 value) internal pure returns (int120) { require(value >= type(int120).min && value <= type(int120).max, "SafeCast: value doesn't fit in 120 bits"); return int120(value); } /** * @dev Returns the downcasted int112 from int256, reverting on * overflow (when the input is less than smallest int112 or * greater than largest int112). * * Counterpart to Solidity's `int112` operator. * * Requirements: * * - input must fit into 112 bits * * _Available since v4.7._ */ function toInt112(int256 value) internal pure returns (int112) { require(value >= type(int112).min && value <= type(int112).max, "SafeCast: value doesn't fit in 112 bits"); return int112(value); } /** * @dev Returns the downcasted int104 from int256, reverting on * overflow (when the input is less than smallest int104 or * greater than largest int104). * * Counterpart to Solidity's `int104` operator. * * Requirements: * * - input must fit into 104 bits * * _Available since v4.7._ */ function toInt104(int256 value) internal pure returns (int104) { require(value >= type(int104).min && value <= type(int104).max, "SafeCast: value doesn't fit in 104 bits"); return int104(value); } /** * @dev Returns the downcasted int96 from int256, reverting on * overflow (when the input is less than smallest int96 or * greater than largest int96). * * Counterpart to Solidity's `int96` operator. * * Requirements: * * - input must fit into 96 bits * * _Available since v4.7._ */ function toInt96(int256 value) internal pure returns (int96) { require(value >= type(int96).min && value <= type(int96).max, "SafeCast: value doesn't fit in 96 bits"); return int96(value); } /** * @dev Returns the downcasted int88 from int256, reverting on * overflow (when the input is less than smallest int88 or * greater than largest int88). * * Counterpart to Solidity's `int88` operator. * * Requirements: * * - input must fit into 88 bits * * _Available since v4.7._ */ function toInt88(int256 value) internal pure returns (int88) { require(value >= type(int88).min && value <= type(int88).max, "SafeCast: value doesn't fit in 88 bits"); return int88(value); } /** * @dev Returns the downcasted int80 from int256, reverting on * overflow (when the input is less than smallest int80 or * greater than largest int80). * * Counterpart to Solidity's `int80` operator. * * Requirements: * * - input must fit into 80 bits * * _Available since v4.7._ */ function toInt80(int256 value) internal pure returns (int80) { require(value >= type(int80).min && value <= type(int80).max, "SafeCast: value doesn't fit in 80 bits"); return int80(value); } /** * @dev Returns the downcasted int72 from int256, reverting on * overflow (when the input is less than smallest int72 or * greater than largest int72). * * Counterpart to Solidity's `int72` operator. * * Requirements: * * - input must fit into 72 bits * * _Available since v4.7._ */ function toInt72(int256 value) internal pure returns (int72) { require(value >= type(int72).min && value <= type(int72).max, "SafeCast: value doesn't fit in 72 bits"); return int72(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int56 from int256, reverting on * overflow (when the input is less than smallest int56 or * greater than largest int56). * * Counterpart to Solidity's `int56` operator. * * Requirements: * * - input must fit into 56 bits * * _Available since v4.7._ */ function toInt56(int256 value) internal pure returns (int56) { require(value >= type(int56).min && value <= type(int56).max, "SafeCast: value doesn't fit in 56 bits"); return int56(value); } /** * @dev Returns the downcasted int48 from int256, reverting on * overflow (when the input is less than smallest int48 or * greater than largest int48). * * Counterpart to Solidity's `int48` operator. * * Requirements: * * - input must fit into 48 bits * * _Available since v4.7._ */ function toInt48(int256 value) internal pure returns (int48) { require(value >= type(int48).min && value <= type(int48).max, "SafeCast: value doesn't fit in 48 bits"); return int48(value); } /** * @dev Returns the downcasted int40 from int256, reverting on * overflow (when the input is less than smallest int40 or * greater than largest int40). * * Counterpart to Solidity's `int40` operator. * * Requirements: * * - input must fit into 40 bits * * _Available since v4.7._ */ function toInt40(int256 value) internal pure returns (int40) { require(value >= type(int40).min && value <= type(int40).max, "SafeCast: value doesn't fit in 40 bits"); return int40(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int24 from int256, reverting on * overflow (when the input is less than smallest int24 or * greater than largest int24). * * Counterpart to Solidity's `int24` operator. * * Requirements: * * - input must fit into 24 bits * * _Available since v4.7._ */ function toInt24(int256 value) internal pure returns (int24) { require(value >= type(int24).min && value <= type(int24).max, "SafeCast: value doesn't fit in 24 bits"); return int24(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. * * _Available since v3.0._ */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract RewardManager is Ownable { using SafeERC20 for ERC20; uint256 private constant P = 52; uint256 private constant BP = 1e4; // Info of each user. struct UserInfo { // How many LP tokens the user has provided. uint256 lpAmount; // Reward debt. uint256 rewardDebt; } // Total virtual LP token amount uint256 public totalLpAmount; // Accumulated rewards per share, shifted left by P bits uint256 public accRewardPerShareP; // Reward token ERC20 public token; // Info of each user that stakes virtual LP tokens mapping(address => UserInfo) public userInfo; // Armin fee share (in BP) uint256 public adminFeeShareBP; // Unclaimed admin fee amount uint256 public adminFeeAmount; event Deposit(address indexed user, uint256 amount); event Withdraw(address indexed user, uint256 amount); event RewardsClaimed(address indexed user, uint256 amount); constructor(ERC20 token_) { token = token_; // Default admin fee is 20% adminFeeShareBP = BP / 5; } function setAdminFeeShare(uint256 _adminFeeShareBP) external onlyOwner { require(_adminFeeShareBP <= BP, "RewardManager: too high"); adminFeeShareBP = _adminFeeShareBP; } // Add revard to the pool, split admin fee share and update accumulated rewards per share function _addRewards(uint256 rewardAmount_) internal { if (totalLpAmount > 0) { uint256 adminFeeRewards = rewardAmount_ * adminFeeShareBP / BP; unchecked { rewardAmount_ -= adminFeeRewards; } accRewardPerShareP += (rewardAmount_ << P) / totalLpAmount; adminFeeAmount += adminFeeRewards; } } function claimAdminFee() external onlyOwner { if (adminFeeAmount > 0) { token.safeTransfer(msg.sender, adminFeeAmount); adminFeeAmount = 0; } } // Returns pending rewards for the address function pendingReward(address user_) external view returns (uint256) { UserInfo memory user = userInfo[user_]; return ((user.lpAmount * accRewardPerShareP) >> P) - user.rewardDebt; } // Deposit LP amount for the user, updates user reward debt and pays pending rewards function _depositLp(address to, uint256 lpAmount) internal { UserInfo storage user = userInfo[to]; uint256 pending; uint256 userLpAmount_ = user.lpAmount; // Gas optimization if (userLpAmount_ > 0) { pending = ((userLpAmount_ * accRewardPerShareP) >> P) - user.rewardDebt; } totalLpAmount += lpAmount; userLpAmount_ += lpAmount; user.lpAmount = userLpAmount_; user.rewardDebt = (userLpAmount_ * accRewardPerShareP) >> P; if (pending > 0) { token.safeTransfer(to, pending); emit RewardsClaimed(to, pending); } emit Deposit(to, lpAmount); } // Withdraws LP amount for the user, updates user reward debt and pays pending rewards function _withdrawLp(address from, uint256 lpAmount) internal { UserInfo storage user = userInfo[from]; uint256 userLpAmount_ = user.lpAmount; // Gas optimization require(userLpAmount_ >= lpAmount, "RewardManager: not enough amount"); uint256 pending; if (userLpAmount_ > 0) { pending = ((userLpAmount_ * accRewardPerShareP) >> P) - user.rewardDebt; } totalLpAmount -= lpAmount; userLpAmount_ -= lpAmount; user.lpAmount = userLpAmount_; user.rewardDebt = (userLpAmount_ * accRewardPerShareP) >> P; if (pending > 0) { token.safeTransfer(from, pending); emit RewardsClaimed(from, pending); } emit Withdraw(from, lpAmount); } // Claims pending rewards without updating stake balance function claimRewards() external { UserInfo storage user = userInfo[msg.sender]; if (user.lpAmount > 0) { uint256 rewards = (user.lpAmount * accRewardPerShareP) >> P; uint256 pending = rewards - user.rewardDebt; if (pending > 0) { user.rewardDebt = rewards; token.safeTransfer(msg.sender, pending); emit RewardsClaimed(msg.sender, pending); } } } } // 4AD - D = 4A(x + y) - (D³ / 4xy) // X - is value of real stable token // Y - is value of virtual usd contract Pool is RewardManager { using SafeERC20 for ERC20; uint256 public a; int256 constant public PP = 1e4; // Price Precision uint256 private constant BP = 10000; // Basis Points uint256 private constant MAX_TOKEN_BALANCE = 2 ** 40; // Max possible token balance uint256 public feeShareBP; address public router; uint256 public tokenBalance; uint256 public vUsdBalance; uint256 public d; uint256 private tokenAmountReduce; uint256 private tokenAmountIncrease; event SwappedToVUsd(address sender, address token, uint256 amount, uint256 vUsdAmount, uint256 fee); event SwappedFromVUsd(address recipient, address token, uint256 vUsdAmount, uint256 amount, uint256 fee); constructor(address router_, uint256 a_, ERC20 token_, uint256 feeShareBP_) RewardManager(token_) { a = a_; router = router_; feeShareBP = feeShareBP_; uint8 decimals = token_.decimals(); if (decimals > 3) { tokenAmountReduce = 10 ** (decimals - 3); } if (decimals < 3) { tokenAmountIncrease = 10 ** (3 - decimals); } } modifier onlyRouter() { require(router == msg.sender, "Pool: caller is not router"); _; } function toSystemPrecision(uint256 amount) internal view returns (uint256) { if (tokenAmountReduce > 0) { return amount / tokenAmountReduce; } else if (tokenAmountIncrease > 0) { return amount * tokenAmountIncrease; } return amount; } function fromSystemPrecision(uint256 amount) internal view returns (uint256) { if (tokenAmountReduce > 0) { return amount * tokenAmountReduce; } else if (tokenAmountIncrease > 0) { return amount / tokenAmountIncrease; } return amount; } // Calculate price and deposit token according to the amount and price, then add the same amount to the X and to the Y function deposit(uint256 amount) external { uint256 oldD = d; uint256 amountSP = toSystemPrecision(amount); require(amountSP > 0, "Pool: too little"); tokenBalance += amountSP; vUsdBalance += amountSP; require(tokenBalance < MAX_TOKEN_BALANCE, "Pool: too much"); token.safeTransferFrom(msg.sender, address(this), amount); _updateD(); if (totalLpAmount == 0 || oldD == 0) { // Initial deposit _depositLp(msg.sender, d >> 1); // Divide by 2 to have initial LP amount close to deposited token amount } else { // Consequent deposits, mint LP according to the D increase _depositLp(msg.sender, totalLpAmount * (d - oldD) / oldD); } } // Subtract X and Y for that amount, calculate current price and withdraw the token to the user according to the price function withdraw(uint256 amountLp) external { uint256 totalLpAmount_ = totalLpAmount; // Gas optimization _withdrawLp(msg.sender, amountLp); // Calculate actual and virtual tokens using burned LP amount share // Swap the difference, get total amount to transfer/burn uint256 amountSP = _preWithdrawSwap( tokenBalance * amountLp / totalLpAmount_, vUsdBalance * amountLp / totalLpAmount_ ); // Always equal amounts removed from actual and virtual tokens tokenBalance -= amountSP; vUsdBalance -= amountSP; // Update D and transfer tokens to the sender _updateD(); token.safeTransfer(msg.sender, fromSystemPrecision(amountSP)); } // Calculate differentce between actual and virtual token, divide by 2 and swap // Return min of resulting actual/virtual token amount function _preWithdrawSwap(uint256 amountToken, uint256 amountVUsd) internal view returns (uint256) { unchecked { if (amountToken > amountVUsd) { uint256 extraToken = (amountToken - amountVUsd) >> 1; // Underflow is impossible here uint256 extraVUsd = vUsdBalance - this.getY(tokenBalance + extraToken); // Underflow is ok return Math.min(amountToken - extraToken, amountVUsd + extraVUsd); } else { uint256 extraVUsd = (amountVUsd - amountToken) >> 1; // Underflow is impossible here uint256 extraToken = tokenBalance - this.getY(vUsdBalance + extraVUsd); // Underflow is ok return Math.min(amountVUsd - extraVUsd, amountToken + extraToken); } }} // Transfer amount from the user to the bridge, calculate new Y according to new X, and return the difference between old and new value function swapToVUsd(address user, uint256 amount) external onlyRouter returns (uint256) { uint256 result; // 0 by default uint256 fee; if (amount > 0) { fee = amount * feeShareBP / BP; uint256 amountIn = toSystemPrecision(amount - fee); // Incorporate rounding dust into the fee fee = amount - fromSystemPrecision(amountIn); tokenBalance += amountIn; uint256 vUsdNewAmount = this.getY(tokenBalance); if (vUsdBalance > vUsdNewAmount) { result = vUsdBalance - vUsdNewAmount; } vUsdBalance = vUsdNewAmount; token.safeTransferFrom(user, address(this), amount); _addRewards(fee); } emit SwappedToVUsd(user, address(token), amount, result, fee); return result; } // Calculate new X according to new Y, Transfer calculated amount from the bridge to the user, and return the amount function swapFromVUsd(address user, uint256 amount) external onlyRouter returns (uint256) { uint256 result; // 0 by default uint256 fee; if (amount > 0) { vUsdBalance += amount; uint256 newAmount = this.getY(vUsdBalance); if (tokenBalance > newAmount) { result = fromSystemPrecision(tokenBalance - newAmount); } // Otherwise result stays 0 fee = result * feeShareBP / BP; // We can use unchecked here because feeShareBP <= BP unchecked { result -= fee; } tokenBalance = newAmount; token.safeTransfer(user, result); _addRewards(fee); } emit SwappedFromVUsd(user, address(token), amount, result, fee); return result; } // y = (sqrt(x(4AD³ + x (4A(D - x) - D )²)) + x (4A(D - x) - D ))/8Ax function getY(uint256 x) external view returns (uint256) { uint256 d_ = d; // Gas optimization uint256 a4_ = a << 2; uint256 a8_ = a4_ << 1; // 4A(D - x) - D int256 part1 = int256(a4_) * (int256(d_) - int256(x)) - int256(d_); // x * (4AD³ + x(part1²)) uint256 part2 = x * (a4_ * d_ * d_ * d_ + x * uint256(part1 * part1)); // (sqrt(part2) + x(part1)) / 8Ax) return SafeCast.toUint256(int256(sqrt(part2)) + int256(x) * part1) / (a8_ * x) + 1;// +1 to offset rounding errors } // price = (1/2) * ((D³ + 8ADx² - 8Ax³ - 2Dx²) / (4x * sqrt(x(4AD³ + x (4A(D - x) - D )²)))) function getPrice() external view returns (uint256) { uint256 x = tokenBalance; uint256 a8_ = a << 3; uint256 d_cube_ = d * d * d; // 4A(D - x) - D int256 p1 = int256(a << 2) * (int256(d) - int256(x)) - int256(d); // x * 4AD³ + x(p1²) uint256 p2 = x * ((a << 2) * d_cube_ + x * uint256(p1 * p1)); // D³ + 8ADx² - 8Ax³ - 2Dx² int256 p3 = int256(d_cube_) + int256((a << 3) * d * x * x) - int256(a8_ * x * x * x) - int256((d << 1) * x * x); // 1/2 * p3 / (4x * sqrt(p2)) return SafeCast.toUint256((PP >> 1) + (PP * p3 / int256((x << 2) * sqrt(p2)))); } function _updateD() private { uint256 x = tokenBalance; uint256 y = vUsdBalance; // a = 8 * Axy(x+y) // b = 4 * xy(4A - 1) / 3 // c = sqrt(a² + b³) // D = cbrt(a + c) + cbrt(a - c) uint256 xy = x * y; uint256 a_ = a; // Axy(x+y) uint256 p1 = a_ * xy * (x + y); // xy(4A - 1) / 3 uint256 p2 = xy * ((a_ << 2) - 1) / 3; // p1² + p2³ uint256 p3 = sqrt((p1 * p1) + (p2 * p2 * p2)); unchecked { uint256 d_ = cbrt(p1 + p3); if (p3 > p1) { d_ -= cbrt(p3 - p1); } else { d_ += cbrt(p1 - p3); } d = (d_ << 1) + 1; // +1 to offset rounding errors } } function sqrt(uint256 n) internal pure returns (uint256) {unchecked { if (n > 0) { uint256 x = (n >> 1) + 1; uint256 y = (x + n / x) >> 1; while (x > y) { x = y; y = (x + n / x) >> 1; } return x; } return 0; }} function cbrt(uint256 n) internal pure returns (uint256) {unchecked { uint256 x = 0; for (uint256 y = 1 << 255; y > 0; y >>= 3) { x <<= 1; uint256 z = 3 * x * (x + 1) + 1; if (n / y >= z) { n -= y * z; x += 1; } } return x; }} function setFeeShare(uint256 _feeShareBP) external onlyOwner { require(_feeShareBP <= BP, "Pool: Too large"); feeShareBP = _feeShareBP; } fallback() external payable { revert("Unsupported"); } receive() external payable { revert("Unsupported"); } //temp method function setRouter(address _router) external onlyOwner { router = _router; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"router_","type":"address"},{"internalType":"uint256","name":"a_","type":"uint256"},{"internalType":"contract ERC20","name":"token_","type":"address"},{"internalType":"uint256","name":"feeShareBP_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"vUsdAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SwappedFromVUsd","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vUsdAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"SwappedToVUsd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"PP","outputs":[{"internalType":"int256","name":"","type":"int256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"a","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accRewardPerShareP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFeeShareBP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAdminFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"d","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeShareBP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"}],"name":"getY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_adminFeeShareBP","type":"uint256"}],"name":"setAdminFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_feeShareBP","type":"uint256"}],"name":"setFeeShare","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapFromVUsd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapToVUsd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalLpAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"lpAmount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vUsdBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountLp","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Deployed Bytecode
0x6080604052600436106101bb5760003560e01c80638a054ac2116100ec578063c0d786551161008a578063f2fde38b11610064578063f2fde38b146104f1578063f40f0f5214610511578063f887ea4014610531578063fc0c546a14610551576101fb565b8063c0d78655146104a6578063e99fee3e146104c6578063eeeac01e146104db576101fb565b80639e1a4d19116100c65780639e1a4d1914610430578063b3cba4a214610446578063b6b55f2514610466578063bed428bf14610486576101fb565b80638a054ac2146103d35780638da5cb5b146103e957806398d5fdca1461041b576101fb565b806352fb8b03116101595780637a23032c116101335780637a23032c146103675780637aba92481461037d5780637f6a92ed1461039d578063845a4697146103b3576101fb565b806352fb8b0314610326578063532d73971461033c578063715018a614610352576101fb565b80632d8fe99a116101955780632d8fe99a146102b95780632e1a7d4d146102db578063372500ab146102fb578063488cb84114610310576101fb565b80630dbe671f146102315780630ec330221461025a5780631959a00214610270576101fb565b366101fb5760405162461bcd60e51b815260206004820152600b60248201526a155b9cdd5c1c1bdc9d195960aa1b60448201526064015b60405180910390fd5b60405162461bcd60e51b815260206004820152600b60248201526a155b9cdd5c1c1bdc9d195960aa1b60448201526064016101f2565b34801561023d57600080fd5b5061024760075481565b6040519081526020015b60405180910390f35b34801561026657600080fd5b50610247600b5481565b34801561027c57600080fd5b506102a461028b366004611a0d565b6004602052600090815260409020805460019091015482565b60408051928352602083019190915201610251565b3480156102c557600080fd5b506102d96102d4366004611a28565b610571565b005b3480156102e757600080fd5b506102d96102f6366004611a28565b6105d0565b34801561030757600080fd5b506102d9610679565b34801561031c57600080fd5b5061024760055481565b34801561033257600080fd5b5061024760025481565b34801561034857600080fd5b5061024760015481565b34801561035e57600080fd5b506102d961071c565b34801561037357600080fd5b5061024760065481565b34801561038957600080fd5b50610247610398366004611a41565b610730565b3480156103a957600080fd5b5061024760085481565b3480156103bf57600080fd5b506102476103ce366004611a28565b61091d565b3480156103df57600080fd5b50610247600c5481565b3480156103f557600080fd5b506000546001600160a01b03165b6040516001600160a01b039091168152602001610251565b34801561042757600080fd5b506102476109ed565b34801561043c57600080fd5b50610247600a5481565b34801561045257600080fd5b506102d9610461366004611a28565b610b53565b34801561047257600080fd5b506102d9610481366004611a28565b610ba4565b34801561049257600080fd5b506102476104a1366004611a41565b610ce0565b3480156104b257600080fd5b506102d96104c1366004611a0d565b610ea0565b3480156104d257600080fd5b506102d9610eca565b3480156104e757600080fd5b5061024761271081565b3480156104fd57600080fd5b506102d961050c366004611a0d565b610efe565b34801561051d57600080fd5b5061024761052c366004611a0d565b610f74565b34801561053d57600080fd5b50600954610403906001600160a01b031681565b34801561055d57600080fd5b50600354610403906001600160a01b031681565b610579610fcd565b6127108111156105cb5760405162461bcd60e51b815260206004820152601760248201527f5265776172644d616e616765723a20746f6f206869676800000000000000000060448201526064016101f2565b600555565b6001546105dd3383611027565b60006106198284600a546105f19190611a81565b6105fb9190611ab6565b8385600b5461060a9190611a81565b6106149190611ab6565b6111a6565b905080600a600082825461062d9190611aca565b9250508190555080600b60008282546106469190611aca565b9091555061065490506112d9565b61067433610661836113b9565b6003546001600160a01b031691906113ea565b505050565b336000908152600460205260409020805415610719576000603460025483600001546106a59190611a81565b901c905060008260010154826106bb9190611aca565b9050801561067457600183018290556003546106e1906001600160a01b031633836113ea565b60405181815233907ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe9060200160405180910390a250505b50565b610724610fcd565b61072e600061144d565b565b6009546000906001600160a01b0316331461078d5760405162461bcd60e51b815260206004820152601a60248201527f506f6f6c3a2063616c6c6572206973206e6f7420726f7574657200000000000060448201526064016101f2565b60008083156108b657612710600854856107a79190611a81565b6107b19190611ab6565b905060006107c76107c28387611aca565b61149d565b90506107d2816113b9565b6107dc9086611aca565b915080600a60008282546107f09190611ae1565b9091555050600a5460405163845a469760e01b8152600091309163845a4697916108209160040190815260200190565b60206040518083038186803b15801561083857600080fd5b505afa15801561084c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108709190611af9565b905080600b54111561088d5780600b5461088a9190611aca565b93505b600b8190556003546108aa906001600160a01b03168830896114ca565b6108b383611508565b50505b600354604080516001600160a01b0380891682529092166020830152810185905260608101839052608081018290527fa930da1d3f27a25892307dd59cec52dd9b881661a0f20364757f83a0da2f68739060a0015b60405180910390a15090505b92915050565b600c5460075460009190600281901b9060031b838361093c8782611b12565b6109469085611b51565b6109509190611b12565b9050600061095e8280611b51565b6109689088611a81565b85806109748188611a81565b61097e9190611a81565b6109889190611a81565b6109929190611ae1565b61099c9088611a81565b90506109a88784611a81565b6109cd6109b5848a611b51565b6109be84611579565b6109c89190611bd6565b6115da565b6109d79190611ab6565b6109e2906001611ae1565b979650505050505050565b600a54600754600c546000929160031b908390610a0a8180611a81565b610a149190611a81565b600c54909150600090610a278582611b12565b600754610a37919060021b611b51565b610a419190611b12565b90506000610a4f8280611b51565b610a599086611a81565b600754610a6a90859060021b611a81565b610a749190611ae1565b610a7e9086611a81565b9050600085866001600c54901b610a959190611a81565b610a9f9190611a81565b8680610aab8189611a81565b610ab59190611a81565b610abf9190611a81565b8788600c546003600754901b610ad59190611a81565b610adf9190611a81565b610ae99190611a81565b610af39087611bd6565b610afd9190611b12565b610b079190611b12565b9050610b48610b1583611579565b610b2390600289901b611a81565b610b2f83612710611b51565b610b399190611c17565b6109c89061271060011d611bd6565b965050505050505090565b610b5b610fcd565b612710811115610b9f5760405162461bcd60e51b815260206004820152600f60248201526e506f6f6c3a20546f6f206c6172676560881b60448201526064016101f2565b600855565b600c546000610bb28361149d565b905060008111610bf75760405162461bcd60e51b815260206004820152601060248201526f506f6f6c3a20746f6f206c6974746c6560801b60448201526064016101f2565b80600a6000828254610c099190611ae1565b9250508190555080600b6000828254610c229190611ae1565b9091555050600a546501000000000011610c6f5760405162461bcd60e51b815260206004820152600e60248201526d0a0deded87440e8dede40daeac6d60931b60448201526064016101f2565b600354610c87906001600160a01b03163330866114ca565b610c8f6112d9565b6001541580610c9c575081155b15610cb157610674336001600c54901c61162c565b610674338384600c54610cc49190611aca565b600154610cd19190611a81565b610cdb9190611ab6565b61162c565b6009546000906001600160a01b03163314610d3d5760405162461bcd60e51b815260206004820152601a60248201527f506f6f6c3a2063616c6c6572206973206e6f7420726f7574657200000000000060448201526064016101f2565b6000808315610e475783600b6000828254610d589190611ae1565b9091555050600b5460405163845a469760e01b8152600091309163845a469791610d889160040190815260200190565b60206040518083038186803b158015610da057600080fd5b505afa158015610db4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd89190611af9565b905080600a541115610dfd57610dfa81600a54610df59190611aca565b6113b9565b92505b61271060085484610e0e9190611a81565b610e189190611ab6565b600a8290556003549381900393909250610e3c906001600160a01b031687856113ea565b610e4582611508565b505b600354604080516001600160a01b0380891682529092166020830152810185905260608101839052608081018290527ffc1df7b9ba72a13350b8a4e0f094e232eebded9edd179950e74a852a0f4051129060a00161090b565b610ea8610fcd565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b610ed2610fcd565b6006541561072e57600654600354610ef7916001600160a01b039091169033906113ea565b6000600655565b610f06610fcd565b6001600160a01b038116610f6b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016101f2565b6107198161144d565b6001600160a01b038116600090815260046020908152604080832081518083019092528054808352600190910154928201839052600254919291603491610fbb9190611a81565b610fc692911c611aca565b9392505050565b6000546001600160a01b0316331461072e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101f2565b6001600160a01b03821660009081526004602052604090208054828110156110915760405162461bcd60e51b815260206004820181905260248201527f5265776172644d616e616765723a206e6f7420656e6f75676820616d6f756e7460448201526064016101f2565b600081156110bc5782600101546034600254846110ae9190611a81565b6110b992911c611aca565b90505b83600160008282546110ce9190611aca565b909155506110de90508483611aca565b8084556002549092506034906110f49084611a81565b901c6001840155801561115c57600354611118906001600160a01b031686836113ea565b846001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe8260405161115391815260200190565b60405180910390a25b846001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243648560405161119791815260200190565b60405180910390a25050505050565b60008183111561124957600a5460405163845a469760e01b815283850360011c9182016004820152600090309063845a46979060240160206040518083038186803b1580156111f457600080fd5b505afa158015611208573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061122c9190611af9565b600b5403905061124082860382860161174d565b92505050610917565b600b5460405163845a469760e01b815284840360011c9182016004820152600090309063845a46979060240160206040518083038186803b15801561128d57600080fd5b505afa1580156112a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c59190611af9565b600a5403905061124082850382870161174d565b600a54600b5460006112eb8284611a81565b60075490915060006112fd8486611ae1565b6113078484611a81565b6113119190611a81565b9050600060036113266001600286901b611aca565b6113309086611a81565b61133a9190611ab6565b9050600061136f8261134c8180611a81565b6113569190611a81565b6113608580611a81565b61136a9190611ae1565b611579565b9050600061137e828501611763565b90508382111561139a57611393848303611763565b90036113a7565b6113a5828503611763565b015b600190811b01600c5550505050505050565b600d54600090156113d157600d546109179083611a81565b600e54156113e657600e546109179083611ab6565b5090565b6040516001600160a01b03831660248201526044810182905261067490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526117ae565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d54600090156114b557600d546109179083611ab6565b600e54156113e657600e546109179083611a81565b6040516001600160a01b03808516602483015283166044820152606481018290526115029085906323b872dd60e01b90608401611416565b50505050565b60015415610719576000612710600554836115239190611a81565b61152d9190611ab6565b90508082039150600154603483901b6115469190611ab6565b600260008282546115579190611ae1565b9250508190555080600660008282546115709190611ae1565b90915550505050565b600081156115d257600182811c81019060009082858161159b5761159b611aa0565b048301901c90505b808211156115cb5780915060018285816115bf576115bf611aa0565b048301901c90506115a3565b5092915050565b506000919050565b6000808212156113e65760405162461bcd60e51b815260206004820181905260248201527f53616665436173743a2076616c7565206d75737420626520706f73697469766560448201526064016101f2565b6001600160a01b0382166000908152600460205260408120805490919080156116725782600101546034600254836116649190611a81565b61166f92911c611aca565b91505b83600160008282546116849190611ae1565b9091555061169490508482611ae1565b8084556002549091506034906116aa9083611a81565b901c60018401558115611712576003546116ce906001600160a01b031686846113ea565b846001600160a01b03167ffc30cddea38e2bf4d6ea7d3f9ed3b6ad7f176419f4963bd81318067a4aee73fe8360405161170991815260200190565b60405180910390a25b846001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c8560405161119791815260200190565b600081831061175c5781610fc6565b5090919050565b600080600160ff1b5b80156115cb57600191821b918281018302600302018082868161179157611791611aa0565b04106117a557808202850394506001830192505b5060031c61176c565b6000611803826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166118809092919063ffffffff16565b80519091501561067457808060200190518101906118219190611c45565b6106745760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016101f2565b606061188f8484600085611897565b949350505050565b6060824710156118f85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016101f2565b6001600160a01b0385163b61194f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016101f2565b600080866001600160a01b0316858760405161196b9190611c93565b60006040518083038185875af1925050503d80600081146119a8576040519150601f19603f3d011682016040523d82523d6000602084013e6119ad565b606091505b50915091506109e2828286606083156119c7575081610fc6565b8251156119d75782518084602001fd5b8160405162461bcd60e51b81526004016101f29190611caf565b80356001600160a01b0381168114611a0857600080fd5b919050565b600060208284031215611a1f57600080fd5b610fc6826119f1565b600060208284031215611a3a57600080fd5b5035919050565b60008060408385031215611a5457600080fd5b611a5d836119f1565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611a9b57611a9b611a6b565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611ac557611ac5611aa0565b500490565b600082821015611adc57611adc611a6b565b500390565b60008219821115611af457611af4611a6b565b500190565b600060208284031215611b0b57600080fd5b5051919050565b60008083128015600160ff1b850184121615611b3057611b30611a6b565b6001600160ff1b0384018313811615611b4b57611b4b611a6b565b50500390565b60006001600160ff1b0381841382841380821686840486111615611b7757611b77611a6b565b600160ff1b6000871282811687830589121615611b9657611b96611a6b565b60008712925087820587128484161615611bb257611bb2611a6b565b87850587128184161615611bc857611bc8611a6b565b505050929093029392505050565b600080821280156001600160ff1b0384900385131615611bf857611bf8611a6b565b600160ff1b8390038412811615611c1157611c11611a6b565b50500190565b600082611c2657611c26611aa0565b600160ff1b821460001984141615611c4057611c40611a6b565b500590565b600060208284031215611c5757600080fd5b81518015158114610fc657600080fd5b60005b83811015611c82578181015183820152602001611c6a565b838111156115025750506000910152565b60008251611ca5818460208701611c67565b9190910192915050565b6020815260008251806020840152611cce816040850160208701611c67565b601f01601f1916919091016040019291505056fea264697066735822122078817afafcd4178bd0e7faa2b099ce691a9fb3a785210f3f0979613d2a447c7664736f6c63430008090033
Deployed Bytecode Sourcemap
84357:10087:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;94295:21;;-1:-1:-1;;;94295:21:0;;216:2:1;94295:21:0;;;198::1;255:2;235:18;;;228:30;-1:-1:-1;;;274:18:1;;;267:41;325:18;;94295:21:0;;;;;;;;84357:10087;94220:21;;-1:-1:-1;;;94220:21:0;;216:2:1;94220:21:0;;;198::1;255:2;235:18;;;228:30;-1:-1:-1;;;274:18:1;;;267:41;325:18;;94220:21:0;14:335:1;84427:16:0;;;;;;;;;;;;;;;;;;;500:25:1;;;488:2;473:18;84427:16:0;;;;;;;;84750:26;;;;;;;;;;;;;;;;80338:44;;;;;;;;;;-1:-1:-1;80338:44:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;1079:25:1;;;1135:2;1120:18;;1113:34;;;;1052:18;80338:44:0;905:248:1;80856:193:0;;;;;;;;;;-1:-1:-1;80856:193:0;;;;;:::i;:::-;;:::i;:::-;;87358:782;;;;;;;;;;-1:-1:-1;87358:782:0;;;;;:::i;:::-;;:::i;83759:481::-;;;;;;;;;;;;;:::i;80423:30::-;;;;;;;;;;;;;;;;80194:33;;;;;;;;;;;;;;;;80097:28;;;;;;;;;;;;;;;;78899:103;;;;;;;;;;;;;:::i;80495:29::-;;;;;;;;;;;;;;;;89197:879;;;;;;;;;;-1:-1:-1;89197:879:0;;;;;:::i;:::-;;:::i;84654:25::-;;;;;;;;;;;;;;;;91143:562;;;;;;;;;;-1:-1:-1;91143:562:0;;;;;:::i;:::-;;:::i;84783:16::-;;;;;;;;;;;;;;;;78251:87;;;;;;;;;;-1:-1:-1;78297:7:0;78324:6;-1:-1:-1;;;;;78324:6:0;78251:87;;;-1:-1:-1;;;;;1766:32:1;;;1748:51;;1736:2;1721:18;78251:87:0;1602:203:1;91821:674:0;;;;;;;;;;;;;:::i;84716:27::-;;;;;;;;;;;;;;;;94013:160;;;;;;;;;;-1:-1:-1;94013:160:0;;;;;:::i;:::-;;:::i;86434:792::-;;;;;;;;;;-1:-1:-1;86434:792:0;;;;;:::i;:::-;;:::i;90206:852::-;;;;;;;;;;-1:-1:-1;90206:852:0;;;;;:::i;:::-;;:::i;94351:90::-;;;;;;;;;;-1:-1:-1;94351:90:0;;;;;:::i;:::-;;:::i;81555:192::-;;;;;;;;;;;;;:::i;84450:31::-;;;;;;;;;;;;84478:3;84450:31;;79157:201;;;;;;;;;;-1:-1:-1;79157:201:0;;;;;:::i;:::-;;:::i;81803:211::-;;;;;;;;;;-1:-1:-1;81803:211:0;;;;;:::i;:::-;;:::i;84688:21::-;;;;;;;;;;-1:-1:-1;84688:21:0;;;;-1:-1:-1;;;;;84688:21:0;;;80257:18;;;;;;;;;;-1:-1:-1;80257:18:0;;;;-1:-1:-1;;;;;80257:18:0;;;80856:193;78137:13;:11;:13::i;:::-;79857:3:::1;80946:16;:22;;80938:58;;;::::0;-1:-1:-1;;;80938:58:0;;2413:2:1;80938:58:0::1;::::0;::::1;2395:21:1::0;2452:2;2432:18;;;2425:30;2491:25;2471:18;;;2464:53;2534:18;;80938:58:0::1;2211:347:1::0;80938:58:0::1;81007:15;:34:::0;80856:193::o;87358:782::-;87439:13;;87485:33;87497:10;87509:8;87485:11;:33::i;:::-;87675:16;87694:137;87751:14;87740:8;87725:12;;:23;;;;:::i;:::-;:40;;;;:::i;:::-;87806:14;87795:8;87781:11;;:22;;;;:::i;:::-;:39;;;;:::i;:::-;87694:16;:137::i;:::-;87675:156;;87932:8;87916:12;;:24;;;;;;;:::i;:::-;;;;;;;;87966:8;87951:11;;:23;;;;;;;:::i;:::-;;;;-1:-1:-1;88050:10:0;;-1:-1:-1;88050:8:0;:10::i;:::-;88071:61;88090:10;88102:29;88122:8;88102:19;:29::i;:::-;88071:5;;-1:-1:-1;;;;;88071:5:0;;:61;:18;:61::i;:::-;87403:737;;87358:782;:::o;83759:481::-;83836:10;83803:21;83827:20;;;:8;:20;;;;;83862:13;;:17;83858:375;;83896:15;79818:2;83931:18;;83915:4;:13;;;:34;;;;:::i;:::-;83914:41;;83896:59;;83970:15;83998:4;:15;;;83988:7;:25;;;;:::i;:::-;83970:43;-1:-1:-1;84032:11:0;;84028:194;;84064:15;;;:25;;;84108:5;;:39;;-1:-1:-1;;;;;84108:5:0;84127:10;84139:7;84108:18;:39::i;:::-;84171:35;;500:25:1;;;84186:10:0;;84171:35;;488:2:1;473:18;84171:35:0;;;;;;;83881:352;;83858:375;83792:448;83759:481::o;78899:103::-;78137:13;:11;:13::i;:::-;78964:30:::1;78991:1;78964:18;:30::i;:::-;78899:103::o:0;89197:879::-;85611:6;;89276:7;;-1:-1:-1;;;;;85611:6:0;85621:10;85611:20;85603:59;;;;-1:-1:-1;;;85603:59:0;;3457:2:1;85603:59:0;;;3439:21:1;3496:2;3476:18;;;3469:30;3535:28;3515:18;;;3508:56;3581:18;;85603:59:0;3255:350:1;85603:59:0;89296:14:::1;::::0;89363:10;;89359:612:::1;;84537:5;89405:10;;89396:6;:19;;;;:::i;:::-;:24;;;;:::i;:::-;89390:30:::0;-1:-1:-1;89435:16:0::1;89454:31;89472:12;89390:30:::0;89472:6;:12:::1;:::i;:::-;89454:17;:31::i;:::-;89435:50;;89570:29;89590:8;89570:19;:29::i;:::-;89561:38;::::0;:6;:38:::1;:::i;:::-;89555:44;;89632:8;89616:12;;:24;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;89689:12:0::1;::::0;89679:23:::1;::::0;-1:-1:-1;;;89679:23:0;;89655:21:::1;::::0;89679:4:::1;::::0;:9:::1;::::0;:23:::1;::::0;::::1;;500:25:1::0;;;488:2;473:18;;354:177;89679:23:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;89655:47;;89735:13;89721:11;;:27;89717:104;;;89792:13;89778:11;;:27;;;;:::i;:::-;89769:36;;89717:104;89835:11;:27:::0;;;89877:5:::1;::::0;:51:::1;::::0;-1:-1:-1;;;;;89877:5:0::1;89900:4:::0;89914::::1;89921:6:::0;89877:22:::1;:51::i;:::-;89943:16;89955:3;89943:11;:16::i;:::-;89375:596;;89359:612;90016:5;::::0;89988:56:::1;::::0;;-1:-1:-1;;;;;4247:15:1;;;4229:34;;90016:5:0;;::::1;4294:2:1::0;4279:18;;4272:43;4331:18;;4324:34;;;4389:2;4374:18;;4367:34;;;4432:3;4417:19;;4410:35;;;89988:56:0::1;::::0;4178:3:1;4163:19;89988:56:0::1;;;;;;;;-1:-1:-1::0;90062:6:0;-1:-1:-1;85673:1:0::1;89197:879:::0;;;;:::o;91143:562::-;91224:1;;91270;;91191:7;;91224:1;91275;91270:6;;;;91301:8;;91191:7;91224:1;91376:22;91396:1;91224;91376:22;:::i;:::-;91361:38;;91368:3;91361:38;:::i;:::-;:51;;;;:::i;:::-;91346:66;-1:-1:-1;91460:13:0;91514;91346:66;;91514:13;:::i;:::-;91502:26;;:1;:26;:::i;:::-;91497:2;;91481:8;91497:2;91481:3;:8;:::i;:::-;:13;;;;:::i;:::-;:18;;;;:::i;:::-;:47;;;;:::i;:::-;91476:53;;:1;:53;:::i;:::-;91460:69;-1:-1:-1;91654:7:0;91660:1;91654:3;:7;:::i;:::-;91591:59;91632:17;91644:5;91639:1;91632:17;:::i;:::-;91617:11;91622:5;91617:4;:11::i;:::-;91610:39;;;;:::i;:::-;91591:18;:59::i;:::-;:71;;;;:::i;:::-;:75;;91665:1;91591:75;:::i;:::-;91584:82;91143:562;-1:-1:-1;;;;;;;91143:562:0:o;91821:674::-;91896:12;;91933:1;;91976;;91864:7;;91896:12;91938:1;91933:6;;91864:7;;91968:5;91976:1;;91968:5;:::i;:::-;:9;;;;:::i;:::-;92078:1;;91950:27;;-1:-1:-1;92016:9:0;;92046:21;92065:1;92078;92046:21;:::i;:::-;92035:1;;92028:40;;;92040:1;92035:6;92028:40;:::i;:::-;:52;;;;:::i;:::-;92016:64;-1:-1:-1;92123:10:0;92174:7;92016:64;;92174:7;:::i;:::-;92162:20;;:1;:20;:::i;:::-;92142:1;;92141:18;;92152:7;;92147:1;92142:6;92141:18;:::i;:::-;:41;;;;:::i;:::-;92136:47;;:1;:47;:::i;:::-;92123:60;;92235:9;92357:1;92353;92348;92343;;:6;;92342:12;;;;:::i;:::-;:16;;;;:::i;:::-;92330:1;;92316:7;92330:1;92316:3;:7;:::i;:::-;:11;;;;:::i;:::-;:15;;;;:::i;:::-;92291:1;92287;92283;;92278;92273;;:6;;92272:12;;;;:::i;:::-;:16;;;;:::i;:::-;:20;;;;:::i;:::-;92247:46;;92254:7;92247:46;:::i;:::-;:85;;;;:::i;:::-;:112;;;;:::i;:::-;92235:124;;92416:71;92476:8;92481:2;92476:4;:8::i;:::-;92465:19;;92471:1;92466:6;;;92465:19;:::i;:::-;92448:7;92453:2;84478:3;92448:7;:::i;:::-;:37;;;;:::i;:::-;92435:51;;84478:3;92442:1;92436:7;92435:51;:::i;92416:71::-;92409:78;;;;;;;;91821:674;:::o;94013:160::-;78137:13;:11;:13::i;:::-;84537:5:::1;94093:11;:17;;94085:45;;;::::0;-1:-1:-1;;;94085:45:0;;5956:2:1;94085:45:0::1;::::0;::::1;5938:21:1::0;5995:2;5975:18;;;5968:30;-1:-1:-1;;;6014:18:1;;;6007:45;6069:18;;94085:45:0::1;5754:339:1::0;94085:45:0::1;94141:10;:24:::0;94013:160::o;86434:792::-;86502:1;;86487:12;86535:25;86553:6;86535:17;:25::i;:::-;86516:44;;86590:1;86579:8;:12;86571:41;;;;-1:-1:-1;;;86571:41:0;;6300:2:1;86571:41:0;;;6282:21:1;6339:2;6319:18;;;6312:30;-1:-1:-1;;;6358:18:1;;;6351:46;6414:18;;86571:41:0;6098:340:1;86571:41:0;86639:8;86623:12;;:24;;;;;;;:::i;:::-;;;;;;;;86673:8;86658:11;;:23;;;;;;;:::i;:::-;;;;-1:-1:-1;;86700:12:0;;84610:7;-1:-1:-1;86692:59:0;;;;-1:-1:-1;;;86692:59:0;;6645:2:1;86692:59:0;;;6627:21:1;6684:2;6664:18;;;6657:30;-1:-1:-1;;;6703:18:1;;;6696:44;6757:18;;86692:59:0;6443:338:1;86692:59:0;86764:5;;:57;;-1:-1:-1;;;;;86764:5:0;86787:10;86807:4;86814:6;86764:22;:57::i;:::-;86834:10;:8;:10::i;:::-;86861:13;;:18;;:31;;-1:-1:-1;86883:9:0;;86861:31;86857:362;;;86941:30;86952:10;86969:1;86964;;:6;;86941:10;:30::i;86857:362::-;87150:57;87161:10;87202:4;87194;87190:1;;:8;;;;:::i;:::-;87173:13;;:26;;;;:::i;:::-;:33;;;;:::i;:::-;87150:10;:57::i;90206:852::-;85611:6;;90287:7;;-1:-1:-1;;;;;85611:6:0;85621:10;85611:20;85603:59;;;;-1:-1:-1;;;85603:59:0;;3457:2:1;85603:59:0;;;3439:21:1;3496:2;3476:18;;;3469:30;3535:28;3515:18;;;3508:56;3581:18;;85603:59:0;3255:350:1;85603:59:0;90307:14:::1;::::0;90374:10;;90370:583:::1;;90416:6;90401:11;;:21;;;;;;;:::i;:::-;::::0;;;-1:-1:-1;;90467:11:0::1;::::0;90457:22:::1;::::0;-1:-1:-1;;;90457:22:0;;90437:17:::1;::::0;90457:4:::1;::::0;:9:::1;::::0;:22:::1;::::0;::::1;;500:25:1::0;;;488:2;473:18;;354:177;90457:22:0::1;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;90437:42;;90513:9;90498:12;;:24;90494:119;;;90552:45;90587:9;90572:12;;:24;;;;:::i;:::-;90552:19;:45::i;:::-;90543:54;;90494:119;84537:5;90670:10;;90661:6;:19;;;;:::i;:::-;:24;;;;:::i;:::-;90839:12;:24:::0;;;90878:5:::1;::::0;90796:13;;;::::1;::::0;90655:30;;-1:-1:-1;90878:32:0::1;::::0;-1:-1:-1;;;;;90878:5:0::1;90897:4:::0;90796:13;90878:18:::1;:32::i;:::-;90925:16;90937:3;90925:11;:16::i;:::-;90386:567;90370:583;90998:5;::::0;90968:58:::1;::::0;;-1:-1:-1;;;;;4247:15:1;;;4229:34;;90998:5:0;;::::1;4294:2:1::0;4279:18;;4272:43;4331:18;;4324:34;;;4389:2;4374:18;;4367:34;;;4432:3;4417:19;;4410:35;;;90968:58:0::1;::::0;4178:3:1;4163:19;90968:58:0::1;3932:519:1::0;94351:90:0;78137:13;:11;:13::i;:::-;94417:6:::1;:16:::0;;-1:-1:-1;;;;;;94417:16:0::1;-1:-1:-1::0;;;;;94417:16:0;;;::::1;::::0;;;::::1;::::0;;94351:90::o;81555:192::-;78137:13;:11;:13::i;:::-;81614:14:::1;::::0;:18;81610:130:::1;;81680:14;::::0;81649:5:::1;::::0;:46:::1;::::0;-1:-1:-1;;;;;81649:5:0;;::::1;::::0;81668:10:::1;::::0;81649:18:::1;:46::i;:::-;81727:1;81710:14;:18:::0;81555:192::o;79157:201::-;78137:13;:11;:13::i;:::-;-1:-1:-1;;;;;79246:22:0;::::1;79238:73;;;::::0;-1:-1:-1;;;79238:73:0;;6988:2:1;79238:73:0::1;::::0;::::1;6970:21:1::0;7027:2;7007:18;;;7000:30;7066:34;7046:18;;;7039:62;-1:-1:-1;;;7117:18:1;;;7110:36;7163:19;;79238:73:0::1;6786:402:1::0;79238:73:0::1;79322:28;79341:8;79322:18;:28::i;81803:211::-:0;-1:-1:-1;;;;;81912:15:0;;81864:7;81912:15;;;:8;:15;;;;;;;;81889:38;;;;;;;;;;;;;;;;;;;;;;;;81963:18;;81889:38;;;79818:2;;81947:34;;81963:18;81947:34;:::i;:::-;81945:61;;;81946:41;81945:61;:::i;:::-;81938:68;81803:211;-1:-1:-1;;;81803:211:0:o;78416:132::-;78297:7;78324:6;-1:-1:-1;;;;;78324:6:0;3941:10;78480:23;78472:68;;;;-1:-1:-1;;;78472:68:0;;7395:2:1;78472:68:0;;;7377:21:1;;;7414:18;;;7407:30;7473:34;7453:18;;;7446:62;7525:18;;78472:68:0;7193:356:1;82902:787:0;-1:-1:-1;;;;;82999:14:0;;82975:21;82999:14;;;:8;:14;;;;;83048:13;;83100:25;;;;83092:70;;;;-1:-1:-1;;;83092:70:0;;7756:2:1;83092:70:0;;;7738:21:1;;;7775:18;;;7768:30;7834:34;7814:18;;;7807:62;7886:18;;83092:70:0;7554:356:1;83092:70:0;83173:15;83203:17;;83199:121;;83293:4;:15;;;79818:2;83265:18;;83249:13;:34;;;;:::i;:::-;83247:61;;;83248:41;83247:61;:::i;:::-;83237:71;;83199:121;83347:8;83330:13;;:25;;;;;;;:::i;:::-;;;;-1:-1:-1;83366:25:0;;-1:-1:-1;83383:8:0;83366:25;;:::i;:::-;83402:29;;;83477:18;;83366:25;;-1:-1:-1;79818:2:0;;83461:34;;83366:25;83461:34;:::i;:::-;83460:41;;83442:15;;;:59;83516:11;;83512:130;;83544:5;;:33;;-1:-1:-1;;;;;83544:5:0;83563:4;83569:7;83544:18;:33::i;:::-;83612:4;-1:-1:-1;;;;;83597:29:0;;83618:7;83597:29;;;;500:25:1;;488:2;473:18;;354:177;83597:29:0;;;;;;;;83512:130;83666:4;-1:-1:-1;;;;;83657:24:0;;83672:8;83657:24;;;;500:25:1;;488:2;473:18;;354:177;83657:24:0;;;;;;;;82964:725;;;82902:787;;:::o;88293:755::-;88383:7;88433:10;88419:11;:24;88415:625;;;88603:12;;88593:36;;-1:-1:-1;;;88593:36:0;;88482:24;;;88511:1;88481:31;88603:25;;;88593:36;;;500:25:1;88460:18:0;;88593:4;;:9;;473:18:1;;88593:36:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;88579:11;;:50;88559:70;;88670:58;88693:10;88679:11;:24;88718:9;88705:10;:22;88670:8;:58::i;:::-;88663:65;;;;;;88415:625;88905:11;;88895:34;;-1:-1:-1;;;88895:34:0;;88782:24;;;88811:1;88781:31;88905:23;;;88895:34;;;500:25:1;88761:17:0;;88895:4;;:9;;473:18:1;;88895:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;88880:12;;:49;88859:70;;88970:58;88992:9;88979:10;:22;89017:10;89003:11;:24;88970:8;:58::i;92503:792::-;92554:12;;92589:11;;92542:9;92762:5;92589:11;92554:12;92762:5;:::i;:::-;92791:1;;92749:18;;-1:-1:-1;92778:10:0;92848:5;92852:1;92848;:5;:::i;:::-;92837:7;92842:2;92837;:7;:::i;:::-;:17;;;;:::i;:::-;92824:30;-1:-1:-1;92892:10:0;92928:1;92911:13;92923:1;92918;92912:7;;;92911:13;:::i;:::-;92905:20;;:2;:20;:::i;:::-;:24;;;;:::i;:::-;92892:37;-1:-1:-1;92964:10:0;92977:32;92892:37;92995:7;92892:37;;92995:7;:::i;:::-;:12;;;;:::i;:::-;92983:7;92988:2;;92983:7;:::i;:::-;92982:26;;;;:::i;:::-;92977:4;:32::i;:::-;92964:45;;93045:10;93058:13;93068:2;93063;:7;93058:4;:13::i;:::-;93045:26;;93095:2;93090;:7;93086:127;;;93124:13;93134:2;93129;:7;93124:4;:13::i;:::-;93118:19;;93086:127;;;93184:13;93194:2;93189;:7;93184:4;:13::i;:::-;93178:19;93086:127;93238:1;93232:7;;;93231:13;93227:1;:17;-1:-1:-1;;;;;;;92503:792:0:o;85999:303::-;86091:17;;86067:7;;86091:21;86087:184;;86145:17;;86136:26;;:6;:26;:::i;86087:184::-;86184:19;;:23;86180:91;;86240:19;;86231:28;;:6;:28;:::i;86180:91::-;-1:-1:-1;86288:6:0;85999:303::o;27934:211::-;28078:58;;-1:-1:-1;;;;;8107:32:1;;28078:58:0;;;8089:51:1;8156:18;;;8149:34;;;28051:86:0;;28071:5;;-1:-1:-1;;;28101:23:0;8062:18:1;;28078:58:0;;;;-1:-1:-1;;28078:58:0;;;;;;;;;;;;;;-1:-1:-1;;;;;28078:58:0;-1:-1:-1;;;;;;28078:58:0;;;;;;;;;;28051:19;:86::i;79518:191::-;79592:16;79611:6;;-1:-1:-1;;;;;79628:17:0;;;-1:-1:-1;;;;;;79628:17:0;;;;;;79661:40;;79611:6;;;;;;;79661:40;;79592:16;79661:40;79581:128;79518:191;:::o;85690:301::-;85780:17;;85756:7;;85780:21;85776:184;;85834:17;;85825:26;;:6;:26;:::i;85776:184::-;85873:19;;:23;85869:91;;85929:19;;85920:28;;:6;:28;:::i;28153:248::-;28324:68;;-1:-1:-1;;;;;8452:15:1;;;28324:68:0;;;8434:34:1;8504:15;;8484:18;;;8477:43;8536:18;;;8529:34;;;28297:96:0;;28317:5;;-1:-1:-1;;;28347:27:0;8369:18:1;;28324:68:0;8194:375:1;28297:96:0;28153:248;;;;:::o;81152:395::-;81220:13;;:17;81216:324;;81254:23;79857:3;81296:15;;81280:13;:31;;;;:::i;:::-;:36;;;;:::i;:::-;81254:62;;81377:15;81360:32;;;;81467:13;;79818:2;81445:13;:18;;81444:36;;;;:::i;:::-;81422:18;;:58;;;;;;;:::i;:::-;;;;;;;;81513:15;81495:14;;:33;;;;;;;:::i;:::-;;;;-1:-1:-1;;;81152:395:0;:::o;93303:341::-;93351:7;93386:5;;93382:235;;93426:1;93421:6;;;93420:12;;;93408:9;;93420:12;93421:1;93420:12;93464:5;;;;:::i;:::-;;93460:1;:9;93459:16;;93447:28;;93490:93;93501:1;93497;:5;93490:93;;;93527:1;93523:5;;93566:1;93560;93556;:5;;;;;:::i;:::-;;93552:1;:9;93551:16;;93547:20;;93490:93;;;-1:-1:-1;93604:1:0;93303:341;-1:-1:-1;;93303:341:0:o;93382:235::-;-1:-1:-1;93634:1:0;;93303:341;-1:-1:-1;93303:341:0:o;58168:171::-;58224:7;58261:1;58252:5;:10;;58244:55;;;;-1:-1:-1;;;58244:55:0;;8776:2:1;58244:55:0;;;8758:21:1;;;8795:18;;;8788:30;8854:34;8834:18;;;8827:62;8906:18;;58244:55:0;8574:356:1;82112:690:0;-1:-1:-1;;;;;82206:12:0;;82182:21;82206:12;;;:8;:12;;;;;82279:13;;82206:12;;82182:21;82327:17;;82323:121;;82417:4;:15;;;79818:2;82389:18;;82373:13;:34;;;;:::i;:::-;82371:61;;;82372:41;82371:61;:::i;:::-;82361:71;;82323:121;82471:8;82454:13;;:25;;;;;;;:::i;:::-;;;;-1:-1:-1;82490:25:0;;-1:-1:-1;82507:8:0;82490:25;;:::i;:::-;82526:29;;;82601:18;;82490:25;;-1:-1:-1;79818:2:0;;82585:34;;82490:25;82585:34;:::i;:::-;82584:41;;82566:15;;;:59;82640:11;;82636:122;;82668:5;;:31;;-1:-1:-1;;;;;82668:5:0;82687:2;82691:7;82668:18;:31::i;:::-;82734:2;-1:-1:-1;;;;;82719:27:0;;82738:7;82719:27;;;;500:25:1;;488:2;473:18;;354:177;82719:27:0;;;;;;;;82636:122;82781:2;-1:-1:-1;;;;;82773:21:0;;82785:8;82773:21;;;;500:25:1;;488:2;473:18;;354:177;32205:106:0;32263:7;32294:1;32290;:5;:13;;32302:1;32290:13;;;-1:-1:-1;32298:1:0;;32283:20;-1:-1:-1;32205:106:0:o;93652:353::-;93700:7;;-1:-1:-1;;;93755:223:0;93782:5;;93755:223;;93819:1;93813:7;;;;93856:5;;;93847:15;;:1;:15;:19;;93889:1;93885;93889;93885:5;;;;:::i;:::-;;:10;93881:86;;93925:1;93921;:5;93916:10;;;;93950:1;93945:6;;;;93881:86;-1:-1:-1;93795:1:0;93789:7;93755:223;;31001:716;31425:23;31451:69;31479:4;31451:69;;;;;;;;;;;;;;;;;31459:5;-1:-1:-1;;;;;31451:27:0;;;:69;;;;;:::i;:::-;31535:17;;31425:95;;-1:-1:-1;31535:21:0;31531:179;;31632:10;31621:30;;;;;;;;;;;;:::i;:::-;31613:85;;;;-1:-1:-1;;;31613:85:0;;9419:2:1;31613:85:0;;;9401:21:1;9458:2;9438:18;;;9431:30;9497:34;9477:18;;;9470:62;-1:-1:-1;;;9548:18:1;;;9541:40;9598:19;;31613:85:0;9217:406:1;22833:229:0;22970:12;23002:52;23024:6;23032:4;23038:1;23041:12;23002:21;:52::i;:::-;22995:59;22833:229;-1:-1:-1;;;;22833:229:0:o;23953:510::-;24123:12;24181:5;24156:21;:30;;24148:81;;;;-1:-1:-1;;;24148:81:0;;9830:2:1;24148:81:0;;;9812:21:1;9869:2;9849:18;;;9842:30;9908:34;9888:18;;;9881:62;-1:-1:-1;;;9959:18:1;;;9952:36;10005:19;;24148:81:0;9628:402:1;24148:81:0;-1:-1:-1;;;;;20383:19:0;;;24240:60;;;;-1:-1:-1;;;24240:60:0;;10237:2:1;24240:60:0;;;10219:21:1;10276:2;10256:18;;;10249:30;10315:31;10295:18;;;10288:59;10364:18;;24240:60:0;10035:353:1;24240:60:0;24314:12;24328:23;24355:6;-1:-1:-1;;;;;24355:11:0;24374:5;24381:4;24355:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;24313:73;;;;24404:51;24421:7;24430:10;24442:12;26789;26818:7;26814:580;;;-1:-1:-1;26849:10:0;26842:17;;26814:580;26963:17;;:21;26959:424;;27211:10;27205:17;27272:15;27259:10;27255:2;27251:19;27244:44;26959:424;27354:12;27347:20;;-1:-1:-1;;;27347:20:0;;;;;;;;:::i;536:173:1:-;604:20;;-1:-1:-1;;;;;653:31:1;;643:42;;633:70;;699:1;696;689:12;633:70;536:173;;;:::o;714:186::-;773:6;826:2;814:9;805:7;801:23;797:32;794:52;;;842:1;839;832:12;794:52;865:29;884:9;865:29;:::i;1158:180::-;1217:6;1270:2;1258:9;1249:7;1245:23;1241:32;1238:52;;;1286:1;1283;1276:12;1238:52;-1:-1:-1;1309:23:1;;1158:180;-1:-1:-1;1158:180:1:o;1343:254::-;1411:6;1419;1472:2;1460:9;1451:7;1447:23;1443:32;1440:52;;;1488:1;1485;1478:12;1440:52;1511:29;1530:9;1511:29;:::i;:::-;1501:39;1587:2;1572:18;;;;1559:32;;-1:-1:-1;;;1343:254:1:o;2563:127::-;2624:10;2619:3;2615:20;2612:1;2605:31;2655:4;2652:1;2645:15;2679:4;2676:1;2669:15;2695:168;2735:7;2801:1;2797;2793:6;2789:14;2786:1;2783:21;2778:1;2771:9;2764:17;2760:45;2757:71;;;2808:18;;:::i;:::-;-1:-1:-1;2848:9:1;;2695:168::o;2868:127::-;2929:10;2924:3;2920:20;2917:1;2910:31;2960:4;2957:1;2950:15;2984:4;2981:1;2974:15;3000:120;3040:1;3066;3056:35;;3071:18;;:::i;:::-;-1:-1:-1;3105:9:1;;3000:120::o;3125:125::-;3165:4;3193:1;3190;3187:8;3184:34;;;3198:18;;:::i;:::-;-1:-1:-1;3235:9:1;;3125:125::o;3610:128::-;3650:3;3681:1;3677:6;3674:1;3671:13;3668:39;;;3687:18;;:::i;:::-;-1:-1:-1;3723:9:1;;3610:128::o;3743:184::-;3813:6;3866:2;3854:9;3845:7;3841:23;3837:32;3834:52;;;3882:1;3879;3872:12;3834:52;-1:-1:-1;3905:16:1;;3743:184;-1:-1:-1;3743:184:1:o;4456:267::-;4495:4;4524:9;;;4549:10;;-1:-1:-1;;;4568:19:1;;4561:27;;4545:44;4542:70;;;4592:18;;:::i;:::-;-1:-1:-1;;;;;4639:27:1;;4632:35;;4624:44;;4621:70;;;4671:18;;:::i;:::-;-1:-1:-1;;4708:9:1;;4456:267::o;4728:553::-;4767:7;-1:-1:-1;;;;;4837:9:1;;;4865;;;4890:11;;;4909:10;;;4903:17;;4886:35;4883:61;;;4924:18;;:::i;:::-;-1:-1:-1;;;5000:1:1;4993:9;;5018:11;;;5038;;;5031:19;;5014:37;5011:63;;;5054:18;;:::i;:::-;5100:1;5097;5093:9;5083:19;;5147:1;5143:2;5138:11;5135:1;5131:19;5126:2;5122;5118:11;5114:37;5111:63;;;5154:18;;:::i;:::-;5219:1;5215:2;5210:11;5207:1;5203:19;5198:2;5194;5190:11;5186:37;5183:63;;;5226:18;;:::i;:::-;-1:-1:-1;;;5266:9:1;;;;;4728:553;-1:-1:-1;;;4728:553:1:o;5286:265::-;5325:3;5353:9;;;5378:10;;-1:-1:-1;;;;;5397:27:1;;;5390:35;;5374:52;5371:78;;;5429:18;;:::i;:::-;-1:-1:-1;;;5476:19:1;;;5469:27;;5461:36;;5458:62;;;5500:18;;:::i;:::-;-1:-1:-1;;5536:9:1;;5286:265::o;5556:193::-;5595:1;5621;5611:35;;5626:18;;:::i;:::-;-1:-1:-1;;;5662:18:1;;-1:-1:-1;;5682:13:1;;5658:38;5655:64;;;5699:18;;:::i;:::-;-1:-1:-1;5733:10:1;;5556:193::o;8935:277::-;9002:6;9055:2;9043:9;9034:7;9030:23;9026:32;9023:52;;;9071:1;9068;9061:12;9023:52;9103:9;9097:16;9156:5;9149:13;9142:21;9135:5;9132:32;9122:60;;9178:1;9175;9168:12;10393:258;10465:1;10475:113;10489:6;10486:1;10483:13;10475:113;;;10565:11;;;10559:18;10546:11;;;10539:39;10511:2;10504:10;10475:113;;;10606:6;10603:1;10600:13;10597:48;;;-1:-1:-1;;10641:1:1;10623:16;;10616:27;10393:258::o;10656:274::-;10785:3;10823:6;10817:13;10839:53;10885:6;10880:3;10873:4;10865:6;10861:17;10839:53;:::i;:::-;10908:16;;;;;10656:274;-1:-1:-1;;10656:274:1:o;10935:383::-;11084:2;11073:9;11066:21;11047:4;11116:6;11110:13;11159:6;11154:2;11143:9;11139:18;11132:34;11175:66;11234:6;11229:2;11218:9;11214:18;11209:2;11201:6;11197:15;11175:66;:::i;:::-;11302:2;11281:15;-1:-1:-1;;11277:29:1;11262:45;;;;11309:2;11258:54;;10935:383;-1:-1:-1;;10935:383:1:o
Swarm Source
ipfs://78817afafcd4178bd0e7faa2b099ce691a9fb3a785210f3f0979613d2a447c76
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.999883 | 1,005.9125 | $1,005.79 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.