Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
OpenFundRedemptionDelegate
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 1 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@solvprotocol/contracts-v3-sft-abilities/contracts/fcfs-multi-repayable/FCFSMultiRepayableDelegate.sol"; import "@solvprotocol/contracts-v3-sft-abilities/contracts/value-issuable/SFTValueIssuableDelegate.sol"; import "./IOpenFundRedemptionDelegate.sol"; import "./IOpenFundRedemptionConcrete.sol"; contract OpenFundRedemptionDelegate is IOpenFundRedemptionDelegate, SFTValueIssuableDelegate, FCFSMultiRepayableDelegate { bytes32 internal constant CONTRACT_OPEN_FUND_MARKET = "OpenFundMarket"; bool private __allowRepayWithBalance; /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address resolver_, string calldata name_, string calldata symbol_, uint8 decimals_, address concrete_, address descriptor_, address owner_, bool allowRepayWithBalance_ ) external initializer { __SFTIssuableDelegate_init(resolver_, name_, symbol_, decimals_, concrete_, descriptor_, owner_); __allowRepayWithBalance = allowRepayWithBalance_; } function setRedeemNavOnlyMarket(uint256 slot_, uint256 nav_) external virtual override { require(_msgSender() == _issueMarket(), "OFRD: only market"); IOpenFundRedemptionConcrete(concrete()).setRedeemNavOnlyDelegate(slot_, nav_); } function claimTo(address to_, uint256 tokenId_, address currency_, uint256 claimValue_) external virtual override nonReentrant { require(claimValue_ > 0, "MultiRepayableDelegate: claim value is zero"); require(_isApprovedOrOwner(_msgSender(), tokenId_), "MultiRepayableDelegate: caller is not owner nor approved"); uint256 slot = ERC3525Upgradeable.slotOf(tokenId_); uint256 claimableValue = IFCFSMultiRepayableConcrete(concrete()).claimableValue(tokenId_); require(claimValue_ <= claimableValue, "MultiRepayableDelegate: over claim"); uint256 claimCurrencyAmount = IFCFSMultiRepayableConcrete(concrete()).claimOnlyDelegate(tokenId_, slot, currency_, claimValue_); uint256 feeRate = IOpenFundRedemptionConcrete(concrete()).getRedemptionFeeRate(slot); uint256 feeAmount = claimCurrencyAmount * feeRate / 1e18; if (claimValue_ == ERC3525Upgradeable.balanceOf(tokenId_)) { ERC3525Upgradeable._burn(tokenId_); } else { ERC3525Upgradeable._burnValue(tokenId_, claimValue_); } address feeReceiver = IOpenFundRedemptionConcrete(concrete()).redemptionFeeReceiver(); if (feeReceiver != address(0) && feeAmount > 0) { ERC20TransferHelper.doTransferOut(currency_, payable(feeReceiver), feeAmount); } ERC20TransferHelper.doTransferOut(currency_, payable(to_), claimCurrencyAmount - feeAmount); emit Claim(to_, tokenId_, claimValue_, currency_, claimCurrencyAmount); } function allowRepayWithBalance() public view virtual override returns (bool) { return __allowRepayWithBalance; } function _beforeValueTransfer( address from_, address to_, uint256 fromTokenId_, uint256 toTokenId_, uint256 slot_, uint256 value_ ) internal virtual override(ERC3525SlotEnumerableUpgradeable, FCFSMultiRepayableDelegate) { FCFSMultiRepayableDelegate._beforeValueTransfer(from_, to_, fromTokenId_, toTokenId_, slot_, value_); } function _resolverAddressesRequired() internal view virtual override returns (bytes32[] memory addressNames) { addressNames = new bytes32[](1); addressNames[0] = CONTRACT_OPEN_FUND_MARKET; } function _issueMarket() internal view virtual override returns (address) { return getRequiredAddress(CONTRACT_OPEN_FUND_MARKET, "OFRD: OpenFundMarket not set"); } function contractType() external view virtual override returns (string memory) { return "Open Fund Redemptions"; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @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] * ``` * 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev 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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return 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 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); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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; } /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library CountersUpgradeable { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. 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 10, 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 * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = MathUpgradeable.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, MathUpgradeable.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IAddressResolver { function getAddress(bytes32 name) external view returns (address); function getRequiredAddress(bytes32 name, string calldata reason) external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "./IAddressResolver.sol"; abstract contract ResolverCache is Initializable { IAddressResolver public resolver; mapping(bytes32 => address) private _addressCache; function __ResolverCache_init(address resolver_) internal onlyInitializing { resolver = IAddressResolver(resolver_); } function getAddress(bytes32 name_) public view returns (address) { return _addressCache[name_]; } function getRequiredAddress(bytes32 name_, string memory reason_) public view returns (address) { address addr = getAddress(name_); require(addr != address(0), reason_); return addr; } function rebuildCache() public virtual { bytes32[] memory requiredAddresses = _resolverAddressesRequired(); for (uint256 i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; address addr = resolver.getRequiredAddress(name, "AddressCache: address not found"); _addressCache[name] = addr; } } function isResolverCached() external view returns (bool) { bytes32[] memory requiredAddresses = _resolverAddressesRequired(); for (uint256 i = 0; i < requiredAddresses.length; i++) { bytes32 name = requiredAddresses[i]; // false if our cache is invalid or if the resolver doesn't have the required address if (resolver.getAddress(name) != _addressCache[name] || _addressCache[name] == address(0)) { return false; } } return true; } function _combineArrays(bytes32[] memory first, bytes32[] memory second) internal pure returns (bytes32[] memory combination) { combination = new bytes32[](first.length + second.length); for (uint i = 0; i < first.length; i++) { combination[i] = first[i]; } for (uint j = 0; j < second.length; j++) { combination[first.length + j] = second[j]; } } function _resolverAddressesRequired() internal view virtual returns (bytes32[] memory addresses) {} uint256[48] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@solvprotocol/contracts-v3-sft-core/contracts/BaseSFTDelegateUpgradeable.sol"; import "@solvprotocol/contracts-v3-solidity-utils/contracts/helpers/ERC20TransferHelper.sol"; import "./IFCFSMultiRepayableDelegate.sol"; import "./IFCFSMultiRepayableConcrete.sol"; abstract contract FCFSMultiRepayableDelegate is IFCFSMultiRepayableDelegate, BaseSFTDelegateUpgradeable { function repay(uint256 slot_, address currency_, uint256 repayCurrencyAmount_) external payable virtual override nonReentrant { IFCFSMultiRepayableConcrete(concrete()).repayOnlyDelegate(_msgSender(), slot_, currency_, repayCurrencyAmount_); ERC20TransferHelper.doTransferIn(currency_, _msgSender(), repayCurrencyAmount_); emit Repay(slot_, _msgSender(), currency_, repayCurrencyAmount_); } function repayWithBalance(uint256 slot_, address currency_, uint256 repayCurrencyAmount_) external payable virtual override nonReentrant { require(allowRepayWithBalance(), "MultiRepayableDelegate: cannot repay with balance"); IFCFSMultiRepayableConcrete(concrete()).repayWithBalanceOnlyDelegate(_msgSender(), slot_, currency_, repayCurrencyAmount_); emit Repay(slot_, _msgSender(), currency_, repayCurrencyAmount_); } function claimTo(address to_, uint256 tokenId_, address currency_, uint256 claimValue_) external virtual override nonReentrant { require(claimValue_ > 0, "MultiRepayableDelegate: claim value is zero"); require(_isApprovedOrOwner(_msgSender(), tokenId_), "MultiRepayableDelegate: caller is not owner nor approved"); uint256 slot = ERC3525Upgradeable.slotOf(tokenId_); uint256 claimableValue = IFCFSMultiRepayableConcrete(concrete()).claimableValue(tokenId_); require(claimValue_ <= claimableValue, "MultiRepayableDelegate: over claim"); uint256 claimCurrencyAmount = IFCFSMultiRepayableConcrete(concrete()).claimOnlyDelegate(tokenId_, slot, currency_, claimValue_); if (claimValue_ == ERC3525Upgradeable.balanceOf(tokenId_)) { ERC3525Upgradeable._burn(tokenId_); } else { ERC3525Upgradeable._burnValue(tokenId_, claimValue_); } ERC20TransferHelper.doTransferOut(currency_, payable(to_), claimCurrencyAmount); emit Claim(to_, tokenId_, claimValue_, currency_, claimCurrencyAmount); } function _beforeValueTransfer( address from_, address to_, uint256 fromTokenId_, uint256 toTokenId_, uint256 slot_, uint256 value_ ) internal virtual override(ERC3525SlotEnumerableUpgradeable) { super._beforeValueTransfer(from_, to_, fromTokenId_, toTokenId_, slot_, value_); if (from_ == address(0) && fromTokenId_ == 0) { IFCFSMultiRepayableConcrete(concrete()).mintOnlyDelegate(toTokenId_, slot_, value_); } if (from_ != address(0) && fromTokenId_ != 0 && to_ != address(0) && toTokenId_ != 0) { IFCFSMultiRepayableConcrete(concrete()).transferOnlyDelegate(fromTokenId_, toTokenId_, ERC3525Upgradeable.balanceOf(fromTokenId_), value_); } } function allowRepayWithBalance() public view virtual returns (bool) { return true; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IFCFSMultiRepayableConcrete { struct SlotRepayInfo { uint256 repaidCurrencyAmount; uint256 currencyBalance; } struct SlotValueInfo { uint256 slotInitialValue; uint256 slotTotalValue; } function repayOnlyDelegate(address txSender_, uint256 slot_, address currency_, uint256 repayCurrencyAmount_) external payable; function repayWithBalanceOnlyDelegate(address txSender_, uint256 slot_, address currency_, uint256 repayCurrencyAmount_) external payable; function mintOnlyDelegate(uint256 tokenId_, uint256 slot_, uint256 mintValue_) external; function claimOnlyDelegate(uint256 tokenId_, uint256 slot_, address currency_, uint256 claimValue_) external returns (uint256); function transferOnlyDelegate(uint256 fromTokenId_, uint256 toTokenId_, uint256 fromTokenBalance_, uint256 transferValue_) external; function slotRepaidCurrencyAmount(uint256 slot_) external view returns (uint256); function slotCurrencyBalance(uint256 slot_) external view returns (uint256); function slotInitialValue(uint256 slot_) external view returns (uint256); function slotTotalValue(uint256 slot_) external view returns (uint256); function claimableValue(uint256 tokenId_) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IFCFSMultiRepayableDelegate { event Repay(uint256 indexed slot, address indexed payer, address currency, uint256 repayCurrencyAmount); event Claim(address indexed to, uint256 indexed tokenId, uint256 claimValue, address currency, uint256 claimCurrencyAmount); function repay(uint256 slot_, address currency_, uint256 repayCurrencyAmount_) external payable; function repayWithBalance(uint256 slot_, address currency_, uint256 repayCurrencyAmount_) external payable; function claimTo(address to_, uint256 tokenId_, address currency_, uint256 claimValue_) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ISFTIssuableConcrete { function createSlotOnlyDelegate(address txSender_, bytes calldata inputSlotInfo_) external returns (uint256 slot_); function mintOnlyDelegate(address txSender_, address currency_, address mintTo_, uint256 slot_, uint256 tokenId_, uint256 amount_) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ISFTIssuableDelegate { function createSlotOnlyIssueMarket(address txSender, bytes calldata inputSlotInfo) external returns(uint256 slot); function mintOnlyIssueMarket(address txSender, address currency, address mintTo, uint256 slot, uint256 value) external payable returns(uint256 tokenId); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@solvprotocol/contracts-v3-solidity-utils/contracts/misc/Constants.sol"; import "@solvprotocol/contracts-v3-address-resolver/contracts/ResolverCache.sol"; import "@solvprotocol/contracts-v3-sft-core/contracts/BaseSFTDelegateUpgradeable.sol"; import "./ISFTIssuableDelegate.sol"; import "./ISFTIssuableConcrete.sol"; abstract contract SFTIssuableDelegate is ISFTIssuableDelegate, BaseSFTDelegateUpgradeable, ResolverCache { function __SFTIssuableDelegate_init(address resolver_, string memory name_, string memory symbol_, uint8 decimals_, address concrete_, address metadata_, address owner_) internal onlyInitializing { __BaseSFTDelegate_init(name_, symbol_, decimals_, concrete_, metadata_, owner_); __ResolverCache_init(resolver_); } function __SFTIssuableDelegate_init_unchained() internal onlyInitializing { } function createSlotOnlyIssueMarket(address txSender_, bytes calldata inputSlotInfo_) external virtual override nonReentrant returns(uint256 slot_) { require(_msgSender() == _issueMarket(), "SFTIssuableDelegate: only issue market"); slot_ = ISFTIssuableConcrete(concrete()).createSlotOnlyDelegate(txSender_, inputSlotInfo_); require(!_slotExists(slot_), "SFTIssuableDelegate: slot already exists"); ERC3525SlotEnumerableUpgradeable._createSlot(slot_); emit CreateSlot(slot_, txSender_, inputSlotInfo_); } function mintOnlyIssueMarket(address txSender_, address currency_, address mintTo_, uint256 slot_, uint256 value_) external payable virtual override nonReentrant returns(uint256 tokenId_) { require(_msgSender() == _issueMarket(), "SFTIssuableDelegate: only issue market"); tokenId_ = ERC3525Upgradeable._mint(mintTo_, slot_, value_); ISFTIssuableConcrete(concrete()).mintOnlyDelegate(txSender_, currency_, mintTo_, slot_, tokenId_, value_); emit MintValue(tokenId_, slot_, value_); } function _resolverAddressesRequired() internal view virtual override returns (bytes32[] memory) { bytes32[] memory existAddresses = super._resolverAddressesRequired(); bytes32[] memory newAddresses = new bytes32[](1); newAddresses[0] = Constants.CONTRACT_ISSUE_MARKET; return _combineArrays(existAddresses, newAddresses); } function _issueMarket() internal view virtual returns (address) { return getRequiredAddress(Constants.CONTRACT_ISSUE_MARKET, "SFTIssuableDelegate: issueMarket not set"); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../issuable/ISFTIssuableConcrete.sol"; interface ISFTValueIssuableConcrete is ISFTIssuableConcrete { function burnOnlyDelegate(uint256 tokenId, uint256 burnValue) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../issuable/ISFTIssuableDelegate.sol"; interface ISFTValueIssuableDelegate is ISFTIssuableDelegate { function mintValueOnlyIssueMarket(address txSender, address currency, uint256 tokenId, uint256 mintValue) external payable; function burnOnlyIssueMarket(uint256 tokenId, uint256 burnValue) external; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "@solvprotocol/contracts-v3-solidity-utils/contracts/misc/Constants.sol"; import "@solvprotocol/contracts-v3-address-resolver/contracts/ResolverCache.sol"; import "@solvprotocol/contracts-v3-sft-core/contracts/BaseSFTDelegateUpgradeable.sol"; import "./ISFTValueIssuableDelegate.sol"; import "./ISFTValueIssuableConcrete.sol"; import "../issuable/SFTIssuableDelegate.sol"; error OnlyMarket(); abstract contract SFTValueIssuableDelegate is ISFTValueIssuableDelegate, SFTIssuableDelegate { event BurnValue(uint256 indexed tokenId, uint256 burnValue); function __SFTValueIssuableDelegate_init( address resolver_, string memory name_, string memory symbol_, uint8 decimals_, address concrete_, address metadata_, address owner_ ) internal onlyInitializing { __SFTIssuableDelegate_init(resolver_, name_, symbol_, decimals_, concrete_, metadata_, owner_); } function __SFTValueIssuableDelegate_init_unchained() internal onlyInitializing { } function mintValueOnlyIssueMarket( address txSender_, address currency_, uint256 tokenId_, uint256 mintValue_ ) external payable virtual override nonReentrant { if (_msgSender() != _issueMarket()) { revert OnlyMarket(); } address owner = ERC3525Upgradeable.ownerOf(tokenId_); uint256 slot = ERC3525Upgradeable.slotOf(tokenId_); ERC3525Upgradeable._mintValue(tokenId_, mintValue_); ISFTIssuableConcrete(concrete()).mintOnlyDelegate(txSender_, currency_, owner, slot, tokenId_, mintValue_); emit MintValue(tokenId_, slot, mintValue_); } function burnOnlyIssueMarket(uint256 tokenId_, uint256 burnValue_) external virtual override nonReentrant { if (_msgSender() != _issueMarket()) { revert OnlyMarket(); } uint256 actualBurnValue = burnValue_ == 0 ? ERC3525Upgradeable.balanceOf(tokenId_) : burnValue_; ISFTValueIssuableConcrete(concrete()).burnOnlyDelegate(tokenId_, actualBurnValue); if (burnValue_ == 0) { ERC3525Upgradeable._burn(tokenId_); } else { ERC3525Upgradeable._burnValue(tokenId_, burnValue_); } emit BurnValue(tokenId_, actualBurnValue); } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@solvprotocol/erc-3525/ERC3525SlotEnumerableUpgradeable.sol"; import "@solvprotocol/contracts-v3-solidity-utils/contracts/access/ISFTConcreteControl.sol"; import "@solvprotocol/contracts-v3-solidity-utils/contracts/access/SFTDelegateControl.sol"; import "@solvprotocol/contracts-v3-solidity-utils/contracts/access/OwnControl.sol"; import "@solvprotocol/contracts-v3-solidity-utils/contracts/misc/Constants.sol"; import "./interface/IBaseSFTDelegate.sol"; import "./interface/IBaseSFTConcrete.sol"; abstract contract BaseSFTDelegateUpgradeable is IBaseSFTDelegate, ERC3525SlotEnumerableUpgradeable, OwnControl, SFTDelegateControl, ReentrancyGuardUpgradeable { event CreateSlot(uint256 indexed _slot, address indexed _creator, bytes _slotInfo); event MintValue(uint256 indexed _tokenId, uint256 indexed _slot, uint256 _value); function __BaseSFTDelegate_init( string memory name_, string memory symbol_, uint8 decimals_, address concrete_, address metadata_, address owner_ ) internal onlyInitializing { ERC3525Upgradeable.__ERC3525_init(name_, symbol_, decimals_); OwnControl.__OwnControl_init(owner_); ERC3525Upgradeable._setMetadataDescriptor(metadata_); SFTDelegateControl.__SFTDelegateControl_init(concrete_); __ReentrancyGuard_init(); //address of concrete must be zero when initializing impletion contract avoid failed after upgrade if (concrete_ != Constants.ZERO_ADDRESS) { ISFTConcreteControl(concrete_).setDelegate(address(this)); } } function delegateToConcreteView(bytes calldata data) external view override returns (bytes memory) { (bool success, bytes memory returnData) = concrete().staticcall(data); assembly { if eq(success, 0) { revert(add(returnData, 0x20), returndatasize()) } } return returnData; } function contractType() external view virtual returns (string memory); uint256[50] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBaseSFTConcrete { function isSlotValid(uint256 slot_) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBaseSFTDelegate { function delegateToConcreteView(bytes calldata data) external view returns (bytes memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; abstract contract AdminControl is Initializable, ContextUpgradeable { event NewAdmin(address oldAdmin, address newAdmin); event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin); address public admin; address public pendingAdmin; modifier onlyAdmin() { require(_msgSender() == admin, "only admin"); _; } function __AdminControl_init(address admin_) internal onlyInitializing { __AdminControl_init_unchained(admin_); } function __AdminControl_init_unchained(address admin_) internal onlyInitializing { admin = admin_; emit NewAdmin(address(0), admin_); } function setPendingAdmin(address newPendingAdmin_) external virtual onlyAdmin { emit NewPendingAdmin(pendingAdmin, newPendingAdmin_); pendingAdmin = newPendingAdmin_; } function acceptAdmin() external virtual { require(_msgSender() == pendingAdmin, "only pending admin"); emit NewAdmin(admin, pendingAdmin); admin = pendingAdmin; pendingAdmin = address(0); } uint256[48] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ISFTConcreteControl { event NewDelegate(address old_, address new_); function setDelegate(address newDelegate_) external; function delegate() external view returns (address); }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface ISFTDelegateControl { event NewConcrete(address old_, address new_); function concrete() external view returns (address); function setConcreteOnlyAdmin(address newConcrete_) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./AdminControl.sol"; abstract contract OwnControl is AdminControl { event NewOwner(address oldOwner, address newOwner); address public owner; modifier onlyOwner() { require(owner == _msgSender(), "only owner"); _; } function __OwnControl_init(address owner_) internal onlyInitializing { __OwnControl_init_unchained(owner_); __AdminControl_init_unchained(_msgSender()); } function __OwnControl_init_unchained(address owner_) internal onlyInitializing { _setOwner(owner_); } function setOwnerOnlyAdmin(address newOwner_) public onlyAdmin { _setOwner(newOwner_); } function _setOwner(address newOwner_) internal { require(newOwner_ != address(0), "Owner address connot be 0"); emit NewOwner(owner, newOwner_); owner = newOwner_; } uint256[49] private __gap; }
//SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./AdminControl.sol"; import "./ISFTDelegateControl.sol"; abstract contract SFTDelegateControl is ISFTDelegateControl, AdminControl { address private _concrete; function __SFTDelegateControl_init(address concrete_) internal onlyInitializing { __AdminControl_init_unchained(_msgSender()); __SFTDelegateControl_init_unchained(concrete_); } function __SFTDelegateControl_init_unchained(address concrete_) internal onlyInitializing { _concrete = concrete_; } function concrete() public view override returns (address) { return _concrete; } function setConcreteOnlyAdmin(address newConcrete_) external override onlyAdmin { emit NewConcrete(_concrete, newConcrete_); _concrete = newConcrete_; } uint256[49] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../misc/Constants.sol"; interface ERC20Interface { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); } // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library ERC20TransferHelper { function doApprove(address underlying, address spender, uint256 amount) internal { require(underlying.code.length > 0, "invalid underlying"); (bool success, bytes memory data) = underlying.call( abi.encodeWithSelector( ERC20Interface.approve.selector, spender, amount ) ); require(success && (data.length == 0 || abi.decode(data, (bool))), "SAF"); } function doTransferIn(address underlying, address from, uint256 amount) internal { if (underlying == Constants.ETH_ADDRESS) { // Sanity checks require(tx.origin == from || msg.sender == from, "sender mismatch"); require(msg.value >= amount, "value mismatch"); } else { require(underlying.code.length > 0, "invalid underlying"); (bool success, bytes memory data) = underlying.call( abi.encodeWithSelector( ERC20Interface.transferFrom.selector, from, address(this), amount ) ); require(success && (data.length == 0 || abi.decode(data, (bool))), "STF"); } } function doTransferOut(address underlying, address payable to, uint256 amount) internal { if (underlying == Constants.ETH_ADDRESS) { (bool success, ) = to.call{value: amount}(new bytes(0)); require(success, "STE"); } else { require(underlying.code.length > 0, "invalid underlying"); (bool success, bytes memory data) = underlying.call( abi.encodeWithSelector( ERC20Interface.transfer.selector, to, amount ) ); require(success && (data.length == 0 || abi.decode(data, (bool))), "ST"); } } function getCashPrior(address underlying_) internal view returns (uint256) { if (underlying_ == Constants.ETH_ADDRESS) { uint256 startingBalance = address(this).balance - msg.value; return startingBalance; } else { ERC20Interface token = ERC20Interface(underlying_); return token.balanceOf(address(this)); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library Constants { uint32 internal constant FULL_PERCENTAGE = 10000; uint32 internal constant SECONDS_PER_YEAR = 360 * 24 * 60 * 60; address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address internal constant ZERO_ADDRESS = 0x0000000000000000000000000000000000000000; bytes32 internal constant CONTRACT_ISSUE_MARKET= "IssueMarket"; bytes32 internal constant CONTRACT_ISSUE_MARKET_PRICE_STRATEGY_MANAGER = "IMPriceStrategyManager"; bytes32 internal constant CONTRACT_ISSUE_MARKET_WHITELIST_STRATEGY_MANAGER = "IMWhitelistStrategyManager"; bytes32 internal constant CONTRACT_ISSUE_MARKET_UNDERWRITER_PROFIT_TOKEN = "IMUnderwriterProfitToken"; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "./ERC3525Upgradeable.sol"; import "./extensions/IERC3525SlotEnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract ERC3525SlotEnumerableUpgradeable is Initializable, ContextUpgradeable, ERC3525Upgradeable, IERC3525SlotEnumerableUpgradeable { function __ERC3525SlotEnumerable_init( string memory name_, string memory symbol_, uint8 decimals_ ) internal onlyInitializing { __ERC3525_init_unchained(name_, symbol_, decimals_); } function __ERC3525SlotEnumerable_init_unchained( string memory, string memory, uint8 ) internal onlyInitializing { } struct SlotData { uint256 slot; uint256[] slotTokens; } // slot => tokenId => index mapping(uint256 => mapping(uint256 => uint256)) private _slotTokensIndex; SlotData[] private _allSlots; // slot => index mapping(uint256 => uint256) private _allSlotsIndex; function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC3525Upgradeable) returns (bool) { return interfaceId == type(IERC3525SlotEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } function slotCount() public view virtual override returns (uint256) { return _allSlots.length; } function slotByIndex(uint256 index_) public view virtual override returns (uint256) { require(index_ < ERC3525SlotEnumerableUpgradeable.slotCount(), "ERC3525SlotEnumerable: slot index out of bounds"); return _allSlots[index_].slot; } function _slotExists(uint256 slot_) internal view virtual returns (bool) { return _allSlots.length != 0 && _allSlots[_allSlotsIndex[slot_]].slot == slot_; } function tokenSupplyInSlot(uint256 slot_) public view virtual override returns (uint256) { if (!_slotExists(slot_)) { return 0; } return _allSlots[_allSlotsIndex[slot_]].slotTokens.length; } function tokenInSlotByIndex(uint256 slot_, uint256 index_) public view virtual override returns (uint256) { require(index_ < ERC3525SlotEnumerableUpgradeable.tokenSupplyInSlot(slot_), "ERC3525SlotEnumerable: slot token index out of bounds"); return _allSlots[_allSlotsIndex[slot_]].slotTokens[index_]; } function _tokenExistsInSlot(uint256 slot_, uint256 tokenId_) private view returns (bool) { SlotData storage slotData = _allSlots[_allSlotsIndex[slot_]]; return slotData.slotTokens.length > 0 && slotData.slotTokens[_slotTokensIndex[slot_][tokenId_]] == tokenId_; } function _createSlot(uint256 slot_) internal virtual { require(!_slotExists(slot_), "ERC3525SlotEnumerable: slot already exists"); SlotData memory slotData = SlotData({ slot: slot_, slotTokens: new uint256[](0) }); _addSlotToAllSlotsEnumeration(slotData); emit SlotChanged(0, 0, slot_); } function _beforeValueTransfer( address from_, address to_, uint256 fromTokenId_, uint256 toTokenId_, uint256 slot_, uint256 value_ ) internal virtual override { super._beforeValueTransfer(from_, to_, fromTokenId_, toTokenId_, slot_, value_); if (from_ == address(0) && fromTokenId_ == 0 && !_slotExists(slot_)) { _createSlot(slot_); } //Shh - currently unused to_; toTokenId_; value_; } function _afterValueTransfer( address from_, address to_, uint256 fromTokenId_, uint256 toTokenId_, uint256 slot_, uint256 value_ ) internal virtual override { if (from_ == address(0) && fromTokenId_ == 0 && !_tokenExistsInSlot(slot_, toTokenId_)) { _addTokenToSlotEnumeration(slot_, toTokenId_); } else if (to_ == address(0) && toTokenId_ == 0 && _tokenExistsInSlot(slot_, fromTokenId_)) { _removeTokenFromSlotEnumeration(slot_, fromTokenId_); } //Shh - currently unused value_; super._afterValueTransfer(from_, to_, fromTokenId_, toTokenId_, slot_, value_); } function _addSlotToAllSlotsEnumeration(SlotData memory slotData) private { _allSlotsIndex[slotData.slot] = _allSlots.length; _allSlots.push(slotData); } function _addTokenToSlotEnumeration(uint256 slot_, uint256 tokenId_) private { SlotData storage slotData = _allSlots[_allSlotsIndex[slot_]]; _slotTokensIndex[slot_][tokenId_] = slotData.slotTokens.length; slotData.slotTokens.push(tokenId_); } function _removeTokenFromSlotEnumeration(uint256 slot_, uint256 tokenId_) private { SlotData storage slotData = _allSlots[_allSlotsIndex[slot_]]; uint256 lastTokenIndex = slotData.slotTokens.length - 1; uint256 lastTokenId = slotData.slotTokens[lastTokenIndex]; uint256 tokenIndex = _slotTokensIndex[slot_][tokenId_]; slotData.slotTokens[tokenIndex] = lastTokenId; _slotTokensIndex[slot_][lastTokenId] = tokenIndex; delete _slotTokensIndex[slot_][tokenId_]; slotData.slotTokens.pop(); } /** * @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[47] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "./IERC721Upgradeable.sol"; import "./IERC3525Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./IERC3525ReceiverUpgradeable.sol"; import "./extensions/IERC721EnumerableUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "./extensions/IERC3525MetadataUpgradeable.sol"; import "./periphery/interface/IERC3525MetadataDescriptorUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; contract ERC3525Upgradeable is Initializable, ContextUpgradeable, IERC3525MetadataUpgradeable, IERC721EnumerableUpgradeable { using StringsUpgradeable for address; using StringsUpgradeable for uint256; using AddressUpgradeable for address; using CountersUpgradeable for CountersUpgradeable.Counter; event SetMetadataDescriptor(address indexed metadataDescriptor); struct TokenData { uint256 id; uint256 slot; uint256 balance; address owner; address approved; address[] valueApprovals; } struct AddressData { uint256[] ownedTokens; mapping(uint256 => uint256) ownedTokensIndex; mapping(address => bool) approvals; } string private _name; string private _symbol; uint8 private _decimals; CountersUpgradeable.Counter private _tokenIdGenerator; // id => (approval => allowance) // @dev _approvedValues cannot be defined within TokenData, cause struct containing mappings cannot be constructed. mapping(uint256 => mapping(address => uint256)) private _approvedValues; TokenData[] private _allTokens; // key: id mapping(uint256 => uint256) private _allTokensIndex; mapping(address => AddressData) private _addressData; IERC3525MetadataDescriptorUpgradeable public metadataDescriptor; function __ERC3525_init(string memory name_, string memory symbol_, uint8 decimals_) internal onlyInitializing { __ERC3525_init_unchained(name_, symbol_, decimals_); } function __ERC3525_init_unchained(string memory name_, string memory symbol_, uint8 decimals_) internal onlyInitializing { _name = name_; _symbol = symbol_; _decimals = decimals_; } function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId || interfaceId == type(IERC3525Upgradeable).interfaceId || interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC3525MetadataUpgradeable).interfaceId || interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId; } /** * @dev Returns the token collection name. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the token collection symbol. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals the token uses for value. */ function valueDecimals() public view virtual override returns (uint8) { return _decimals; } function balanceOf(uint256 tokenId_) public view virtual override returns (uint256) { _requireMinted(tokenId_); return _allTokens[_allTokensIndex[tokenId_]].balance; } function ownerOf(uint256 tokenId_) public view virtual override returns (address owner_) { _requireMinted(tokenId_); owner_ = _allTokens[_allTokensIndex[tokenId_]].owner; require(owner_ != address(0), "ERC3525: invalid token ID"); } function slotOf(uint256 tokenId_) public view virtual override returns (uint256) { _requireMinted(tokenId_); return _allTokens[_allTokensIndex[tokenId_]].slot; } function _baseURI() internal view virtual returns (string memory) { return ""; } function contractURI() public view virtual override returns (string memory) { string memory baseURI = _baseURI(); return address(metadataDescriptor) != address(0) ? metadataDescriptor.constructContractURI() : bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, "contract/", StringsUpgradeable.toHexString(address(this)))) : ""; } function slotURI(uint256 slot_) public view virtual override returns (string memory) { string memory baseURI = _baseURI(); return address(metadataDescriptor) != address(0) ? metadataDescriptor.constructSlotURI(slot_) : bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, "slot/", slot_.toString())) : ""; } /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId_) public view virtual override returns (string memory) { _requireMinted(tokenId_); string memory baseURI = _baseURI(); return address(metadataDescriptor) != address(0) ? metadataDescriptor.constructTokenURI(tokenId_) : bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId_.toString())) : ""; } function approve(uint256 tokenId_, address to_, uint256 value_) public payable virtual override { address owner = ERC3525Upgradeable.ownerOf(tokenId_); require(to_ != owner, "ERC3525: approval to current owner"); require(_isApprovedOrOwner(_msgSender(), tokenId_), "ERC3525: approve caller is not owner nor approved"); _approveValue(tokenId_, to_, value_); } function allowance(uint256 tokenId_, address operator_) public view virtual override returns (uint256) { _requireMinted(tokenId_); return _approvedValues[tokenId_][operator_]; } function transferFrom( uint256 fromTokenId_, address to_, uint256 value_ ) public payable virtual override returns (uint256 newTokenId) { _spendAllowance(_msgSender(), fromTokenId_, value_); newTokenId = _createDerivedTokenId(fromTokenId_); _mint(to_, newTokenId, ERC3525Upgradeable.slotOf(fromTokenId_), 0); _transferValue(fromTokenId_, newTokenId, value_); } function transferFrom( uint256 fromTokenId_, uint256 toTokenId_, uint256 value_ ) public payable virtual override { _spendAllowance(_msgSender(), fromTokenId_, value_); _transferValue(fromTokenId_, toTokenId_, value_); } function balanceOf(address owner_) public view virtual override returns (uint256 balance) { require(owner_ != address(0), "ERC3525: balance query for the zero address"); return _addressData[owner_].ownedTokens.length; } function transferFrom( address from_, address to_, uint256 tokenId_ ) public payable virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId_), "ERC3525: transfer caller is not owner nor approved"); _transferTokenId(from_, to_, tokenId_); } function safeTransferFrom( address from_, address to_, uint256 tokenId_, bytes memory data_ ) public payable virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId_), "ERC3525: transfer caller is not owner nor approved"); _safeTransferTokenId(from_, to_, tokenId_, data_); } function safeTransferFrom( address from_, address to_, uint256 tokenId_ ) public payable virtual override { safeTransferFrom(from_, to_, tokenId_, ""); } function approve(address to_, uint256 tokenId_) public payable virtual override { address owner = ERC3525Upgradeable.ownerOf(tokenId_); require(to_ != owner, "ERC3525: approval to current owner"); require( _msgSender() == owner || ERC3525Upgradeable.isApprovedForAll(owner, _msgSender()), "ERC3525: approve caller is not owner nor approved for all" ); _approve(to_, tokenId_); } function getApproved(uint256 tokenId_) public view virtual override returns (address) { _requireMinted(tokenId_); return _allTokens[_allTokensIndex[tokenId_]].approved; } function setApprovalForAll(address operator_, bool approved_) public virtual override { _setApprovalForAll(_msgSender(), operator_, approved_); } function isApprovedForAll(address owner_, address operator_) public view virtual override returns (bool) { return _addressData[owner_].approvals[operator_]; } function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } function tokenByIndex(uint256 index_) public view virtual override returns (uint256) { require(index_ < ERC3525Upgradeable.totalSupply(), "ERC3525: global index out of bounds"); return _allTokens[index_].id; } function tokenOfOwnerByIndex(address owner_, uint256 index_) public view virtual override returns (uint256) { require(index_ < ERC3525Upgradeable.balanceOf(owner_), "ERC3525: owner index out of bounds"); return _addressData[owner_].ownedTokens[index_]; } function _setApprovalForAll( address owner_, address operator_, bool approved_ ) internal virtual { require(owner_ != operator_, "ERC3525: approve to caller"); _addressData[owner_].approvals[operator_] = approved_; emit ApprovalForAll(owner_, operator_, approved_); } function _isApprovedOrOwner(address operator_, uint256 tokenId_) internal view virtual returns (bool) { address owner = ERC3525Upgradeable.ownerOf(tokenId_); return ( operator_ == owner || ERC3525Upgradeable.isApprovedForAll(owner, operator_) || ERC3525Upgradeable.getApproved(tokenId_) == operator_ ); } function _spendAllowance(address operator_, uint256 tokenId_, uint256 value_) internal virtual { uint256 currentAllowance = ERC3525Upgradeable.allowance(tokenId_, operator_); if (!_isApprovedOrOwner(operator_, tokenId_) && currentAllowance != type(uint256).max) { require(currentAllowance >= value_, "ERC3525: insufficient allowance"); _approveValue(tokenId_, operator_, currentAllowance - value_); } } function _exists(uint256 tokenId_) internal view virtual returns (bool) { return _allTokens.length != 0 && _allTokens[_allTokensIndex[tokenId_]].id == tokenId_; } function _requireMinted(uint256 tokenId_) internal view virtual { require(_exists(tokenId_), "ERC3525: invalid token ID"); } function _mint(address to_, uint256 slot_, uint256 value_) internal virtual returns (uint256 tokenId) { tokenId = _createOriginalTokenId(); _mint(to_, tokenId, slot_, value_); } function _mint(address to_, uint256 tokenId_, uint256 slot_, uint256 value_) internal virtual { require(to_ != address(0), "ERC3525: mint to the zero address"); require(tokenId_ != 0, "ERC3525: cannot mint zero tokenId"); require(!_exists(tokenId_), "ERC3525: token already minted"); _beforeValueTransfer(address(0), to_, 0, tokenId_, slot_, value_); __mintToken(to_, tokenId_, slot_); __mintValue(tokenId_, value_); _afterValueTransfer(address(0), to_, 0, tokenId_, slot_, value_); } function _mintValue(uint256 tokenId_, uint256 value_) internal virtual { address owner = ERC3525Upgradeable.ownerOf(tokenId_); uint256 slot = ERC3525Upgradeable.slotOf(tokenId_); _beforeValueTransfer(address(0), owner, 0, tokenId_, slot, value_); __mintValue(tokenId_, value_); _afterValueTransfer(address(0), owner, 0, tokenId_, slot, value_); } function __mintValue(uint256 tokenId_, uint256 value_) private { _allTokens[_allTokensIndex[tokenId_]].balance += value_; emit TransferValue(0, tokenId_, value_); } function __mintToken(address to_, uint256 tokenId_, uint256 slot_) private { TokenData memory tokenData = TokenData({ id: tokenId_, slot: slot_, balance: 0, owner: to_, approved: address(0), valueApprovals: new address[](0) }); _addTokenToAllTokensEnumeration(tokenData); _addTokenToOwnerEnumeration(to_, tokenId_); emit Transfer(address(0), to_, tokenId_); emit SlotChanged(tokenId_, 0, slot_); } function _burn(uint256 tokenId_) internal virtual { _requireMinted(tokenId_); TokenData storage tokenData = _allTokens[_allTokensIndex[tokenId_]]; address owner = tokenData.owner; uint256 slot = tokenData.slot; uint256 value = tokenData.balance; _beforeValueTransfer(owner, address(0), tokenId_, 0, slot, value); _clearApprovedValues(tokenId_); _removeTokenFromOwnerEnumeration(owner, tokenId_); _removeTokenFromAllTokensEnumeration(tokenId_); emit TransferValue(tokenId_, 0, value); emit SlotChanged(tokenId_, slot, 0); emit Transfer(owner, address(0), tokenId_); _afterValueTransfer(owner, address(0), tokenId_, 0, slot, value); } function _burnValue(uint256 tokenId_, uint256 burnValue_) internal virtual { _requireMinted(tokenId_); TokenData storage tokenData = _allTokens[_allTokensIndex[tokenId_]]; address owner = tokenData.owner; uint256 slot = tokenData.slot; uint256 value = tokenData.balance; require(value >= burnValue_, "ERC3525: burn value exceeds balance"); _beforeValueTransfer(owner, address(0), tokenId_, 0, slot, burnValue_); tokenData.balance -= burnValue_; emit TransferValue(tokenId_, 0, burnValue_); _afterValueTransfer(owner, address(0), tokenId_, 0, slot, burnValue_); } function _addTokenToOwnerEnumeration(address to_, uint256 tokenId_) private { _allTokens[_allTokensIndex[tokenId_]].owner = to_; _addressData[to_].ownedTokensIndex[tokenId_] = _addressData[to_].ownedTokens.length; _addressData[to_].ownedTokens.push(tokenId_); } function _removeTokenFromOwnerEnumeration(address from_, uint256 tokenId_) private { _allTokens[_allTokensIndex[tokenId_]].owner = address(0); AddressData storage ownerData = _addressData[from_]; uint256 lastTokenIndex = ownerData.ownedTokens.length - 1; uint256 lastTokenId = ownerData.ownedTokens[lastTokenIndex]; uint256 tokenIndex = ownerData.ownedTokensIndex[tokenId_]; ownerData.ownedTokens[tokenIndex] = lastTokenId; ownerData.ownedTokensIndex[lastTokenId] = tokenIndex; delete ownerData.ownedTokensIndex[tokenId_]; ownerData.ownedTokens.pop(); } function _addTokenToAllTokensEnumeration(TokenData memory tokenData_) private { _allTokensIndex[tokenData_.id] = _allTokens.length; _allTokens.push(tokenData_); } function _removeTokenFromAllTokensEnumeration(uint256 tokenId_) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId_]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) TokenData memory lastTokenData = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenData; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenData.id] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId_]; _allTokens.pop(); } function _approve(address to_, uint256 tokenId_) internal virtual { _allTokens[_allTokensIndex[tokenId_]].approved = to_; emit Approval(ERC3525Upgradeable.ownerOf(tokenId_), to_, tokenId_); } function _approveValue( uint256 tokenId_, address to_, uint256 value_ ) internal virtual { require(to_ != address(0), "ERC3525: approve value to the zero address"); if (!_existApproveValue(to_, tokenId_)) { _allTokens[_allTokensIndex[tokenId_]].valueApprovals.push(to_); } _approvedValues[tokenId_][to_] = value_; emit ApprovalValue(tokenId_, to_, value_); } function _clearApprovedValues(uint256 tokenId_) internal virtual { TokenData storage tokenData = _allTokens[_allTokensIndex[tokenId_]]; uint256 length = tokenData.valueApprovals.length; for (uint256 i = 0; i < length; i++) { address approval = tokenData.valueApprovals[i]; delete _approvedValues[tokenId_][approval]; } delete tokenData.valueApprovals; } function _existApproveValue(address to_, uint256 tokenId_) internal view virtual returns (bool) { uint256 length = _allTokens[_allTokensIndex[tokenId_]].valueApprovals.length; for (uint256 i = 0; i < length; i++) { if (_allTokens[_allTokensIndex[tokenId_]].valueApprovals[i] == to_) { return true; } } return false; } function _transferValue( uint256 fromTokenId_, uint256 toTokenId_, uint256 value_ ) internal virtual { require(_exists(fromTokenId_), "ERC3525: transfer from invalid token ID"); require(_exists(toTokenId_), "ERC3525: transfer to invalid token ID"); TokenData storage fromTokenData = _allTokens[_allTokensIndex[fromTokenId_]]; TokenData storage toTokenData = _allTokens[_allTokensIndex[toTokenId_]]; require(fromTokenData.balance >= value_, "ERC3525: insufficient balance for transfer"); require(fromTokenData.slot == toTokenData.slot, "ERC3525: transfer to token with different slot"); _beforeValueTransfer( fromTokenData.owner, toTokenData.owner, fromTokenId_, toTokenId_, fromTokenData.slot, value_ ); fromTokenData.balance -= value_; toTokenData.balance += value_; emit TransferValue(fromTokenId_, toTokenId_, value_); _afterValueTransfer( fromTokenData.owner, toTokenData.owner, fromTokenId_, toTokenId_, fromTokenData.slot, value_ ); require( _checkOnERC3525Received(fromTokenId_, toTokenId_, value_, ""), "ERC3525: transfer rejected by ERC3525Receiver" ); } function _transferTokenId( address from_, address to_, uint256 tokenId_ ) internal virtual { require(ERC3525Upgradeable.ownerOf(tokenId_) == from_, "ERC3525: transfer from invalid owner"); require(to_ != address(0), "ERC3525: transfer to the zero address"); uint256 slot = ERC3525Upgradeable.slotOf(tokenId_); uint256 value = ERC3525Upgradeable.balanceOf(tokenId_); _beforeValueTransfer(from_, to_, tokenId_, tokenId_, slot, value); _approve(address(0), tokenId_); _clearApprovedValues(tokenId_); _removeTokenFromOwnerEnumeration(from_, tokenId_); _addTokenToOwnerEnumeration(to_, tokenId_); emit Transfer(from_, to_, tokenId_); _afterValueTransfer(from_, to_, tokenId_, tokenId_, slot, value); } function _safeTransferTokenId( address from_, address to_, uint256 tokenId_, bytes memory data_ ) internal virtual { _transferTokenId(from_, to_, tokenId_); require( _checkOnERC721Received(from_, to_, tokenId_, data_), "ERC3525: transfer to non ERC721Receiver" ); } function _checkOnERC3525Received( uint256 fromTokenId_, uint256 toTokenId_, uint256 value_, bytes memory data_ ) internal virtual returns (bool) { address to = ERC3525Upgradeable.ownerOf(toTokenId_); if (to.isContract()) { try IERC165Upgradeable(to).supportsInterface(type(IERC3525ReceiverUpgradeable).interfaceId) returns (bool retval) { if (retval) { bytes4 receivedVal = IERC3525ReceiverUpgradeable(to).onERC3525Received(_msgSender(), fromTokenId_, toTokenId_, value_, data_); return receivedVal == IERC3525ReceiverUpgradeable.onERC3525Received.selector; } else { return true; } } catch (bytes memory /** reason */) { return true; } } else { return true; } } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from_ address representing the previous owner of the given token ID * @param to_ target address that will receive the tokens * @param tokenId_ uint256 ID of the token to be transferred * @param data_ bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from_, address to_, uint256 tokenId_, bytes memory data_ ) private returns (bool) { if (to_.isContract()) { try IERC721ReceiverUpgradeable(to_).onERC721Received(_msgSender(), from_, tokenId_, data_) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /* solhint-disable */ function _beforeValueTransfer( address from_, address to_, uint256 fromTokenId_, uint256 toTokenId_, uint256 slot_, uint256 value_ ) internal virtual {} function _afterValueTransfer( address from_, address to_, uint256 fromTokenId_, uint256 toTokenId_, uint256 slot_, uint256 value_ ) internal virtual {} /* solhint-enable */ function _setMetadataDescriptor(address metadataDescriptor_) internal virtual { metadataDescriptor = IERC3525MetadataDescriptorUpgradeable(metadataDescriptor_); emit SetMetadataDescriptor(metadataDescriptor_); } function _createOriginalTokenId() internal virtual returns (uint256) { _tokenIdGenerator.increment(); return _tokenIdGenerator.current(); } function _createDerivedTokenId(uint256 fromTokenId_) internal virtual returns (uint256) { fromTokenId_; return _createOriginalTokenId(); } /** * @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[41] private __gap; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "../IERC3525Upgradeable.sol"; import "./IERC721MetadataUpgradeable.sol"; /** * @title ERC-3525 Semi-Fungible Token Standard, optional extension for metadata * @dev Interfaces for any contract that wants to support query of the Uniform Resource Identifier * (URI) for the ERC3525 contract as well as a specified slot. * Because of the higher reliability of data stored in smart contracts compared to data stored in * centralized systems, it is recommended that metadata, including `contractURI`, `slotURI` and * `tokenURI`, be directly returned in JSON format, instead of being returned with a url pointing * to any resource stored in a centralized system. * See https://eips.ethereum.org/EIPS/eip-3525 * Note: the ERC-165 identifier for this interface is 0xe1600902. */ interface IERC3525MetadataUpgradeable is IERC3525Upgradeable, IERC721MetadataUpgradeable { /** * @notice Returns the Uniform Resource Identifier (URI) for the current ERC3525 contract. * @dev This function SHOULD return the URI for this contract in JSON format, starting with * header `data:application/json;`. * See https://eips.ethereum.org/EIPS/eip-3525 for the JSON schema for contract URI. * @return The JSON formatted URI of the current ERC3525 contract */ function contractURI() external view returns (string memory); /** * @notice Returns the Uniform Resource Identifier (URI) for the specified slot. * @dev This function SHOULD return the URI for `_slot` in JSON format, starting with header * `data:application/json;`. * See https://eips.ethereum.org/EIPS/eip-3525 for the JSON schema for slot URI. * @return The JSON formatted URI of `_slot` */ function slotURI(uint256 _slot) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "../IERC3525Upgradeable.sol"; import "./IERC721EnumerableUpgradeable.sol"; /** * @title ERC-3525 Semi-Fungible Token Standard, optional extension for slot enumeration * @dev Interfaces for any contract that wants to support enumeration of slots as well as tokens * with the same slot. * See https://eips.ethereum.org/EIPS/eip-3525 * Note: the ERC-165 identifier for this interface is 0x3b741b9e. */ interface IERC3525SlotEnumerableUpgradeable is IERC3525Upgradeable, IERC721EnumerableUpgradeable { /** * @notice Get the total amount of slots stored by the contract. * @return The total amount of slots */ function slotCount() external view returns (uint256); /** * @notice Get the slot at the specified index of all slots stored by the contract. * @param _index The index in the slot list * @return The slot at `index` of all slots. */ function slotByIndex(uint256 _index) external view returns (uint256); /** * @notice Get the total amount of tokens with the same slot. * @param _slot The slot to query token supply for * @return The total amount of tokens with the specified `_slot` */ function tokenSupplyInSlot(uint256 _slot) external view returns (uint256); /** * @notice Get the token at the specified index of all tokens with the same slot. * @param _slot The slot to query tokens with * @param _index The index in the token list of the slot * @return The token ID at `_index` of all tokens with `_slot` */ function tokenInSlotByIndex(uint256 _slot, uint256 _index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 * Note: the ERC-165 identifier for this interface is 0x780e9d63. */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @notice Count NFTs tracked by this contract * @return A count of valid NFTs tracked by this contract, where each one of * them has an assigned and queryable owner not equal to the zero address */ function totalSupply() external view returns (uint256); /** * @notice Enumerate valid NFTs * @dev Throws if `_index` >= `totalSupply()`. * @param _index A counter less than `totalSupply()` * @return The token identifier for the `_index`th NFT, * (sort order not specified) */ function tokenByIndex(uint256 _index) external view returns (uint256); /** * @notice Enumerate NFTs assigned to an owner * @dev Throws if `_index` >= `balanceOf(_owner)` or if * `_owner` is the zero address, representing invalid NFTs. * @param _owner An address where we are interested in NFTs owned by them * @param _index A counter less than `balanceOf(_owner)` * @return The token identifier for the `_index`th NFT assigned to `_owner`, * (sort order not specified) */ function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 * Note: the ERC-165 identifier for this interface is 0x5b5e139f. */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @notice A descriptive name for a collection of NFTs in this contract */ function name() external view returns (string memory); /** * @notice An abbreviated name for NFTs in this contract */ function symbol() external view returns (string memory); /** * @notice A distinct Uniform Resource Identifier (URI) for a given asset. * @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC * 3986. The URI may point to a JSON file that conforms to the "ERC721 * Metadata JSON Schema". */ function tokenURI(uint256 _tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; /** * @title EIP-3525 token receiver interface * @dev Interface for a smart contract that wants to be informed by EIP-3525 contracts when * receiving values from ANY addresses or EIP-3525 tokens. * Note: the EIP-165 identifier for this interface is 0x009ce20b. */ interface IERC3525ReceiverUpgradeable { /** * @notice Handle the receipt of an EIP-3525 token value. * @dev An EIP-3525 smart contract MUST check whether this function is implemented by the * recipient contract, if the recipient contract implements this function, the EIP-3525 * contract MUST call this function after a value transfer (i.e. `transferFrom(uint256, * uint256,uint256,bytes)`). * MUST return 0x009ce20b (i.e. `bytes4(keccak256('onERC3525Received(address,uint256,uint256, * uint256,bytes)'))`) if the transfer is accepted. * MUST revert or return any value other than 0x009ce20b if the transfer is rejected. * @param _operator The address which triggered the transfer * @param _fromTokenId The token id to transfer value from * @param _toTokenId The token id to transfer value to * @param _value The transferred value * @param _data Additional data with no specified format * @return `bytes4(keccak256('onERC3525Received(address,uint256,uint256,uint256,bytes)'))` * unless the transfer is rejected. */ function onERC3525Received(address _operator, uint256 _fromTokenId, uint256 _toTokenId, uint256 _value, bytes calldata _data) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; import "./IERC721Upgradeable.sol"; /** * @title ERC-3525 Semi-Fungible Token Standard * @dev See https://eips.ethereum.org/EIPS/eip-3525 * Note: the ERC-165 identifier for this interface is 0xd5358140. */ interface IERC3525Upgradeable is IERC165Upgradeable, IERC721Upgradeable { /** * @dev MUST emit when value of a token is transferred to another token with the same slot, * including zero value transfers (_value == 0) as well as transfers when tokens are created * (`_fromTokenId` == 0) or destroyed (`_toTokenId` == 0). * @param _fromTokenId The token id to transfer value from * @param _toTokenId The token id to transfer value to * @param _value The transferred value */ event TransferValue(uint256 indexed _fromTokenId, uint256 indexed _toTokenId, uint256 _value); /** * @dev MUST emits when the approval value of a token is set or changed. * @param _tokenId The token to approve * @param _operator The operator to approve for * @param _value The maximum value that `_operator` is allowed to manage */ event ApprovalValue(uint256 indexed _tokenId, address indexed _operator, uint256 _value); /** * @dev MUST emit when the slot of a token is set or changed. * @param _tokenId The token of which slot is set or changed * @param _oldSlot The previous slot of the token * @param _newSlot The updated slot of the token */ event SlotChanged(uint256 indexed _tokenId, uint256 indexed _oldSlot, uint256 indexed _newSlot); /** * @notice Get the number of decimals the token uses for value - e.g. 6, means the user * representation of the value of a token can be calculated by dividing it by 1,000,000. * Considering the compatibility with third-party wallets, this function is defined as * `valueDecimals()` instead of `decimals()` to avoid conflict with ERC20 tokens. * @return The number of decimals for value */ function valueDecimals() external view returns (uint8); /** * @notice Get the value of a token. * @param _tokenId The token for which to query the balance * @return The value of `_tokenId` */ function balanceOf(uint256 _tokenId) external view returns (uint256); /** * @notice Get the slot of a token. * @param _tokenId The identifier for a token * @return The slot of the token */ function slotOf(uint256 _tokenId) external view returns (uint256); /** * @notice Allow an operator to manage the value of a token, up to the `_value` amount. * @dev MUST revert unless caller is the current owner, an authorized operator, or the approved * address for `_tokenId`. * MUST emit ApprovalValue event. * @param _tokenId The token to approve * @param _operator The operator to be approved * @param _value The maximum value of `_toTokenId` that `_operator` is allowed to manage */ function approve( uint256 _tokenId, address _operator, uint256 _value ) external payable; /** * @notice Get the maximum value of a token that an operator is allowed to manage. * @param _tokenId The token for which to query the allowance * @param _operator The address of an operator * @return The current approval value of `_tokenId` that `_operator` is allowed to manage */ function allowance(uint256 _tokenId, address _operator) external view returns (uint256); /** * @notice Transfer value from a specified token to another specified token with the same slot. * @dev Caller MUST be the current owner, an authorized operator or an operator who has been * approved the whole `_fromTokenId` or part of it. * MUST revert if `_fromTokenId` or `_toTokenId` is zero token id or does not exist. * MUST revert if slots of `_fromTokenId` and `_toTokenId` do not match. * MUST revert if `_value` exceeds the balance of `_fromTokenId` or its allowance to the * operator. * MUST emit `TransferValue` event. * @param _fromTokenId The token to transfer value from * @param _toTokenId The token to transfer value to * @param _value The transferred value */ function transferFrom( uint256 _fromTokenId, uint256 _toTokenId, uint256 _value ) external payable; /** * @notice Transfer value from a specified token to an address. The caller should confirm that * `_to` is capable of receiving ERC3525 tokens. * @dev This function MUST create a new ERC3525 token with the same slot for `_to` to receive * the transferred value. * MUST revert if `_fromTokenId` is zero token id or does not exist. * MUST revert if `_to` is zero address. * MUST revert if `_value` exceeds the balance of `_fromTokenId` or its allowance to the * operator. * MUST emit `Transfer` and `TransferValue` events. * @param _fromTokenId The token to transfer value from * @param _to The address to transfer value to * @param _value The transferred value * @return ID of the new token created for `_to` which receives the transferred value */ function transferFrom( uint256 _fromTokenId, address _to, uint256 _value ) external payable returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers from ERC721 asset contracts. * Note: the ERC-165 identifier for this interface is 0x150b7a02. */ interface IERC721ReceiverUpgradeable { /** * @notice Handle the receipt of an NFT * @dev The ERC721 smart contract calls this function on the recipient * after a `transfer`. This function MAY throw to revert and reject the * transfer. Return of other than the magic value MUST result in the * transaction being reverted. * Note: the contract address is always the message sender. * @param _operator The address which called `safeTransferFrom` function * @param _from The address which previously owned the token * @param _tokenId The NFT identifier which is being transferred * @param _data Additional data with no specified format * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` * unless throwing */ function onERC721Received( address _operator, address _from, uint256 _tokenId, bytes calldata _data ) external returns(bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.1; import "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard * @dev See https://eips.ethereum.org/EIPS/eip-721 * Note: the ERC-165 identifier for this interface is 0x80ac58cd. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev This emits when ownership of any NFT changes by any mechanism. * This event emits when NFTs are created (`from` == 0) and destroyed * (`to` == 0). Exception: during contract creation, any number of NFTs * may be created and assigned without emitting Transfer. At the time of * any transfer, the approved address for that NFT (if any) is reset to none. */ event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId); /** * @dev This emits when the approved address for an NFT is changed or * reaffirmed. The zero address indicates there is no approved address. * When a Transfer event emits, this also indicates that the approved * address for that NFT (if any) is reset to none. */ event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId); /** * @dev This emits when an operator is enabled or disabled for an owner. * The operator can manage all NFTs of the owner. */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /** * @notice Count all NFTs assigned to an owner * @dev NFTs assigned to the zero address are considered invalid, and this * function throws for queries about the zero address. * @param _owner An address for whom to query the balance * @return The number of NFTs owned by `_owner`, possibly zero */ function balanceOf(address _owner) external view returns (uint256); /** * @notice Find the owner of an NFT * @dev NFTs assigned to zero address are considered invalid, and queries * about them do throw. * @param _tokenId The identifier for an NFT * @return The address of the owner of the NFT */ function ownerOf(uint256 _tokenId) external view returns (address); /** * @notice Transfers the ownership of an NFT from one address to another address * @dev Throws unless `msg.sender` is the current owner, an authorized * operator, or the approved address for this NFT. Throws if `_from` is * not the current owner. Throws if `_to` is the zero address. Throws if * `_tokenId` is not a valid NFT. When transfer is complete, this function * checks if `_to` is a smart contract (code size > 0). If so, it calls * `onERC721Received` on `_to` and throws if the return value is not * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. * @param _from The current owner of the NFT * @param _to The new owner * @param _tokenId The NFT to transfer * @param data Additional data with no specified format, sent in call to `_to` */ function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external payable; /** * @notice Transfers the ownership of an NFT from one address to another address * @dev This works identically to the other function with an extra data parameter, * except this function just sets data to "". * @param _from The current owner of the NFT * @param _to The new owner * @param _tokenId The NFT to transfer */ function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable; /** * @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE * TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE * THEY MAY BE PERMANENTLY LOST * @dev Throws unless `msg.sender` is the current owner, an authorized * operator, or the approved address for this NFT. Throws if `_from` is * not the current owner. Throws if `_to` is the zero address. Throws if * `_tokenId` is not a valid NFT. * @param _from The current owner of the NFT * @param _to The new owner * @param _tokenId The NFT to transfer */ function transferFrom(address _from, address _to, uint256 _tokenId) external payable; /** * @notice Change or reaffirm the approved address for an NFT * @dev The zero address indicates there is no approved address. * Throws unless `msg.sender` is the current NFT owner, or an authorized * operator of the current owner. * @param _approved The new approved NFT controller * @param _tokenId The NFT to approve */ function approve(address _approved, uint256 _tokenId) external payable; /** * @notice Enable or disable approval for a third party ("operator") to manage * all of `msg.sender`'s assets * @dev Emits the ApprovalForAll event. The contract MUST allow * multiple operators per owner. * @param _operator Address to add to the set of authorized operators * @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** * @notice Get the approved address for a single NFT * @dev Throws if `_tokenId` is not a valid NFT. * @param _tokenId The NFT to find the approved address for * @return The approved address for this NFT, or the zero address if there is none */ function getApproved(uint256 _tokenId) external view returns (address); /** * @notice Query if an address is an authorized operator for another address * @param _owner The address that owns the NFTs * @param _operator The address that acts on behalf of the owner * @return True if `_operator` is an approved operator for `_owner`, false otherwise */ function isApprovedForAll(address _owner, address _operator) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC3525MetadataDescriptorUpgradeable { function constructContractURI() external view returns (string memory); function constructSlotURI(uint256 slot) external view returns (string memory); function constructTokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IOpenFundRedemptionConcrete { struct RedeemInfo { bytes32 poolId; address currency; uint256 createTime; uint256 nav; } function setRedeemNavOnlyDelegate(uint256 slot_, uint256 nav_) external; function getRedeemInfo(uint256 slot_) external view returns (RedeemInfo memory); function getRedeemNav(uint256 slot_) external view returns (uint256); function getRedemptionFeeRate(uint256 slot_) external view returns (uint256); function redemptionFeeReceiver() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IOpenFundRedemptionDelegate { function setRedeemNavOnlyMarket(uint256 slot_, uint256 nav_) external; }
{ "optimizer": { "enabled": true, "runs": 1 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyMarket","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"ApprovalValue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnValue","type":"uint256"}],"name":"BurnValue","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimValue","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimCurrencyAmount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"_creator","type":"address"},{"indexed":false,"internalType":"bytes","name":"_slotInfo","type":"bytes"}],"name":"CreateSlot","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_slot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"MintValue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"old_","type":"address"},{"indexed":false,"internalType":"address","name":"new_","type":"address"}],"name":"NewConcrete","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"NewOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"slot","type":"uint256"},{"indexed":true,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"uint256","name":"repayCurrencyAmount","type":"uint256"}],"name":"Repay","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"metadataDescriptor","type":"address"}],"name":"SetMetadataDescriptor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_oldSlot","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_newSlot","type":"uint256"}],"name":"SlotChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_toTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"TransferValue","type":"event"},{"inputs":[],"name":"acceptAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"allowRepayWithBalance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"address","name":"operator_","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"burnValue_","type":"uint256"}],"name":"burnOnlyIssueMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"address","name":"currency_","type":"address"},{"internalType":"uint256","name":"claimValue_","type":"uint256"}],"name":"claimTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"concrete","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractType","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"txSender_","type":"address"},{"internalType":"bytes","name":"inputSlotInfo_","type":"bytes"}],"name":"createSlotOnlyIssueMarket","outputs":[{"internalType":"uint256","name":"slot_","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"delegateToConcreteView","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name_","type":"bytes32"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"name_","type":"bytes32"},{"internalType":"string","name":"reason_","type":"string"}],"name":"getRequiredAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"resolver_","type":"address"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address","name":"concrete_","type":"address"},{"internalType":"address","name":"descriptor_","type":"address"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"bool","name":"allowRepayWithBalance_","type":"bool"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"operator_","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isResolverCached","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataDescriptor","outputs":[{"internalType":"contract IERC3525MetadataDescriptorUpgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"txSender_","type":"address"},{"internalType":"address","name":"currency_","type":"address"},{"internalType":"address","name":"mintTo_","type":"address"},{"internalType":"uint256","name":"slot_","type":"uint256"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"mintOnlyIssueMarket","outputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"txSender_","type":"address"},{"internalType":"address","name":"currency_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"mintValue_","type":"uint256"}],"name":"mintValueOnlyIssueMarket","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebuildCache","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"slot_","type":"uint256"},{"internalType":"address","name":"currency_","type":"address"},{"internalType":"uint256","name":"repayCurrencyAmount_","type":"uint256"}],"name":"repay","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"slot_","type":"uint256"},{"internalType":"address","name":"currency_","type":"address"},{"internalType":"uint256","name":"repayCurrencyAmount_","type":"uint256"}],"name":"repayWithBalance","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"resolver","outputs":[{"internalType":"contract IAddressResolver","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"bytes","name":"data_","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator_","type":"address"},{"internalType":"bool","name":"approved_","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newConcrete_","type":"address"}],"name":"setConcreteOnlyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner_","type":"address"}],"name":"setOwnerOnlyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPendingAdmin_","type":"address"}],"name":"setPendingAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"slot_","type":"uint256"},{"internalType":"uint256","name":"nav_","type":"uint256"}],"name":"setRedeemNavOnlyMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"slotByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slotCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"slotOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"slot_","type":"uint256"}],"name":"slotURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"slot_","type":"uint256"},{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"tokenInSlotByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint256","name":"index_","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"slot_","type":"uint256"}],"name":"tokenSupplyInSlot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTokenId_","type":"uint256"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"uint256","name":"newTokenId","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from_","type":"address"},{"internalType":"address","name":"to_","type":"address"},{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTokenId_","type":"uint256"},{"internalType":"uint256","name":"toTokenId_","type":"uint256"},{"internalType":"uint256","name":"value_","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"valueDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b615ee580620000f46000396000f3fe60806040526004361061026f5760003560e01c8062cd01101461027457806301ffc9a7146102a757806304f3bcec146102d757806306fdde0314610305578063081812fc14610327578063095ea7b31461034757806309c3dd871461035c5780630e18b6811461037c5780630f485c021461039157806310edd3ae146103a457806318160ddd146103c457806318f41d2f146103d95780631f3a1272146103ec5780632127e6b2146103ff57806321f8a7211461041f57806323b872dd1461043f578063263f3e7e1461045257806326782247146104725780632af64bd3146104925780632f745c59146104a7578063310ed7f0146104c75780633e7e8669146104da57806342842e0e146104fc578063466525d01461050f5780634dd18bf51461052f5780634f6ccce71461054f5780634f8a0f831461056f5780634ff7b4eb1461058f57806359c54a7c146105af5780636352211e146105c257806370a08231146105e25780637122c67d146106025780637418536014610622578063840f71131461063757806389e43fbd146106575780638ba344701461066a5780638cb0a5111461067f5780638da5cb5b1461069257806395d89b41146106b2578063993bef8d146106c75780639bc128bf146106e75780639cc7f70814610700578063a22cb46514610720578063aa67606014610740578063b88d4fde14610760578063c87b56dd14610773578063cb2ef6f714610793578063d5d049d1146107d1578063d8018928146107f1578063e345e0bc14610811578063e8a3d48514610831578063e985e9c514610846578063ed08fa8014610866578063f851a4401461087b578063ffe9b7e21461089b575b600080fd5b34801561028057600080fd5b5061029461028f36600461505b565b6108bb565b6040519081526020015b60405180910390f35b3480156102b357600080fd5b506102c76102c2366004615093565b610991565b604051901515815260200161029e565b3480156102e357600080fd5b50610191546102f8906001600160a01b031681565b60405161029e91906150b0565b34801561031157600080fd5b5061031a6109b6565b60405161029e9190615114565b34801561033357600080fd5b506102f8610342366004615127565b610a48565b61035a610355366004615160565b610a9a565b005b34801561036857600080fd5b5061031a610377366004615127565b610b5f565b34801561038857600080fd5b5061035a610c44565b61029461039f36600461518c565b610cfc565b3480156103b057600080fd5b506102946103bf36600461520c565b610d34565b3480156103d057600080fd5b50603854610294565b61035a6103e7366004615260565b610eb1565b61035a6103fa36600461518c565b610fc1565b34801561040b57600080fd5b5061035a61041a3660046152bf565b611095565b34801561042b57600080fd5b506102f861043a366004615127565b611238565b61035a61044d36600461539b565b611254565b34801561045e57600080fd5b5061029461046d366004615127565b611285565b34801561047e57600080fd5b506098546102f8906001600160a01b031681565b34801561049e57600080fd5b506102c76112cd565b3480156104b357600080fd5b506102946104c2366004615160565b6113e1565b61035a6104d53660046153cb565b61146f565b3480156104e657600080fd5b5060355460405160ff909116815260200161029e565b61035a61050a36600461539b565b611485565b34801561051b57600080fd5b5061035a61052a3660046153f7565b6114a0565b34801561053b57600080fd5b5061035a61054a3660046153f7565b61153c565b34801561055b57600080fd5b5061029461056a366004615127565b6115d8565b34801561057b57600080fd5b5061029461058a366004615127565b611669565b34801561059b57600080fd5b5061031a6105aa366004615414565b6116be565b61035a6105bd36600461518c565b61173e565b3480156105ce57600080fd5b506102f86105dd366004615127565b611825565b3480156105ee57600080fd5b506102946105fd3660046153f7565b611895565b34801561060e57600080fd5b5061035a61061d36600461505b565b61191d565b34801561062e57600080fd5b5061035a6119e8565b34801561064357600080fd5b50603b546102f8906001600160a01b031681565b610294610665366004615455565b611b0e565b34801561067657600080fd5b506102f8611c09565b61035a61068d36600461518c565b611c18565b34801561069e57600080fd5b5060c9546102f8906001600160a01b031681565b3480156106be57600080fd5b5061031a611cbf565b3480156106d357600080fd5b506102946106e2366004615127565b611cce565b3480156106f357600080fd5b506102595460ff166102c7565b34801561070c57600080fd5b5061029461071b366004615127565b611d6b565b34801561072c57600080fd5b5061035a61073b3660046154b0565b611db3565b34801561074c57600080fd5b506102f861075b366004615594565b611dbe565b61035a61076e3660046155ee565b611dfc565b34801561077f57600080fd5b5061031a61078e366004615127565b611e2e565b34801561079f57600080fd5b506040805180820190915260158152744f70656e2046756e6420526564656d7074696f6e7360581b602082015261031a565b3480156107dd57600080fd5b5061035a6107ec36600461505b565b611ec0565b3480156107fd57600080fd5b5061035a61080c36600461566d565b611feb565b34801561081d57600080fd5b5061029461082c3660046156b5565b61240a565b34801561083d57600080fd5b5061031a61243e565b34801561085257600080fd5b506102c76108613660046156da565b61252b565b34801561087257600080fd5b50606654610294565b34801561088757600080fd5b506097546102f8906001600160a01b031681565b3480156108a757600080fd5b5061035a6108b63660046153f7565b61255d565b60006108c683611669565b82106109375760405162461bcd60e51b815260206004820152603560248201527f45524333353235536c6f74456e756d657261626c653a20736c6f7420746f6b656044820152746e20696e646578206f7574206f6620626f756e647360581b60648201526084015b60405180910390fd5b60008381526067602052604090205460668054909190811061095b5761095b615708565b9060005260206000209060020201600101828154811061097d5761097d615708565b906000526020600020015490505b92915050565b60006001600160e01b03198216631dba0dcf60e11b148061098b575061098b8261259c565b6060603380546109c59061571e565b80601f01602080910402602001604051908101604052809291908181526020018280546109f19061571e565b8015610a3e5780601f10610a1357610100808354040283529160200191610a3e565b820191906000526020600020905b815481529060010190602001808311610a2157829003601f168201915b5050505050905090565b6000610a538261263e565b600082815260396020526040902054603880549091908110610a7757610a77615708565b60009182526020909120600460069092020101546001600160a01b031692915050565b6000610aa582611825565b9050806001600160a01b0316836001600160a01b031603610ad85760405162461bcd60e51b815260040161092e90615758565b336001600160a01b0382161480610af45750610af4813361252b565b610b505760405162461bcd60e51b81526020600482015260396024820152600080516020615df08339815191526044820152781ddb995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b603a1b606482015260840161092e565b610b5a8383612663565b505050565b60606000610b6b6126fa565b603b549091506001600160a01b0316610bcb576000815111610b9c5760405180602001604052806000815250610c3d565b80610ba68461270c565b604051602001610bb792919061579a565b604051602081830303815290604052610c3d565b603b54604051633601bfc560e11b8152600481018590526001600160a01b0390911690636c037f8a906024015b600060405180830381865afa158015610c15573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c3d91908101906157da565b9392505050565b6098546001600160a01b0316336001600160a01b031614610c9c5760405162461bcd60e51b815260206004820152601260248201527137b7363c903832b73234b7339030b236b4b760711b604482015260640161092e565b609754609854604051600080516020615e5083398151915292610ccd926001600160a01b0391821692911690615847565b60405180910390a160988054609780546001600160a01b03199081166001600160a01b03841617909155169055565b6000610d0933858461279e565b610d128461282e565b9050610d298382610d2287611285565b6000612838565b610c3d84828461297d565b6000610d3e612cb9565b610d46612d14565b6001600160a01b0316336001600160a01b031614610d765760405162461bcd60e51b815260040161092e90615861565b610d7e611c09565b6001600160a01b031663dae85ba38585856040518463ffffffff1660e01b8152600401610dad939291906158d0565b6020604051808303816000875af1158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df091906158f5565b9050610dfb81612d6a565b15610e595760405162461bcd60e51b815260206004820152602860248201527f5346544973737561626c6544656c65676174653a20736c6f7420616c72656164604482015267792065786973747360c01b606482015260840161092e565b610e6281612db6565b836001600160a01b0316817f812dafd1bbea8aa1e81f2b03677c72a46b0ef2cb6ddf3b401a553bdb4fce5d8c8585604051610e9e92919061590e565b60405180910390a3610c3d600161012d55565b610eb9612cb9565b610ec1612d14565b6001600160a01b0316336001600160a01b031614610ef257604051639e0125a960e01b815260040160405180910390fd5b6000610efd83611825565b90506000610f0a84611285565b9050610f168484612e73565b610f1e611c09565b6001600160a01b03166389197e238787858589896040518763ffffffff1660e01b8152600401610f5396959493929190615922565b600060405180830381600087803b158015610f6d57600080fd5b505af1158015610f81573d6000803e3d6000fd5b505050508084600080516020615e9083398151915285604051610fa691815260200190565b60405180910390a35050610fbb600161012d55565b50505050565b610fc9612cb9565b610fd1611c09565b6001600160a01b031663a6a978d8338585856040518563ffffffff1660e01b8152600401611002949392919061595b565b600060405180830381600087803b15801561101c57600080fd5b505af1158015611030573d6000803e3d6000fd5b505050506110458261103f3390565b83612eb7565b335b6001600160a01b0316837fb42c5f4d7454a3dbf5af30732b0d66efa11d73c66cef1f5732fa84b7e63cf99a8484604051611082929190615985565b60405180910390a3610b5a600161012d55565b600054610100900460ff16158080156110b55750600054600160ff909116105b806110d657506110c4306130a4565b1580156110d6575060005460ff166001145b6111395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b6000805460ff19166001179055801561115c576000805461ff0019166101001790555b6111d68b8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c90819084018382808284376000920191909152508c92508b91508a9050896130b3565b610259805460ff1916831515179055801561122b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b600090815261019260205260409020546001600160a01b031690565b61125e33826130fa565b61127a5760405162461bcd60e51b815260040161092e9061599e565b610b5a838383613158565b60006112908261263e565b6000828152603960205260409020546038805490919081106112b4576112b4615708565b9060005260206000209060060201600101549050919050565b6000806112d86132be565b905060005b81518110156113d85760008282815181106112fa576112fa615708565b6020908102919091018101516000818152610192909252604091829020546101915492516321f8a72160e01b8152600481018390529193506001600160a01b039081169216906321f8a72190602401602060405180830381865afa158015611366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138a91906159f0565b6001600160a01b03161415806113b65750600081815261019260205260409020546001600160a01b0316155b156113c5576000935050505090565b50806113d081615a23565b9150506112dd565b50600191505090565b60006113ec83611895565b82106114455760405162461bcd60e51b815260206004820152602260248201527f455243333532353a206f776e657220696e646578206f7574206f6620626f756e604482015261647360f01b606482015260840161092e565b6001600160a01b0383166000908152603a6020526040902080548390811061097d5761097d615708565b61147a33848361279e565b610b5a83838361297d565b610b5a83838360405180602001604052806000815250611dfc565b6097546001600160a01b0316336001600160a01b0316146114d35760405162461bcd60e51b815260040161092e90615a3c565b60fb546040517f1eeb545565f5659deaedac206fd7c39c875a55001aba786f2a6b7245a301eaa491611512916001600160a01b03909116908490615847565b60405180910390a160fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b0316336001600160a01b03161461156f5760405162461bcd60e51b815260040161092e90615a3c565b6098546040517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9916115ae916001600160a01b03909116908490615847565b60405180910390a1609880546001600160a01b0319166001600160a01b0392909216919091179055565b60006115e360385490565b821061163d5760405162461bcd60e51b815260206004820152602360248201527f455243333532353a20676c6f62616c20696e646578206f7574206f6620626f756044820152626e647360e81b606482015260840161092e565b6038828154811061165057611650615708565b9060005260206000209060060201600001549050919050565b600061167482612d6a565b61168057506000919050565b6000828152606760205260409020546066805490919081106116a4576116a4615708565b600091825260209091206001600290920201015492915050565b60606000806116cb611c09565b6001600160a01b031685856040516116e4929190615a60565b600060405180830381855afa9150503d806000811461171f576040519150601f19603f3d011682016040523d82523d6000602084013e611724565b606091505b50909250905081611736573d60208201fd5b949350505050565b611746612cb9565b6102595460ff166117b35760405162461bcd60e51b815260206004820152603160248201527f4d756c7469526570617961626c6544656c65676174653a2063616e6e6f7420726044820152706570617920776974682062616c616e636560781b606482015260840161092e565b6117bb611c09565b6001600160a01b0316633b2f4830338585856040518563ffffffff1660e01b81526004016117ec949392919061595b565b600060405180830381600087803b15801561180657600080fd5b505af115801561181a573d6000803e3d6000fd5b505050506110473390565b60006118308261263e565b60008281526039602052604090205460388054909190811061185457611854615708565b60009182526020909120600360069092020101546001600160a01b03169050806118905760405162461bcd60e51b815260040161092e90615a70565b919050565b60006001600160a01b0382166119015760405162461bcd60e51b815260206004820152602b60248201527f455243333532353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b606482015260840161092e565b506001600160a01b03166000908152603a602052604090205490565b611925612d14565b6001600160a01b0316336001600160a01b0316146119795760405162461bcd60e51b815260206004820152601160248201527013d194910e881bdb9b1e481b585c9ad95d607a1b604482015260640161092e565b611981611c09565b604051637b832a6760e11b815260048101849052602481018390526001600160a01b03919091169063f70654ce90604401600060405180830381600087803b1580156119cc57600080fd5b505af11580156119e0573d6000803e3d6000fd5b505050505050565b60006119f26132be565b905060005b8151811015611b0a576000828281518110611a1457611a14615708565b602090810291909101015161019154604080516305533b0360e51b8152600481018490526024810191909152601f60448201527f4164647265737343616368653a2061646472657373206e6f7420666f756e640060648201529192506000916001600160a01b039091169063aa67606090608401602060405180830381865afa158015611aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac991906159f0565b6000928352610192602052604090922080546001600160a01b0319166001600160a01b03909316929092179091555080611b0281615a23565b9150506119f7565b5050565b6000611b18612cb9565b611b20612d14565b6001600160a01b0316336001600160a01b031614611b505760405162461bcd60e51b815260040161092e90615861565b611b5b848484613314565b9050611b65611c09565b6001600160a01b03166389197e238787878786886040518763ffffffff1660e01b8152600401611b9a96959493929190615922565b600060405180830381600087803b158015611bb457600080fd5b505af1158015611bc8573d6000803e3d6000fd5b505050508281600080516020615e9083398151915284604051611bed91815260200190565b60405180910390a3611c00600161012d55565b95945050505050565b60fb546001600160a01b031690565b6000611c2384611825565b9050806001600160a01b0316836001600160a01b031603611c565760405162461bcd60e51b815260040161092e90615758565b611c6033856130fa565b611cb45760405162461bcd60e51b81526020600482015260316024820152600080516020615df08339815191526044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606482015260840161092e565b610fbb84848461332c565b6060603480546109c59061571e565b6000611cd960665490565b8210611d3f5760405162461bcd60e51b815260206004820152602f60248201527f45524333353235536c6f74456e756d657261626c653a20736c6f7420696e646560448201526e78206f7574206f6620626f756e647360881b606482015260840161092e565b60668281548110611d5257611d52615708565b9060005260206000209060020201600001549050919050565b6000611d768261263e565b600082815260396020526040902054603880549091908110611d9a57611d9a615708565b9060005260206000209060060201600201549050919050565b611b0a338383613464565b600080611dca84611238565b9050826001600160a01b038216611df45760405162461bcd60e51b815260040161092e9190615114565b509392505050565b611e0633836130fa565b611e225760405162461bcd60e51b815260040161092e9061599e565b610fbb8484848461352b565b6060611e398261263e565b6000611e436126fa565b603b549091506001600160a01b0316611e8f576000815111611e745760405180602001604052806000815250610c3d565b80611e7e8461270c565b604051602001610bb7929190615aa3565b603b546040516344a5a61760e11b8152600481018590526001600160a01b039091169063894b4c2e90602401610bf8565b611ec8612cb9565b611ed0612d14565b6001600160a01b0316336001600160a01b031614611f0157604051639e0125a960e01b815260040160405180910390fd5b60008115611f0f5781611f18565b611f1883611d6b565b9050611f22611c09565b60405163663f60bd60e11b815260048101859052602481018390526001600160a01b03919091169063cc7ec17a90604401600060405180830381600087803b158015611f6d57600080fd5b505af1158015611f81573d6000803e3d6000fd5b5050505081600003611f9b57611f968361359e565b611fa5565b611fa583836136a5565b827f98ba6768a6df38155451a706e1f1ffb2dd8ea75a1184c3d45acc3b9586ede6d482604051611fd791815260200190565b60405180910390a250611b0a600161012d55565b611ff3612cb9565b600081116120575760405162461bcd60e51b815260206004820152602b60248201527f4d756c7469526570617961626c6544656c65676174653a20636c61696d20766160448201526a6c7565206973207a65726f60a81b606482015260840161092e565b61206133846130fa565b6120ce5760405162461bcd60e51b815260206004820152603860248201527f4d756c7469526570617961626c6544656c65676174653a2063616c6c657220696044820152771cc81b9bdd081bdddb995c881b9bdc88185c1c1c9bdd995960421b606482015260840161092e565b60006120d984611285565b905060006120e5611c09565b6001600160a01b03166356b04045866040518263ffffffff1660e01b815260040161211291815260200190565b602060405180830381865afa15801561212f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215391906158f5565b9050808311156121b05760405162461bcd60e51b815260206004820152602260248201527f4d756c7469526570617961626c6544656c65676174653a206f76657220636c61604482015261696d60f01b606482015260840161092e565b60006121ba611c09565b604051633cc6cee360e21b815260048101889052602481018590526001600160a01b03878116604483015260648201879052919091169063f31b3b8c906084016020604051808303816000875af1158015612219573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223d91906158f5565b90506000612249611c09565b6001600160a01b03166391553089856040518263ffffffff1660e01b815260040161227691815260200190565b602060405180830381865afa158015612293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b791906158f5565b90506000670de0b6b3a76400006122ce8385615ad2565b6122d89190615ae9565b90506122e388611d6b565b86036122f7576122f28861359e565b612301565b61230188876136a5565b600061230b611c09565b6001600160a01b031663a95929976040518163ffffffff1660e01b8152600401602060405180830381865afa158015612348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236c91906159f0565b90506001600160a01b038116158015906123865750600082115b15612396576123968882846137bb565b6123aa888b6123a58588615b0b565b6137bb565b604080518881526001600160a01b038a811660208301529181018690528a918c16907f04defe9d288e5d6a64d8aad79ce94f8c21b1bead0a5fbe9b869e0245be447fc59060600160405180910390a3505050505050610fbb600161012d55565b60006124158361263e565b5060009182526037602090815260408084206001600160a01b0393909316845291905290205490565b6060600061244a6126fa565b603b549091506001600160a01b03166124aa57600081511161247b5760405180602001604052806000815250612525565b80612485306139b0565b604051602001612496929190615b1e565b604051602081830303815290604052612525565b603b60009054906101000a90046001600160a01b03166001600160a01b031663725fa09c6040518163ffffffff1660e01b8152600401600060405180830381865afa1580156124fd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261252591908101906157da565b91505090565b6001600160a01b039182166000908152603a602090815260408083209390941682526002909201909152205460ff1690565b6097546001600160a01b0316336001600160a01b0316146125905760405162461bcd60e51b815260040161092e90615a3c565b612599816139c6565b50565b60006001600160e01b031982166301ffc9a760e01b14806125cd57506001600160e01b03198216630354d60560e61b145b806125e857506001600160e01b031982166380ac58cd60e01b145b8061260357506001600160e01b031982166370b0048160e11b145b8061261e57506001600160e01b0319821663780e9d6360e01b145b8061098b57506001600160e01b03198216635b5e139f60e01b1492915050565b61264781613a81565b6125995760405162461bcd60e51b815260040161092e90615a70565b60008181526039602052604090205460388054849290811061268757612687615708565b6000918252602090912060069091020160040180546001600160a01b0319166001600160a01b03928316179055819083166126c182611825565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60408051602081019091526000815290565b6060600061271983613acd565b60010190506000816001600160401b03811115612738576127386154e9565b6040519080825280601f01601f191660200182016040528015612762576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461276c57509392505050565b60006127aa838561240a565b90506127b684846130fa565b1580156127c557506000198114155b15610fbb578181101561281a5760405162461bcd60e51b815260206004820152601f60248201527f455243333532353a20696e73756666696369656e7420616c6c6f77616e636500604482015260640161092e565b610fbb83856128298585615b0b565b61332c565b600061098b613ba3565b6001600160a01b0384166128985760405162461bcd60e51b815260206004820152602160248201527f455243333532353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161092e565b826000036128f25760405162461bcd60e51b815260206004820152602160248201527f455243333532353a2063616e6e6f74206d696e74207a65726f20746f6b656e496044820152601960fa1b606482015260840161092e565b6128fb83613a81565b156129485760405162461bcd60e51b815260206004820152601d60248201527f455243333532353a20746f6b656e20616c7265616479206d696e746564000000604482015260640161092e565b6129586000856000868686613bba565b612963848484613bc8565b61296d8382613c6a565b610fbb6000856000868686613cdd565b61298683613a81565b6129e25760405162461bcd60e51b815260206004820152602760248201527f455243333532353a207472616e736665722066726f6d20696e76616c696420746044820152661bdad95b88125160ca1b606482015260840161092e565b6129eb82613a81565b612a455760405162461bcd60e51b815260206004820152602560248201527f455243333532353a207472616e7366657220746f20696e76616c696420746f6b604482015264195b88125160da1b606482015260840161092e565b600083815260396020526040812054603880549091908110612a6957612a69615708565b9060005260206000209060060201905060006038603960008681526020019081526020016000205481548110612aa157612aa1615708565b906000526020600020906006020190508282600201541015612b185760405162461bcd60e51b815260206004820152602a60248201527f455243333532353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161092e565b8060010154826001015414612b865760405162461bcd60e51b815260206004820152602e60248201527f455243333532353a207472616e7366657220746f20746f6b656e20776974682060448201526d191a5999995c995b9d081cdb1bdd60921b606482015260840161092e565b600380830154908201546001840154612bb1926001600160a01b039081169216908890889088613bba565b82826002016000828254612bc59190615b0b565b9250508190555082816002016000828254612be09190615b62565b909155505060405183815284908690600080516020615e108339815191529060200160405180910390a3600380830154908201546001840154612c35926001600160a01b039081169216908890889088613cdd565b612c5085858560405180602001604052806000815250613d4e565b612cb25760405162461bcd60e51b815260206004820152602d60248201527f455243333532353a207472616e736665722072656a656374656420627920455260448201526c21999a991aa932b1b2b4bb32b960991b606482015260840161092e565b5050505050565b600261012d5403612d0c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161092e565b600261012d55565b6000612d656d13dc195b919d5b9913585c9ad95d60921b6040518060400160405280601c81526020017b13d194910e8813dc195b919d5b9913585c9ad95d081b9bdd081cd95d60221b815250611dbe565b905090565b6066546000901580159061098b5750600082815260676020526040902054606680548492908110612d9d57612d9d615708565b9060005260206000209060020201600001541492915050565b612dbf81612d6a565b15612e1f5760405162461bcd60e51b815260206004820152602a60248201527f45524333353235536c6f74456e756d657261626c653a20736c6f7420616c72656044820152696164792065786973747360b01b606482015260840161092e565b604080518082018252828152815160008082526020828101909452928201529050612e4981613eca565b81600080600080516020615e7083398151915260405160405180910390a45050565b600161012d55565b6000612e7e83611825565b90506000612e8b84611285565b9050612e9d6000836000878588613bba565b612ea78484613c6a565b610fbb6000836000878588613cdd565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601612f7a57326001600160a01b0383161480612efb5750336001600160a01b038316145b612f395760405162461bcd60e51b815260206004820152600f60248201526e0e6cadcc8cae440dad2e6dac2e8c6d608b1b604482015260640161092e565b80341015610b5a5760405162461bcd60e51b815260206004820152600e60248201526d0ecc2d8eaca40dad2e6dac2e8c6d60931b604482015260640161092e565b6000836001600160a01b03163b11612fa45760405162461bcd60e51b815260040161092e90615b75565b604080516001600160a01b038481166024830152306044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908716916130069190615ba1565b6000604051808303816000865af19150503d8060008114613043576040519150601f19603f3d011682016040523d82523d6000602084013e613048565b606091505b50915091508180156130725750805115806130725750808060200190518101906130729190615bbd565b612cb25760405162461bcd60e51b815260206004820152600360248201526229aa2360e91b604482015260640161092e565b6001600160a01b03163b151590565b600054610100900460ff166130da5760405162461bcd60e51b815260040161092e90615bda565b6130e8868686868686613f4f565b6130f187614019565b50505050505050565b60008061310683611825565b9050806001600160a01b0316846001600160a01b0316148061312d575061312d818561252b565b806117365750836001600160a01b031661314684610a48565b6001600160a01b031614949350505050565b826001600160a01b031661316b82611825565b6001600160a01b0316146131cd5760405162461bcd60e51b8152602060048201526024808201527f455243333532353a207472616e736665722066726f6d20696e76616c6964206f6044820152633bb732b960e11b606482015260840161092e565b6001600160a01b0382166132315760405162461bcd60e51b815260206004820152602560248201527f455243333532353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161092e565b600061323c82611285565b9050600061324983611d6b565b9050613259858585868686613bba565b613264600084612663565b61326d83614063565b613277858461410e565b613281848461422f565b82846001600160a01b0316866001600160a01b0316600080516020615e3083398151915260405160405180910390a4612cb2858585868686613cdd565b604080516001808252818301909252606091602080830190803683370190505090506d13dc195b919d5b9913585c9ad95d60921b8160008151811061330557613305615708565b60200260200101818152505090565b600061331e613ba3565b9050610c3d84828585612838565b6001600160a01b0382166133955760405162461bcd60e51b815260206004820152602a60248201527f455243333532353a20617070726f76652076616c756520746f20746865207a65604482015269726f206164647265737360b01b606482015260840161092e565b61339f82846142b8565b613405576000838152603960205260409020546038805490919081106133c7576133c7615708565b60009182526020808320600692909202909101600501805460018101825590835291200180546001600160a01b0319166001600160a01b0384161790555b60008381526037602090815260408083206001600160a01b038616808552908352928190208490555183815285917f621b050de0ad08b51d19b48b3e6df75348c4de6bdd93e81b252ca62e28265b1b91015b60405180910390a3505050565b816001600160a01b0316836001600160a01b0316036134c25760405162461bcd60e51b815260206004820152601a60248201527922a921999a991a9d1030b8383937bb32903a379031b0b63632b960311b604482015260640161092e565b6001600160a01b038381166000818152603a602090815260408083209487168084526002909501825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101613457565b613536848484613158565b6135428484848461438b565b610fbb5760405162461bcd60e51b815260206004820152602760248201527f455243333532353a207472616e7366657220746f206e6f6e204552433732315260448201526632b1b2b4bb32b960c91b606482015260840161092e565b6135a78161263e565b6000818152603960205260408120546038805490919081106135cb576135cb615708565b600091825260208220600360069092020190810154600182015460028301549294506001600160a01b039091169290919061360b90849087818686613bba565b61361485614063565b61361e838661410e565b613627856144db565b600085600080516020615e108339815191528360405161364991815260200190565b60405180910390a360008286600080516020615e7083398151915260405160405180910390a460405185906000906001600160a01b03861690600080516020615e30833981519152908390a4612cb28360008760008686613cdd565b6136ae8261263e565b6000828152603960205260408120546038805490919081106136d2576136d2615708565b600091825260209091206006909102016003810154600182015460028301549293506001600160a01b03909116918481101561375c5760405162461bcd60e51b815260206004820152602360248201527f455243333532353a206275726e2076616c756520657863656564732062616c616044820152626e636560e81b606482015260840161092e565b61376c836000886000868a613bba565b848460020160008282546137809190615b0b565b90915550506040518581526000908790600080516020615e108339815191529060200160405180910390a36119e0836000886000868a613cdd565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161388357604080516000808252602082019092526001600160a01b03841690839060405161380a9190615ba1565b60006040518083038185875af1925050503d8060008114613847576040519150601f19603f3d011682016040523d82523d6000602084013e61384c565b606091505b5050905080610fbb5760405162461bcd60e51b815260206004820152600360248201526253544560e81b604482015260640161092e565b6000836001600160a01b03163b116138ad5760405162461bcd60e51b815260040161092e90615b75565b600080846001600160a01b031663a9059cbb60e01b85856040516024016138d5929190615985565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516139139190615ba1565b6000604051808303816000865af19150503d8060008114613950576040519150601f19603f3d011682016040523d82523d6000602084013e613955565b606091505b509150915081801561397f57508051158061397f57508080602001905181019061397f9190615bbd565b612cb25760405162461bcd60e51b815260206004820152600260248201526114d560f21b604482015260640161092e565b606061098b6001600160a01b03831660146146e9565b6001600160a01b038116613a185760405162461bcd60e51b815260206004820152601960248201527804f776e6572206164647265737320636f6e6e6f74206265203603c1b604482015260640161092e565b60c9546040517f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491613a57916001600160a01b03909116908490615847565b60405180910390a160c980546001600160a01b0319166001600160a01b0392909216919091179055565b6038546000901580159061098b5750600082815260396020526040902054603880548492908110613ab457613ab4615708565b9060005260206000209060060201600001541492915050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613b0c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310613b36576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310613b5457662386f26fc10000830492506010015b6305f5e1008310613b6c576305f5e100830492506008015b6127108310613b8057612710830492506004015b60648310613b92576064830492506002015b600a831061098b5760010192915050565b6000613bb3603680546001019055565b5060365490565b6119e0868686868686614884565b6040805160c081018252838152602080820184905260008284018190526001600160a01b038716606084015260808301819052835181815291820190935260a08201529050613c16816149b3565b613c20848461422f565b60405183906001600160a01b03861690600090600080516020615e30833981519152908290a481600084600080516020615e7083398151915260405160405180910390a450505050565b600082815260396020526040902054603880548392908110613c8e57613c8e615708565b90600052602060002090600602016002016000828254613cae9190615b62565b90915550506040518181528290600090600080516020615e108339815191529060200160405180910390a35050565b6001600160a01b038616158015613cf2575083155b8015613d055750613d038284614b05565b155b15613d1957613d148284614b91565b6119e0565b6001600160a01b038516158015613d2e575082155b8015613d3f5750613d3f8285614b05565b15613d1457613d148285614bf2565b600080613d5a85611825565b9050613d6e816001600160a01b03166130a4565b15613ebe576040516301ffc9a760e01b8152629ce20b60e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa925050508015613dd9575060408051601f3d908101601f19168201909252613dd691810190615bbd565b60015b613e18573d808015613e07576040519150601f19603f3d011682016040523d82523d6000602084013e613e0c565b606091505b50600192505050611736565b8015613eb357604051629ce20b60e01b81526000906001600160a01b03841690629ce20b90613e539033908c908c908c908c90600401615c25565b6020604051808303816000875af1158015613e72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e969190615c63565b6001600160e01b031916629ce20b60e01b14935061173692505050565b600192505050611736565b50600195945050505050565b60668054825160009081526067602090815260408220839055600183018455929052825160029091027f46501879b8ca8525e8c2fd519e2fbfcfa2ebea26501294aa02cbfcfb12e9435481019182558284015180518594610fbb937f46501879b8ca8525e8c2fd519e2fbfcfa2ebea26501294aa02cbfcfb12e9435501920190614f88565b600054610100900460ff16613f765760405162461bcd60e51b815260040161092e90615bda565b613f81868686614cd6565b613f8a81614d08565b613f9382614d41565b613f9c83614d8b565b613fa4614dc4565b6001600160a01b038316156119e05760405163ca5eb5e160e01b81526001600160a01b0384169063ca5eb5e190613fdf9030906004016150b0565b600060405180830381600087803b158015613ff957600080fd5b505af115801561400d573d6000803e3d6000fd5b50505050505050505050565b600054610100900460ff166140405760405162461bcd60e51b815260040161092e90615bda565b61019180546001600160a01b0319166001600160a01b0392909216919091179055565b60008181526039602052604081205460388054909190811061408757614087615708565b600091825260208220600560069092020190810154909250905b818110156140ff5760008360050182815481106140c0576140c0615708565b60009182526020808320909101548783526037825260408084206001600160a01b039092168452915281205550806140f781615a23565b9150506140a1565b50610b5a600583016000614fd3565b60008181526039602052604081205460388054909190811061413257614132615708565b6000918252602080832060069290920290910160030180546001600160a01b0319166001600160a01b039485161790559184168152603a90915260408120805490919061418190600190615b0b565b9050600082600001828154811061419a5761419a615708565b906000526020600020015490506000836001016000868152602001908152602001600020549050818460000182815481106141d7576141d7615708565b6000918252602080832090910192909255838152600186019091526040808220839055868252812055835484908061421157614211615c80565b60019003818190600052602060002001600090559055505050505050565b60008181526039602052604090205460388054849290811061425357614253615708565b6000918252602080832060069290920290910160030180546001600160a01b0319166001600160a01b03948516179055939091168152603a80845260408083208054858552600182810188529285208190559286529082018155825292902090910155565b6000818152603960205260408120546038805483929081106142dc576142dc615708565b6000918252602082206005600690920201015491505b8181101561438057600084815260396020526040902054603880546001600160a01b0388169290811061432757614327615708565b9060005260206000209060060201600501828154811061434957614349615708565b6000918252602090912001546001600160a01b03160361436e5760019250505061098b565b8061437881615a23565b9150506142f2565b506000949350505050565b600061439f846001600160a01b03166130a4565b156144d357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906143d6903390899088908890600401615c96565b6020604051808303816000875af1925050508015614411575060408051601f3d908101601f1916820190925261440e91810190615c63565b60015b6144b9573d80801561443f576040519150601f19603f3d011682016040523d82523d6000602084013e614444565b606091505b5080516000036144b15760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606482015260840161092e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611736565b506001611736565b6038546000906144ed90600190615b0b565b6000838152603960205260408120546038805493945090928490811061451557614515615708565b60009182526020918290206040805160c08101825260069093029091018054835260018101548385015260028101548383015260038101546001600160a01b03908116606085015260048201541660808401526005810180548351818702810187019094528084529394919360a0860193928301828280156145c057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116145a2575b505050505081525050905080603883815481106145df576145df615708565b600091825260209182902083516006909202019081558282015160018201556040830151600282015560608301516003820180546001600160a01b039283166001600160a01b031991821617909155608085015160048401805491909316911617905560a08301518051919261465d92600585019290910190614ff1565b5050815160009081526039602052604080822085905586825281205550603880548061468b5761468b615c80565b60008281526020812060066000199093019283020181815560018101829055600281018290556003810180546001600160a01b03199081169091556004820180549091169055906146df6005830182614fd3565b5050905550505050565b606060006146f8836002615ad2565b614703906002615b62565b6001600160401b0381111561471a5761471a6154e9565b6040519080825280601f01601f191660200182016040528015614744576020820181803683370190505b509050600360fc1b8160008151811061475f5761475f615708565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061478e5761478e615708565b60200101906001600160f81b031916908160001a90535060006147b2846002615ad2565b6147bd906001615b62565b90505b6001811115614835576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106147f1576147f1615708565b1a60f81b82828151811061480757614807615708565b60200101906001600160f81b031916908160001a90535060049490941c9361482e81615cd3565b90506147c0565b508315610c3d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161092e565b614892868686868686614df5565b6001600160a01b0386161580156148a7575083155b1561491f576148b4611c09565b6040516335f28fa560e01b81526004810185905260248101849052604481018390526001600160a01b0391909116906335f28fa590606401600060405180830381600087803b15801561490657600080fd5b505af115801561491a573d6000803e3d6000fd5b505050505b6001600160a01b0386161580159061493657508315155b801561494a57506001600160a01b03851615155b801561495557508215155b156119e057614962611c09565b6001600160a01b031663302b586a858561497b88611d6b565b6040516001600160e01b031960e086901b16815260048101939093526024830191909152604482015260648101849052608401613fdf565b603880548251600090815260396020908152604080832084905560018401855593909152835160069092027f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f4561998101928355818501517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619a820155928401517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619b84015560608401517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619c840180546001600160a01b039283166001600160a01b03199182161790915560808601517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619d8601805491909316911617905560a084015180518594610fbb937f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619e909101920190614ff1565b600082815260676020526040812054606680548392908110614b2957614b29615708565b9060005260206000209060020201905060008160010180549050118015611736575060008481526065602090815260408083208684529091529020546001820180548592908110614b7c57614b7c615708565b90600052602060002001541491505092915050565b600082815260676020526040812054606680549091908110614bb557614bb5615708565b6000918252602080832060016002909302018201805496845260658252604080852087865283528420879055918601825590825290209092015550565b600082815260676020526040812054606680549091908110614c1657614c16615708565b600091825260208220600160029092020181810154909350614c389190615b0b565b90506000826001018281548110614c5157614c51615708565b6000918252602080832090910154878352606582526040808420888552909252912054600185018054929350909183919083908110614c9257614c92615708565b600091825260208083209190910192909255878152606582526040808220858352909252818120839055868152908120556001840180548061421157614211615c80565b600054610100900460ff16614cfd5760405162461bcd60e51b815260040161092e90615bda565b610b5a838383614e2a565b600054610100900460ff16614d2f5760405162461bcd60e51b815260040161092e90615bda565b614d3881614e83565b61259933614eaa565b603b80546001600160a01b0319166001600160a01b0383169081179091556040517f5252f52e45fc8ee6a7b43cef3645d23e9a470a34182b8b3a12627556635bfc9c90600090a250565b600054610100900460ff16614db25760405162461bcd60e51b815260040161092e90615bda565b614dbb33614eaa565b61259981614f18565b600054610100900460ff16614deb5760405162461bcd60e51b815260040161092e90615bda565b614df3614f61565b565b6001600160a01b038616158015614e0a575083155b8015614e1c5750614e1a82612d6a565b155b156119e0576119e082612db6565b600054610100900460ff16614e515760405162461bcd60e51b815260040161092e90615bda565b6033614e5d8482615d30565b506034614e6a8382615d30565b506035805460ff191660ff929092169190911790555050565b600054610100900460ff166125905760405162461bcd60e51b815260040161092e90615bda565b600054610100900460ff16614ed15760405162461bcd60e51b815260040161092e90615bda565b609780546001600160a01b0319166001600160a01b038316179055604051600080516020615e5083398151915290614f0d906000908490615847565b60405180910390a150565b600054610100900460ff16614f3f5760405162461bcd60e51b815260040161092e90615bda565b60fb80546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16612e6b5760405162461bcd60e51b815260040161092e90615bda565b828054828255906000526020600020908101928215614fc3579160200282015b82811115614fc3578251825591602001919060010190614fa8565b50614fcf929150615046565b5090565b50805460008255906000526020600020908101906125999190615046565b828054828255906000526020600020908101928215614fc3579160200282015b82811115614fc357825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615011565b5b80821115614fcf5760008155600101615047565b6000806040838503121561506e57600080fd5b50508035926020909101359150565b6001600160e01b03198116811461259957600080fd5b6000602082840312156150a557600080fd5b8135610c3d8161507d565b6001600160a01b0391909116815260200190565b60005b838110156150df5781810151838201526020016150c7565b50506000910152565b600081518084526151008160208601602086016150c4565b601f01601f19169290920160200192915050565b602081526000610c3d60208301846150e8565b60006020828403121561513957600080fd5b5035919050565b6001600160a01b038116811461259957600080fd5b803561189081615140565b6000806040838503121561517357600080fd5b823561517e81615140565b946020939093013593505050565b6000806000606084860312156151a157600080fd5b8335925060208401356151b381615140565b929592945050506040919091013590565b60008083601f8401126151d657600080fd5b5081356001600160401b038111156151ed57600080fd5b60208301915083602082850101111561520557600080fd5b9250929050565b60008060006040848603121561522157600080fd5b833561522c81615140565b925060208401356001600160401b0381111561524757600080fd5b615253868287016151c4565b9497909650939450505050565b6000806000806080858703121561527657600080fd5b843561528181615140565b9350602085013561529181615140565b93969395505050506040820135916060013590565b801515811461259957600080fd5b8035611890816152a6565b6000806000806000806000806000806101008b8d0312156152df57600080fd5b8a356152ea81615140565b995060208b01356001600160401b038082111561530657600080fd5b6153128e838f016151c4565b909b50995060408d013591508082111561532b57600080fd5b506153388d828e016151c4565b90985096505060608b013560ff8116811461535257600080fd5b945061536060808c01615155565b935061536e60a08c01615155565b925061537c60c08c01615155565b915061538a60e08c016152b4565b90509295989b9194979a5092959850565b6000806000606084860312156153b057600080fd5b83356153bb81615140565b925060208401356151b381615140565b6000806000606084860312156153e057600080fd5b505081359360208301359350604090920135919050565b60006020828403121561540957600080fd5b8135610c3d81615140565b6000806020838503121561542757600080fd5b82356001600160401b0381111561543d57600080fd5b615449858286016151c4565b90969095509350505050565b600080600080600060a0868803121561546d57600080fd5b853561547881615140565b9450602086013561548881615140565b9350604086013561549881615140565b94979396509394606081013594506080013592915050565b600080604083850312156154c357600080fd5b82356154ce81615140565b915060208301356154de816152a6565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715615527576155276154e9565b604052919050565b60006001600160401b03821115615548576155486154e9565b50601f01601f191660200190565b60006155696155648461552f565b6154ff565b905082815283838301111561557d57600080fd5b828260208301376000602084830101529392505050565b600080604083850312156155a757600080fd5b8235915060208301356001600160401b038111156155c457600080fd5b8301601f810185136155d557600080fd5b6155e485823560208401615556565b9150509250929050565b6000806000806080858703121561560457600080fd5b843561560f81615140565b9350602085013561561f81615140565b92506040850135915060608501356001600160401b0381111561564157600080fd5b8501601f8101871361565257600080fd5b61566187823560208401615556565b91505092959194509250565b6000806000806080858703121561568357600080fd5b843561568e81615140565b93506020850135925060408501356156a581615140565b9396929550929360600135925050565b600080604083850312156156c857600080fd5b8235915060208301356154de81615140565b600080604083850312156156ed57600080fd5b82356156f881615140565b915060208301356154de81615140565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061573257607f821691505b60208210810361575257634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f455243333532353a20617070726f76616c20746f2063757272656e74206f776e60408201526132b960f11b606082015260800190565b600083516157ac8184602088016150c4565b64736c6f742f60d81b90830190815283516157ce8160058401602088016150c4565b01600501949350505050565b6000602082840312156157ec57600080fd5b81516001600160401b0381111561580257600080fd5b8201601f8101841361581357600080fd5b80516158216155648261552f565b81815285602083850101111561583657600080fd5b611c008260208301602086016150c4565b6001600160a01b0392831681529116602082015260400190565b60208082526026908201527f5346544973737561626c6544656c65676174653a206f6e6c79206973737565206040820152651b585c9ad95d60d21b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0384168152604060208201819052600090611c0090830184866158a7565b60006020828403121561590757600080fd5b5051919050565b6020815260006117366020830184866158a7565b6001600160a01b03968716815294861660208601529290941660408401526060830152608082019290925260a081019190915260c00190565b6001600160a01b039485168152602081019390935292166040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b60208082526032908201527f455243333532353a207472616e736665722063616c6c6572206973206e6f74206040820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606082015260800190565b600060208284031215615a0257600080fd5b8151610c3d81615140565b634e487b7160e01b600052601160045260246000fd5b600060018201615a3557615a35615a0d565b5060010190565b6020808252600a908201526937b7363c9030b236b4b760b11b604082015260600190565b8183823760009101908152919050565b602080825260199082015278115490cccd4c8d4e881a5b9d985b1a59081d1bdad95b881251603a1b604082015260600190565b60008351615ab58184602088016150c4565b835190830190615ac98183602088016150c4565b01949350505050565b808202811582820484141761098b5761098b615a0d565b600082615b0657634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561098b5761098b615a0d565b60008351615b308184602088016150c4565b68636f6e74726163742f60b81b9083019081528351615b568160098401602088016150c4565b01600901949350505050565b8082018082111561098b5761098b615a0d565b602080825260129082015271696e76616c696420756e6465726c79696e6760701b604082015260600190565b60008251615bb38184602087016150c4565b9190910192915050565b600060208284031215615bcf57600080fd5b8151610c3d816152a6565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60018060a01b038616815284602082015283604082015282606082015260a060808201526000615c5860a08301846150e8565b979650505050505050565b600060208284031215615c7557600080fd5b8151610c3d8161507d565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615cc9908301846150e8565b9695505050505050565b600081615ce257615ce2615a0d565b506000190190565b601f821115610b5a57600081815260208120601f850160051c81016020861015615d115750805b601f850160051c820191505b818110156119e057828155600101615d1d565b81516001600160401b03811115615d4957615d496154e9565b615d5d81615d57845461571e565b84615cea565b602080601f831160018114615d925760008415615d7a5750858301515b600019600386901b1c1916600185901b1785556119e0565b600085815260208120601f198616915b82811015615dc157888601518255948401946001909101908401615da2565b5085821015615ddf5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fe455243333532353a20617070726f76652063616c6c6572206973206e6f74206f0b2aac84f3ec956911fd78eae5311062972ff949f38412e8da39069d9f068cc6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3eff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dce4f48c240d3b994948aa54f3e2f5fca59263dfe1d52b6e4cf39a5d249b5ccb65db1c3d54d13a327abe6187cf7a8328411546c3b743fd98e8447254318d65ab2ca264697066735822122098aae348f03003665592934f23f532580b824852a03ea501c8bf20cca692ad6864736f6c63430008110033
Deployed Bytecode
0x60806040526004361061026f5760003560e01c8062cd01101461027457806301ffc9a7146102a757806304f3bcec146102d757806306fdde0314610305578063081812fc14610327578063095ea7b31461034757806309c3dd871461035c5780630e18b6811461037c5780630f485c021461039157806310edd3ae146103a457806318160ddd146103c457806318f41d2f146103d95780631f3a1272146103ec5780632127e6b2146103ff57806321f8a7211461041f57806323b872dd1461043f578063263f3e7e1461045257806326782247146104725780632af64bd3146104925780632f745c59146104a7578063310ed7f0146104c75780633e7e8669146104da57806342842e0e146104fc578063466525d01461050f5780634dd18bf51461052f5780634f6ccce71461054f5780634f8a0f831461056f5780634ff7b4eb1461058f57806359c54a7c146105af5780636352211e146105c257806370a08231146105e25780637122c67d146106025780637418536014610622578063840f71131461063757806389e43fbd146106575780638ba344701461066a5780638cb0a5111461067f5780638da5cb5b1461069257806395d89b41146106b2578063993bef8d146106c75780639bc128bf146106e75780639cc7f70814610700578063a22cb46514610720578063aa67606014610740578063b88d4fde14610760578063c87b56dd14610773578063cb2ef6f714610793578063d5d049d1146107d1578063d8018928146107f1578063e345e0bc14610811578063e8a3d48514610831578063e985e9c514610846578063ed08fa8014610866578063f851a4401461087b578063ffe9b7e21461089b575b600080fd5b34801561028057600080fd5b5061029461028f36600461505b565b6108bb565b6040519081526020015b60405180910390f35b3480156102b357600080fd5b506102c76102c2366004615093565b610991565b604051901515815260200161029e565b3480156102e357600080fd5b50610191546102f8906001600160a01b031681565b60405161029e91906150b0565b34801561031157600080fd5b5061031a6109b6565b60405161029e9190615114565b34801561033357600080fd5b506102f8610342366004615127565b610a48565b61035a610355366004615160565b610a9a565b005b34801561036857600080fd5b5061031a610377366004615127565b610b5f565b34801561038857600080fd5b5061035a610c44565b61029461039f36600461518c565b610cfc565b3480156103b057600080fd5b506102946103bf36600461520c565b610d34565b3480156103d057600080fd5b50603854610294565b61035a6103e7366004615260565b610eb1565b61035a6103fa36600461518c565b610fc1565b34801561040b57600080fd5b5061035a61041a3660046152bf565b611095565b34801561042b57600080fd5b506102f861043a366004615127565b611238565b61035a61044d36600461539b565b611254565b34801561045e57600080fd5b5061029461046d366004615127565b611285565b34801561047e57600080fd5b506098546102f8906001600160a01b031681565b34801561049e57600080fd5b506102c76112cd565b3480156104b357600080fd5b506102946104c2366004615160565b6113e1565b61035a6104d53660046153cb565b61146f565b3480156104e657600080fd5b5060355460405160ff909116815260200161029e565b61035a61050a36600461539b565b611485565b34801561051b57600080fd5b5061035a61052a3660046153f7565b6114a0565b34801561053b57600080fd5b5061035a61054a3660046153f7565b61153c565b34801561055b57600080fd5b5061029461056a366004615127565b6115d8565b34801561057b57600080fd5b5061029461058a366004615127565b611669565b34801561059b57600080fd5b5061031a6105aa366004615414565b6116be565b61035a6105bd36600461518c565b61173e565b3480156105ce57600080fd5b506102f86105dd366004615127565b611825565b3480156105ee57600080fd5b506102946105fd3660046153f7565b611895565b34801561060e57600080fd5b5061035a61061d36600461505b565b61191d565b34801561062e57600080fd5b5061035a6119e8565b34801561064357600080fd5b50603b546102f8906001600160a01b031681565b610294610665366004615455565b611b0e565b34801561067657600080fd5b506102f8611c09565b61035a61068d36600461518c565b611c18565b34801561069e57600080fd5b5060c9546102f8906001600160a01b031681565b3480156106be57600080fd5b5061031a611cbf565b3480156106d357600080fd5b506102946106e2366004615127565b611cce565b3480156106f357600080fd5b506102595460ff166102c7565b34801561070c57600080fd5b5061029461071b366004615127565b611d6b565b34801561072c57600080fd5b5061035a61073b3660046154b0565b611db3565b34801561074c57600080fd5b506102f861075b366004615594565b611dbe565b61035a61076e3660046155ee565b611dfc565b34801561077f57600080fd5b5061031a61078e366004615127565b611e2e565b34801561079f57600080fd5b506040805180820190915260158152744f70656e2046756e6420526564656d7074696f6e7360581b602082015261031a565b3480156107dd57600080fd5b5061035a6107ec36600461505b565b611ec0565b3480156107fd57600080fd5b5061035a61080c36600461566d565b611feb565b34801561081d57600080fd5b5061029461082c3660046156b5565b61240a565b34801561083d57600080fd5b5061031a61243e565b34801561085257600080fd5b506102c76108613660046156da565b61252b565b34801561087257600080fd5b50606654610294565b34801561088757600080fd5b506097546102f8906001600160a01b031681565b3480156108a757600080fd5b5061035a6108b63660046153f7565b61255d565b60006108c683611669565b82106109375760405162461bcd60e51b815260206004820152603560248201527f45524333353235536c6f74456e756d657261626c653a20736c6f7420746f6b656044820152746e20696e646578206f7574206f6620626f756e647360581b60648201526084015b60405180910390fd5b60008381526067602052604090205460668054909190811061095b5761095b615708565b9060005260206000209060020201600101828154811061097d5761097d615708565b906000526020600020015490505b92915050565b60006001600160e01b03198216631dba0dcf60e11b148061098b575061098b8261259c565b6060603380546109c59061571e565b80601f01602080910402602001604051908101604052809291908181526020018280546109f19061571e565b8015610a3e5780601f10610a1357610100808354040283529160200191610a3e565b820191906000526020600020905b815481529060010190602001808311610a2157829003601f168201915b5050505050905090565b6000610a538261263e565b600082815260396020526040902054603880549091908110610a7757610a77615708565b60009182526020909120600460069092020101546001600160a01b031692915050565b6000610aa582611825565b9050806001600160a01b0316836001600160a01b031603610ad85760405162461bcd60e51b815260040161092e90615758565b336001600160a01b0382161480610af45750610af4813361252b565b610b505760405162461bcd60e51b81526020600482015260396024820152600080516020615df08339815191526044820152781ddb995c881b9bdc88185c1c1c9bdd995908199bdc88185b1b603a1b606482015260840161092e565b610b5a8383612663565b505050565b60606000610b6b6126fa565b603b549091506001600160a01b0316610bcb576000815111610b9c5760405180602001604052806000815250610c3d565b80610ba68461270c565b604051602001610bb792919061579a565b604051602081830303815290604052610c3d565b603b54604051633601bfc560e11b8152600481018590526001600160a01b0390911690636c037f8a906024015b600060405180830381865afa158015610c15573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610c3d91908101906157da565b9392505050565b6098546001600160a01b0316336001600160a01b031614610c9c5760405162461bcd60e51b815260206004820152601260248201527137b7363c903832b73234b7339030b236b4b760711b604482015260640161092e565b609754609854604051600080516020615e5083398151915292610ccd926001600160a01b0391821692911690615847565b60405180910390a160988054609780546001600160a01b03199081166001600160a01b03841617909155169055565b6000610d0933858461279e565b610d128461282e565b9050610d298382610d2287611285565b6000612838565b610c3d84828461297d565b6000610d3e612cb9565b610d46612d14565b6001600160a01b0316336001600160a01b031614610d765760405162461bcd60e51b815260040161092e90615861565b610d7e611c09565b6001600160a01b031663dae85ba38585856040518463ffffffff1660e01b8152600401610dad939291906158d0565b6020604051808303816000875af1158015610dcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df091906158f5565b9050610dfb81612d6a565b15610e595760405162461bcd60e51b815260206004820152602860248201527f5346544973737561626c6544656c65676174653a20736c6f7420616c72656164604482015267792065786973747360c01b606482015260840161092e565b610e6281612db6565b836001600160a01b0316817f812dafd1bbea8aa1e81f2b03677c72a46b0ef2cb6ddf3b401a553bdb4fce5d8c8585604051610e9e92919061590e565b60405180910390a3610c3d600161012d55565b610eb9612cb9565b610ec1612d14565b6001600160a01b0316336001600160a01b031614610ef257604051639e0125a960e01b815260040160405180910390fd5b6000610efd83611825565b90506000610f0a84611285565b9050610f168484612e73565b610f1e611c09565b6001600160a01b03166389197e238787858589896040518763ffffffff1660e01b8152600401610f5396959493929190615922565b600060405180830381600087803b158015610f6d57600080fd5b505af1158015610f81573d6000803e3d6000fd5b505050508084600080516020615e9083398151915285604051610fa691815260200190565b60405180910390a35050610fbb600161012d55565b50505050565b610fc9612cb9565b610fd1611c09565b6001600160a01b031663a6a978d8338585856040518563ffffffff1660e01b8152600401611002949392919061595b565b600060405180830381600087803b15801561101c57600080fd5b505af1158015611030573d6000803e3d6000fd5b505050506110458261103f3390565b83612eb7565b335b6001600160a01b0316837fb42c5f4d7454a3dbf5af30732b0d66efa11d73c66cef1f5732fa84b7e63cf99a8484604051611082929190615985565b60405180910390a3610b5a600161012d55565b600054610100900460ff16158080156110b55750600054600160ff909116105b806110d657506110c4306130a4565b1580156110d6575060005460ff166001145b6111395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161092e565b6000805460ff19166001179055801561115c576000805461ff0019166101001790555b6111d68b8b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c90819084018382808284376000920191909152508c92508b91508a9050896130b3565b610259805460ff1916831515179055801561122b576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050505050505050565b600090815261019260205260409020546001600160a01b031690565b61125e33826130fa565b61127a5760405162461bcd60e51b815260040161092e9061599e565b610b5a838383613158565b60006112908261263e565b6000828152603960205260409020546038805490919081106112b4576112b4615708565b9060005260206000209060060201600101549050919050565b6000806112d86132be565b905060005b81518110156113d85760008282815181106112fa576112fa615708565b6020908102919091018101516000818152610192909252604091829020546101915492516321f8a72160e01b8152600481018390529193506001600160a01b039081169216906321f8a72190602401602060405180830381865afa158015611366573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138a91906159f0565b6001600160a01b03161415806113b65750600081815261019260205260409020546001600160a01b0316155b156113c5576000935050505090565b50806113d081615a23565b9150506112dd565b50600191505090565b60006113ec83611895565b82106114455760405162461bcd60e51b815260206004820152602260248201527f455243333532353a206f776e657220696e646578206f7574206f6620626f756e604482015261647360f01b606482015260840161092e565b6001600160a01b0383166000908152603a6020526040902080548390811061097d5761097d615708565b61147a33848361279e565b610b5a83838361297d565b610b5a83838360405180602001604052806000815250611dfc565b6097546001600160a01b0316336001600160a01b0316146114d35760405162461bcd60e51b815260040161092e90615a3c565b60fb546040517f1eeb545565f5659deaedac206fd7c39c875a55001aba786f2a6b7245a301eaa491611512916001600160a01b03909116908490615847565b60405180910390a160fb80546001600160a01b0319166001600160a01b0392909216919091179055565b6097546001600160a01b0316336001600160a01b03161461156f5760405162461bcd60e51b815260040161092e90615a3c565b6098546040517fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a9916115ae916001600160a01b03909116908490615847565b60405180910390a1609880546001600160a01b0319166001600160a01b0392909216919091179055565b60006115e360385490565b821061163d5760405162461bcd60e51b815260206004820152602360248201527f455243333532353a20676c6f62616c20696e646578206f7574206f6620626f756044820152626e647360e81b606482015260840161092e565b6038828154811061165057611650615708565b9060005260206000209060060201600001549050919050565b600061167482612d6a565b61168057506000919050565b6000828152606760205260409020546066805490919081106116a4576116a4615708565b600091825260209091206001600290920201015492915050565b60606000806116cb611c09565b6001600160a01b031685856040516116e4929190615a60565b600060405180830381855afa9150503d806000811461171f576040519150601f19603f3d011682016040523d82523d6000602084013e611724565b606091505b50909250905081611736573d60208201fd5b949350505050565b611746612cb9565b6102595460ff166117b35760405162461bcd60e51b815260206004820152603160248201527f4d756c7469526570617961626c6544656c65676174653a2063616e6e6f7420726044820152706570617920776974682062616c616e636560781b606482015260840161092e565b6117bb611c09565b6001600160a01b0316633b2f4830338585856040518563ffffffff1660e01b81526004016117ec949392919061595b565b600060405180830381600087803b15801561180657600080fd5b505af115801561181a573d6000803e3d6000fd5b505050506110473390565b60006118308261263e565b60008281526039602052604090205460388054909190811061185457611854615708565b60009182526020909120600360069092020101546001600160a01b03169050806118905760405162461bcd60e51b815260040161092e90615a70565b919050565b60006001600160a01b0382166119015760405162461bcd60e51b815260206004820152602b60248201527f455243333532353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b606482015260840161092e565b506001600160a01b03166000908152603a602052604090205490565b611925612d14565b6001600160a01b0316336001600160a01b0316146119795760405162461bcd60e51b815260206004820152601160248201527013d194910e881bdb9b1e481b585c9ad95d607a1b604482015260640161092e565b611981611c09565b604051637b832a6760e11b815260048101849052602481018390526001600160a01b03919091169063f70654ce90604401600060405180830381600087803b1580156119cc57600080fd5b505af11580156119e0573d6000803e3d6000fd5b505050505050565b60006119f26132be565b905060005b8151811015611b0a576000828281518110611a1457611a14615708565b602090810291909101015161019154604080516305533b0360e51b8152600481018490526024810191909152601f60448201527f4164647265737343616368653a2061646472657373206e6f7420666f756e640060648201529192506000916001600160a01b039091169063aa67606090608401602060405180830381865afa158015611aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ac991906159f0565b6000928352610192602052604090922080546001600160a01b0319166001600160a01b03909316929092179091555080611b0281615a23565b9150506119f7565b5050565b6000611b18612cb9565b611b20612d14565b6001600160a01b0316336001600160a01b031614611b505760405162461bcd60e51b815260040161092e90615861565b611b5b848484613314565b9050611b65611c09565b6001600160a01b03166389197e238787878786886040518763ffffffff1660e01b8152600401611b9a96959493929190615922565b600060405180830381600087803b158015611bb457600080fd5b505af1158015611bc8573d6000803e3d6000fd5b505050508281600080516020615e9083398151915284604051611bed91815260200190565b60405180910390a3611c00600161012d55565b95945050505050565b60fb546001600160a01b031690565b6000611c2384611825565b9050806001600160a01b0316836001600160a01b031603611c565760405162461bcd60e51b815260040161092e90615758565b611c6033856130fa565b611cb45760405162461bcd60e51b81526020600482015260316024820152600080516020615df08339815191526044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606482015260840161092e565b610fbb84848461332c565b6060603480546109c59061571e565b6000611cd960665490565b8210611d3f5760405162461bcd60e51b815260206004820152602f60248201527f45524333353235536c6f74456e756d657261626c653a20736c6f7420696e646560448201526e78206f7574206f6620626f756e647360881b606482015260840161092e565b60668281548110611d5257611d52615708565b9060005260206000209060020201600001549050919050565b6000611d768261263e565b600082815260396020526040902054603880549091908110611d9a57611d9a615708565b9060005260206000209060060201600201549050919050565b611b0a338383613464565b600080611dca84611238565b9050826001600160a01b038216611df45760405162461bcd60e51b815260040161092e9190615114565b509392505050565b611e0633836130fa565b611e225760405162461bcd60e51b815260040161092e9061599e565b610fbb8484848461352b565b6060611e398261263e565b6000611e436126fa565b603b549091506001600160a01b0316611e8f576000815111611e745760405180602001604052806000815250610c3d565b80611e7e8461270c565b604051602001610bb7929190615aa3565b603b546040516344a5a61760e11b8152600481018590526001600160a01b039091169063894b4c2e90602401610bf8565b611ec8612cb9565b611ed0612d14565b6001600160a01b0316336001600160a01b031614611f0157604051639e0125a960e01b815260040160405180910390fd5b60008115611f0f5781611f18565b611f1883611d6b565b9050611f22611c09565b60405163663f60bd60e11b815260048101859052602481018390526001600160a01b03919091169063cc7ec17a90604401600060405180830381600087803b158015611f6d57600080fd5b505af1158015611f81573d6000803e3d6000fd5b5050505081600003611f9b57611f968361359e565b611fa5565b611fa583836136a5565b827f98ba6768a6df38155451a706e1f1ffb2dd8ea75a1184c3d45acc3b9586ede6d482604051611fd791815260200190565b60405180910390a250611b0a600161012d55565b611ff3612cb9565b600081116120575760405162461bcd60e51b815260206004820152602b60248201527f4d756c7469526570617961626c6544656c65676174653a20636c61696d20766160448201526a6c7565206973207a65726f60a81b606482015260840161092e565b61206133846130fa565b6120ce5760405162461bcd60e51b815260206004820152603860248201527f4d756c7469526570617961626c6544656c65676174653a2063616c6c657220696044820152771cc81b9bdd081bdddb995c881b9bdc88185c1c1c9bdd995960421b606482015260840161092e565b60006120d984611285565b905060006120e5611c09565b6001600160a01b03166356b04045866040518263ffffffff1660e01b815260040161211291815260200190565b602060405180830381865afa15801561212f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061215391906158f5565b9050808311156121b05760405162461bcd60e51b815260206004820152602260248201527f4d756c7469526570617961626c6544656c65676174653a206f76657220636c61604482015261696d60f01b606482015260840161092e565b60006121ba611c09565b604051633cc6cee360e21b815260048101889052602481018590526001600160a01b03878116604483015260648201879052919091169063f31b3b8c906084016020604051808303816000875af1158015612219573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223d91906158f5565b90506000612249611c09565b6001600160a01b03166391553089856040518263ffffffff1660e01b815260040161227691815260200190565b602060405180830381865afa158015612293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b791906158f5565b90506000670de0b6b3a76400006122ce8385615ad2565b6122d89190615ae9565b90506122e388611d6b565b86036122f7576122f28861359e565b612301565b61230188876136a5565b600061230b611c09565b6001600160a01b031663a95929976040518163ffffffff1660e01b8152600401602060405180830381865afa158015612348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236c91906159f0565b90506001600160a01b038116158015906123865750600082115b15612396576123968882846137bb565b6123aa888b6123a58588615b0b565b6137bb565b604080518881526001600160a01b038a811660208301529181018690528a918c16907f04defe9d288e5d6a64d8aad79ce94f8c21b1bead0a5fbe9b869e0245be447fc59060600160405180910390a3505050505050610fbb600161012d55565b60006124158361263e565b5060009182526037602090815260408084206001600160a01b0393909316845291905290205490565b6060600061244a6126fa565b603b549091506001600160a01b03166124aa57600081511161247b5760405180602001604052806000815250612525565b80612485306139b0565b604051602001612496929190615b1e565b604051602081830303815290604052612525565b603b60009054906101000a90046001600160a01b03166001600160a01b031663725fa09c6040518163ffffffff1660e01b8152600401600060405180830381865afa1580156124fd573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261252591908101906157da565b91505090565b6001600160a01b039182166000908152603a602090815260408083209390941682526002909201909152205460ff1690565b6097546001600160a01b0316336001600160a01b0316146125905760405162461bcd60e51b815260040161092e90615a3c565b612599816139c6565b50565b60006001600160e01b031982166301ffc9a760e01b14806125cd57506001600160e01b03198216630354d60560e61b145b806125e857506001600160e01b031982166380ac58cd60e01b145b8061260357506001600160e01b031982166370b0048160e11b145b8061261e57506001600160e01b0319821663780e9d6360e01b145b8061098b57506001600160e01b03198216635b5e139f60e01b1492915050565b61264781613a81565b6125995760405162461bcd60e51b815260040161092e90615a70565b60008181526039602052604090205460388054849290811061268757612687615708565b6000918252602090912060069091020160040180546001600160a01b0319166001600160a01b03928316179055819083166126c182611825565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60408051602081019091526000815290565b6060600061271983613acd565b60010190506000816001600160401b03811115612738576127386154e9565b6040519080825280601f01601f191660200182016040528015612762576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461276c57509392505050565b60006127aa838561240a565b90506127b684846130fa565b1580156127c557506000198114155b15610fbb578181101561281a5760405162461bcd60e51b815260206004820152601f60248201527f455243333532353a20696e73756666696369656e7420616c6c6f77616e636500604482015260640161092e565b610fbb83856128298585615b0b565b61332c565b600061098b613ba3565b6001600160a01b0384166128985760405162461bcd60e51b815260206004820152602160248201527f455243333532353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161092e565b826000036128f25760405162461bcd60e51b815260206004820152602160248201527f455243333532353a2063616e6e6f74206d696e74207a65726f20746f6b656e496044820152601960fa1b606482015260840161092e565b6128fb83613a81565b156129485760405162461bcd60e51b815260206004820152601d60248201527f455243333532353a20746f6b656e20616c7265616479206d696e746564000000604482015260640161092e565b6129586000856000868686613bba565b612963848484613bc8565b61296d8382613c6a565b610fbb6000856000868686613cdd565b61298683613a81565b6129e25760405162461bcd60e51b815260206004820152602760248201527f455243333532353a207472616e736665722066726f6d20696e76616c696420746044820152661bdad95b88125160ca1b606482015260840161092e565b6129eb82613a81565b612a455760405162461bcd60e51b815260206004820152602560248201527f455243333532353a207472616e7366657220746f20696e76616c696420746f6b604482015264195b88125160da1b606482015260840161092e565b600083815260396020526040812054603880549091908110612a6957612a69615708565b9060005260206000209060060201905060006038603960008681526020019081526020016000205481548110612aa157612aa1615708565b906000526020600020906006020190508282600201541015612b185760405162461bcd60e51b815260206004820152602a60248201527f455243333532353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b606482015260840161092e565b8060010154826001015414612b865760405162461bcd60e51b815260206004820152602e60248201527f455243333532353a207472616e7366657220746f20746f6b656e20776974682060448201526d191a5999995c995b9d081cdb1bdd60921b606482015260840161092e565b600380830154908201546001840154612bb1926001600160a01b039081169216908890889088613bba565b82826002016000828254612bc59190615b0b565b9250508190555082816002016000828254612be09190615b62565b909155505060405183815284908690600080516020615e108339815191529060200160405180910390a3600380830154908201546001840154612c35926001600160a01b039081169216908890889088613cdd565b612c5085858560405180602001604052806000815250613d4e565b612cb25760405162461bcd60e51b815260206004820152602d60248201527f455243333532353a207472616e736665722072656a656374656420627920455260448201526c21999a991aa932b1b2b4bb32b960991b606482015260840161092e565b5050505050565b600261012d5403612d0c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161092e565b600261012d55565b6000612d656d13dc195b919d5b9913585c9ad95d60921b6040518060400160405280601c81526020017b13d194910e8813dc195b919d5b9913585c9ad95d081b9bdd081cd95d60221b815250611dbe565b905090565b6066546000901580159061098b5750600082815260676020526040902054606680548492908110612d9d57612d9d615708565b9060005260206000209060020201600001541492915050565b612dbf81612d6a565b15612e1f5760405162461bcd60e51b815260206004820152602a60248201527f45524333353235536c6f74456e756d657261626c653a20736c6f7420616c72656044820152696164792065786973747360b01b606482015260840161092e565b604080518082018252828152815160008082526020828101909452928201529050612e4981613eca565b81600080600080516020615e7083398151915260405160405180910390a45050565b600161012d55565b6000612e7e83611825565b90506000612e8b84611285565b9050612e9d6000836000878588613bba565b612ea78484613c6a565b610fbb6000836000878588613cdd565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601612f7a57326001600160a01b0383161480612efb5750336001600160a01b038316145b612f395760405162461bcd60e51b815260206004820152600f60248201526e0e6cadcc8cae440dad2e6dac2e8c6d608b1b604482015260640161092e565b80341015610b5a5760405162461bcd60e51b815260206004820152600e60248201526d0ecc2d8eaca40dad2e6dac2e8c6d60931b604482015260640161092e565b6000836001600160a01b03163b11612fa45760405162461bcd60e51b815260040161092e90615b75565b604080516001600160a01b038481166024830152306044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17905291516000928392908716916130069190615ba1565b6000604051808303816000865af19150503d8060008114613043576040519150601f19603f3d011682016040523d82523d6000602084013e613048565b606091505b50915091508180156130725750805115806130725750808060200190518101906130729190615bbd565b612cb25760405162461bcd60e51b815260206004820152600360248201526229aa2360e91b604482015260640161092e565b6001600160a01b03163b151590565b600054610100900460ff166130da5760405162461bcd60e51b815260040161092e90615bda565b6130e8868686868686613f4f565b6130f187614019565b50505050505050565b60008061310683611825565b9050806001600160a01b0316846001600160a01b0316148061312d575061312d818561252b565b806117365750836001600160a01b031661314684610a48565b6001600160a01b031614949350505050565b826001600160a01b031661316b82611825565b6001600160a01b0316146131cd5760405162461bcd60e51b8152602060048201526024808201527f455243333532353a207472616e736665722066726f6d20696e76616c6964206f6044820152633bb732b960e11b606482015260840161092e565b6001600160a01b0382166132315760405162461bcd60e51b815260206004820152602560248201527f455243333532353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b606482015260840161092e565b600061323c82611285565b9050600061324983611d6b565b9050613259858585868686613bba565b613264600084612663565b61326d83614063565b613277858461410e565b613281848461422f565b82846001600160a01b0316866001600160a01b0316600080516020615e3083398151915260405160405180910390a4612cb2858585868686613cdd565b604080516001808252818301909252606091602080830190803683370190505090506d13dc195b919d5b9913585c9ad95d60921b8160008151811061330557613305615708565b60200260200101818152505090565b600061331e613ba3565b9050610c3d84828585612838565b6001600160a01b0382166133955760405162461bcd60e51b815260206004820152602a60248201527f455243333532353a20617070726f76652076616c756520746f20746865207a65604482015269726f206164647265737360b01b606482015260840161092e565b61339f82846142b8565b613405576000838152603960205260409020546038805490919081106133c7576133c7615708565b60009182526020808320600692909202909101600501805460018101825590835291200180546001600160a01b0319166001600160a01b0384161790555b60008381526037602090815260408083206001600160a01b038616808552908352928190208490555183815285917f621b050de0ad08b51d19b48b3e6df75348c4de6bdd93e81b252ca62e28265b1b91015b60405180910390a3505050565b816001600160a01b0316836001600160a01b0316036134c25760405162461bcd60e51b815260206004820152601a60248201527922a921999a991a9d1030b8383937bb32903a379031b0b63632b960311b604482015260640161092e565b6001600160a01b038381166000818152603a602090815260408083209487168084526002909501825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101613457565b613536848484613158565b6135428484848461438b565b610fbb5760405162461bcd60e51b815260206004820152602760248201527f455243333532353a207472616e7366657220746f206e6f6e204552433732315260448201526632b1b2b4bb32b960c91b606482015260840161092e565b6135a78161263e565b6000818152603960205260408120546038805490919081106135cb576135cb615708565b600091825260208220600360069092020190810154600182015460028301549294506001600160a01b039091169290919061360b90849087818686613bba565b61361485614063565b61361e838661410e565b613627856144db565b600085600080516020615e108339815191528360405161364991815260200190565b60405180910390a360008286600080516020615e7083398151915260405160405180910390a460405185906000906001600160a01b03861690600080516020615e30833981519152908390a4612cb28360008760008686613cdd565b6136ae8261263e565b6000828152603960205260408120546038805490919081106136d2576136d2615708565b600091825260209091206006909102016003810154600182015460028301549293506001600160a01b03909116918481101561375c5760405162461bcd60e51b815260206004820152602360248201527f455243333532353a206275726e2076616c756520657863656564732062616c616044820152626e636560e81b606482015260840161092e565b61376c836000886000868a613bba565b848460020160008282546137809190615b0b565b90915550506040518581526000908790600080516020615e108339815191529060200160405180910390a36119e0836000886000868a613cdd565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b0384160161388357604080516000808252602082019092526001600160a01b03841690839060405161380a9190615ba1565b60006040518083038185875af1925050503d8060008114613847576040519150601f19603f3d011682016040523d82523d6000602084013e61384c565b606091505b5050905080610fbb5760405162461bcd60e51b815260206004820152600360248201526253544560e81b604482015260640161092e565b6000836001600160a01b03163b116138ad5760405162461bcd60e51b815260040161092e90615b75565b600080846001600160a01b031663a9059cbb60e01b85856040516024016138d5929190615985565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516139139190615ba1565b6000604051808303816000865af19150503d8060008114613950576040519150601f19603f3d011682016040523d82523d6000602084013e613955565b606091505b509150915081801561397f57508051158061397f57508080602001905181019061397f9190615bbd565b612cb25760405162461bcd60e51b815260206004820152600260248201526114d560f21b604482015260640161092e565b606061098b6001600160a01b03831660146146e9565b6001600160a01b038116613a185760405162461bcd60e51b815260206004820152601960248201527804f776e6572206164647265737320636f6e6e6f74206265203603c1b604482015260640161092e565b60c9546040517f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491613a57916001600160a01b03909116908490615847565b60405180910390a160c980546001600160a01b0319166001600160a01b0392909216919091179055565b6038546000901580159061098b5750600082815260396020526040902054603880548492908110613ab457613ab4615708565b9060005260206000209060060201600001541492915050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613b0c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310613b36576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310613b5457662386f26fc10000830492506010015b6305f5e1008310613b6c576305f5e100830492506008015b6127108310613b8057612710830492506004015b60648310613b92576064830492506002015b600a831061098b5760010192915050565b6000613bb3603680546001019055565b5060365490565b6119e0868686868686614884565b6040805160c081018252838152602080820184905260008284018190526001600160a01b038716606084015260808301819052835181815291820190935260a08201529050613c16816149b3565b613c20848461422f565b60405183906001600160a01b03861690600090600080516020615e30833981519152908290a481600084600080516020615e7083398151915260405160405180910390a450505050565b600082815260396020526040902054603880548392908110613c8e57613c8e615708565b90600052602060002090600602016002016000828254613cae9190615b62565b90915550506040518181528290600090600080516020615e108339815191529060200160405180910390a35050565b6001600160a01b038616158015613cf2575083155b8015613d055750613d038284614b05565b155b15613d1957613d148284614b91565b6119e0565b6001600160a01b038516158015613d2e575082155b8015613d3f5750613d3f8285614b05565b15613d1457613d148285614bf2565b600080613d5a85611825565b9050613d6e816001600160a01b03166130a4565b15613ebe576040516301ffc9a760e01b8152629ce20b60e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa925050508015613dd9575060408051601f3d908101601f19168201909252613dd691810190615bbd565b60015b613e18573d808015613e07576040519150601f19603f3d011682016040523d82523d6000602084013e613e0c565b606091505b50600192505050611736565b8015613eb357604051629ce20b60e01b81526000906001600160a01b03841690629ce20b90613e539033908c908c908c908c90600401615c25565b6020604051808303816000875af1158015613e72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e969190615c63565b6001600160e01b031916629ce20b60e01b14935061173692505050565b600192505050611736565b50600195945050505050565b60668054825160009081526067602090815260408220839055600183018455929052825160029091027f46501879b8ca8525e8c2fd519e2fbfcfa2ebea26501294aa02cbfcfb12e9435481019182558284015180518594610fbb937f46501879b8ca8525e8c2fd519e2fbfcfa2ebea26501294aa02cbfcfb12e9435501920190614f88565b600054610100900460ff16613f765760405162461bcd60e51b815260040161092e90615bda565b613f81868686614cd6565b613f8a81614d08565b613f9382614d41565b613f9c83614d8b565b613fa4614dc4565b6001600160a01b038316156119e05760405163ca5eb5e160e01b81526001600160a01b0384169063ca5eb5e190613fdf9030906004016150b0565b600060405180830381600087803b158015613ff957600080fd5b505af115801561400d573d6000803e3d6000fd5b50505050505050505050565b600054610100900460ff166140405760405162461bcd60e51b815260040161092e90615bda565b61019180546001600160a01b0319166001600160a01b0392909216919091179055565b60008181526039602052604081205460388054909190811061408757614087615708565b600091825260208220600560069092020190810154909250905b818110156140ff5760008360050182815481106140c0576140c0615708565b60009182526020808320909101548783526037825260408084206001600160a01b039092168452915281205550806140f781615a23565b9150506140a1565b50610b5a600583016000614fd3565b60008181526039602052604081205460388054909190811061413257614132615708565b6000918252602080832060069290920290910160030180546001600160a01b0319166001600160a01b039485161790559184168152603a90915260408120805490919061418190600190615b0b565b9050600082600001828154811061419a5761419a615708565b906000526020600020015490506000836001016000868152602001908152602001600020549050818460000182815481106141d7576141d7615708565b6000918252602080832090910192909255838152600186019091526040808220839055868252812055835484908061421157614211615c80565b60019003818190600052602060002001600090559055505050505050565b60008181526039602052604090205460388054849290811061425357614253615708565b6000918252602080832060069290920290910160030180546001600160a01b0319166001600160a01b03948516179055939091168152603a80845260408083208054858552600182810188529285208190559286529082018155825292902090910155565b6000818152603960205260408120546038805483929081106142dc576142dc615708565b6000918252602082206005600690920201015491505b8181101561438057600084815260396020526040902054603880546001600160a01b0388169290811061432757614327615708565b9060005260206000209060060201600501828154811061434957614349615708565b6000918252602090912001546001600160a01b03160361436e5760019250505061098b565b8061437881615a23565b9150506142f2565b506000949350505050565b600061439f846001600160a01b03166130a4565b156144d357604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906143d6903390899088908890600401615c96565b6020604051808303816000875af1925050508015614411575060408051601f3d908101601f1916820190925261440e91810190615c63565b60015b6144b9573d80801561443f576040519150601f19603f3d011682016040523d82523d6000602084013e614444565b606091505b5080516000036144b15760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606482015260840161092e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611736565b506001611736565b6038546000906144ed90600190615b0b565b6000838152603960205260408120546038805493945090928490811061451557614515615708565b60009182526020918290206040805160c08101825260069093029091018054835260018101548385015260028101548383015260038101546001600160a01b03908116606085015260048201541660808401526005810180548351818702810187019094528084529394919360a0860193928301828280156145c057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116145a2575b505050505081525050905080603883815481106145df576145df615708565b600091825260209182902083516006909202019081558282015160018201556040830151600282015560608301516003820180546001600160a01b039283166001600160a01b031991821617909155608085015160048401805491909316911617905560a08301518051919261465d92600585019290910190614ff1565b5050815160009081526039602052604080822085905586825281205550603880548061468b5761468b615c80565b60008281526020812060066000199093019283020181815560018101829055600281018290556003810180546001600160a01b03199081169091556004820180549091169055906146df6005830182614fd3565b5050905550505050565b606060006146f8836002615ad2565b614703906002615b62565b6001600160401b0381111561471a5761471a6154e9565b6040519080825280601f01601f191660200182016040528015614744576020820181803683370190505b509050600360fc1b8160008151811061475f5761475f615708565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061478e5761478e615708565b60200101906001600160f81b031916908160001a90535060006147b2846002615ad2565b6147bd906001615b62565b90505b6001811115614835576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106147f1576147f1615708565b1a60f81b82828151811061480757614807615708565b60200101906001600160f81b031916908160001a90535060049490941c9361482e81615cd3565b90506147c0565b508315610c3d5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161092e565b614892868686868686614df5565b6001600160a01b0386161580156148a7575083155b1561491f576148b4611c09565b6040516335f28fa560e01b81526004810185905260248101849052604481018390526001600160a01b0391909116906335f28fa590606401600060405180830381600087803b15801561490657600080fd5b505af115801561491a573d6000803e3d6000fd5b505050505b6001600160a01b0386161580159061493657508315155b801561494a57506001600160a01b03851615155b801561495557508215155b156119e057614962611c09565b6001600160a01b031663302b586a858561497b88611d6b565b6040516001600160e01b031960e086901b16815260048101939093526024830191909152604482015260648101849052608401613fdf565b603880548251600090815260396020908152604080832084905560018401855593909152835160069092027f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f4561998101928355818501517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619a820155928401517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619b84015560608401517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619c840180546001600160a01b039283166001600160a01b03199182161790915560808601517f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619d8601805491909316911617905560a084015180518594610fbb937f38395c5dceade9603479b177b68959049485df8aa97b39f3533039af5f45619e909101920190614ff1565b600082815260676020526040812054606680548392908110614b2957614b29615708565b9060005260206000209060020201905060008160010180549050118015611736575060008481526065602090815260408083208684529091529020546001820180548592908110614b7c57614b7c615708565b90600052602060002001541491505092915050565b600082815260676020526040812054606680549091908110614bb557614bb5615708565b6000918252602080832060016002909302018201805496845260658252604080852087865283528420879055918601825590825290209092015550565b600082815260676020526040812054606680549091908110614c1657614c16615708565b600091825260208220600160029092020181810154909350614c389190615b0b565b90506000826001018281548110614c5157614c51615708565b6000918252602080832090910154878352606582526040808420888552909252912054600185018054929350909183919083908110614c9257614c92615708565b600091825260208083209190910192909255878152606582526040808220858352909252818120839055868152908120556001840180548061421157614211615c80565b600054610100900460ff16614cfd5760405162461bcd60e51b815260040161092e90615bda565b610b5a838383614e2a565b600054610100900460ff16614d2f5760405162461bcd60e51b815260040161092e90615bda565b614d3881614e83565b61259933614eaa565b603b80546001600160a01b0319166001600160a01b0383169081179091556040517f5252f52e45fc8ee6a7b43cef3645d23e9a470a34182b8b3a12627556635bfc9c90600090a250565b600054610100900460ff16614db25760405162461bcd60e51b815260040161092e90615bda565b614dbb33614eaa565b61259981614f18565b600054610100900460ff16614deb5760405162461bcd60e51b815260040161092e90615bda565b614df3614f61565b565b6001600160a01b038616158015614e0a575083155b8015614e1c5750614e1a82612d6a565b155b156119e0576119e082612db6565b600054610100900460ff16614e515760405162461bcd60e51b815260040161092e90615bda565b6033614e5d8482615d30565b506034614e6a8382615d30565b506035805460ff191660ff929092169190911790555050565b600054610100900460ff166125905760405162461bcd60e51b815260040161092e90615bda565b600054610100900460ff16614ed15760405162461bcd60e51b815260040161092e90615bda565b609780546001600160a01b0319166001600160a01b038316179055604051600080516020615e5083398151915290614f0d906000908490615847565b60405180910390a150565b600054610100900460ff16614f3f5760405162461bcd60e51b815260040161092e90615bda565b60fb80546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff16612e6b5760405162461bcd60e51b815260040161092e90615bda565b828054828255906000526020600020908101928215614fc3579160200282015b82811115614fc3578251825591602001919060010190614fa8565b50614fcf929150615046565b5090565b50805460008255906000526020600020908101906125999190615046565b828054828255906000526020600020908101928215614fc3579160200282015b82811115614fc357825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190615011565b5b80821115614fcf5760008155600101615047565b6000806040838503121561506e57600080fd5b50508035926020909101359150565b6001600160e01b03198116811461259957600080fd5b6000602082840312156150a557600080fd5b8135610c3d8161507d565b6001600160a01b0391909116815260200190565b60005b838110156150df5781810151838201526020016150c7565b50506000910152565b600081518084526151008160208601602086016150c4565b601f01601f19169290920160200192915050565b602081526000610c3d60208301846150e8565b60006020828403121561513957600080fd5b5035919050565b6001600160a01b038116811461259957600080fd5b803561189081615140565b6000806040838503121561517357600080fd5b823561517e81615140565b946020939093013593505050565b6000806000606084860312156151a157600080fd5b8335925060208401356151b381615140565b929592945050506040919091013590565b60008083601f8401126151d657600080fd5b5081356001600160401b038111156151ed57600080fd5b60208301915083602082850101111561520557600080fd5b9250929050565b60008060006040848603121561522157600080fd5b833561522c81615140565b925060208401356001600160401b0381111561524757600080fd5b615253868287016151c4565b9497909650939450505050565b6000806000806080858703121561527657600080fd5b843561528181615140565b9350602085013561529181615140565b93969395505050506040820135916060013590565b801515811461259957600080fd5b8035611890816152a6565b6000806000806000806000806000806101008b8d0312156152df57600080fd5b8a356152ea81615140565b995060208b01356001600160401b038082111561530657600080fd5b6153128e838f016151c4565b909b50995060408d013591508082111561532b57600080fd5b506153388d828e016151c4565b90985096505060608b013560ff8116811461535257600080fd5b945061536060808c01615155565b935061536e60a08c01615155565b925061537c60c08c01615155565b915061538a60e08c016152b4565b90509295989b9194979a5092959850565b6000806000606084860312156153b057600080fd5b83356153bb81615140565b925060208401356151b381615140565b6000806000606084860312156153e057600080fd5b505081359360208301359350604090920135919050565b60006020828403121561540957600080fd5b8135610c3d81615140565b6000806020838503121561542757600080fd5b82356001600160401b0381111561543d57600080fd5b615449858286016151c4565b90969095509350505050565b600080600080600060a0868803121561546d57600080fd5b853561547881615140565b9450602086013561548881615140565b9350604086013561549881615140565b94979396509394606081013594506080013592915050565b600080604083850312156154c357600080fd5b82356154ce81615140565b915060208301356154de816152a6565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715615527576155276154e9565b604052919050565b60006001600160401b03821115615548576155486154e9565b50601f01601f191660200190565b60006155696155648461552f565b6154ff565b905082815283838301111561557d57600080fd5b828260208301376000602084830101529392505050565b600080604083850312156155a757600080fd5b8235915060208301356001600160401b038111156155c457600080fd5b8301601f810185136155d557600080fd5b6155e485823560208401615556565b9150509250929050565b6000806000806080858703121561560457600080fd5b843561560f81615140565b9350602085013561561f81615140565b92506040850135915060608501356001600160401b0381111561564157600080fd5b8501601f8101871361565257600080fd5b61566187823560208401615556565b91505092959194509250565b6000806000806080858703121561568357600080fd5b843561568e81615140565b93506020850135925060408501356156a581615140565b9396929550929360600135925050565b600080604083850312156156c857600080fd5b8235915060208301356154de81615140565b600080604083850312156156ed57600080fd5b82356156f881615140565b915060208301356154de81615140565b634e487b7160e01b600052603260045260246000fd5b600181811c9082168061573257607f821691505b60208210810361575257634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526022908201527f455243333532353a20617070726f76616c20746f2063757272656e74206f776e60408201526132b960f11b606082015260800190565b600083516157ac8184602088016150c4565b64736c6f742f60d81b90830190815283516157ce8160058401602088016150c4565b01600501949350505050565b6000602082840312156157ec57600080fd5b81516001600160401b0381111561580257600080fd5b8201601f8101841361581357600080fd5b80516158216155648261552f565b81815285602083850101111561583657600080fd5b611c008260208301602086016150c4565b6001600160a01b0392831681529116602082015260400190565b60208082526026908201527f5346544973737561626c6544656c65676174653a206f6e6c79206973737565206040820152651b585c9ad95d60d21b606082015260800190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0384168152604060208201819052600090611c0090830184866158a7565b60006020828403121561590757600080fd5b5051919050565b6020815260006117366020830184866158a7565b6001600160a01b03968716815294861660208601529290941660408401526060830152608082019290925260a081019190915260c00190565b6001600160a01b039485168152602081019390935292166040820152606081019190915260800190565b6001600160a01b03929092168252602082015260400190565b60208082526032908201527f455243333532353a207472616e736665722063616c6c6572206973206e6f74206040820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b606082015260800190565b600060208284031215615a0257600080fd5b8151610c3d81615140565b634e487b7160e01b600052601160045260246000fd5b600060018201615a3557615a35615a0d565b5060010190565b6020808252600a908201526937b7363c9030b236b4b760b11b604082015260600190565b8183823760009101908152919050565b602080825260199082015278115490cccd4c8d4e881a5b9d985b1a59081d1bdad95b881251603a1b604082015260600190565b60008351615ab58184602088016150c4565b835190830190615ac98183602088016150c4565b01949350505050565b808202811582820484141761098b5761098b615a0d565b600082615b0657634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561098b5761098b615a0d565b60008351615b308184602088016150c4565b68636f6e74726163742f60b81b9083019081528351615b568160098401602088016150c4565b01600901949350505050565b8082018082111561098b5761098b615a0d565b602080825260129082015271696e76616c696420756e6465726c79696e6760701b604082015260600190565b60008251615bb38184602087016150c4565b9190910192915050565b600060208284031215615bcf57600080fd5b8151610c3d816152a6565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b60018060a01b038616815284602082015283604082015282606082015260a060808201526000615c5860a08301846150e8565b979650505050505050565b600060208284031215615c7557600080fd5b8151610c3d8161507d565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615cc9908301846150e8565b9695505050505050565b600081615ce257615ce2615a0d565b506000190190565b601f821115610b5a57600081815260208120601f850160051c81016020861015615d115750805b601f850160051c820191505b818110156119e057828155600101615d1d565b81516001600160401b03811115615d4957615d496154e9565b615d5d81615d57845461571e565b84615cea565b602080601f831160018114615d925760008415615d7a5750858301515b600019600386901b1c1916600185901b1785556119e0565b600085815260208120601f198616915b82811015615dc157888601518255948401946001909101908401615da2565b5085821015615ddf5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fe455243333532353a20617070726f76652063616c6c6572206973206e6f74206f0b2aac84f3ec956911fd78eae5311062972ff949f38412e8da39069d9f068cc6ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3eff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dce4f48c240d3b994948aa54f3e2f5fca59263dfe1d52b6e4cf39a5d249b5ccb65db1c3d54d13a327abe6187cf7a8328411546c3b743fd98e8447254318d65ab2ca264697066735822122098aae348f03003665592934f23f532580b824852a03ea501c8bf20cca692ad6864736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.