Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
UsycRedemption
Compiler Version
v0.8.18+commit.87f61d96
Contract Source Code (Solidity)
/**
*Submitted for verification at Etherscan.io on 2025-10-28
*/
// File: node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
// File: node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20PermitUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20PermitUpgradeable {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// File: node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
// File: node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
/**
* @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 SafeERC20Upgradeable {
using AddressUpgradeable for address;
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20Upgradeable token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20Upgradeable 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(IERC20Upgradeable token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20Upgradeable token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20Upgradeable token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.
* Revert on invalid signature.
*/
function safePermit(
IERC20PermitUpgradeable 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(IERC20Upgradeable token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20Upgradeable token, bytes memory data) private returns (bool) {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && AddressUpgradeable.isContract(address(token));
}
}
// File: node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}
// File: node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
// File: node_modules/@openzeppelin/contracts-upgradeable/interfaces/draft-IERC1822Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}
// File: node_modules/@openzeppelin/contracts-upgradeable/proxy/beacon/IBeaconUpgradeable.sol
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}
// File: node_modules/@openzeppelin/contracts-upgradeable/interfaces/IERC1967Upgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.
*
* _Available since v4.8.3._
*/
interface IERC1967Upgradeable {
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Emitted when the beacon is changed.
*/
event BeaconUpgraded(address indexed beacon);
}
// File: node_modules/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
* _Available since v4.9 for `string`, `bytes`._
*/
library StorageSlotUpgradeable {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}
// File: node_modules/@openzeppelin/contracts-upgradeable/proxy/ERC1967/ERC1967UpgradeUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*/
abstract contract ERC1967UpgradeUpgradeable is Initializable, IERC1967Upgradeable {
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
AddressUpgradeable.functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
AddressUpgradeable.functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate the implementation's compatibility when performing an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeTo(address newImplementation) public virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*
* @custom:oz-upgrades-unsafe-allow-reachable delegatecall
*/
function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
// File: node_modules/@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library MathUpgradeable {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
// File: contracts/interfaces/IRedemption.sol
pragma solidity =0.8.18;
interface IRedemption {
function checkLiquidity() external view returns (uint256, uint256, uint256, uint256, uint256, uint256);
function checkPaused() external view returns (bool);
function redeem(uint256 amount) external returns (uint256 payout, uint256 fee, int256 price);
function redeemFor(address user, uint256 amount) external returns (uint256 payout, uint256 fee, int256 price);
}
// File: contracts/interfaces/IPriceFeed.sol
pragma solidity =0.8.18;
interface IPriceFeed {
function decimals() external view returns (uint8);
function latestAnswer() external view returns (uint256);
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}
// File: contracts/extensions/redemption/LiquidityController.sol
pragma solidity =0.8.18;
error QuotaExceedsTotal(uint256 userQuota, uint256 totalLiquidity);
error QuotaExceedsUsed(uint256 newQuota, uint256 usedAmount);
error InsufficientTotalLiquidity(uint256 available, uint256 requested);
error UnauthorizedCaller();
error ZeroAddress();
error ZeroAmount();
error UserNotFound(address user);
error InsufficientUserQuota(address user, uint256 available, uint256 requested);
/**
* @title LiquidityController
* @dev Manages user-specific liquidity quotas for redemption operations
* @dev Tracks allocations and enforces limits per user and globally
* @dev Integrates with redemption contracts to validate liquidity access
*/
contract LiquidityController is OwnableUpgradeable, UUPSUpgradeable {
using MathUpgradeable for uint256;
// Events
event QuotaSet(address indexed user, uint256 quota);
event TotalLiquidityUpdated(uint256 newTotal);
event QuotaUsed(address indexed user, uint256 amount, uint256 remainingQuota);
event QuotaRestored(address indexed user, uint256 amount, uint256 remainingQuota);
event CallerUpdated(address indexed newCaller);
// State variables
mapping(address => uint256) public userQuotas;
mapping(address => uint256) public usedQuotas;
mapping(address => bool) public authorizedUsers;
address[] public users;
address public caller;
uint256 public totalLiquidity;
// Track total allocated across all users
uint256 public totalAllocated;
// Track total used across all users
uint256 public totalUsed;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Initialize the contract
* @param _caller Authorized caller address (typically the redemption contract)
* @param _totalLiquidity Total available liquidity pool
*/
function initialize(address _caller, uint256 _totalLiquidity) public initializer {
if (_caller == address(0)) revert ZeroAddress();
__Ownable_init();
__UUPSUpgradeable_init();
caller = _caller;
totalLiquidity = _totalLiquidity;
totalAllocated = 0;
totalUsed = 0;
emit TotalLiquidityUpdated(_totalLiquidity);
emit CallerUpdated(_caller);
}
/**
* @notice Set quota for a specific user
* @param user User address
* @param quota Quota amount in underlying token (USYC)
*/
function setUserQuota(address user, uint256 quota) external onlyOwner {
uint256 oldQuota = userQuotas[user];
uint256 usedQuota = usedQuotas[user];
// Update total allocated accounting
if (oldQuota > 0) {
totalAllocated = totalAllocated - oldQuota;
}
if (quota > 0) {
// Check that new quota isn't less than already used amount
if (quota < usedQuota) {
revert QuotaExceedsUsed(quota, usedQuota);
}
// Check if new allocation fits within total liquidity
if (totalAllocated + quota > totalLiquidity) {
revert QuotaExceedsTotal(quota, totalLiquidity - totalAllocated);
}
totalAllocated = totalAllocated + quota;
// Add to users array if new user
if (!authorizedUsers[user]) {
users.push(user);
authorizedUsers[user] = true;
}
} else {
// Removing quota - also clear used quota
authorizedUsers[user] = false;
if (usedQuota > 0) {
totalUsed = totalUsed - usedQuota;
usedQuotas[user] = 0;
}
}
userQuotas[user] = quota;
emit QuotaSet(user, quota);
}
/**
* @notice Reserve liquidity for a user (consumes quota)
* @param user User address
* @param amount Amount to reserve
*/
function reserveLiquidity(address user, uint256 amount) external {
if (msg.sender != caller) revert UnauthorizedCaller();
if (amount == 0) revert ZeroAmount();
uint256 quota = userQuotas[user];
if (quota == 0) revert UserNotFound(user);
uint256 used = usedQuotas[user];
uint256 availableQuota = quota > used ? quota - used : 0;
if (amount > availableQuota) {
revert InsufficientUserQuota(user, availableQuota, amount);
}
// Check total liquidity constraint
uint256 totalAvailable = totalLiquidity > totalUsed ? totalLiquidity - totalUsed : 0;
if (amount > totalAvailable) {
revert InsufficientTotalLiquidity(totalAvailable, amount);
}
usedQuotas[user] = used + amount;
totalUsed = totalUsed + amount;
emit QuotaUsed(user, amount, quota > usedQuotas[user] ? quota - usedQuotas[user] : 0);
}
/**
* @notice Restore liquidity for a user (releases quota back)
* @param user User address
* @param amount Amount to restore
*/
function restoreLiquidity(address user, uint256 amount) external onlyOwner {
if (amount == 0) revert ZeroAmount();
uint256 used = usedQuotas[user];
uint256 toRestore = amount > used ? used : amount;
if (toRestore > 0) {
usedQuotas[user] = used - toRestore;
totalUsed = totalUsed - toRestore;
uint256 quota = userQuotas[user];
emit QuotaRestored(user, toRestore, quota > usedQuotas[user] ? quota - usedQuotas[user] : 0);
}
}
/**
* @notice Check if user has sufficient quota for amount
* @param user User address
* @param amount Amount to validate
* @return allowed Whether the amount is within user's available quota
* @return quota User's total quota
*/
function validateUserQuota(address user, uint256 amount) external view returns (bool allowed, uint256 quota) {
quota = userQuotas[user];
uint256 used = usedQuotas[user];
if (quota == 0) {
allowed = false; // User has no quota
} else {
uint256 availableQuota = quota > used ? quota - used : 0;
allowed = amount <= availableQuota; // Check: amount <= remaining quota
}
}
/**
* @notice Check total liquidity status
* @return totalAvailable Total unallocated liquidity
* @return totalReserved Total allocated across all users
* @return totalConsumed Total used across all users
* @return poolBalance Total liquidity pool
*/
function checkTotalLiquidity()
external
view
returns (uint256 totalAvailable, uint256 totalReserved, uint256 totalConsumed, uint256 poolBalance)
{
totalReserved = totalAllocated;
totalConsumed = totalUsed;
totalAvailable = totalLiquidity > totalAllocated ? totalLiquidity - totalAllocated : 0;
poolBalance = totalLiquidity;
}
/**
* @notice Check liquidity status for a specific user
* @param user User address
* @return available Available quota for this user
* @return total Total quota for this user
* @return used Used quota for this user
*/
function checkUserLiquidity(address user) external view returns (uint256 available, uint256 total, uint256 used) {
total = userQuotas[user];
used = usedQuotas[user];
available = total > used ? total - used : 0;
}
/**
* @notice Check if a user is authorized and their quota status
* @param user User address
* @return hasQuota Whether user has a quota
* @return quota User's total quota
* @return available User's available quota
*/
function isUserAuthorized(address user) external view returns (bool hasQuota, uint256 quota, uint256 available) {
quota = userQuotas[user];
hasQuota = quota > 0 && authorizedUsers[user];
uint256 used = usedQuotas[user];
available = quota > used ? quota - used : 0;
}
/**
* @notice Update total liquidity pool (owner only)
* @param newTotal New total liquidity amount
*/
function updateTotalLiquidity(uint256 newTotal) external onlyOwner {
if (newTotal < totalAllocated) {
revert InsufficientTotalLiquidity(totalAllocated, newTotal);
}
totalLiquidity = newTotal;
emit TotalLiquidityUpdated(newTotal);
}
/**
* @notice Update authorized caller address (owner only)
* @param newCaller New caller address
*/
function updateCaller(address newCaller) external onlyOwner {
if (newCaller == address(0)) revert ZeroAddress();
caller = newCaller;
emit CallerUpdated(newCaller);
}
/**
* @notice Get list of all users with active quotas
* @return activeUsers Array of user addresses with active quotas
*/
function getAllUsers() external view returns (address[] memory activeUsers) {
uint256 activeCount = 0;
// Count active users
for (uint256 i = 0; i < users.length; i++) {
if (authorizedUsers[users[i]] && userQuotas[users[i]] > 0) {
activeCount++;
}
}
// Build active user list
activeUsers = new address[](activeCount);
uint256 index = 0;
for (uint256 i = 0; i < users.length; i++) {
if (authorizedUsers[users[i]] && userQuotas[users[i]] > 0) {
activeUsers[index] = users[i];
index++;
}
}
}
/**
* @notice Required by the OZ UUPS module
*/
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}
// File: contracts/extensions/redemption/UsycRedemption.sol
pragma solidity =0.8.18;
error StalePrice(uint256 updatedAt, uint256 maxAge);
error InvalidPrice(int256 price);
error InsufficientUSDCReceived(uint256 received, uint256 required);
error ExcessiveSellFee(uint256 feeRate);
error LiquidityControllerNotSet();
interface IUsycHelper {
/**
* @notice Sell USYC tokens and receive USDC
* @param amount Amount of USYC tokens to sell
* @param recipient Address to receive USDC
* @return Amount of USDC received
*/
function sellFor(uint256 amount, address recipient) external returns (uint256);
/**
* @notice Preview a sale of Yield Token
* @dev Produces the anticipated payout and fees using a price.
* Total amount of yield token is rounded down to 2 decimals (cents)
* sending more precision will not be used in payout calculation
* @param amount is the amount of Yield Token to sell
* @return payout amount of stablecoin received
* @return fee taken
* @return price used in conversion
*/
function sellPreview(uint256 amount) external view returns (uint256 payout, uint256 fee, int256 price);
/**
* @notice Check if selling is currently paused
* @return true if selling is paused, false otherwise
*/
function sellPaused() external view returns (bool);
function sellFee() external view returns (uint256);
function oracle() external view returns (address);
}
/**
* @title UsycRedemption
* @dev Implements instant redemption of USYC tokens to USDC using USYC's sell function
* @dev Pausable by the owner
* @dev Asset token (USDC) is ERC20-compatible
* @dev USYC token implements IUsyc interface with sell function
* @dev Upgradeable using UUPS pattern
*/
contract UsycRedemption is IRedemption, OwnableUpgradeable, UUPSUpgradeable {
using SafeERC20Upgradeable for IERC20Upgradeable;
using MathUpgradeable for uint256;
uint256 public minPrice;
uint256 public scaleFactor;
uint8 public usycDecimals;
uint8 public usdcDecimals;
address public usyc;
address public usdc;
address public helper;
address public caller;
address public usycTreasury;
address public liquidityController;
uint256 public RESERVE2;
uint256 public maxSellFeeRate;
uint256 public maxPriceAge;
uint256 public constant FEE_MULTIPLIER = 10 ** 18;
uint256 public constant HUNDRED_PCT = 100 * FEE_MULTIPLIER;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Initialize the contract
* @param _usyc USYC token address
* @param _usdc USDC token address
* @param _helper USYC helper contract address
* @param _caller Authorized caller address
* @param _usycTreasury USYC treasury address
* @param _liquidityController LiquidityController contract address (optional)
*/
function initialize(
address _usyc,
address _usdc,
address _helper,
address _caller,
address _usycTreasury,
address _liquidityController
) public initializer {
__Ownable_init();
__UUPSUpgradeable_init();
usyc = _usyc;
usdc = _usdc;
helper = _helper;
caller = _caller;
usycTreasury = _usycTreasury;
liquidityController = _liquidityController;
// Get decimals from both tokens
usycDecimals = IERC20MetadataUpgradeable(_usyc).decimals();
usdcDecimals = IERC20MetadataUpgradeable(_usdc).decimals();
scaleFactor = 10 ** IPriceFeed(IUsycHelper(helper).oracle()).decimals();
minPrice = 1 * scaleFactor;
maxPriceAge = 3 days; // Default: 3-day buffer
}
/**
* @notice Set the maximum price age (only owner)
* @param _maxPriceAge Maximum age for price data in seconds
*/
function setMaxPriceAge(uint256 _maxPriceAge) external onlyOwner {
maxPriceAge = _maxPriceAge;
}
/**
* @notice Set the maximum sell fee rate (only owner)
* @param _maxRate Maximum sell fee rate
*/
function setMaxSellFeeRate(uint256 _maxRate) external onlyOwner {
maxSellFeeRate = _maxRate;
}
/**
* @notice Set liquidity controller contract (only owner)
* @param _liquidityController LiquidityController contract address
*/
function setLiquidityController(address _liquidityController) external onlyOwner {
liquidityController = _liquidityController;
}
/**
* @notice Redeem USYC tokens for USDC using USYC's sell function
* @param _amount Amount of USDC desired to receive
* @return payout usdc amount
* @return fee charged by usdc amount
* @return price used in conversion
*/
function redeem(uint256 _amount) external override returns (uint256 payout, uint256 fee, int256 price) {
return _redeem(address(0), _amount);
}
function redeemFor(
address user,
uint256 _amount
) external override returns (uint256 payout, uint256 fee, int256 price) {
return _redeem(user, _amount);
}
function _redeem(address user, uint256 _amount) internal returns (uint256 payout, uint256 fee, int256 price) {
if (msg.sender != caller) revert UnauthorizedCaller();
if (liquidityController == address(0)) revert LiquidityControllerNotSet();
uint256 sellFeeRate = IUsycHelper(helper).sellFee();
if (sellFeeRate > maxSellFeeRate) revert ExcessiveSellFee(sellFeeRate);
uint256 usycAmount = convertUsdcToToken(_amount);
// Reserve liquidity if user-specific quota is being used
if (user != address(0)) {
// This will revert if user doesn't have sufficient quota
LiquidityController(liquidityController).reserveLiquidity(user, usycAmount);
}
SafeERC20Upgradeable.safeTransferFrom(IERC20Upgradeable(usyc), usycTreasury, address(this), usycAmount);
SafeERC20Upgradeable.safeIncreaseAllowance(IERC20Upgradeable(usyc), helper, usycAmount);
payout = IUsycHelper(helper).sellFor(usycAmount, address(caller));
(, fee, price) = IUsycHelper(helper).sellPreview(usycAmount);
}
/**
* @notice Check the available liquidity for instant redeem.
* @return liquidity The available liquidity from the redemption contract.
* @return tAllowance The redemption token allowance for the vault.
* @return tBalance The redemption token balance in the Treasury.
* @return tAllowanceInUsdc The redemption token allowance in USDC.
* @return tBalanceInUsdc The redemption token balance in USDC.
* @return minimumInUsdc The minimum of liquidity, tAllowanceInUsdc, and tBalanceInUsdc.
*/
function checkLiquidity()
public
view
override
returns (
uint256 liquidity,
uint256 tAllowance,
uint256 tBalance,
uint256 tAllowanceInUsdc,
uint256 tBalanceInUsdc,
uint256 minimumInUsdc
)
{
liquidity = IERC20Upgradeable(usdc).balanceOf(helper);
tAllowance = IERC20Upgradeable(usyc).allowance(usycTreasury, address(this));
tAllowanceInUsdc = convertTokenToUsdc(tAllowance);
tBalance = IERC20Upgradeable(usyc).balanceOf(usycTreasury);
tBalanceInUsdc = convertTokenToUsdc(tBalance);
minimumInUsdc = liquidity.min(tAllowanceInUsdc.min(tBalanceInUsdc));
}
/**
* @notice Check liquidity available for a specific user
* @param user User address to check
* @return userUsdcLiquidity Available liquidity for this user in USDC
* @return totalUsdcLiquidity Total available liquidity in USDC
* @return userUsycQuota User's available quota in USYC
*/
function checkUserLiquidity(
address user
) external view returns (uint256 userUsdcLiquidity, uint256 totalUsdcLiquidity, uint256 userUsycQuota) {
// Get base liquidity
(, , , , , uint256 baseLiquidity) = checkLiquidity();
totalUsdcLiquidity = baseLiquidity;
if (liquidityController == address(0)) {
userUsdcLiquidity = 0;
userUsycQuota = 0;
} else {
// Get user-specific available quota (total quota - used)
(uint256 availableQuota, , ) = LiquidityController(liquidityController).checkUserLiquidity(user);
userUsycQuota = availableQuota;
// User liquidity is minimum of available quota and total liquidity
uint256 quotaInUsdc = convertTokenToUsdc(availableQuota);
userUsdcLiquidity = totalUsdcLiquidity.min(quotaInUsdc);
}
}
/**
* @notice Check if USYC selling is currently available
* @return false if USYC can be sold, true otherwise
*/
function checkPaused() external view returns (bool) {
return IUsycHelper(helper).sellPaused();
}
function getPrice(address _oracle) public view returns (uint256) {
(uint80 roundId, int256 price, , uint256 updatedAt, uint80 answeredInRound) = IPriceFeed(_oracle)
.latestRoundData();
// Check if the price data is not older than maxPriceAge
if (block.timestamp - updatedAt > maxPriceAge) {
revert StalePrice(updatedAt, maxPriceAge);
}
// Check for incomplete round data
if (answeredInRound < roundId) {
revert StalePrice(updatedAt, maxPriceAge);
}
if (uint256(price) < minPrice) revert InvalidPrice(price);
return uint256(price);
}
function convertUsdcToToken(uint256 _amount) public view returns (uint256) {
uint256 price = getPrice(IUsycHelper(helper).oracle());
// Convert USDC amount to USYC token amount accounting for decimal differences
// Formula: (usdcAmount * 10^usycDecimals * scaleFactor) / (price * 10^usdcDecimals)
return
_amount.mulDiv(10 ** usycDecimals * scaleFactor, price * 10 ** usdcDecimals, MathUpgradeable.Rounding.Up);
}
function convertTokenToUsdc(uint256 _amount) public view returns (uint256) {
uint256 price = getPrice(IUsycHelper(helper).oracle());
// Convert USYC token amount to USDC amount accounting for decimal differences
// Formula: (usycAmount * price * 10^usdcDecimals) / (scaleFactor * 10^usycDecimals)
return
_amount.mulDiv(price * 10 ** usdcDecimals, scaleFactor * 10 ** usycDecimals, MathUpgradeable.Rounding.Down);
}
/**
* @notice Set the caller address (only owner)
* @param _caller Address of the caller
*/
function setCaller(address _caller) external onlyOwner {
if (_caller == address(0)) revert ZeroAddress();
caller = _caller;
}
/**
* @notice Set the USYC treasury address (only owner)
* @param _usycTreasury Address of the USYC treasury
*/
function setUsycTreasury(address _usycTreasury) external onlyOwner {
if (_usycTreasury == address(0)) revert ZeroAddress();
usycTreasury = _usycTreasury;
}
/**
* @notice Emergency withdraw function for owner to withdraw stuck tokens
* @param token Token address to withdraw
* @param amount Amount to withdraw
*/
function emergencyWithdraw(address token, uint256 amount) external onlyOwner {
if (token == address(0)) revert ZeroAddress();
SafeERC20Upgradeable.safeTransfer(IERC20Upgradeable(token), usycTreasury, amount);
}
/**
* @notice Required by the OZ UUPS module
* @dev Only owner can upgrade the contract
*/
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"feeRate","type":"uint256"}],"name":"ExcessiveSellFee","type":"error"},{"inputs":[{"internalType":"int256","name":"price","type":"int256"}],"name":"InvalidPrice","type":"error"},{"inputs":[],"name":"LiquidityControllerNotSet","type":"error"},{"inputs":[{"internalType":"uint256","name":"updatedAt","type":"uint256"},{"internalType":"uint256","name":"maxAge","type":"uint256"}],"name":"StalePrice","type":"error"},{"inputs":[],"name":"UnauthorizedCaller","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"FEE_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HUNDRED_PCT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RESERVE2","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"caller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkLiquidity","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"tAllowance","type":"uint256"},{"internalType":"uint256","name":"tBalance","type":"uint256"},{"internalType":"uint256","name":"tAllowanceInUsdc","type":"uint256"},{"internalType":"uint256","name":"tBalanceInUsdc","type":"uint256"},{"internalType":"uint256","name":"minimumInUsdc","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"checkUserLiquidity","outputs":[{"internalType":"uint256","name":"userUsdcLiquidity","type":"uint256"},{"internalType":"uint256","name":"totalUsdcLiquidity","type":"uint256"},{"internalType":"uint256","name":"userUsycQuota","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertTokenToUsdc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"convertUsdcToToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oracle","type":"address"}],"name":"getPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"helper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_usyc","type":"address"},{"internalType":"address","name":"_usdc","type":"address"},{"internalType":"address","name":"_helper","type":"address"},{"internalType":"address","name":"_caller","type":"address"},{"internalType":"address","name":"_usycTreasury","type":"address"},{"internalType":"address","name":"_liquidityController","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"liquidityController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPriceAge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSellFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"payout","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"int256","name":"price","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"redeemFor","outputs":[{"internalType":"uint256","name":"payout","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"int256","name":"price","type":"int256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"scaleFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_caller","type":"address"}],"name":"setCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_liquidityController","type":"address"}],"name":"setLiquidityController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxPriceAge","type":"uint256"}],"name":"setMaxPriceAge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxRate","type":"uint256"}],"name":"setMaxSellFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_usycTreasury","type":"address"}],"name":"setUsycTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"usdc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdcDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usyc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usycDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usycTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a0604052306080523480156200001557600080fd5b506200002062000026565b620000e7565b600054610100900460ff1615620000935760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000e5576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b60805161266b6200011f600039600081816106e20152818161072b01528181610963015281816109a30152610a36015261266b6000f3fe60806040526004361061020f5760003560e01c80637bf4216511610118578063c166beb6116100a0578063db006a751161006f578063db006a7514610622578063e45be8eb14610642578063ed13fd5c14610658578063f2fde38b1461066e578063fc9c8d391461068e57600080fd5b8063c166beb614610585578063c1b5dcb6146105ab578063cc2a9a5b146105c0578063d82c52d6146105e057600080fd5b806398ed2b8e116100e757806398ed2b8e146104f9578063b32524ea14610519578063b591b13c14610533578063beb92f551461054f578063c0d50ea11461056f57600080fd5b80637bf421651461046a5780638da5cb5b1461049b5780638dfd3ea7146104b957806395ccea67146104d957600080fd5b806354b18d681161019b57806363b0e66a1161016a57806363b0e66a146103c4578063683dd191146103e45780636e496073146103fa578063715018a6146104355780637a82a1981461044a57600080fd5b806354b18d681461034457806356447ce8146103645780635d77cf19146103845780635e417f83146103a457600080fd5b80633e413bee116101e25780633e413bee146102b757806341976e09146102d75780634c890060146102f75780634f1ef2861461031c57806352d1902d1461032f57600080fd5b80630b8c7b9c146102145780631584410a146102365780631adacb6b1461025f5780633659cfe614610297575b600080fd5b34801561022057600080fd5b5061023461022f366004612050565b6106ae565b005b34801561024257600080fd5b5061024c60d35481565b6040519081526020015b60405180910390f35b34801561026b57600080fd5b5060cf5461027f906001600160a01b031681565b6040516001600160a01b039091168152602001610256565b3480156102a357600080fd5b506102346102b2366004612050565b6106d8565b3480156102c357600080fd5b5060cc5461027f906001600160a01b031681565b3480156102e357600080fd5b5061024c6102f2366004612050565b6107c0565b34801561030357600080fd5b5061030c6108e6565b6040519015158152602001610256565b61023461032a366004612083565b610959565b34801561033b57600080fd5b5061024c610a29565b34801561035057600080fd5b5061023461035f366004612147565b610adc565b34801561037057600080fd5b5061023461037f366004612147565b610ae9565b34801561039057600080fd5b5060d05461027f906001600160a01b031681565b3480156103b057600080fd5b506102346103bf366004612050565b610af6565b3480156103d057600080fd5b5060cd5461027f906001600160a01b031681565b3480156103f057600080fd5b5061024c60ca5481565b34801561040657600080fd5b5061041a610415366004612050565b610b47565b60408051938452602084019290925290820152606001610256565b34801561044157600080fd5b50610234610c19565b34801561045657600080fd5b5061041a610465366004612160565b610c2d565b34801561047657600080fd5b5060cb5461048990610100900460ff1681565b60405160ff9091168152602001610256565b3480156104a757600080fd5b506033546001600160a01b031661027f565b3480156104c557600080fd5b5061024c6104d4366004612147565b610c49565b3480156104e557600080fd5b506102346104f4366004612160565b610d1c565b34801561050557600080fd5b5061024c610514366004612147565b610d63565b34801561052557600080fd5b5060cb546104899060ff1681565b34801561053f57600080fd5b5061024c670de0b6b3a764000081565b34801561055b57600080fd5b5061023461056a366004612050565b610e0b565b34801561057b57600080fd5b5061024c60d15481565b34801561059157600080fd5b5060cb5461027f906201000090046001600160a01b031681565b3480156105b757600080fd5b5061024c610e5c565b3480156105cc57600080fd5b506102346105db36600461218c565b610e72565b3480156105ec57600080fd5b506105f56111f7565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610256565b34801561062e57600080fd5b5061041a61063d366004612147565b6113a2565b34801561064e57600080fd5b5061024c60c95481565b34801561066457600080fd5b5061024c60d25481565b34801561067a57600080fd5b50610234610689366004612050565b6113bf565b34801561069a57600080fd5b5060ce5461027f906001600160a01b031681565b6106b6611435565b60d080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036107295760405162461bcd60e51b81526004016107209061220e565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166107726000805160206125ef833981519152546001600160a01b031690565b6001600160a01b0316146107985760405162461bcd60e51b81526004016107209061225a565b6107a18161148f565b604080516000808252602082019092526107bd91839190611497565b50565b6000806000806000856001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906122c5565b94509450509350935060d3548242610842919061232b565b111561086f5760d3546040516304e61d6960e31b8152610720918491600401918252602082015260400190565b8369ffffffffffffffffffff168169ffffffffffffffffffff1610156108b65760d3546040516304e61d6960e31b8152610720918491600401918252602082015260400190565b60c9548310156108dc576040516338ee04a760e01b815260048101849052602401610720565b5090949350505050565b60cd5460408051637080b99960e11b815290516000926001600160a01b03169163e10173329160048083019260209291908290030181865afa158015610930573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610954919061233e565b905090565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036109a15760405162461bcd60e51b81526004016107209061220e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166109ea6000805160206125ef833981519152546001600160a01b031690565b6001600160a01b031614610a105760405162461bcd60e51b81526004016107209061225a565b610a198261148f565b610a2582826001611497565b5050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610ac95760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610720565b506000805160206125ef83398151915290565b610ae4611435565b60d255565b610af1611435565b60d355565b610afe611435565b6001600160a01b038116610b255760405163d92e233d60e01b815260040160405180910390fd5b60cf80546001600160a01b0319166001600160a01b0392909216919091179055565b600080600080610b556111f7565b60d0549098508896506001600160a01b03169450610b7f9350505050576000935060009150610c11565b60d054604051636e49607360e01b81526001600160a01b0387811660048301526000921690636e49607390602401606060405180830381865afa158015610bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bee9190612360565b505090508092506000610c0082610d63565b9050610c0c8582611607565b955050505b509193909250565b610c21611435565b610c2b6000611621565b565b6000806000610c3c8585611673565b9250925092509250925092565b600080610cc660cd60009054906101000a90046001600160a01b03166001600160a01b0316637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ca2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f2919061238e565b60ca5460cb54919250610d1591610ce19060ff16600a61248f565b610ceb919061249e565b60cb54610d0190610100900460ff16600a61248f565b610d0b908461249e565b8591906001611924565b9392505050565b610d24611435565b6001600160a01b038216610d4b5760405163d92e233d60e01b815260040160405180910390fd5b60cf54610a259083906001600160a01b031683611983565b600080610dbc60cd60009054906101000a90046001600160a01b03166001600160a01b0316637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ca2573d6000803e3d6000fd5b60cb54909150610d1590610dd990610100900460ff16600a61248f565b610de3908361249e565b60cb54610df49060ff16600a61248f565b60ca54610e01919061249e565b8591906000611924565b610e13611435565b6001600160a01b038116610e3a5760405163d92e233d60e01b815260040160405180910390fd5b60ce80546001600160a01b0319166001600160a01b0392909216919091179055565b610e6f670de0b6b3a7640000606461249e565b81565b600054610100900460ff1615808015610e925750600054600160ff909116105b80610eac5750303b158015610eac575060005460ff166001145b610f0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610720565b6000805460ff191660011790558015610f32576000805461ff0019166101001790555b610f3a6119e6565b610f42611a15565b60cb805462010000600160b01b031916620100006001600160a01b038a81169182029290921790925560cc80546001600160a01b03199081168a84161790915560cd8054821689841617905560ce8054821688841617905560cf8054821687841617905560d080549091169185169190911790556040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa158015610ff1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101591906124b5565b60cb60006101000a81548160ff021916908360ff160217905550856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561106d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109191906124b5565b60cb60016101000a81548160ff021916908360ff16021790555060cd60009054906101000a90046001600160a01b03166001600160a01b0316637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611122919061238e565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118391906124b5565b61118e90600a61248f565b60ca81905561119e90600161249e565b60c9556203f48060d35580156111ee576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60cc5460cd546040516370a0823160e01b81526001600160a01b039182166004820152600092839283928392839283929116906370a0823190602401602060405180830381865afa158015611250573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127491906124d8565b60cb5460cf54604051636eb1769f60e11b81526001600160a01b03918216600482015230602482015292985062010000909104169063dd62ed3e90604401602060405180830381865afa1580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906124d8565b94506112fe85610d63565b60cb5460cf546040516370a0823160e01b81526001600160a01b0391821660048201529295506201000090910416906370a0823190602401602060405180830381865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137791906124d8565b935061138284610d63565b91506113986113918484611607565b8790611607565b9050909192939495565b60008060006113b2600085611673565b9250925092509193909250565b6113c7611435565b6001600160a01b03811661142c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610720565b6107bd81611621565b6033546001600160a01b03163314610c2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610720565b6107bd611435565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156114cf576114ca83611a3c565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611529575060408051601f3d908101601f19168201909252611526918101906124d8565b60015b61158c5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610720565b6000805160206125ef83398151915281146115fb5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610720565b506114ca838383611ad8565b60008183106116165781611618565b825b90505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60ce54600090819081906001600160a01b031633146116a557604051635c427cd960e01b815260040160405180910390fd5b60d0546001600160a01b03166116ce57604051630110fc7960e61b815260040160405180910390fd5b60cd546040805163158a652b60e11b815290516000926001600160a01b031691632b14ca569160048083019260209291908290030181865afa158015611718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c91906124d8565b905060d2548111156117645760405163c977386d60e01b815260048101829052602401610720565b600061176f86610c49565b90506001600160a01b038716156117e75760d0546040516364624f9960e11b81526001600160a01b038981166004830152602482018490529091169063c8c49f3290604401600060405180830381600087803b1580156117ce57600080fd5b505af11580156117e2573d6000803e3d6000fd5b505050505b60cb5460cf5461180b916001600160a01b0362010000909104811691163084611b03565b60cb5460cd5461182e916001600160a01b03620100009091048116911683611b3b565b60cd5460ce54604051631d0ad6dd60e21b8152600481018490526001600160a01b03918216602482015291169063742b5b74906044016020604051808303816000875af1158015611883573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a791906124d8565b60cd546040516320b8bb4f60e11b8152600481018490529196506001600160a01b031690634171769e90602401606060405180830381865afa1580156118f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119159190612360565b96999098509596505050505050565b600080611932868686611be8565b90506001836002811115611948576119486124f1565b14801561196557506000848061196057611960612507565b868809115b156119785761197560018261251d565b90505b90505b949350505050565b6040516001600160a01b0383166024820152604481018290526114ca90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cd1565b600054610100900460ff16611a0d5760405162461bcd60e51b815260040161072090612530565b610c2b611da6565b600054610100900460ff16610c2b5760405162461bcd60e51b815260040161072090612530565b6001600160a01b0381163b611aa95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610720565b6000805160206125ef83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611ae183611dd6565b600082511180611aee5750805b156114ca57611afd8383611e16565b50505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611afd9085906323b872dd60e01b906084016119af565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611b8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611baf91906124d8565b9050611afd8463095ea7b360e01b85611bc8868661251d565b6040516001600160a01b03909216602483015260448201526064016119af565b6000808060001985870985870292508281108382030391505080600003611c2257838281611c1857611c18612507565b0492505050610d15565b808411611c695760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610720565b600084868809600260036001881981018916988990049182028318808302840302808302840302808302840302808302840302808302840302918202909203026000889003889004909101858311909403939093029303949094049190911702949350505050565b6000611d26826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e3b9092919063ffffffff16565b9050805160001480611d47575080806020019051810190611d47919061233e565b6114ca5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610720565b600054610100900460ff16611dcd5760405162461bcd60e51b815260040161072090612530565b610c2b33611621565b611ddf81611a3c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611618838360405180606001604052806027815260200161260f60279139611e4a565b606061197b8484600085611ec2565b6060600080856001600160a01b031685604051611e67919061259f565b600060405180830381855af49150503d8060008114611ea2576040519150601f19603f3d011682016040523d82523d6000602084013e611ea7565b606091505b5091509150611eb886838387611f9d565b9695505050505050565b606082471015611f235760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610720565b600080866001600160a01b03168587604051611f3f919061259f565b60006040518083038185875af1925050503d8060008114611f7c576040519150601f19603f3d011682016040523d82523d6000602084013e611f81565b606091505b5091509150611f9287838387611f9d565b979650505050505050565b6060831561200c578251600003612005576001600160a01b0385163b6120055760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610720565b508161197b565b61197b83838151156120215781518083602001fd5b8060405162461bcd60e51b815260040161072091906125bb565b6001600160a01b03811681146107bd57600080fd5b60006020828403121561206257600080fd5b8135610d158161203b565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561209657600080fd5b82356120a18161203b565b9150602083013567ffffffffffffffff808211156120be57600080fd5b818501915085601f8301126120d257600080fd5b8135818111156120e4576120e461206d565b604051601f8201601f19908116603f0116810190838211818310171561210c5761210c61206d565b8160405282815288602084870101111561212557600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561215957600080fd5b5035919050565b6000806040838503121561217357600080fd5b823561217e8161203b565b946020939093013593505050565b60008060008060008060c087890312156121a557600080fd5b86356121b08161203b565b955060208701356121c08161203b565b945060408701356121d08161203b565b935060608701356121e08161203b565b925060808701356121f08161203b565b915060a08701356122008161203b565b809150509295509295509295565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b805169ffffffffffffffffffff811681146122c057600080fd5b919050565b600080600080600060a086880312156122dd57600080fd5b6122e6866122a6565b9450602086015193506040860151925060608601519150612309608087016122a6565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b8181038181111561161b5761161b612315565b60006020828403121561235057600080fd5b81518015158114610d1557600080fd5b60008060006060848603121561237557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156123a057600080fd5b8151610d158161203b565b600181815b808511156123e65781600019048211156123cc576123cc612315565b808516156123d957918102915b93841c93908002906123b0565b509250929050565b6000826123fd5750600161161b565b8161240a5750600061161b565b8160018114612420576002811461242a57612446565b600191505061161b565b60ff84111561243b5761243b612315565b50506001821b61161b565b5060208310610133831016604e8410600b8410161715612469575081810a61161b565b61247383836123ab565b806000190482111561248757612487612315565b029392505050565b600061161860ff8416836123ee565b808202811582820484141761161b5761161b612315565b6000602082840312156124c757600080fd5b815160ff81168114610d1557600080fd5b6000602082840312156124ea57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b8082018082111561161b5761161b612315565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b8381101561259657818101518382015260200161257e565b50506000910152565b600082516125b181846020870161257b565b9190910192915050565b60208152600082518060208401526125da81604085016020870161257b565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212202fd6a7343e574203d5027d0e54b34ee9e0713e70d73b024ef33cc0c7e314b57a64736f6c63430008120033
Deployed Bytecode
0x60806040526004361061020f5760003560e01c80637bf4216511610118578063c166beb6116100a0578063db006a751161006f578063db006a7514610622578063e45be8eb14610642578063ed13fd5c14610658578063f2fde38b1461066e578063fc9c8d391461068e57600080fd5b8063c166beb614610585578063c1b5dcb6146105ab578063cc2a9a5b146105c0578063d82c52d6146105e057600080fd5b806398ed2b8e116100e757806398ed2b8e146104f9578063b32524ea14610519578063b591b13c14610533578063beb92f551461054f578063c0d50ea11461056f57600080fd5b80637bf421651461046a5780638da5cb5b1461049b5780638dfd3ea7146104b957806395ccea67146104d957600080fd5b806354b18d681161019b57806363b0e66a1161016a57806363b0e66a146103c4578063683dd191146103e45780636e496073146103fa578063715018a6146104355780637a82a1981461044a57600080fd5b806354b18d681461034457806356447ce8146103645780635d77cf19146103845780635e417f83146103a457600080fd5b80633e413bee116101e25780633e413bee146102b757806341976e09146102d75780634c890060146102f75780634f1ef2861461031c57806352d1902d1461032f57600080fd5b80630b8c7b9c146102145780631584410a146102365780631adacb6b1461025f5780633659cfe614610297575b600080fd5b34801561022057600080fd5b5061023461022f366004612050565b6106ae565b005b34801561024257600080fd5b5061024c60d35481565b6040519081526020015b60405180910390f35b34801561026b57600080fd5b5060cf5461027f906001600160a01b031681565b6040516001600160a01b039091168152602001610256565b3480156102a357600080fd5b506102346102b2366004612050565b6106d8565b3480156102c357600080fd5b5060cc5461027f906001600160a01b031681565b3480156102e357600080fd5b5061024c6102f2366004612050565b6107c0565b34801561030357600080fd5b5061030c6108e6565b6040519015158152602001610256565b61023461032a366004612083565b610959565b34801561033b57600080fd5b5061024c610a29565b34801561035057600080fd5b5061023461035f366004612147565b610adc565b34801561037057600080fd5b5061023461037f366004612147565b610ae9565b34801561039057600080fd5b5060d05461027f906001600160a01b031681565b3480156103b057600080fd5b506102346103bf366004612050565b610af6565b3480156103d057600080fd5b5060cd5461027f906001600160a01b031681565b3480156103f057600080fd5b5061024c60ca5481565b34801561040657600080fd5b5061041a610415366004612050565b610b47565b60408051938452602084019290925290820152606001610256565b34801561044157600080fd5b50610234610c19565b34801561045657600080fd5b5061041a610465366004612160565b610c2d565b34801561047657600080fd5b5060cb5461048990610100900460ff1681565b60405160ff9091168152602001610256565b3480156104a757600080fd5b506033546001600160a01b031661027f565b3480156104c557600080fd5b5061024c6104d4366004612147565b610c49565b3480156104e557600080fd5b506102346104f4366004612160565b610d1c565b34801561050557600080fd5b5061024c610514366004612147565b610d63565b34801561052557600080fd5b5060cb546104899060ff1681565b34801561053f57600080fd5b5061024c670de0b6b3a764000081565b34801561055b57600080fd5b5061023461056a366004612050565b610e0b565b34801561057b57600080fd5b5061024c60d15481565b34801561059157600080fd5b5060cb5461027f906201000090046001600160a01b031681565b3480156105b757600080fd5b5061024c610e5c565b3480156105cc57600080fd5b506102346105db36600461218c565b610e72565b3480156105ec57600080fd5b506105f56111f7565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610256565b34801561062e57600080fd5b5061041a61063d366004612147565b6113a2565b34801561064e57600080fd5b5061024c60c95481565b34801561066457600080fd5b5061024c60d25481565b34801561067a57600080fd5b50610234610689366004612050565b6113bf565b34801561069a57600080fd5b5060ce5461027f906001600160a01b031681565b6106b6611435565b60d080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b037f000000000000000000000000259c315333a6f8a33a8714b9b185361b216262851630036107295760405162461bcd60e51b81526004016107209061220e565b60405180910390fd5b7f000000000000000000000000259c315333a6f8a33a8714b9b185361b216262856001600160a01b03166107726000805160206125ef833981519152546001600160a01b031690565b6001600160a01b0316146107985760405162461bcd60e51b81526004016107209061225a565b6107a18161148f565b604080516000808252602082019092526107bd91839190611497565b50565b6000806000806000856001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906122c5565b94509450509350935060d3548242610842919061232b565b111561086f5760d3546040516304e61d6960e31b8152610720918491600401918252602082015260400190565b8369ffffffffffffffffffff168169ffffffffffffffffffff1610156108b65760d3546040516304e61d6960e31b8152610720918491600401918252602082015260400190565b60c9548310156108dc576040516338ee04a760e01b815260048101849052602401610720565b5090949350505050565b60cd5460408051637080b99960e11b815290516000926001600160a01b03169163e10173329160048083019260209291908290030181865afa158015610930573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610954919061233e565b905090565b6001600160a01b037f000000000000000000000000259c315333a6f8a33a8714b9b185361b216262851630036109a15760405162461bcd60e51b81526004016107209061220e565b7f000000000000000000000000259c315333a6f8a33a8714b9b185361b216262856001600160a01b03166109ea6000805160206125ef833981519152546001600160a01b031690565b6001600160a01b031614610a105760405162461bcd60e51b81526004016107209061225a565b610a198261148f565b610a2582826001611497565b5050565b6000306001600160a01b037f000000000000000000000000259c315333a6f8a33a8714b9b185361b216262851614610ac95760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610720565b506000805160206125ef83398151915290565b610ae4611435565b60d255565b610af1611435565b60d355565b610afe611435565b6001600160a01b038116610b255760405163d92e233d60e01b815260040160405180910390fd5b60cf80546001600160a01b0319166001600160a01b0392909216919091179055565b600080600080610b556111f7565b60d0549098508896506001600160a01b03169450610b7f9350505050576000935060009150610c11565b60d054604051636e49607360e01b81526001600160a01b0387811660048301526000921690636e49607390602401606060405180830381865afa158015610bca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bee9190612360565b505090508092506000610c0082610d63565b9050610c0c8582611607565b955050505b509193909250565b610c21611435565b610c2b6000611621565b565b6000806000610c3c8585611673565b9250925092509250925092565b600080610cc660cd60009054906101000a90046001600160a01b03166001600160a01b0316637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ca2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f2919061238e565b60ca5460cb54919250610d1591610ce19060ff16600a61248f565b610ceb919061249e565b60cb54610d0190610100900460ff16600a61248f565b610d0b908461249e565b8591906001611924565b9392505050565b610d24611435565b6001600160a01b038216610d4b5760405163d92e233d60e01b815260040160405180910390fd5b60cf54610a259083906001600160a01b031683611983565b600080610dbc60cd60009054906101000a90046001600160a01b03166001600160a01b0316637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ca2573d6000803e3d6000fd5b60cb54909150610d1590610dd990610100900460ff16600a61248f565b610de3908361249e565b60cb54610df49060ff16600a61248f565b60ca54610e01919061249e565b8591906000611924565b610e13611435565b6001600160a01b038116610e3a5760405163d92e233d60e01b815260040160405180910390fd5b60ce80546001600160a01b0319166001600160a01b0392909216919091179055565b610e6f670de0b6b3a7640000606461249e565b81565b600054610100900460ff1615808015610e925750600054600160ff909116105b80610eac5750303b158015610eac575060005460ff166001145b610f0f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610720565b6000805460ff191660011790558015610f32576000805461ff0019166101001790555b610f3a6119e6565b610f42611a15565b60cb805462010000600160b01b031916620100006001600160a01b038a81169182029290921790925560cc80546001600160a01b03199081168a84161790915560cd8054821689841617905560ce8054821688841617905560cf8054821687841617905560d080549091169185169190911790556040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa158015610ff1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101591906124b5565b60cb60006101000a81548160ff021916908360ff160217905550856001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561106d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109191906124b5565b60cb60016101000a81548160ff021916908360ff16021790555060cd60009054906101000a90046001600160a01b03166001600160a01b0316637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611122919061238e565b6001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa15801561115f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118391906124b5565b61118e90600a61248f565b60ca81905561119e90600161249e565b60c9556203f48060d35580156111ee576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b60cc5460cd546040516370a0823160e01b81526001600160a01b039182166004820152600092839283928392839283929116906370a0823190602401602060405180830381865afa158015611250573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127491906124d8565b60cb5460cf54604051636eb1769f60e11b81526001600160a01b03918216600482015230602482015292985062010000909104169063dd62ed3e90604401602060405180830381865afa1580156112cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f391906124d8565b94506112fe85610d63565b60cb5460cf546040516370a0823160e01b81526001600160a01b0391821660048201529295506201000090910416906370a0823190602401602060405180830381865afa158015611353573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137791906124d8565b935061138284610d63565b91506113986113918484611607565b8790611607565b9050909192939495565b60008060006113b2600085611673565b9250925092509193909250565b6113c7611435565b6001600160a01b03811661142c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610720565b6107bd81611621565b6033546001600160a01b03163314610c2b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610720565b6107bd611435565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156114cf576114ca83611a3c565b505050565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611529575060408051601f3d908101601f19168201909252611526918101906124d8565b60015b61158c5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610720565b6000805160206125ef83398151915281146115fb5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610720565b506114ca838383611ad8565b60008183106116165781611618565b825b90505b92915050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60ce54600090819081906001600160a01b031633146116a557604051635c427cd960e01b815260040160405180910390fd5b60d0546001600160a01b03166116ce57604051630110fc7960e61b815260040160405180910390fd5b60cd546040805163158a652b60e11b815290516000926001600160a01b031691632b14ca569160048083019260209291908290030181865afa158015611718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c91906124d8565b905060d2548111156117645760405163c977386d60e01b815260048101829052602401610720565b600061176f86610c49565b90506001600160a01b038716156117e75760d0546040516364624f9960e11b81526001600160a01b038981166004830152602482018490529091169063c8c49f3290604401600060405180830381600087803b1580156117ce57600080fd5b505af11580156117e2573d6000803e3d6000fd5b505050505b60cb5460cf5461180b916001600160a01b0362010000909104811691163084611b03565b60cb5460cd5461182e916001600160a01b03620100009091048116911683611b3b565b60cd5460ce54604051631d0ad6dd60e21b8152600481018490526001600160a01b03918216602482015291169063742b5b74906044016020604051808303816000875af1158015611883573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118a791906124d8565b60cd546040516320b8bb4f60e11b8152600481018490529196506001600160a01b031690634171769e90602401606060405180830381865afa1580156118f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119159190612360565b96999098509596505050505050565b600080611932868686611be8565b90506001836002811115611948576119486124f1565b14801561196557506000848061196057611960612507565b868809115b156119785761197560018261251d565b90505b90505b949350505050565b6040516001600160a01b0383166024820152604481018290526114ca90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611cd1565b600054610100900460ff16611a0d5760405162461bcd60e51b815260040161072090612530565b610c2b611da6565b600054610100900460ff16610c2b5760405162461bcd60e51b815260040161072090612530565b6001600160a01b0381163b611aa95760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610720565b6000805160206125ef83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b611ae183611dd6565b600082511180611aee5750805b156114ca57611afd8383611e16565b50505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611afd9085906323b872dd60e01b906084016119af565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e90604401602060405180830381865afa158015611b8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611baf91906124d8565b9050611afd8463095ea7b360e01b85611bc8868661251d565b6040516001600160a01b03909216602483015260448201526064016119af565b6000808060001985870985870292508281108382030391505080600003611c2257838281611c1857611c18612507565b0492505050610d15565b808411611c695760405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606401610720565b600084868809600260036001881981018916988990049182028318808302840302808302840302808302840302808302840302808302840302918202909203026000889003889004909101858311909403939093029303949094049190911702949350505050565b6000611d26826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611e3b9092919063ffffffff16565b9050805160001480611d47575080806020019051810190611d47919061233e565b6114ca5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610720565b600054610100900460ff16611dcd5760405162461bcd60e51b815260040161072090612530565b610c2b33611621565b611ddf81611a3c565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060611618838360405180606001604052806027815260200161260f60279139611e4a565b606061197b8484600085611ec2565b6060600080856001600160a01b031685604051611e67919061259f565b600060405180830381855af49150503d8060008114611ea2576040519150601f19603f3d011682016040523d82523d6000602084013e611ea7565b606091505b5091509150611eb886838387611f9d565b9695505050505050565b606082471015611f235760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610720565b600080866001600160a01b03168587604051611f3f919061259f565b60006040518083038185875af1925050503d8060008114611f7c576040519150601f19603f3d011682016040523d82523d6000602084013e611f81565b606091505b5091509150611f9287838387611f9d565b979650505050505050565b6060831561200c578251600003612005576001600160a01b0385163b6120055760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610720565b508161197b565b61197b83838151156120215781518083602001fd5b8060405162461bcd60e51b815260040161072091906125bb565b6001600160a01b03811681146107bd57600080fd5b60006020828403121561206257600080fd5b8135610d158161203b565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561209657600080fd5b82356120a18161203b565b9150602083013567ffffffffffffffff808211156120be57600080fd5b818501915085601f8301126120d257600080fd5b8135818111156120e4576120e461206d565b604051601f8201601f19908116603f0116810190838211818310171561210c5761210c61206d565b8160405282815288602084870101111561212557600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60006020828403121561215957600080fd5b5035919050565b6000806040838503121561217357600080fd5b823561217e8161203b565b946020939093013593505050565b60008060008060008060c087890312156121a557600080fd5b86356121b08161203b565b955060208701356121c08161203b565b945060408701356121d08161203b565b935060608701356121e08161203b565b925060808701356121f08161203b565b915060a08701356122008161203b565b809150509295509295509295565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b805169ffffffffffffffffffff811681146122c057600080fd5b919050565b600080600080600060a086880312156122dd57600080fd5b6122e6866122a6565b9450602086015193506040860151925060608601519150612309608087016122a6565b90509295509295909350565b634e487b7160e01b600052601160045260246000fd5b8181038181111561161b5761161b612315565b60006020828403121561235057600080fd5b81518015158114610d1557600080fd5b60008060006060848603121561237557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156123a057600080fd5b8151610d158161203b565b600181815b808511156123e65781600019048211156123cc576123cc612315565b808516156123d957918102915b93841c93908002906123b0565b509250929050565b6000826123fd5750600161161b565b8161240a5750600061161b565b8160018114612420576002811461242a57612446565b600191505061161b565b60ff84111561243b5761243b612315565b50506001821b61161b565b5060208310610133831016604e8410600b8410161715612469575081810a61161b565b61247383836123ab565b806000190482111561248757612487612315565b029392505050565b600061161860ff8416836123ee565b808202811582820484141761161b5761161b612315565b6000602082840312156124c757600080fd5b815160ff81168114610d1557600080fd5b6000602082840312156124ea57600080fd5b5051919050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b8082018082111561161b5761161b612315565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60005b8381101561259657818101518382015260200161257e565b50506000910152565b600082516125b181846020870161257b565b9190910192915050565b60208152600082518060208401526125da81604085016020870161257b565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212202fd6a7343e574203d5027d0e54b34ee9e0713e70d73b024ef33cc0c7e314b57a64736f6c63430008120033
Deployed Bytecode Sourcemap
80407:10240:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;83114:142;;;;;;;;;;-1:-1:-1;83114:142:0;;;;;:::i;:::-;;:::i;:::-;;80967:26;;;;;;;;;;;;;;;;;;;548:25:1;;;536:2;521:18;80967:26:0;;;;;;;;80824:27;;;;;;;;;;-1:-1:-1;80824:27:0;;;;-1:-1:-1;;;;;80824:27:0;;;;;;-1:-1:-1;;;;;748:32:1;;;730:51;;718:2;703:18;80824:27:0;584:203:1;52855:198:0;;;;;;;;;;-1:-1:-1;52855:198:0;;;;;:::i;:::-;;:::i;80742:19::-;;;;;;;;;;-1:-1:-1;80742:19:0;;;;-1:-1:-1;;;;;80742:19:0;;;87807:663;;;;;;;;;;-1:-1:-1;87807:663:0;;;;;:::i;:::-;;:::i;87689:110::-;;;;;;;;;;;;;:::i;:::-;;;957:14:1;;950:22;932:41;;920:2;905:18;87689:110:0;792:187:1;53384:223:0;;;;;;:::i;:::-;;:::i;52461:133::-;;;;;;;;;;;;;:::i;82844:108::-;;;;;;;;;;-1:-1:-1;82844:108:0;;;;;:::i;:::-;;:::i;82603:110::-;;;;;;;;;;-1:-1:-1;82603:110:0;;;;;:::i;:::-;;:::i;80858:34::-;;;;;;;;;;-1:-1:-1;80858:34:0;;;;-1:-1:-1;;;;;80858:34:0;;;89834:178;;;;;;;;;;-1:-1:-1;89834:178:0;;;;;:::i;:::-;;:::i;80768:21::-;;;;;;;;;;-1:-1:-1;80768:21:0;;;;-1:-1:-1;;;;;80768:21:0;;;80617:26;;;;;;;;;;;;;;;;86638:906;;;;;;;;;;-1:-1:-1;86638:906:0;;;;;:::i;:::-;;:::i;:::-;;;;2746:25:1;;;2802:2;2787:18;;2780:34;;;;2830:18;;;2823:34;2734:2;2719:18;86638:906:0;2544:319:1;34986:103:0;;;;;;;;;;;;;:::i;83694:193::-;;;;;;;;;;-1:-1:-1;83694:193:0;;;;;:::i;:::-;;:::i;80682:25::-;;;;;;;;;;-1:-1:-1;80682:25:0;;;;;;;;;;;;;;3682:4:1;3670:17;;;3652:36;;3640:2;3625:18;80682:25:0;3510:184:1;34345:87:0;;;;;;;;;;-1:-1:-1;34418:6:0;;-1:-1:-1;;;;;34418:6:0;34345:87;;88478:466;;;;;;;;;;-1:-1:-1;88478:466:0;;;;;:::i;:::-;;:::i;90205:233::-;;;;;;;;;;-1:-1:-1;90205:233:0;;;;;:::i;:::-;;:::i;88952:468::-;;;;;;;;;;-1:-1:-1;88952:468:0;;;;;:::i;:::-;;:::i;80650:25::-;;;;;;;;;;-1:-1:-1;80650:25:0;;;;;;;;81002:49;;;;;;;;;;;;81043:8;81002:49;;89543:148;;;;;;;;;;-1:-1:-1;89543:148:0;;;;;:::i;:::-;;:::i;80899:23::-;;;;;;;;;;;;;;;;80716:19;;;;;;;;;;-1:-1:-1;80716:19:0;;;;;;;-1:-1:-1;;;;;80716:19:0;;;81058:58;;;;;;;;;;;;;:::i;81616:840::-;;;;;;;;;;-1:-1:-1;81616:840:0;;;;;:::i;:::-;;:::i;85559:743::-;;;;;;;;;;;;;:::i;:::-;;;;4946:25:1;;;5002:2;4987:18;;4980:34;;;;5030:18;;;5023:34;;;;5088:2;5073:18;;5066:34;5131:3;5116:19;;5109:35;5175:3;5160:19;;5153:35;4933:3;4918:19;85559:743:0;4659:535:1;83529:157:0;;;;;;;;;;-1:-1:-1;83529:157:0;;;;;:::i;:::-;;:::i;80587:23::-;;;;;;;;;;;;;;;;80929:29;;;;;;;;;;;;;;;;35244:201;;;;;;;;;;-1:-1:-1;35244:201:0;;;;;:::i;:::-;;:::i;80796:21::-;;;;;;;;;;-1:-1:-1;80796:21:0;;;;-1:-1:-1;;;;;80796:21:0;;;83114:142;34231:13;:11;:13::i;:::-;83206:19:::1;:42:::0;;-1:-1:-1;;;;;;83206:42:0::1;-1:-1:-1::0;;;;;83206:42:0;;;::::1;::::0;;;::::1;::::0;;83114:142::o;52855:198::-;-1:-1:-1;;;;;51171:6:0;51154:23;51162:4;51154:23;51146:80;;;;-1:-1:-1;;;51146:80:0;;;;;;;:::i;:::-;;;;;;;;;51269:6;-1:-1:-1;;;;;51245:30:0;:20;-1:-1:-1;;;;;;;;;;;44090:65:0;-1:-1:-1;;;;;44090:65:0;;44010:153;51245:20;-1:-1:-1;;;;;51245:30:0;;51237:87;;;;-1:-1:-1;;;51237:87:0;;;;;;;:::i;:::-;52937:36:::1;52955:17;52937;:36::i;:::-;53025:12;::::0;;53035:1:::1;53025:12:::0;;;::::1;::::0;::::1;::::0;;;52984:61:::1;::::0;53006:17;;53025:12;52984:21:::1;:61::i;:::-;52855:198:::0;:::o;87807:663::-;87863:7;87884:14;87900:12;87916:17;87935:22;87972:7;-1:-1:-1;;;;;87961:49:0;;:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;87883:129;;;;;;;;;88125:11;;88113:9;88095:15;:27;;;;:::i;:::-;:41;88091:115;;;88182:11;;88160:34;;-1:-1:-1;;;88160:34:0;;;;88171:9;;88160:34;;7126:25:1;;;7182:2;7167:18;;7160:34;7114:2;7099:18;;6952:248;88091:115:0;88284:7;88266:25;;:15;:25;;;88262:99;;;88337:11;;88315:34;;-1:-1:-1;;;88315:34:0;;;;88326:9;;88315:34;;7126:25:1;;;7182:2;7167:18;;7160:34;7114:2;7099:18;;6952:248;88262:99:0;88394:8;;88385:5;88377:25;88373:57;;;88411:19;;-1:-1:-1;;;88411:19:0;;;;;548:25:1;;;521:18;;88411:19:0;402:177:1;88373:57:0;-1:-1:-1;88456:5:0;;87807:663;-1:-1:-1;;;;87807:663:0:o;87689:110::-;87771:6;;87759:32;;;-1:-1:-1;;;87759:32:0;;;;87735:4;;-1:-1:-1;;;;;87771:6:0;;87759:30;;:32;;;;;;;;;;;;;;87771:6;87759:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;87752:39;;87689:110;:::o;53384:223::-;-1:-1:-1;;;;;51171:6:0;51154:23;51162:4;51154:23;51146:80;;;;-1:-1:-1;;;51146:80:0;;;;;;;:::i;:::-;51269:6;-1:-1:-1;;;;;51245:30:0;:20;-1:-1:-1;;;;;;;;;;;44090:65:0;-1:-1:-1;;;;;44090:65:0;;44010:153;51245:20;-1:-1:-1;;;;;51245:30:0;;51237:87;;;;-1:-1:-1;;;51237:87:0;;;;;;;:::i;:::-;53500:36:::1;53518:17;53500;:36::i;:::-;53547:52;53569:17;53588:4;53594;53547:21;:52::i;:::-;53384:223:::0;;:::o;52461:133::-;52539:7;51607:4;-1:-1:-1;;;;;51616:6:0;51599:23;;51591:92;;;;-1:-1:-1;;;51591:92:0;;7869:2:1;51591:92:0;;;7851:21:1;7908:2;7888:18;;;7881:30;7947:34;7927:18;;;7920:62;8018:26;7998:18;;;7991:54;8062:19;;51591:92:0;7667:420:1;51591:92:0;-1:-1:-1;;;;;;;;;;;;52461:133:0;:::o;82844:108::-;34231:13;:11;:13::i;:::-;82919:14:::1;:25:::0;82844:108::o;82603:110::-;34231:13;:11;:13::i;:::-;82679:11:::1;:26:::0;82603:110::o;89834:178::-;34231:13;:11;:13::i;:::-;-1:-1:-1;;;;;89916:27:0;::::1;89912:53;;89952:13;;-1:-1:-1::0;;;89952:13:0::1;;;;;;;;;;;89912:53;89976:12;:28:::0;;-1:-1:-1;;;;;;89976:28:0::1;-1:-1:-1::0;;;;;89976:28:0;;;::::1;::::0;;;::::1;::::0;;89834:178::o;86638:906::-;86719:25;86746:26;86774:21;86850;86875:16;:14;:16::i;:::-;86953:19;;86839:52;;-1:-1:-1;86839:52:0;;-1:-1:-1;;;;;;86953:19:0;;-1:-1:-1;86949:588:0;;-1:-1:-1;;;;86949:588:0;87023:1;87003:21;;87055:1;87039:17;;86949:588;;;87211:19;;87191:65;;-1:-1:-1;;;87191:65:0;;-1:-1:-1;;;;;748:32:1;;;87191:65:0;;;730:51:1;87161:22:0;;87211:19;;87191:59;;703:18:1;;87191:65:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;87160:96;;;;87287:14;87271:30;;87399:19;87421:34;87440:14;87421:18;:34::i;:::-;87399:56;-1:-1:-1;87490:35:0;:18;87399:56;87490:22;:35::i;:::-;87470:55;;87074:463;;86949:588;86797:747;86638:906;;;;;:::o;34986:103::-;34231:13;:11;:13::i;:::-;35051:30:::1;35078:1;35051:18;:30::i;:::-;34986:103::o:0;83694:193::-;83796:14;83812:11;83825:12;83857:22;83865:4;83871:7;83857;:22::i;:::-;83850:29;;;;;;83694:193;;;;;:::o;88478:466::-;88544:7;88564:13;88580:38;88601:6;;;;;;;;;-1:-1:-1;;;;;88601:6:0;-1:-1:-1;;;;;88589:26:0;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;88580:38::-;88867:11;;88852:12;;88564:54;;-1:-1:-1;88831:105:0;;88846:18;;88852:12;;88846:2;:18;:::i;:::-;:32;;;;:::i;:::-;88894:12;;88888:18;;88894:12;;;;;88888:2;:18;:::i;:::-;88880:26;;:5;:26;:::i;:::-;88831:7;;:105;88908:27;88831:14;:105::i;:::-;88811:125;88478:466;-1:-1:-1;;;88478:466:0:o;90205:233::-;34231:13;:11;:13::i;:::-;-1:-1:-1;;;;;90297:19:0;::::1;90293:45;;90325:13;;-1:-1:-1::0;;;90325:13:0::1;;;;;;;;;;;90293:45;90409:12;::::0;90349:81:::1;::::0;90401:5;;-1:-1:-1;;;;;90409:12:0::1;90423:6:::0;90349:33:::1;:81::i;88952:468::-:0;89018:7;89038:13;89054:38;89075:6;;;;;;;;;-1:-1:-1;;;;;89075:6:0;-1:-1:-1;;;;;89063:26:0;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;89054:38;89334:12;;89038:54;;-1:-1:-1;89305:107:0;;89328:18;;89334:12;;;;;89328:2;:18;:::i;:::-;89320:26;;:5;:26;:::i;:::-;89368:12;;89362:18;;89368:12;;89362:2;:18;:::i;:::-;89348:11;;:32;;;;:::i;:::-;89305:7;;:107;89382:29;89305:14;:107::i;89543:148::-;34231:13;:11;:13::i;:::-;-1:-1:-1;;;;;89613:21:0;::::1;89609:47;;89643:13;;-1:-1:-1::0;;;89643:13:0::1;;;;;;;;;;;89609:47;89667:6;:16:::0;;-1:-1:-1;;;;;;89667:16:0::1;-1:-1:-1::0;;;;;89667:16:0;;;::::1;::::0;;;::::1;::::0;;89543:148::o;81058:58::-;81096:20;81043:8;81096:3;:20;:::i;:::-;81058:58;:::o;81616:840::-;27913:19;27936:13;;;;;;27935:14;;27983:34;;;;-1:-1:-1;28001:12:0;;28016:1;28001:12;;;;:16;27983:34;27982:108;;;-1:-1:-1;28062:4:0;9487:19;:23;;;28023:66;;-1:-1:-1;28072:12:0;;;;;:17;28023:66;27960:204;;;;-1:-1:-1;;;27960:204:0;;10417:2:1;27960:204:0;;;10399:21:1;10456:2;10436:18;;;10429:30;10495:34;10475:18;;;10468:62;-1:-1:-1;;;10546:18:1;;;10539:44;10600:19;;27960:204:0;10215:410:1;27960:204:0;28175:12;:16;;-1:-1:-1;;28175:16:0;28190:1;28175:16;;;28202:67;;;;28237:13;:20;;-1:-1:-1;;28237:20:0;;;;;28202:67;81844:16:::1;:14;:16::i;:::-;81871:24;:22;:24::i;:::-;81908:4;:12:::0;;-1:-1:-1;;;;;;81908:12:0::1;::::0;-1:-1:-1;;;;;81908:12:0;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;;81931:4:::1;:12:::0;;-1:-1:-1;;;;;;81931:12:0;;::::1;::::0;;::::1;;::::0;;;81954:6:::1;:16:::0;;;::::1;::::0;;::::1;;::::0;;81981:6:::1;:16:::0;;;::::1;::::0;;::::1;;::::0;;82008:12:::1;:28:::0;;;::::1;::::0;;::::1;;::::0;;82047:19:::1;:42:::0;;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;;82159:43:::1;::::0;;-1:-1:-1;;;82159:43:0;;;;:41:::1;::::0;:43:::1;::::0;;::::1;::::0;::::1;::::0;;;;;;;;;81908:12;82159:43:::1;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;82144:12;;:58;;;;;;;;;;;;;;;;;;82254:5;-1:-1:-1::0;;;;;82228:41:0::1;;:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;82213:12;;:58;;;;;;;;;;;;;;;;;;82327:6;;;;;;;;;-1:-1:-1::0;;;;;82327:6:0::1;-1:-1:-1::0;;;;;82315:26:0::1;;:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;82304:49:0::1;;:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;82298:57;::::0;:2:::1;:57;:::i;:::-;82284:11;:71:::0;;;82377:15:::1;::::0;:1:::1;:15;:::i;:::-;82366:8;:26:::0;82417:6:::1;82403:11;:20:::0;28291:102;;;;28342:5;28326:21;;-1:-1:-1;;28326:21:0;;;28367:14;;-1:-1:-1;3652:36:1;;28367:14:0;;3640:2:1;3625:18;28367:14:0;;;;;;;28291:102;27902:498;81616:840;;;;;;:::o;85559:743::-;85916:4;;85932:6;;85898:41;;-1:-1:-1;;;85898:41:0;;-1:-1:-1;;;;;85932:6:0;;;85898:41;;;730:51:1;85665:17:0;;;;;;;;;;;;85916:4;;;85898:33;;703:18:1;;85898:41:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85983:4;;85999:12;;85965:62;;-1:-1:-1;;;85965:62:0;;-1:-1:-1;;;;;85999:12:0;;;85965:62;;;11508:34:1;86021:4:0;11558:18:1;;;11551:43;85886:53:0;;-1:-1:-1;85983:4:0;;;;;;85965:33;;11443:18:1;;85965:62:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;85952:75;;86057:30;86076:10;86057:18;:30::i;:::-;86129:4;;86145:12;;86111:47;;-1:-1:-1;;;86111:47:0;;-1:-1:-1;;;;;86145:12:0;;;86111:47;;;730:51:1;86038:49:0;;-1:-1:-1;86129:4:0;;;;;;86111:33;;703:18:1;;86111:47:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;86100:58;;86186:28;86205:8;86186:18;:28::i;:::-;86169:45;-1:-1:-1;86243:51:0;86257:36;:16;86169:45;86257:20;:36::i;:::-;86243:9;;:13;:51::i;:::-;86227:67;;85559:743;;;;;;:::o;83529:157::-;83589:14;83605:11;83618:12;83650:28;83666:1;83670:7;83650;:28::i;:::-;83643:35;;;;;;83529:157;;;;;:::o;35244:201::-;34231:13;:11;:13::i;:::-;-1:-1:-1;;;;;35333:22:0;::::1;35325:73;;;::::0;-1:-1:-1;;;35325:73:0;;11807:2:1;35325:73:0::1;::::0;::::1;11789:21:1::0;11846:2;11826:18;;;11819:30;11885:34;11865:18;;;11858:62;-1:-1:-1;;;11936:18:1;;;11929:36;11982:19;;35325:73:0::1;11605:402:1::0;35325:73:0::1;35409:28;35428:8;35409:18;:28::i;34510:132::-:0;34418:6;;-1:-1:-1;;;;;34418:6:0;32343:10;34574:23;34566:68;;;;-1:-1:-1;;;34566:68:0;;12214:2:1;34566:68:0;;;12196:21:1;;;12233:18;;;12226:30;12292:34;12272:18;;;12265:62;12344:18;;34566:68:0;12012:356:1;90560:84:0;34231:13;:11;:13::i;45412:958::-;43354:66;45832:59;;;45828:535;;;45908:37;45927:17;45908:18;:37::i;:::-;45412:958;;;:::o;45828:535::-;46011:17;-1:-1:-1;;;;;45982:61:0;;:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;45982:63:0;;;;;;;;-1:-1:-1;;45982:63:0;;;;;;;;;;;;:::i;:::-;;;45978:306;;46212:56;;-1:-1:-1;;;46212:56:0;;12764:2:1;46212:56:0;;;12746:21:1;12803:2;12783:18;;;12776:30;12842:34;12822:18;;;12815:62;-1:-1:-1;;;12893:18:1;;;12886:44;12947:19;;46212:56:0;12562:410:1;45978:306:0;-1:-1:-1;;;;;;;;;;;46096:28:0;;46088:82;;;;-1:-1:-1;;;46088:82:0;;13179:2:1;46088:82:0;;;13161:21:1;13218:2;13198:18;;;13191:30;13257:34;13237:18;;;13230:62;-1:-1:-1;;;13308:18:1;;;13301:39;13357:19;;46088:82:0;12977:405:1;46088:82:0;46046:140;46298:53;46316:17;46335:4;46341:9;46298:17;:53::i;55088:106::-;55146:7;55177:1;55173;:5;:13;;55185:1;55173:13;;;55181:1;55173:13;55166:20;;55088:106;;;;;:::o;35605:191::-;35698:6;;;-1:-1:-1;;;;;35715:17:0;;;-1:-1:-1;;;;;;35715:17:0;;;;;;;35748:40;;35698:6;;;35715:17;35698:6;;35748:40;;35679:16;;35748:40;35668:128;35605:191;:::o;83895:1112::-;84033:6;;83961:14;;;;;;-1:-1:-1;;;;;84033:6:0;84019:10;:20;84015:53;;84048:20;;-1:-1:-1;;;84048:20:0;;;;;;;;;;;84015:53;84083:19;;-1:-1:-1;;;;;84083:19:0;84079:73;;84125:27;;-1:-1:-1;;;84125:27:0;;;;;;;;;;;84079:73;84199:6;;84187:29;;;-1:-1:-1;;;84187:29:0;;;;84165:19;;-1:-1:-1;;;;;84199:6:0;;84187:27;;:29;;;;;;;;;;;;;;84199:6;84187:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;84165:51;;84245:14;;84231:11;:28;84227:70;;;84268:29;;-1:-1:-1;;;84268:29:0;;;;;548:25:1;;;521:18;;84268:29:0;402:177:1;84227:70:0;84310:18;84331:27;84350:7;84331:18;:27::i;:::-;84310:48;-1:-1:-1;;;;;;84442:18:0;;;84438:197;;84568:19;;84548:75;;-1:-1:-1;;;84548:75:0;;-1:-1:-1;;;;;13579:32:1;;;84548:75:0;;;13561:51:1;13628:18;;;13621:34;;;84568:19:0;;;;84548:57;;13534:18:1;;84548:75:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;84438:197;84703:4;;84710:12;;84647:103;;-1:-1:-1;;;;;84703:4:0;;;;;;;84710:12;84732:4;84739:10;84647:37;:103::i;:::-;84822:4;;84829:6;;84761:87;;-1:-1:-1;;;;;84822:4:0;;;;;;;84829:6;84837:10;84761:42;:87::i;:::-;84882:6;;84918;;84870:56;;-1:-1:-1;;;84870:56:0;;;;;13840:25:1;;;-1:-1:-1;;;;;84918:6:0;;;13881:18:1;;;13874:60;84882:6:0;;;84870:27;;13813:18:1;;84870:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;84968:6;;84956:43;;-1:-1:-1;;;84956:43:0;;;;;548:25:1;;;84861:65:0;;-1:-1:-1;;;;;;84968:6:0;;84956:31;;521:18:1;;84956:43:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;83895:1112;;84939:60;;-1:-1:-1;84939:60:0;;-1:-1:-1;;;;;;83895:1112:0:o;60625:305::-;60726:7;60746:14;60763:25;60770:1;60773;60776:11;60763:6;:25::i;:::-;60746:42;-1:-1:-1;60815:11:0;60803:8;:23;;;;;;;;:::i;:::-;;:56;;;;;60858:1;60843:11;60830:25;;;;;:::i;:::-;60840:1;60837;60830:25;:29;60803:56;60799:100;;;60876:11;60886:1;60876:11;;:::i;:::-;;;60799:100;60916:6;-1:-1:-1;60625:305:0;;;;;;;:::o;18311:188::-;18432:58;;-1:-1:-1;;;;;13579:32:1;;18432:58:0;;;13561:51:1;13628:18;;;13621:34;;;18405:86:0;;18425:5;;-1:-1:-1;;;18455:23:0;13534:18:1;;18432:58:0;;;;-1:-1:-1;;18432:58:0;;;;;;;;;;;;;;-1:-1:-1;;;;;18432:58:0;-1:-1:-1;;;;;;18432:58:0;;;;;;;;;;18405:19;:86::i;33888:97::-;30056:13;;;;;;;30048:69;;;;-1:-1:-1;;;30048:69:0;;;;;;;:::i;:::-;33951:26:::1;:24;:26::i;51711:68::-:0;30056:13;;;;;;;30048:69;;;;-1:-1:-1;;;30048:69:0;;;;;;;:::i;44259:284::-;-1:-1:-1;;;;;9487:19:0;;;44333:106;;;;-1:-1:-1;;;44333:106:0;;15263:2:1;44333:106:0;;;15245:21:1;15302:2;15282:18;;;15275:30;15341:34;15321:18;;;15314:62;-1:-1:-1;;;15392:18:1;;;15385:43;15445:19;;44333:106:0;15061:409:1;44333:106:0;-1:-1:-1;;;;;;;;;;;44450:85:0;;-1:-1:-1;;;;;;44450:85:0;-1:-1:-1;;;;;44450:85:0;;;;;;;;;;44259:284::o;44952:281::-;45061:29;45072:17;45061:10;:29::i;:::-;45119:1;45105:4;:11;:15;:28;;;;45124:9;45105:28;45101:125;;;45150:64;45190:17;45209:4;45150:39;:64::i;:::-;;44952:281;;;:::o;18744:216::-;18883:68;;-1:-1:-1;;;;;15733:15:1;;;18883:68:0;;;15715:34:1;15785:15;;15765:18;;;15758:43;15817:18;;;15810:34;;;18856:96:0;;18876:5;;-1:-1:-1;;;18906:27:0;15650:18:1;;18883:68:0;15475:375:1;20019:294:0;20150:39;;-1:-1:-1;;;20150:39:0;;20174:4;20150:39;;;11508:34:1;-1:-1:-1;;;;;11578:15:1;;;11558:18;;;11551:43;20127:20:0;;20150:15;;;;;;11443:18:1;;20150:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;20127:62;-1:-1:-1;20200:105:0;20220:5;-1:-1:-1;;;20274:7:0;20283:20;20298:5;20127:62;20283:20;:::i;:::-;20227:77;;-1:-1:-1;;;;;13579:32:1;;;20227:77:0;;;13561:51:1;13628:18;;;13621:34;13534:18;;20227:77:0;13387:274:1;56196:4292:0;56278:14;;;-1:-1:-1;;56823:1:0;56820;56813:20;56867:1;56864;56860:9;56851:18;;56923:5;56919:2;56916:13;56908:5;56904:2;56900:14;56896:34;56887:43;;;57029:5;57038:1;57029:10;57025:373;;57371:11;57363:5;:19;;;;;:::i;:::-;;57356:26;;;;;;57025:373;57525:5;57511:11;:19;57503:53;;;;-1:-1:-1;;;57503:53:0;;16057:2:1;57503:53:0;;;16039:21:1;16096:2;16076:18;;;16069:30;-1:-1:-1;;;16115:18:1;;;16108:51;16176:18;;57503:53:0;15855:345:1;57503:53:0;57819:17;57957:11;57954:1;57951;57944:25;59364:1;59345;58516;58501:12;;:16;;58486:32;;58624:22;;;;59345:15;;;59344:21;;59601;;;59597:25;;59586:36;59671:21;;;59667:25;;59656:36;59742:21;;;59738:25;;59727:36;59813:21;;;59809:25;;59798:36;59884:21;;;59880:25;;59869:36;59956:21;;;59952:25;;;59941:36;58471:12;58875;;;58871:23;;;58867:31;;;58074:20;;;58063:32;;;58991:12;;;;58122:21;;58725:16;;;;58982:21;;;;60426:15;;56196:4292;-1:-1:-1;;;;56196:4292:0:o;22734:660::-;23169:23;23195:69;23223:4;23195:69;;;;;;;;;;;;;;;;;23203:5;-1:-1:-1;;;;;23195:27:0;;;:69;;;;;:::i;:::-;23169:95;;23283:10;:17;23304:1;23283:22;:56;;;;23320:10;23309:30;;;;;;;;;;;;:::i;:::-;23275:111;;;;-1:-1:-1;;;23275:111:0;;16407:2:1;23275:111:0;;;16389:21:1;16446:2;16426:18;;;16419:30;16485:34;16465:18;;;16458:62;-1:-1:-1;;;16536:18:1;;;16529:40;16586:19;;23275:111:0;16205:406:1;33993:113:0;30056:13;;;;;;;30048:69;;;;-1:-1:-1;;;30048:69:0;;;;;;;:::i;:::-;34066:32:::1;32343:10:::0;34066:18:::1;:32::i;44656:155::-:0;44723:37;44742:17;44723:18;:37::i;:::-;44776:27;;-1:-1:-1;;;;;44776:27:0;;;;;;;;44656:155;:::o;14584:200::-;14667:12;14699:77;14720:6;14728:4;14699:77;;;;;;;;;;;;;;;;;:20;:77::i;11947:229::-;12084:12;12116:52;12138:6;12146:4;12152:1;12155:12;12116:21;:52::i;14978:332::-;15123:12;15149;15163:23;15190:6;-1:-1:-1;;;;;15190:19:0;15210:4;15190:25;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15148:67;;;;15233:69;15260:6;15268:7;15277:10;15289:12;15233:26;:69::i;:::-;15226:76;14978:332;-1:-1:-1;;;;;;14978:332:0:o;13033:455::-;13203:12;13261:5;13236:21;:30;;13228:81;;;;-1:-1:-1;;;13228:81:0;;17365:2:1;13228:81:0;;;17347:21:1;17404:2;17384:18;;;17377:30;17443:34;17423:18;;;17416:62;-1:-1:-1;;;17494:18:1;;;17487:36;17540:19;;13228:81:0;17163:402:1;13228:81:0;13321:12;13335:23;13362:6;-1:-1:-1;;;;;13362:11:0;13381:5;13388:4;13362:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13320:73;;;;13411:69;13438:6;13446:7;13455:10;13467:12;13411:26;:69::i;:::-;13404:76;13033:455;-1:-1:-1;;;;;;;13033:455:0:o;15606:644::-;15791:12;15820:7;15816:427;;;15848:10;:17;15869:1;15848:22;15844:290;;-1:-1:-1;;;;;9487:19:0;;;16058:60;;;;-1:-1:-1;;;16058:60:0;;17772:2:1;16058:60:0;;;17754:21:1;17811:2;17791:18;;;17784:30;17850:31;17830:18;;;17823:59;17899:18;;16058:60:0;17570:353:1;16058:60:0;-1:-1:-1;16155:10:0;16148:17;;15816:427;16198:33;16206:10;16218:12;16953:17;;:21;16949:388;;17185:10;17179:17;17242:15;17229:10;17225:2;17221:19;17214:44;16949:388;17312:12;17305:20;;-1:-1:-1;;;17305:20:0;;;;;;;;:::i;14:131:1:-;-1:-1:-1;;;;;89:31:1;;79:42;;69:70;;135:1;132;125:12;150:247;209:6;262:2;250:9;241:7;237:23;233:32;230:52;;;278:1;275;268:12;230:52;317:9;304:23;336:31;361:5;336:31;:::i;984:127::-;1045:10;1040:3;1036:20;1033:1;1026:31;1076:4;1073:1;1066:15;1100:4;1097:1;1090:15;1116:1056;1193:6;1201;1254:2;1242:9;1233:7;1229:23;1225:32;1222:52;;;1270:1;1267;1260:12;1222:52;1309:9;1296:23;1328:31;1353:5;1328:31;:::i;:::-;1378:5;-1:-1:-1;1434:2:1;1419:18;;1406:32;1457:18;1487:14;;;1484:34;;;1514:1;1511;1504:12;1484:34;1552:6;1541:9;1537:22;1527:32;;1597:7;1590:4;1586:2;1582:13;1578:27;1568:55;;1619:1;1616;1609:12;1568:55;1655:2;1642:16;1677:2;1673;1670:10;1667:36;;;1683:18;;:::i;:::-;1758:2;1752:9;1726:2;1812:13;;-1:-1:-1;;1808:22:1;;;1832:2;1804:31;1800:40;1788:53;;;1856:18;;;1876:22;;;1853:46;1850:72;;;1902:18;;:::i;:::-;1942:10;1938:2;1931:22;1977:2;1969:6;1962:18;2017:7;2012:2;2007;2003;1999:11;1995:20;1992:33;1989:53;;;2038:1;2035;2028:12;1989:53;2094:2;2089;2085;2081:11;2076:2;2068:6;2064:15;2051:46;2139:1;2134:2;2129;2121:6;2117:15;2113:24;2106:35;2160:6;2150:16;;;;;;;1116:1056;;;;;:::o;2359:180::-;2418:6;2471:2;2459:9;2450:7;2446:23;2442:32;2439:52;;;2487:1;2484;2477:12;2439:52;-1:-1:-1;2510:23:1;;2359:180;-1:-1:-1;2359:180:1:o;2868:315::-;2936:6;2944;2997:2;2985:9;2976:7;2972:23;2968:32;2965:52;;;3013:1;3010;3003:12;2965:52;3052:9;3039:23;3071:31;3096:5;3071:31;:::i;:::-;3121:5;3173:2;3158:18;;;;3145:32;;-1:-1:-1;;;2868:315:1:o;3699:955::-;3803:6;3811;3819;3827;3835;3843;3896:3;3884:9;3875:7;3871:23;3867:33;3864:53;;;3913:1;3910;3903:12;3864:53;3952:9;3939:23;3971:31;3996:5;3971:31;:::i;:::-;4021:5;-1:-1:-1;4078:2:1;4063:18;;4050:32;4091:33;4050:32;4091:33;:::i;:::-;4143:7;-1:-1:-1;4202:2:1;4187:18;;4174:32;4215:33;4174:32;4215:33;:::i;:::-;4267:7;-1:-1:-1;4326:2:1;4311:18;;4298:32;4339:33;4298:32;4339:33;:::i;:::-;4391:7;-1:-1:-1;4450:3:1;4435:19;;4422:33;4464;4422;4464;:::i;:::-;4516:7;-1:-1:-1;4575:3:1;4560:19;;4547:33;4589;4547;4589;:::i;:::-;4641:7;4631:17;;;3699:955;;;;;;;;:::o;5199:408::-;5401:2;5383:21;;;5440:2;5420:18;;;5413:30;5479:34;5474:2;5459:18;;5452:62;-1:-1:-1;;;5545:2:1;5530:18;;5523:42;5597:3;5582:19;;5199:408::o;5612:::-;5814:2;5796:21;;;5853:2;5833:18;;;5826:30;5892:34;5887:2;5872:18;;5865:62;-1:-1:-1;;;5958:2:1;5943:18;;5936:42;6010:3;5995:19;;5612:408::o;6025:179::-;6103:13;;6156:22;6145:34;;6135:45;;6125:73;;6194:1;6191;6184:12;6125:73;6025:179;;;:::o;6209:473::-;6312:6;6320;6328;6336;6344;6397:3;6385:9;6376:7;6372:23;6368:33;6365:53;;;6414:1;6411;6404:12;6365:53;6437:39;6466:9;6437:39;:::i;:::-;6427:49;;6516:2;6505:9;6501:18;6495:25;6485:35;;6560:2;6549:9;6545:18;6539:25;6529:35;;6604:2;6593:9;6589:18;6583:25;6573:35;;6627:49;6671:3;6660:9;6656:19;6627:49;:::i;:::-;6617:59;;6209:473;;;;;;;;:::o;6687:127::-;6748:10;6743:3;6739:20;6736:1;6729:31;6779:4;6776:1;6769:15;6803:4;6800:1;6793:15;6819:128;6886:9;;;6907:11;;;6904:37;;;6921:18;;:::i;7385:277::-;7452:6;7505:2;7493:9;7484:7;7480:23;7476:32;7473:52;;;7521:1;7518;7511:12;7473:52;7553:9;7547:16;7606:5;7599:13;7592:21;7585:5;7582:32;7572:60;;7628:1;7625;7618:12;8092:306;8180:6;8188;8196;8249:2;8237:9;8228:7;8224:23;8220:32;8217:52;;;8265:1;8262;8255:12;8217:52;8294:9;8288:16;8278:26;;8344:2;8333:9;8329:18;8323:25;8313:35;;8388:2;8377:9;8373:18;8367:25;8357:35;;8092:306;;;;;:::o;8403:251::-;8473:6;8526:2;8514:9;8505:7;8501:23;8497:32;8494:52;;;8542:1;8539;8532:12;8494:52;8574:9;8568:16;8593:31;8618:5;8593:31;:::i;8659:422::-;8748:1;8791:5;8748:1;8805:270;8826:7;8816:8;8813:21;8805:270;;;8885:4;8881:1;8877:6;8873:17;8867:4;8864:27;8861:53;;;8894:18;;:::i;:::-;8944:7;8934:8;8930:22;8927:55;;;8964:16;;;;8927:55;9043:22;;;;9003:15;;;;8805:270;;;8809:3;8659:422;;;;;:::o;9086:806::-;9135:5;9165:8;9155:80;;-1:-1:-1;9206:1:1;9220:5;;9155:80;9254:4;9244:76;;-1:-1:-1;9291:1:1;9305:5;;9244:76;9336:4;9354:1;9349:59;;;;9422:1;9417:130;;;;9329:218;;9349:59;9379:1;9370:10;;9393:5;;;9417:130;9454:3;9444:8;9441:17;9438:43;;;9461:18;;:::i;:::-;-1:-1:-1;;9517:1:1;9503:16;;9532:5;;9329:218;;9631:2;9621:8;9618:16;9612:3;9606:4;9603:13;9599:36;9593:2;9583:8;9580:16;9575:2;9569:4;9566:12;9562:35;9559:77;9556:159;;;-1:-1:-1;9668:19:1;;;9700:5;;9556:159;9747:34;9772:8;9766:4;9747:34;:::i;:::-;9817:6;9813:1;9809:6;9805:19;9796:7;9793:32;9790:58;;;9828:18;;:::i;:::-;9866:20;;9086:806;-1:-1:-1;;;9086:806:1:o;9897:140::-;9955:5;9984:47;10025:4;10015:8;10011:19;10005:4;9984:47;:::i;10042:168::-;10115:9;;;10146;;10163:15;;;10157:22;;10143:37;10133:71;;10184:18;;:::i;10630:273::-;10698:6;10751:2;10739:9;10730:7;10726:23;10722:32;10719:52;;;10767:1;10764;10757:12;10719:52;10799:9;10793:16;10849:4;10842:5;10838:16;10831:5;10828:27;10818:55;;10869:1;10866;10859:12;11107:184;11177:6;11230:2;11218:9;11209:7;11205:23;11201:32;11198:52;;;11246:1;11243;11236:12;11198:52;-1:-1:-1;11269:16:1;;11107:184;-1:-1:-1;11107:184:1:o;14255:127::-;14316:10;14311:3;14307:20;14304:1;14297:31;14347:4;14344:1;14337:15;14371:4;14368:1;14361:15;14387:127;14448:10;14443:3;14439:20;14436:1;14429:31;14479:4;14476:1;14469:15;14503:4;14500:1;14493:15;14519:125;14584:9;;;14605:10;;;14602:36;;;14618:18;;:::i;14649:407::-;14851:2;14833:21;;;14890:2;14870:18;;;14863:30;14929:34;14924:2;14909:18;;14902:62;-1:-1:-1;;;14995:2:1;14980:18;;14973:41;15046:3;15031:19;;14649:407::o;16616:250::-;16701:1;16711:113;16725:6;16722:1;16719:13;16711:113;;;16801:11;;;16795:18;16782:11;;;16775:39;16747:2;16740:10;16711:113;;;-1:-1:-1;;16858:1:1;16840:16;;16833:27;16616:250::o;16871:287::-;17000:3;17038:6;17032:13;17054:66;17113:6;17108:3;17101:4;17093:6;17089:17;17054:66;:::i;:::-;17136:16;;;;;16871:287;-1:-1:-1;;16871:287:1:o;17928:396::-;18077:2;18066:9;18059:21;18040:4;18109:6;18103:13;18152:6;18147:2;18136:9;18132:18;18125:34;18168:79;18240:6;18235:2;18224:9;18220:18;18215:2;18207:6;18203:15;18168:79;:::i;:::-;18308:2;18287:15;-1:-1:-1;;18283:29:1;18268:45;;;;18315:2;18264:54;;17928:396;-1:-1:-1;;17928:396:1:o
Swarm Source
ipfs://2fd6a7343e574203d5027d0e54b34ee9e0713e70d73b024ef33cc0c7e314b57a
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.