Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
ThePlagueUpgradeable
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 900 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC2981Upgradeable, ERC2981Upgradeable} from "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol"; import {StringsUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol"; import {OperatorFilterer} from "closedsea/src/OperatorFilterer.sol"; import {ERC721BUpgradeable} from "./abstract/ERC721BUpgradeable.sol"; import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "./interfaces/IDelegationRegistryV2.sol"; import "./interfaces/IThePlague.sol"; /*********************************************************************** * MMMMMMMMMMMMMMMMMMWWWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM * MMMMMMMMMMMMMWXOxdlllloxOKNWNXXK000OOO000KXXX0OOkOO0XWMMMMMMMMMMMMMMMM * MMMMMMMMMMMW0o:,''''''''';cc:;;,,,'''''',,;;;,''''',;cd0WMMMMMMMMMMMMM * MMMMMMMMMMNx;'''''''''''''''''''''''''''''''''''''''''',dXMMMMMMMMMMMM * MMMMMMMMMM0:',lol;'.';cllc,',''',,,,,''''',''''''''''''''dNMMMMMMMMMMM * MMMMMMMMMM0c':kkc'';;;d00x;'',,'','''''',lxl,....,:cll;'';xXWMMMMMMMMM * MMMMMMMMMMXo';dx;.':;'lOkc,'',,,,,'''''';dOc'.;c;,o00Ol'''':xXMMMMMMMM * MMMMMMMMMWO:'';:,'..'';::,',''''','''''',cd;..,:,,d0Od;''''''lKWMMMMMM * MMMMMMMMMKl,''''''''','''',,',,',,'''''''','''''',clc,''''''''cKMMMMMM * MMMMMMMMNd,''''','''''''''''''''''',,,'''''''''''''''''''''''''dNMMMMM * MMMMMMMWk;'','''''''''''''''''''''''''''''''''''','','','''''''cKMMMMM * MMMMMMW0c,','',''''''''''''''',,,,'''''''''''''',,,,;;;,,''''''cKMMMMM * MMMMMNkl::;,,,,,,'''''''''''''''',''''''',,,,;;::ccccllc;''''''oNMMMMM * MMMMMXo:lllllc:;;;;,,,,,,,,,,,,,,,;;;;::::::ccccllllllc;,''''':OMMMMMM * MMMMMWx:cccccccccc::::::::::::::::::::ccccccccllllcc:;,'''''';kWMMMMMM * MMMMMW0occlllllcccccccccccccccccccccclllllllcc::;,,,'''''''':OWMMMMMMM * MMMMMMWN0xoc:::::ccccclllllllccccccc::::;;,,,,'''''''''''',oKWMMMMMMMM * MMMMMMMMMMWX0koc,'',,,,,,,,,,,,,,,''''''',,''''''''''''';o0WMMMMMMMMMM * MMMMMMMMMMMMMMWN0xo;'''''''''''''''''''''''''''''''.';lxKWMMMMMMMMMMMM * MMMMMMMMMMMMMMMMMMWKko:,''''''''''''''''''''''.',;cdkKWMMMMMMMMMMMMMMM * MMMMMMMMMMMMMMMMMMMMMWNKOxolc:;,,'''''',,,;:codk0XWMMMMMMMMMMMMMMMMMMM * MMMMMMMMMMMMMMMMMMMMMMMMMMMWNNXK000OOO00KKXNWMMMMMMMMMMMMMMMMMMMMMMMMM * MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ************************************************************************/ /** * @title ThePlagueUpgradeable * @custom:website https://www.plaguebrands.io/ * @author @scottybmitch * @custom:coauthor @lozzereth (www.allthingsweb3.com) * @custom:reference https://etherscan.io/token/0xbe0e87fa5bcb163b614ba1853668ffcd39d18fcb * @custom:license CC-BY-NC-4.0 * @notice Contract is configured to use the DefaultOperatorFilterer, which automatically registers the * token and subscribes it to OpenSea's curated filters. Contract has no minting functionality. * Contract state is synced to a previous contract snapshot via `migrateTokens`. Primary adaptation * from source work is moving towards non-escrow staking and configuration based rewards. */ contract ThePlagueUpgradeable is Initializable, OwnableUpgradeable, ERC2981Upgradeable, ERC721BUpgradeable, OperatorFilterer, IThePlague { using StringsUpgradeable for uint256; using SafeMathUpgradeable for uint256; /// @notice Base uri string public baseURI; /// @notice Maximum supply for the collection uint256 public constant MAX_SUPPLY = 11000; /// @notice Total supply uint256 private _totalMinted; /// @notice The base stake configuration to use on stake uint256 private baseStakeConfigId; /// @notice Operator filter toggle switch bool private operatorFilteringEnabled; /// @notice Delegation registry address public delegationRegistryAddress; /// @notice ERC20 Reward address address public erc20RewardsAddress; /// @notice Track the deposit and claim state of tokens mapping(uint256 => StakedToken) public staked; /// @notice Set configurations for staking rewards mapping(uint256 => StakeConfiguration) public configuration; /// @notice Store valid reward configuration ids mapping(uint256 => bool) public validConfigurations; modifier isDelegate(address vault) { bool isDelegateValid = IDelegationRegistryV2(delegationRegistryAddress) .checkDelegateForContract(_msgSender(), vault, address(this), ""); require(isDelegateValid, "Invalid delegate-vault pairing"); _; } /// @custom:oz-upgrades-unsafe-allow constructor constructor() { _disableInitializers(); } function initialize( address _erc20RewardsAddress, address _delegationRegistryAddress, string memory baseURI_ ) public virtual initializer { __ERC721B_init("The Plague", "FROG"); __Ownable_init(); __ERC2981_init(); // Setup filter registry _registerForOperatorFiltering(); operatorFilteringEnabled = true; // Setup royalties to 10% (default denominator is 10000) _setDefaultRoyalty(_msgSender(), 1000); // Set baseline configuration baseStakeConfigId = 2; // Setup contracts erc20RewardsAddress = _erc20RewardsAddress; delegationRegistryAddress = _delegationRegistryAddress; // Set metadata baseURI = baseURI_; } /** * @notice Migrate NFTs from a snapshot * @param tokenIds - The token ids * @param owners - The token owners * @param stakedTokens - The token staking information */ function migrateTokens( uint256[] calldata tokenIds, address[] calldata owners, StakedToken[] calldata stakedTokens ) external onlyOwner { uint256 inputSize = tokenIds.length; uint256 newTotalMinted = _totalMinted + inputSize; require(owners.length == inputSize); require(newTotalMinted <= MAX_SUPPLY); uint256 tokenId; address owner; for (uint256 i; i < inputSize; ) { tokenId = tokenIds[i]; owner = owners[i]; // Mint new token token id to previous owner _mint(owner, tokenId); // Sync stake state if (stakedTokens[i].configId == 1) { staked[tokenId] = stakedTokens[i]; // To allow marketplaces to block listings of staked tokens emit Stake(tokenId); } unchecked { i++; } } _totalMinted = newTotalMinted; } /** * @notice Total supply of the collection * @return uint256 The total supply */ function totalSupply() external view returns (uint256) { return _totalMinted; } /** * @notice Stake by token id * @param tokenIds - token ids to stake */ function stake(uint256[] calldata tokenIds) external { _deposit(baseStakeConfigId, tokenIds, _msgSender()); } /** * @notice Stake by token id & config. Disallows setting stake to legacy stake config. * @param configId - The config id to stake * @param tokenIds - token ids to stake */ function stakeByConfigId( uint256 configId, uint256[] calldata tokenIds ) external { _deposit(configId, tokenIds, _msgSender()); } /** * @notice Delegate stake call * @param tokenIds - token ids to stake * @param vault - The cold wallet */ function delegatedStake( uint256[] calldata tokenIds, address vault ) external isDelegate(vault) { _deposit(baseStakeConfigId, tokenIds, vault); } /** * @notice Delegate stake call * @param configId - The config id to stake * @param tokenIds - token ids to stake * @param vault - The cold wallet */ function delegatedStakeByConfigId( uint256 configId, uint256[] calldata tokenIds, address vault ) external isDelegate(vault) { _deposit(configId, tokenIds, vault); } /** * @notice Unstake by token id * @param tokenIds - token ids to unstake */ function unstake(uint256[] calldata tokenIds) external { _withdraw(tokenIds, _msgSender()); } /** * @notice Delegate unstake call * @param tokenIds - token ids to unstake * @param vault - The cold wallet */ function delegatedUnstake( uint256[] calldata tokenIds, address vault ) external isDelegate(vault) { _withdraw(tokenIds, vault); } /** * @notice Stake tokens into the contract, locking all token ids. Sets stake config id to leverage during rewards calculation. * @param configId - The config id * @param tokenIds - Array of token ids * @param requester - Address of depositor */ function _deposit( uint256 configId, uint256[] calldata tokenIds, address requester ) internal { require(configId > 1 && validConfigurations[configId], "!config"); for (uint256 i; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; // Check token isn't already locked is owned by the `requester` (sender or delegate) require(isUnlocked(tokenId), "!unlocked"); require(ownerOf(tokenId) == requester, "!owner"); staked[tokenId].configId = uint16(configId); staked[tokenId].stakedAt = uint120(block.timestamp); // Emit event for marketplaces to track staked tokens emit Stake(tokenId); } } /** * @notice Withdraw tokens from stake, unlocking all token ids * @param tokenIds - Array of token ids * @param requester - Address of withdraw requester */ function _withdraw( uint256[] calldata tokenIds, address requester ) internal { // Claim pending rewards before unstaking _claimRewards(tokenIds, requester); // Process each token unstaking, also validating whether minimum lock in thresholds were hit StakeConfiguration storage config; for (uint256 i; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; // Check is owned by the `requester` (sender or delegate) require(ownerOf(tokenId) == requester, "!owner"); uint120 lastStakedAt = staked[tokenId].stakedAt; config = configuration[staked[tokenId].configId]; // Check minimum threshold for lock ins if (config.minimumStakePeriod > 0) { uint120 timePassed = (uint120(block.timestamp) - lastStakedAt); require(timePassed > config.minimumStakePeriod, "!minimum"); } // Reset state delete staked[tokenId]; // Emit event for marketplaces to track unstaked tokens emit Unstake(tokenId, uint256(lastStakedAt), block.timestamp); } } function _accruedRewards( StakeConfiguration memory config, uint256 periodsTotal, uint256 totalTimePassed ) internal pure returns (uint256) { uint256 next = 0; uint256 maxIterations = config.bonusIntervals.length; uint256 bonusMin = 0; uint256 periodsChecked = 0; uint256 accrued = 0; do { bonusMin = config.bonusIntervals[next]; // Bonus met if (bonusMin < periodsTotal) { accrued += config.periodEmissions[next] * (bonusMin - periodsChecked); periodsChecked = bonusMin; next += 1; } else { maxIterations = 0; } } while (next < maxIterations); // Add in diff from periods total of the last bonus if (next == 0 && periodsTotal > 0) { // Never hit bonus interval accrued += config.periodEmissions[next] * periodsTotal; } else if (periodsChecked < periodsTotal) { // Remaining diff accrued += config.periodEmissions[next] * (periodsTotal - periodsChecked); } // Apply additional bonus yields based on minimum stake period if ( config.minimumStakePeriod > 0 && totalTimePassed > config.minimumStakePeriod && !config.isRetroactiveBonus && periodsTotal > bonusMin ) { uint256 baseReward = config.periodEmissions[next]; uint256 previousLevelReward = config.periodEmissions[next - 1]; return baseReward * (periodsTotal - bonusMin) + previousLevelReward * bonusMin; } return accrued; } /** * @notice Calculates the rewards for specific token * @param tokenId - token id to check against */ function calculateReward(uint256 tokenId) public view returns (uint256) { uint120 stakedAt = staked[tokenId].stakedAt; require(stakedAt > 0, "!staked"); uint256 configId = staked[tokenId].configId; uint120 claimedAt = staked[tokenId].claimedAt; StakeConfiguration storage config = configuration[configId]; // Total accrued since stake time uint120 sinceDeposit = (uint120(block.timestamp) - stakedAt); uint256 totalPeriods = uint256(sinceDeposit) / config.periodDenominator; uint256 accrued = _accruedRewards(config, totalPeriods, sinceDeposit); // Subtract out previous claim amounts if (claimedAt > stakedAt) { uint256 sinceClaim = claimedAt - stakedAt; uint256 sinceClaimPeriods = uint256(sinceClaim) / config.periodDenominator; uint256 alreadyClaimed = _accruedRewards( config, sinceClaimPeriods, sinceDeposit ); accrued = accrued - alreadyClaimed; } return accrued; } /** * @notice Calculates the rewards for specific tokens under an address * @param tokenIds - token ids to check against * @return rewards - reward totals */ function calculateRewards( uint256[] calldata tokenIds ) external view returns (uint256[] memory rewards) { rewards = new uint256[](tokenIds.length); for (uint256 i; i < tokenIds.length; i++) { rewards[i] = calculateReward(tokenIds[i]); } return rewards; } /** * @notice Claim the rewards for the tokens * @param tokenIds - Array of token ids */ function claimRewards(uint256[] calldata tokenIds) public { _claimRewards(tokenIds, _msgSender()); } /** * @notice Delegate claim rewards * @param tokenIds - token ids to claim rewards on * @param vault - The cold wallet */ function delegatedClaimRewards( uint256[] calldata tokenIds, address vault ) external isDelegate(vault) { _claimRewards(tokenIds, vault); } /** * @notice Claim the rewards for the tokens * @param tokenIds - Array of token ids * @param requester - Address for rewards */ function _claimRewards( uint256[] calldata tokenIds, address requester ) internal { uint256 reward; for (uint256 i; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; require(ownerOf(tokenId) == requester, "!owner"); unchecked { reward += calculateReward(tokenId); } staked[tokenId].claimedAt = uint120(block.timestamp); } if (reward > 0) { _safeTransferRewards(requester, reward * 1e18); } } /** * @notice Gets whether a particular token is locked from staking * @param tokenId - token id to check * @return bool */ function isUnlocked(uint256 tokenId) public view returns (bool) { return staked[tokenId].configId == 0; } /** * @dev Issues tokens only if there is a sufficient balance in the contract * @param recipient - Address of recipient * @param amount - Amount in wei to transfer */ function _safeTransferRewards(address recipient, uint256 amount) internal { uint256 balance = IERC20(erc20RewardsAddress).balanceOf(address(this)); if (amount <= balance) { IERC20(erc20RewardsAddress).transfer(recipient, amount); } } /** * @notice Set stake config by `configId` * @param configId - The config id by int * @param config - The configuration tuple that defines period emissions, bonus intervals, and period denominator */ function setStakeConfig( uint256 configId, StakeConfiguration calldata config ) external onlyOwner { configuration[configId] = config; validConfigurations[configId] = true; } /** * @notice Sets the base stake config id * @param _baseStakeConfigId The id of the stake configuration to use */ function setStakedBaseConfigId( uint256 _baseStakeConfigId ) external onlyOwner { require(validConfigurations[_baseStakeConfigId], "!valid"); baseStakeConfigId = _baseStakeConfigId; } /** * @notice Emergency stake configuration update. Can be used to unlock all tokens from staking rewards system. * @param tokenIds - Array of token ids to update stake * @param stakeInfo - The staked info */ function emergencyStakeUpdate( uint256[] calldata tokenIds, StakedToken calldata stakeInfo ) external onlyOwner { for (uint256 i; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; staked[tokenId] = stakeInfo; } } /** * @notice Staked transfers allow users to move staked assets to different wallets * without losing the contextual history. This could facilitate OTC staked * trading that may bypass royalties but probably good for this. * @param to - The address to transfer to * @param tokenIds - The token ids to transfer */ function stakedBatchTransfer( address to, uint256[] calldata tokenIds ) public { for (uint256 i; i < tokenIds.length; ) { uint256 tokenId = tokenIds[i]; require(ownerOf(tokenId) == _msgSender(), "!owner"); _safeTransfer(_msgSender(), to, tokenId, ""); unchecked { ++i; } } } /** * @notice Withdraw FRG tokens from the staking contract * @param amount - Amount in wei to withdraw */ function withdrawFRG(uint256 amount) external onlyOwner { _safeTransferRewards(_msgSender(), amount); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721BUpgradeable, ERC2981Upgradeable, IERC165Upgradeable) returns (bool) { return ERC721BUpgradeable.supportsInterface(interfaceId) || ERC2981Upgradeable.supportsInterface(interfaceId); } function setApprovalForAll( address operator, bool approved ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperatorApproval(operator) { super.setApprovalForAll(operator, approved); } function approve( address operator, uint256 tokenId ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperatorApproval(operator) { require(isUnlocked(tokenId), "!unlocked"); super.approve(operator, tokenId); } function transferFrom( address from, address to, uint256 tokenId ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { require(isUnlocked(tokenId), "!unlocked"); super.transferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { require(isUnlocked(tokenId), "!unlocked"); super.safeTransferFrom(from, to, tokenId); } function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory data ) public override(ERC721BUpgradeable, IERC721Upgradeable) onlyAllowedOperator(from) { require(isUnlocked(tokenId), "!unlocked"); super.safeTransferFrom(from, to, tokenId, data); } /** * @notice Sets the delegation registry address * @param _delegationRegistryAddress The delegation registry address */ function setDelegationRegistry( address _delegationRegistryAddress ) external onlyOwner { delegationRegistryAddress = _delegationRegistryAddress; } /** * @notice Sets the erc20 address * @param _erc20RewardsAddress The ERC20 address */ function setRewardsAddress( address _erc20RewardsAddress ) external onlyOwner { erc20RewardsAddress = _erc20RewardsAddress; } /** * @notice Token uri * @param tokenId The token id */ function tokenURI( uint256 tokenId ) public view override returns (string memory) { require(_exists(tokenId), "!exists"); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @notice Sets the base uri for the token metadata * @param _baseURI The base uri */ function setBaseURI(string memory _baseURI) external onlyOwner { baseURI = _baseURI; } /** * @notice Set default royalty * @param receiver The royalty receiver address * @param feeNumerator A number for 10k basis */ function setDefaultRoyalty( address receiver, uint96 feeNumerator ) external onlyOwner { _setDefaultRoyalty(receiver, feeNumerator); } /** * @notice Sets whether the operator filter is enabled or disabled * @param operatorFilteringEnabled_ A boolean value for the operator filter */ function setOperatorFilteringEnabled( bool operatorFilteringEnabled_ ) public onlyOwner { operatorFilteringEnabled = operatorFilteringEnabled_; } function _operatorFilteringEnabled() internal view override returns (bool) { return operatorFilteringEnabled; } /** * @notice Returns the locked information of specific token ids * @param tokenIds - token ids to check against */ function areTokensLocked( uint256[] memory tokenIds ) external view returns (bool[] memory) { bool[] memory lockedStates = new bool[](tokenIds.length); for (uint256 i; i < tokenIds.length; i++) { lockedStates[i] = !isUnlocked(tokenIds[i]); } return lockedStates; } /** * @notice Returns the staked information of specific token ids as an array of bytes. * @param tokenIds - token ids to check against * @return bytes[] */ function stakedInfoOf( uint256[] memory tokenIds ) external view returns (bytes[] memory) { bytes[] memory stakedTimes = new bytes[](tokenIds.length); for (uint256 i; i < tokenIds.length; i++) { uint256 tokenId = tokenIds[i]; stakedTimes[i] = abi.encode( tokenId, staked[tokenId].stakedAt, staked[tokenId].claimedAt, staked[tokenId].configId ); } return stakedTimes; } /** * @notice Return token ids owned by user * @param account Account to query * @return tokenIds */ function tokensOfOwner( address account ) external view returns (uint256[] memory) { unchecked { uint256 tokenIdsIdx; uint256 tokenIdsLength = balanceOf(account); uint256[] memory tokenIds = new uint256[](tokenIdsLength); for (uint256 i; tokenIdsIdx != tokenIdsLength; ++i) { if (!_exists(i)) { continue; } if (ownerOf(i) == account) { tokenIds[tokenIdsIdx++] = i; } } return tokenIds; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @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.6.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981Upgradeable is IERC165Upgradeable { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo(uint256 tokenId, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount); }
// 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.7.0) (token/common/ERC2981.sol) pragma solidity ^0.8.0; import "../../interfaces/IERC2981Upgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information. * * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first. * * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the * fee is specified in basis points by default. * * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. * * _Available since v4.5._ */ abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable { function __ERC2981_init() internal onlyInitializing { } function __ERC2981_init_unchained() internal onlyInitializing { } struct RoyaltyInfo { address receiver; uint96 royaltyFraction; } RoyaltyInfo private _defaultRoyaltyInfo; mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) { return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @inheritdoc IERC2981Upgradeable */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) { royalty = _defaultRoyaltyInfo; } uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator(); return (royalty.receiver, royaltyAmount); } /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; } /** * @dev Sets the royalty information that all ids in this contract will default to. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: invalid receiver"); _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Removes default royalty information. */ function _deleteDefaultRoyalty() internal virtual { delete _defaultRoyaltyInfo; } /** * @dev Sets the royalty information for a specific token id, overriding the global default. * * Requirements: * * - `receiver` cannot be the zero address. * - `feeNumerator` cannot be greater than the fee denominator. */ function _setTokenRoyalty( uint256 tokenId, address receiver, uint96 feeNumerator ) internal virtual { require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice"); require(receiver != address(0), "ERC2981: Invalid parameters"); _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator); } /** * @dev Resets royalty information for the token id back to the global default. */ function _resetTokenRoyalty(uint256 tokenId) internal virtual { delete _tokenRoyaltyInfo[tokenId]; } /** * @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[48] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721EnumerableUpgradeable is IERC721Upgradeable { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// 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/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @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/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.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMathUpgradeable { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// 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 // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; /// @notice Optimized and flexible operator filterer to abide to OpenSea's /// mandatory on-chain royalty enforcement in order for new collections to /// receive royalties. /// For more information, see: /// See: https://github.com/ProjectOpenSea/operator-filter-registry abstract contract OperatorFilterer { /// @dev The default OpenSea operator blocklist subscription. address internal constant _DEFAULT_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6; /// @dev The OpenSea operator filter registry. address internal constant _OPERATOR_FILTER_REGISTRY = 0x000000000000AAeB6D7670E522A718067333cd4E; /// @dev Registers the current contract to OpenSea's operator filter, /// and subscribe to the default OpenSea operator blocklist. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering() internal virtual { _registerForOperatorFiltering(_DEFAULT_SUBSCRIPTION, true); } /// @dev Registers the current contract to OpenSea's operator filter. /// Note: Will not revert nor update existing settings for repeated registration. function _registerForOperatorFiltering(address subscriptionOrRegistrantToCopy, bool subscribe) internal virtual { /// @solidity memory-safe-assembly assembly { let functionSelector := 0x7d3e3dbe // `registerAndSubscribe(address,address)`. // Clean the upper 96 bits of `subscriptionOrRegistrantToCopy` in case they are dirty. subscriptionOrRegistrantToCopy := shr(96, shl(96, subscriptionOrRegistrantToCopy)) for {} iszero(subscribe) {} { if iszero(subscriptionOrRegistrantToCopy) { functionSelector := 0x4420e486 // `register(address)`. break } functionSelector := 0xa0af2903 // `registerAndCopyEntries(address,address)`. break } // Store the function selector. mstore(0x00, shl(224, functionSelector)) // Store the `address(this)`. mstore(0x04, address()) // Store the `subscriptionOrRegistrantToCopy`. mstore(0x24, subscriptionOrRegistrantToCopy) // Register into the registry. if iszero(call(gas(), _OPERATOR_FILTER_REGISTRY, 0, 0x00, 0x44, 0x00, 0x04)) { // If the function selector has not been overwritten, // it is an out-of-gas error. if eq(shr(224, mload(0x00)), functionSelector) { // To prevent gas under-estimation. revert(0, 0) } } // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, because of Solidity's memory size limits. mstore(0x24, 0) } } /// @dev Modifier to guard a function and revert if the caller is a blocked operator. modifier onlyAllowedOperator(address from) virtual { if (from != msg.sender) { if (!_isPriorityOperator(msg.sender)) { if (_operatorFilteringEnabled()) _revertIfBlocked(msg.sender); } } _; } /// @dev Modifier to guard a function from approving a blocked operator.. modifier onlyAllowedOperatorApproval(address operator) virtual { if (!_isPriorityOperator(operator)) { if (_operatorFilteringEnabled()) _revertIfBlocked(operator); } _; } /// @dev Helper function that reverts if the `operator` is blocked by the registry. function _revertIfBlocked(address operator) private view { /// @solidity memory-safe-assembly assembly { // Store the function selector of `isOperatorAllowed(address,address)`, // shifted left by 6 bytes, which is enough for 8tb of memory. // We waste 6-3 = 3 bytes to save on 6 runtime gas (PUSH1 0x224 SHL). mstore(0x00, 0xc6171134001122334455) // Store the `address(this)`. mstore(0x1a, address()) // Store the `operator`. mstore(0x3a, operator) // `isOperatorAllowed` always returns true if it does not revert. if iszero(staticcall(gas(), _OPERATOR_FILTER_REGISTRY, 0x16, 0x44, 0x00, 0x00)) { // Bubble up the revert if the staticcall reverts. returndatacopy(0x00, 0x00, returndatasize()) revert(0x00, returndatasize()) } // We'll skip checking if `from` is inside the blacklist. // Even though that can block transferring out of wrapper contracts, // we don't want tokens to be stuck. // Restore the part of the free memory pointer that was overwritten, // which is guaranteed to be zero, if less than 8tb of memory is used. mstore(0x3a, 0) } } /// @dev For deriving contracts to override, so that operator filtering /// can be turned on / off. /// Returns true by default. function _operatorFilteringEnabled() internal view virtual returns (bool) { return true; } /// @dev For deriving contracts to override, so that preferred marketplaces can /// skip operator filtering, helping users save gas. /// Returns false for all inputs by default. function _isPriorityOperator(address) internal view virtual returns (bool) { return false; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721EnumerableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; /************************* * @author: @scottybmitch ************************/ abstract contract ERC721BUpgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable for uint256; string private _name; string private _symbol; // Mapping from token ID to owner address address[] internal _owners; mapping(uint256 => address) private _tokenApprovals; mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ function __ERC721B_init( string memory name_, string memory symbol_ ) internal onlyInitializing { __ERC721B_init_unchained(name_, symbol_); } function __ERC721B_init_unchained( string memory name_, string memory symbol_ ) internal onlyInitializing { _name = name_; _symbol = symbol_; _owners.push(address(0)); } /** * @dev See {ERC165Upgradeable-supportsInterface}. */ function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).interfaceId || interfaceId == type(IERC721EnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf( address owner ) public view virtual override returns (uint256) { require( owner != address(0), "ERC721: balance query for the zero address" ); uint256 count = 0; uint256 length = _owners.length; for (uint256 i = 0; i < length; ++i) { if (owner == _owners[i]) ++count; } return count; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf( uint256 tokenId ) public view virtual override returns (address) { address owner = _owners[tokenId]; require( owner != address(0), "ERC721: owner query for nonexistent token" ); return owner; } /** * @dev See {IERC721UpgradeableMetadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721UpgradeableMetadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI( uint256 tokenId ) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721B: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved( uint256 tokenId ) public view virtual override returns (address) { require( _exists(tokenId), "ERC721: approved query for nonexistent token" ); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll( address operator, bool approved ) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll( address owner, address operator ) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require( _isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved" ); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721ReceiverUpgradeable-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require( _checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return tokenId < _owners.length && _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner( address spender, uint256 tokenId ) internal view virtual returns (bool) { require( _exists(tokenId), "ERC721: operator query for nonexistent token" ); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721ReceiverUpgradeable-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721ReceiverUpgradeable-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _owners.push(to); emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _owners[tokenId] = address(0); emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require( ownerOf(tokenId) == from, "ERC721: transfer of token that is not own" ); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721ReceiverUpgradeable-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 { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: CC0-1.0 pragma solidity >=0.8.13; /** * @title IDelegateRegistry * @custom:version 2.0 * @custom:author foobar (0xfoobar) * @notice A standalone immutable registry storing delegated permissions from one address to another */ interface IDelegationRegistryV2 { /// @notice Delegation type, NONE is used when a delegation does not exist or is revoked enum DelegationType { NONE, ALL, CONTRACT, ERC721, ERC20, ERC1155 } /// @notice Struct for returning delegations struct Delegation { DelegationType type_; address to; address from; bytes32 rights; address contract_; uint256 tokenId; uint256 amount; } /// @notice Emitted when an address delegates or revokes rights for their entire wallet event DelegateAll( address indexed from, address indexed to, bytes32 rights, bool enable ); /// @notice Emitted when an address delegates or revokes rights for a contract address event DelegateContract( address indexed from, address indexed to, address indexed contract_, bytes32 rights, bool enable ); /// @notice Emitted when an address delegates or revokes rights for an ERC721 tokenId event DelegateERC721( address indexed from, address indexed to, address indexed contract_, uint256 tokenId, bytes32 rights, bool enable ); /// @notice Emitted when an address delegates or revokes rights for an amount of ERC20 tokens event DelegateERC20( address indexed from, address indexed to, address indexed contract_, bytes32 rights, uint256 amount ); /// @notice Emitted when an address delegates or revokes rights for an amount of an ERC1155 tokenId event DelegateERC1155( address indexed from, address indexed to, address indexed contract_, uint256 tokenId, bytes32 rights, uint256 amount ); /// @notice Thrown if multicall calldata is malformed error MulticallFailed(); /** * ----------- WRITE ----------- */ /** * @notice Call multiple functions in the current contract and return the data from all of them if they all succeed * @param data The encoded function data for each of the calls to make to this contract * @return results The results from each of the calls passed in via data */ function multicall( bytes[] calldata data ) external payable returns (bytes[] memory results); /** * @notice Allow the delegate to act on behalf of `msg.sender` for all contracts * @param to The address to act as delegate * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param enable Whether to enable or disable this delegation, true delegates and false revokes * @return delegationHash The unique identifier of the delegation */ function delegateAll( address to, bytes32 rights, bool enable ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific contract * @param to The address to act as delegate * @param contract_ The contract whose rights are being delegated * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param enable Whether to enable or disable this delegation, true delegates and false revokes * @return delegationHash The unique identifier of the delegation */ function delegateContract( address to, address contract_, bytes32 rights, bool enable ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific ERC721 token * @param to The address to act as delegate * @param contract_ The contract whose rights are being delegated * @param tokenId The token id to delegate * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param enable Whether to enable or disable this delegation, true delegates and false revokes * @return delegationHash The unique identifier of the delegation */ function delegateERC721( address to, address contract_, uint256 tokenId, bytes32 rights, bool enable ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC20 tokens * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound) * @param to The address to act as delegate * @param contract_ The address for the fungible token contract * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param amount The amount to delegate, > 0 delegates and 0 revokes * @return delegationHash The unique identifier of the delegation */ function delegateERC20( address to, address contract_, bytes32 rights, uint256 amount ) external payable returns (bytes32 delegationHash); /** * @notice Allow the delegate to act on behalf of `msg.sender` for a specific amount of ERC1155 tokens * @dev The actual amount is not encoded in the hash, just the existence of a amount (since it is an upper bound) * @param to The address to act as delegate * @param contract_ The address of the contract that holds the token * @param tokenId The token id to delegate * @param rights Specific subdelegation rights granted to the delegate, pass an empty bytestring to encompass all rights * @param amount The amount of that token id to delegate, > 0 delegates and 0 revokes * @return delegationHash The unique identifier of the delegation */ function delegateERC1155( address to, address contract_, uint256 tokenId, bytes32 rights, uint256 amount ) external payable returns (bytes32 delegationHash); /** * ----------- CHECKS ----------- */ /** * @notice Check if `to` is a delegate of `from` for the entire wallet * @param to The potential delegate address * @param from The potential address who delegated rights * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return valid Whether delegate is granted to act on the from's behalf */ function checkDelegateForAll( address to, address from, bytes32 rights ) external view returns (bool); /** * @notice Check if `to` is a delegate of `from` for the specified `contract_` or the entire wallet * @param to The delegated address to check * @param contract_ The specific contract address being checked * @param from The cold wallet who issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return valid Whether delegate is granted to act on from's behalf for entire wallet or that specific contract */ function checkDelegateForContract( address to, address from, address contract_, bytes32 rights ) external view returns (bool); /** * @notice Check if `to` is a delegate of `from` for the specific `contract` and `tokenId`, the entire `contract_`, or the entire wallet * @param to The delegated address to check * @param contract_ The specific contract address being checked * @param tokenId The token id for the token to delegating * @param from The wallet that issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return valid Whether delegate is granted to act on from's behalf for entire wallet, that contract, or that specific tokenId */ function checkDelegateForERC721( address to, address from, address contract_, uint256 tokenId, bytes32 rights ) external view returns (bool); /** * @notice Returns the amount of ERC20 tokens the delegate is granted rights to act on the behalf of * @param to The delegated address to check * @param contract_ The address of the token contract * @param from The cold wallet who issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return balance The delegated balance, which will be 0 if the delegation does not exist */ function checkDelegateForERC20( address to, address from, address contract_, bytes32 rights ) external view returns (uint256); /** * @notice Returns the amount of a ERC1155 tokens the delegate is granted rights to act on the behalf of * @param to The delegated address to check * @param contract_ The address of the token contract * @param tokenId The token id to check the delegated amount of * @param from The cold wallet who issued the delegation * @param rights Specific rights to check for, pass the zero value to ignore subdelegations and check full delegations only * @return balance The delegated balance, which will be 0 if the delegation does not exist */ function checkDelegateForERC1155( address to, address from, address contract_, uint256 tokenId, bytes32 rights ) external view returns (uint256); /** * ----------- ENUMERATIONS ----------- */ /** * @notice Returns all enabled delegations a given delegate has received * @param to The address to retrieve delegations for * @return delegations Array of Delegation structs */ function getIncomingDelegations( address to ) external view returns (Delegation[] memory delegations); /** * @notice Returns all enabled delegations an address has given out * @param from The address to retrieve delegations for * @return delegations Array of Delegation structs */ function getOutgoingDelegations( address from ) external view returns (Delegation[] memory delegations); /** * @notice Returns all hashes associated with enabled delegations an address has received * @param to The address to retrieve incoming delegation hashes for * @return delegationHashes Array of delegation hashes */ function getIncomingDelegationHashes( address to ) external view returns (bytes32[] memory delegationHashes); /** * @notice Returns all hashes associated with enabled delegations an address has given out * @param from The address to retrieve outgoing delegation hashes for * @return delegationHashes Array of delegation hashes */ function getOutgoingDelegationHashes( address from ) external view returns (bytes32[] memory delegationHashes); /** * @notice Returns the delegations for a given array of delegation hashes * @param delegationHashes is an array of hashes that correspond to delegations * @return delegations Array of Delegation structs, return empty structs for nonexistent or revoked delegations */ function getDelegationsFromHashes( bytes32[] calldata delegationHashes ) external view returns (Delegation[] memory delegations); /** * ----------- STORAGE ACCESS ----------- */ /** * @notice Allows external contracts to read arbitrary storage slots */ function readSlot(bytes32 location) external view returns (bytes32); /** * @notice Allows external contracts to read an arbitrary array of storage slots */ function readSlots( bytes32[] calldata locations ) external view returns (bytes32[] memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; import {IERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; interface IThePlague is IERC721Upgradeable { struct StakeConfiguration { string description; /// First is default, followed by bonusIntervals rates uint256[] periodEmissions; // Minimum intervals (interval * denominator) to begin bonus emissions uint256[] bonusIntervals; // Duration of a single period (e.g, 1...30 days) uint256 periodDenominator; // Whether or not the current bonus works retroactively // e.g, Lock in 12 months gives 4x bonus but only multiplies the base reward after 12 months bool isRetroactiveBonus; // Minimum stake period (e.g, 1...365...x days) uint256 minimumStakePeriod; } // Pack struct for some gas savings struct StakedToken { uint16 configId; uint120 stakedAt; uint120 claimedAt; } event Stake(uint256 indexed tokenId); event Unstake( uint256 indexed tokenId, uint256 stakedAtTimestamp, uint256 removedFromStakeAtTimestamp ); function totalSupply() external view returns (uint256); function stake(uint256[] calldata tokenIds) external; function delegatedStake( uint256[] calldata tokenIds, address vault ) external; function stakeByConfigId( uint256 configId, uint256[] calldata tokenIds ) external; function delegatedStakeByConfigId( uint256 configId, uint256[] calldata tokenIds, address vault ) external; function unstake(uint256[] calldata tokenIds) external; function delegatedUnstake( uint256[] calldata tokenIds, address vault ) external; function migrateTokens( uint256[] calldata tokenIds, address[] calldata owners, StakedToken[] calldata stakedTokens ) external; function setDelegationRegistry(address _delegationRegistryAddress) external; function setRewardsAddress(address _erc20RewardsAddress) external; function setDefaultRoyalty(address receiver, uint96 feeNumerator) external; function setOperatorFilteringEnabled( bool _operatorFilteringEnabled ) external; function setStakeConfig( uint256 stakeId, StakeConfiguration calldata config ) external; function stakedInfoOf( uint256[] calldata tokenIds ) external view returns (bytes[] memory); }
{ "optimizer": { "enabled": true, "runs": 900 }, "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"},{"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":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Stake","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":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"stakedAtTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"removedFromStakeAtTimestamp","type":"uint256"}],"name":"Unstake","type":"event"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"areTokensLocked","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"calculateReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"calculateRewards","outputs":[{"internalType":"uint256[]","name":"rewards","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"configuration","outputs":[{"internalType":"string","name":"description","type":"string"},{"internalType":"uint256","name":"periodDenominator","type":"uint256"},{"internalType":"bool","name":"isRetroactiveBonus","type":"bool"},{"internalType":"uint256","name":"minimumStakePeriod","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"vault","type":"address"}],"name":"delegatedClaimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"vault","type":"address"}],"name":"delegatedStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"configId","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"vault","type":"address"}],"name":"delegatedStakeByConfigId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"vault","type":"address"}],"name":"delegatedUnstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegationRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"components":[{"internalType":"uint16","name":"configId","type":"uint16"},{"internalType":"uint120","name":"stakedAt","type":"uint120"},{"internalType":"uint120","name":"claimedAt","type":"uint120"}],"internalType":"struct IThePlague.StakedToken","name":"stakeInfo","type":"tuple"}],"name":"emergencyStakeUpdate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"erc20RewardsAddress","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":"address","name":"_erc20RewardsAddress","type":"address"},{"internalType":"address","name":"_delegationRegistryAddress","type":"address"},{"internalType":"string","name":"baseURI_","type":"string"}],"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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isUnlocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"owners","type":"address[]"},{"components":[{"internalType":"uint16","name":"configId","type":"uint16"},{"internalType":"uint120","name":"stakedAt","type":"uint120"},{"internalType":"uint120","name":"claimedAt","type":"uint120"}],"internalType":"struct IThePlague.StakedToken[]","name":"stakedTokens","type":"tuple[]"}],"name":"migrateTokens","outputs":[],"stateMutability":"nonpayable","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":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"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":"nonpayable","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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegationRegistryAddress","type":"address"}],"name":"setDelegationRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"operatorFilteringEnabled_","type":"bool"}],"name":"setOperatorFilteringEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_erc20RewardsAddress","type":"address"}],"name":"setRewardsAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"configId","type":"uint256"},{"components":[{"internalType":"string","name":"description","type":"string"},{"internalType":"uint256[]","name":"periodEmissions","type":"uint256[]"},{"internalType":"uint256[]","name":"bonusIntervals","type":"uint256[]"},{"internalType":"uint256","name":"periodDenominator","type":"uint256"},{"internalType":"bool","name":"isRetroactiveBonus","type":"bool"},{"internalType":"uint256","name":"minimumStakePeriod","type":"uint256"}],"internalType":"struct IThePlague.StakeConfiguration","name":"config","type":"tuple"}],"name":"setStakeConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_baseStakeConfigId","type":"uint256"}],"name":"setStakedBaseConfigId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"configId","type":"uint256"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stakeByConfigId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"staked","outputs":[{"internalType":"uint16","name":"configId","type":"uint16"},{"internalType":"uint120","name":"stakedAt","type":"uint120"},{"internalType":"uint120","name":"claimedAt","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stakedBatchTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"stakedInfoOf","outputs":[{"internalType":"bytes[]","name":"","type":"bytes[]"}],"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":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"validConfigurations","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFRG","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506200001c62000022565b620000e4565b600054610100900460ff16156200008f5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff9081161015620000e2576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61494d80620000f46000396000f3fe608060405234801561001057600080fd5b50600436106103415760003560e01c806372abc8b7116101bd578063a350820d116100f9578063bf5bf5f8116100a2578063e449f3411161007c578063e449f34114610799578063e582460d146107ac578063e985e9c5146107bf578063f2fde38b146107fb57600080fd5b8063bf5bf5f81461075b578063c87b56dd14610773578063d2d7231f1461078657600080fd5b8063b7c0b8e8116100d3578063b7c0b8e814610722578063b88d4fde14610735578063bb7d1f8f1461074857600080fd5b8063a350820d146106d9578063aae1f2c6146106fc578063ad3c26e71461070f57600080fd5b806395c1c7951161016657806399ccbd7f1161014057806399ccbd7f1461068d5780639cb51136146106a0578063a0e1851f146106b3578063a22cb465146106c657600080fd5b806395c1c7951461065f57806395d89b411461067257806396e8cc0c1461067a57600080fd5b80638462151c116101975780638462151c1461061b5780638906758d1461063b5780638da5cb5b1461064e57600080fd5b806372abc8b7146105d057806373aa9e94146105f55780637aff44261461060857600080fd5b806332cb6b0c1161028c5780635e1bef3211610235578063688f9ac81161020f578063688f9ac81461058d5780636c0360eb146105ad57806370a08231146105b5578063715018a6146105c857600080fd5b80635e1bef32146104fe5780635eac6239146105675780636352211e1461057a57600080fd5b80634571e3a6116102665780634571e3a6146104b55780634b624579146104c857806355f804b3146104eb57600080fd5b806332cb6b0c14610479578063335e15a21461048257806342842e0e146104a257600080fd5b8063136be69d116102ee57806323b872dd116102c857806323b872dd146104215780632a55205a146104345780632ebb0d411461046657600080fd5b8063136be69d146103e957806318160ddd146103fc5780631a87451f1461040e57600080fd5b8063081812fc1161031f578063081812fc14610398578063095ea7b3146103c35780630fbf0a93146103d657600080fd5b806301ffc9a71461034657806304634d8d1461036e57806306fdde0314610383575b600080fd5b610359610354366004613a00565b61080e565b60405190151581526020015b60405180910390f35b61038161037c366004613a39565b61082e565b005b61038b610844565b6040516103659190613ad1565b6103ab6103a6366004613ae4565b6108d6565b6040516001600160a01b039091168152602001610365565b6103816103d1366004613afd565b610963565b6103816103e4366004613b6c565b6109d3565b6103816103f7366004613bae565b6109e7565b60cf545b604051908152602001610365565b60d2546103ab906001600160a01b031681565b61038161042f366004613c02565b610ae1565b610447610442366004613c3e565b610b63565b604080516001600160a01b039093168352602083019190915201610365565b610381610474366004613c60565b610c20565b610400612af881565b610495610490366004613cf3565b610c2c565b6040516103659190613d8d565b6103816104b0366004613c02565b610d3f565b6103816104c3366004613e67565b610dbb565b6103596104d6366004613ae4565b60d56020526000908152604090205460ff1681565b6103816104f9366004613ec5565b610fde565b61053d61050c366004613ae4565b60d36020526000908152604090205461ffff8116906001600160781b03620100008204811691600160881b90041683565b6040805161ffff90941684526001600160781b039283166020850152911690820152606001610365565b610381610575366004613b6c565b610ff2565b6103ab610588366004613ae4565b610ffd565b6105a061059b366004613cf3565b61109d565b6040516103659190613efa565b61038b61115c565b6104006105c3366004613f40565b6111ea565b6103816112cf565b6103596105de366004613ae4565b600090815260d3602052604090205461ffff161590565b610381610603366004613f40565b6112e3565b610381610616366004613ae4565b611320565b61062e610629366004613f40565b611335565b6040516103659190613f5b565b610381610649366004613f40565b6113fc565b6033546001600160a01b03166103ab565b61038161066d366004613f93565b611426565b61038b6114ca565b610381610688366004613ae4565b6114d9565b61038161069b366004613fcd565b611544565b61062e6106ae366004613b6c565b6115ab565b6103816106c136600461402c565b61164d565b6103816106d436600461407d565b61168d565b6106ec6106e7366004613ae4565b6116ac565b60405161036594939291906140a9565b61038161070a3660046140d8565b611762565b61038161071d366004613bae565b61185e565b610381610730366004614136565b611951565b610381610743366004614153565b61196c565b6103816107563660046141cf565b6119e9565b60d1546103ab9061010090046001600160a01b031681565b61038b610781366004613ae4565b611b2c565b610400610794366004613ae4565b611bdf565b6103816107a7366004613b6c565b61201d565b6103816107ba366004613bae565b612028565b6103596107cd366004614298565b6001600160a01b03918216600090815260cd6020908152604080832093909416825291909152205460ff1690565b610381610809366004613f40565b61211e565b6000610819826121ab565b8061082857506108288261224c565b92915050565b6108366122b3565b610840828261230d565b5050565b606060c98054610853906142cb565b80601f016020809104026020016040519081016040528092919081815260200182805461087f906142cb565b80156108cc5780601f106108a1576101008083540402835291602001916108cc565b820191906000526020600020905b8154815290600101906020018083116108af57829003601f168201915b5050505050905090565b60006108e182612427565b6109475760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815260cc60205260409020546001600160a01b031690565b8160d15460ff16156109785761097881612471565b600082815260d3602052604090205461ffff16156109c45760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b6109ce83836124b5565b505050565b61084060d05483836109e23390565b6125c5565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa158015610a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a809190614305565b905080610acf5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b610ada858585612774565b5050505050565b826001600160a01b0381163314610b065760d15460ff1615610b0657610b0633612471565b600082815260d3602052604090205461ffff1615610b525760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b610b5d848484612919565b50505050565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610be25750604080518082019091526097546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610c06906bffffffffffffffffffffffff1687614338565b610c10919061434f565b91519350909150505b9250929050565b6109ce838383336125c5565b60606000825167ffffffffffffffff811115610c4a57610c4a613cac565b604051908082528060200260200182016040528015610c7d57816020015b6060815260200190600190039081610c685790505b50905060005b8351811015610d38576000848281518110610ca057610ca0614371565b602090810291909101810151600081815260d383526040908190205481519384018390526001600160781b03620100008204811692850192909252600160881b8104909116606084015261ffff166080830152915060a001604051602081830303815290604052838381518110610d1957610d19614371565b6020026020010181905250508080610d3090614387565b915050610c83565b5092915050565b826001600160a01b0381163314610d645760d15460ff1615610d6457610d6433612471565b600082815260d3602052604090205461ffff1615610db05760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b610b5d8484846129a0565b600054610100900460ff1615808015610ddb5750600054600160ff909116105b80610df55750303b158015610df5575060005460ff166001145b610e675760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161093e565b6000805460ff191660011790558015610e8a576000805461ff0019166101001790555b610efe6040518060400160405280600a81526020017f54686520506c61677565000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f46524f47000000000000000000000000000000000000000000000000000000008152506129bb565b610f06612a30565b610f0e612aa3565b610f16612b0e565b60d1805460ff19166001179055610f35610f2d3390565b6103e861230d565b600260d05560d280546001600160a01b0319166001600160a01b038681169190911790915560d1805474ffffffffffffffffffffffffffffffffffffffff0019166101009286169290920291909117905560ce610f9283826143ee565b508015610b5d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b610fe66122b3565b60ce61084082826143ee565b610840828233612b2d565b60008060cb838154811061101357611013614371565b6000918252602090912001546001600160a01b03169050806108285760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606482015260840161093e565b60606000825167ffffffffffffffff8111156110bb576110bb613cac565b6040519080825280602002602001820160405280156110e4578160200160208202803683370190505b50905060005b8351811015610d385761112784828151811061110857611108614371565b6020026020010151600090815260d3602052604090205461ffff161590565b1582828151811061113a5761113a614371565b911515602092830291909101909101528061115481614387565b9150506110ea565b60ce8054611169906142cb565b80601f0160208091040260200160405190810160405280929190818152602001828054611195906142cb565b80156111e25780601f106111b7576101008083540402835291602001916111e2565b820191906000526020600020905b8154815290600101906020018083116111c557829003601f168201915b505050505081565b60006001600160a01b0382166112685760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f206164647265737300000000000000000000000000000000000000000000606482015260840161093e565b60cb54600090815b818110156112c65760cb818154811061128b5761128b614371565b6000918252602090912001546001600160a01b03908116908616036112b6576112b383614387565b92505b6112bf81614387565b9050611270565b50909392505050565b6112d76122b3565b6112e16000612c21565b565b6112eb6122b3565b60d180546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6113286122b3565b6113323382612c73565b50565b6060600080611343846111ea565b905060008167ffffffffffffffff81111561136057611360613cac565b604051908082528060200260200182016040528015611389578160200160208202803683370190505b50905060005b8284146113f35761139f81612427565b156113eb57856001600160a01b03166113b782610ffd565b6001600160a01b0316036113eb57808285806001019650815181106113de576113de614371565b6020026020010181815250505b60010161138f565b50949350505050565b6114046122b3565b60d280546001600160a01b0319166001600160a01b0392909216919091179055565b60005b81811015610b5d57600083838381811061144557611445614371565b9050602002013590506114553390565b6001600160a01b031661146782610ffd565b6001600160a01b0316146114a65760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b6114c133868360405180602001604052806000815250612d92565b50600101611429565b606060ca8054610853906142cb565b6114e16122b3565b600081815260d5602052604090205460ff1661153f5760405162461bcd60e51b815260206004820152600660248201527f2176616c69640000000000000000000000000000000000000000000000000000604482015260640161093e565b60d055565b61154c6122b3565b60005b82811015610b5d57600084848381811061156b5761156b614371565b9050602002013590508260d36000838152602001908152602001600020818161159491906144d7565b9050505080806115a390614387565b91505061154f565b60608167ffffffffffffffff8111156115c6576115c6613cac565b6040519080825280602002602001820160405280156115ef578160200160208202803683370190505b50905060005b82811015610d385761161e84848381811061161257611612614371565b90506020020135611bdf565b82828151811061163057611630614371565b60209081029190910101528061164581614387565b9150506115f5565b6116556122b3565b600082815260d460205260409020819061166f82826146f2565b505050600090815260d560205260409020805460ff19166001179055565b8160d15460ff16156116a2576116a281612471565b6109ce8383612e1b565b60d4602052600090815260409020805481906116c7906142cb565b80601f01602080910402602001604051908101604052809291908181526020018280546116f3906142cb565b80156117405780601f1061171557610100808354040283529160200191611740565b820191906000526020600020905b81548152906001019060200180831161172357829003601f168201915b50505050600383015460048401546005909401549293909260ff909116915084565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa1580156117d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117fb9190614305565b90508061184a5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b611856868686866125c5565b505050505050565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa1580156118d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f79190614305565b9050806119465760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b610ada858585612b2d565b6119596122b3565b60d1805460ff1916911515919091179055565b836001600160a01b03811633146119915760d15460ff16156119915761199133612471565b600083815260d3602052604090205461ffff16156119dd5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b610ada85858585612edf565b6119f16122b3565b60cf548590600090611a049083906147bb565b9050848214611a1257600080fd5b612af8811115611a2157600080fd5b60008060005b84811015611b1d578a8a82818110611a4157611a41614371565b905060200201359250888882818110611a5c57611a5c614371565b9050602002016020810190611a719190613f40565b9150611a7d8284612f67565b868682818110611a8f57611a8f614371565b611aa592602060609092020190810191506147ce565b61ffff16600103611b1557868682818110611ac257611ac2614371565b90506060020160d360008581526020019081526020016000208181611ae791906144d7565b505060405183907f227a473b70d2f893cc7659219575c030a63b5743024fe1e0c1a680e708b1525a90600090a25b600101611a27565b50505060cf5550505050505050565b6060611b3782612427565b611b835760405162461bcd60e51b815260206004820152600760248201527f2165786973747300000000000000000000000000000000000000000000000000604482015260640161093e565b600060ce8054611b92906142cb565b905011611bae5760405180602001604052806000815250610828565b60ce611bb98361308f565b604051602001611bca9291906147eb565b60405160208183030381529060405292915050565b600081815260d360205260408120546201000090046001600160781b031680611c4a5760405162461bcd60e51b815260206004820152600760248201527f217374616b656400000000000000000000000000000000000000000000000000604482015260640161093e565b600083815260d3602090815260408083205461ffff811680855260d49093529083209192600160881b9091046001600160781b03169190611c8b8542614872565b905060008260030154826001600160781b0316611ca8919061434f565b90506000611e31846040518060c0016040529081600082018054611ccb906142cb565b80601f0160208091040260200160405190810160405280929190818152602001828054611cf7906142cb565b8015611d445780601f10611d1957610100808354040283529160200191611d44565b820191906000526020600020905b815481529060010190602001808311611d2757829003601f168201915b5050505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015611d9c57602002820191906000526020600020905b815481526020019060010190808311611d88575b5050505050815260200160028201805480602002602001604051908101604052809291908181526020018280548015611df457602002820191906000526020600020905b815481526020019060010190808311611de0575b505050918352505060038201546020820152600482015460ff1615156040820152600590910154606090910152836001600160781b03861661312f565b9050866001600160781b0316856001600160781b03161115612011576000611e598887614872565b6001600160781b031690506000856003015482611e76919061434f565b90506000611fff876040518060c0016040529081600082018054611e99906142cb565b80601f0160208091040260200160405190810160405280929190818152602001828054611ec5906142cb565b8015611f125780601f10611ee757610100808354040283529160200191611f12565b820191906000526020600020905b815481529060010190602001808311611ef557829003601f168201915b5050505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015611f6a57602002820191906000526020600020905b815481526020019060010190808311611f56575b5050505050815260200160028201805480602002602001604051908101604052809291908181526020018280548015611fc257602002820191906000526020600020905b815481526020019060010190808311611fae575b505050918352505060038201546020820152600482015460ff1615156040820152600590910154606090910152836001600160781b03891661312f565b905061200b8185614892565b93505050505b98975050505050505050565b610840828233612774565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa15801561209d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c19190614305565b9050806121105760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b610ada60d0548686866125c5565b6121266122b3565b6001600160a01b0381166121a25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161093e565b61133281612c21565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061220e57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061081957506001600160e01b031982167f780e9d630000000000000000000000000000000000000000000000000000000014806108285750610828825b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061082857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610828565b6033546001600160a01b031633146112e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161093e565b6127106bffffffffffffffffffffffff821611156123935760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c65507269636500000000000000000000000000000000000000000000606482015260840161093e565b6001600160a01b0382166123e95760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161093e565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217609755565b60cb5460009082108015610828575060006001600160a01b031660cb838154811061245457612454614371565b6000918252602090912001546001600160a01b0316141592915050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa6124ad573d6000803e3d6000fd5b6000603a5250565b60006124c082610ffd565b9050806001600160a01b0316836001600160a01b03160361252d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161093e565b336001600160a01b0382161480612549575061254981336107cd565b6125bb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161093e565b6109ce8383613324565b6001841180156125e35750600084815260d5602052604090205460ff165b61262f5760405162461bcd60e51b815260206004820152600760248201527f21636f6e66696700000000000000000000000000000000000000000000000000604482015260640161093e565b60005b82811015610ada57600084848381811061264e5761264e614371565b90506020020135905061267281600090815260d3602052604090205461ffff161590565b6126aa5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b826001600160a01b03166126bd82610ffd565b6001600160a01b0316146126fc5760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b600081815260d3602052604080822080546001600160781b034216620100000270ffffffffffffffffffffffffffffffffff1990911661ffff8b16171790555182917f227a473b70d2f893cc7659219575c030a63b5743024fe1e0c1a680e708b1525a91a2508061276c81614387565b915050612632565b61277f838383612b2d565b6000805b83811015610ada57600085858381811061279f5761279f614371565b905060200201359050836001600160a01b03166127bb82610ffd565b6001600160a01b0316146127fa5760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b600081815260d3602090815260408083205461ffff8116845260d49092529091206005810154909450620100009091046001600160781b031690156128a55760006128458242614872565b90508460050154816001600160781b0316116128a35760405162461bcd60e51b815260206004820152600860248201527f216d696e696d756d000000000000000000000000000000000000000000000000604482015260640161093e565b505b600082815260d36020526040808220919091555182907f529f395783b74aeb16a02d6320297d8415f7312f2ff2c398cd0d70e30bebc6c9906128fc906001600160781b038516904290918252602082015260400190565b60405180910390a25050808061291190614387565b915050612783565b6129233382613392565b6129955760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161093e565b6109ce83838361347c565b6109ce8383836040518060200160405280600081525061196c565b600054610100900460ff16612a265760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b61084082826135ff565b600054610100900460ff16612a9b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b6112e16136c8565b600054610100900460ff166112e15760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b6112e1733cc6cdda760b79bafa08df41ecfa224f810dceb6600161373c565b6000805b83811015612bff576000858583818110612b4d57612b4d614371565b905060200201359050836001600160a01b0316612b6982610ffd565b6001600160a01b031614612ba85760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b612bb181611bdf565b600091825260d36020526040909120805470ffffffffffffffffffffffffffffffffff16600160881b426001600160781b031602179055919091019080612bf781614387565b915050612b31565b508015610b5d57610b5d82612c1c83670de0b6b3a7640000614338565b612c73565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60d2546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf991906148a5565b90508082116109ce5760d2546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af1158015612d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d9190614305565b612d9d84848461347c565b612da9848484846137b1565b610b5d5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161093e565b336001600160a01b03831603612e735760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161093e565b33600081815260cd602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612ee93383613392565b612f5b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161093e565b610b5d84848484612d92565b6001600160a01b038216612fbd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161093e565b612fc681612427565b156130135760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161093e565b60cb805460018101825560009182527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b0319166001600160a01b0385169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060600061309c83613908565b600101905060008167ffffffffffffffff8111156130bc576130bc613cac565b6040519080825280601f01601f1916602001820160405280156130e6576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846130f057509392505050565b60408301515160009081908180805b8860400151858151811061315457613154614371565b60200260200101519250878310156131b9576131708284614892565b8960200151868151811061318657613186614371565b60200260200101516131989190614338565b6131a290826147bb565b83925090506131b26001866147bb565b94506131be565b600093505b83851061313e57841580156131d35750600088115b156132125787896020015186815181106131ef576131ef614371565b60200260200101516132019190614338565b61320b90826147bb565b9050613259565b87821015613259576132248289614892565b8960200151868151811061323a5761323a614371565b602002602001015161324c9190614338565b61325690826147bb565b90505b60008960a0015111801561327057508860a0015187115b801561327e57508860800151155b801561328957508288115b15613316576000896020015186815181106132a6576132a6614371565b6020026020010151905060008a602001516001886132c49190614892565b815181106132d4576132d4614371565b6020026020010151905084816132ea9190614338565b6132f4868c614892565b6132fe9084614338565b61330891906147bb565b97505050505050505061331d565b9450505050505b9392505050565b600081815260cc6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061335982610ffd565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061339d82612427565b6133fe5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161093e565b600061340983610ffd565b9050806001600160a01b0316846001600160a01b031614806134445750836001600160a01b0316613439846108d6565b6001600160a01b0316145b8061347457506001600160a01b03808216600090815260cd602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661348f82610ffd565b6001600160a01b03161461350b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e0000000000000000000000000000000000000000000000606482015260840161093e565b6001600160a01b0382166135865760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161093e565b613591600082613324565b8160cb82815481106135a5576135a5614371565b6000918252602082200180546001600160a01b0319166001600160a01b03938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b600054610100900460ff1661366a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b60c961367683826143ee565b5060ca61368382826143ee565b505060cb80546001810182556000919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b031916905550565b600054610100900460ff166137335760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b6112e133612c21565b6001600160a01b0390911690637d3e3dbe8161376957826137625750634420e486613769565b5063a0af29035b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af16137a7578060005160e01c036137a757600080fd5b5060006024525050565b60006001600160a01b0384163b156138fd57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906137f59033908990889088906004016148be565b6020604051808303816000875af1925050508015613830575060408051601f3d908101601f1916820190925261382d918101906148fa565b60015b6138e3573d80801561385e576040519150601f19603f3d011682016040523d82523d6000602084013e613863565b606091505b5080516000036138db5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161093e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613474565b506001949350505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613951577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061397d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061399b57662386f26fc10000830492506010015b6305f5e10083106139b3576305f5e100830492506008015b61271083106139c757612710830492506004015b606483106139d9576064830492506002015b600a83106108285760010192915050565b6001600160e01b03198116811461133257600080fd5b600060208284031215613a1257600080fd5b813561331d816139ea565b80356001600160a01b0381168114613a3457600080fd5b919050565b60008060408385031215613a4c57600080fd5b613a5583613a1d565b915060208301356bffffffffffffffffffffffff81168114613a7657600080fd5b809150509250929050565b60005b83811015613a9c578181015183820152602001613a84565b50506000910152565b60008151808452613abd816020860160208601613a81565b601f01601f19169290920160200192915050565b60208152600061331d6020830184613aa5565b600060208284031215613af657600080fd5b5035919050565b60008060408385031215613b1057600080fd5b613b1983613a1d565b946020939093013593505050565b60008083601f840112613b3957600080fd5b50813567ffffffffffffffff811115613b5157600080fd5b6020830191508360208260051b8501011115610c1957600080fd5b60008060208385031215613b7f57600080fd5b823567ffffffffffffffff811115613b9657600080fd5b613ba285828601613b27565b90969095509350505050565b600080600060408486031215613bc357600080fd5b833567ffffffffffffffff811115613bda57600080fd5b613be686828701613b27565b9094509250613bf9905060208501613a1d565b90509250925092565b600080600060608486031215613c1757600080fd5b613c2084613a1d565b9250613c2e60208501613a1d565b9150604084013590509250925092565b60008060408385031215613c5157600080fd5b50508035926020909101359150565b600080600060408486031215613c7557600080fd5b83359250602084013567ffffffffffffffff811115613c9357600080fd5b613c9f86828701613b27565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613ceb57613ceb613cac565b604052919050565b60006020808385031215613d0657600080fd5b823567ffffffffffffffff80821115613d1e57600080fd5b818501915085601f830112613d3257600080fd5b813581811115613d4457613d44613cac565b8060051b9150613d55848301613cc2565b8181529183018401918481019088841115613d6f57600080fd5b938501935b8385101561201157843582529385019390850190613d74565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613de257603f19888603018452613dd0858351613aa5565b94509285019290850190600101613db4565b5092979650505050505050565b600067ffffffffffffffff831115613e0957613e09613cac565b613e1c601f8401601f1916602001613cc2565b9050828152838383011115613e3057600080fd5b828260208301376000602084830101529392505050565b600082601f830112613e5857600080fd5b61331d83833560208501613def565b600080600060608486031215613e7c57600080fd5b613e8584613a1d565b9250613e9360208501613a1d565b9150604084013567ffffffffffffffff811115613eaf57600080fd5b613ebb86828701613e47565b9150509250925092565b600060208284031215613ed757600080fd5b813567ffffffffffffffff811115613eee57600080fd5b61347484828501613e47565b6020808252825182820181905260009190848201906040850190845b81811015613f34578351151583529284019291840191600101613f16565b50909695505050505050565b600060208284031215613f5257600080fd5b61331d82613a1d565b6020808252825182820181905260009190848201906040850190845b81811015613f3457835183529284019291840191600101613f77565b600080600060408486031215613fa857600080fd5b613fb184613a1d565b9250602084013567ffffffffffffffff811115613c9357600080fd5b60008060008385036080811215613fe357600080fd5b843567ffffffffffffffff811115613ffa57600080fd5b61400687828801613b27565b9095509350506060601f198201121561401e57600080fd5b506020840190509250925092565b6000806040838503121561403f57600080fd5b82359150602083013567ffffffffffffffff81111561405d57600080fd5b830160c08186031215613a7657600080fd5b801515811461133257600080fd5b6000806040838503121561409057600080fd5b61409983613a1d565b91506020830135613a768161406f565b6080815260006140bc6080830187613aa5565b6020830195909552509115156040830152606090910152919050565b600080600080606085870312156140ee57600080fd5b84359350602085013567ffffffffffffffff81111561410c57600080fd5b61411887828801613b27565b909450925061412b905060408601613a1d565b905092959194509250565b60006020828403121561414857600080fd5b813561331d8161406f565b6000806000806080858703121561416957600080fd5b61417285613a1d565b935061418060208601613a1d565b925060408501359150606085013567ffffffffffffffff8111156141a357600080fd5b8501601f810187136141b457600080fd5b6141c387823560208401613def565b91505092959194509250565b600080600080600080606087890312156141e857600080fd5b863567ffffffffffffffff8082111561420057600080fd5b61420c8a838b01613b27565b9098509650602089013591508082111561422557600080fd5b6142318a838b01613b27565b9096509450604089013591508082111561424a57600080fd5b818901915089601f83011261425e57600080fd5b81358181111561426d57600080fd5b8a602060608302850101111561428257600080fd5b6020830194508093505050509295509295509295565b600080604083850312156142ab57600080fd5b6142b483613a1d565b91506142c260208401613a1d565b90509250929050565b600181811c908216806142df57607f821691505b6020821081036142ff57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561431757600080fd5b815161331d8161406f565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761082857610828614322565b60008261436c57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60006001820161439957614399614322565b5060010190565b5b8181101561084057600081556001016143a1565b601f8211156109ce57806000526020600020601f840160051c810160208510156143dc5750805b610ada601f850160051c8301826143a0565b815167ffffffffffffffff81111561440857614408613cac565b61441c8161441684546142cb565b846143b5565b602080601f83116001811461445157600084156144395750858301515b600019600386901b1c1916600185901b178555611856565b600085815260208120601f198616915b8281101561448057888601518255948401946001909101908401614461565b508582101561449e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61ffff8116811461133257600080fd5b600081356001600160781b038116811461082857600080fd5b81356144e2816144ae565b61ffff8116905081548161ffff19821617835570ffffffffffffffffffffffffffffff0000614513602086016144be565b60101b1670ffffffffffffffffffffffffffffffffff1981848285161717855580614540604088016144be565b60881b16848317178555505050505050565b67ffffffffffffffff83111561456a5761456a613cac565b61457e8361457883546142cb565b836143b5565b6000601f8411600181146145b2576000851561459a5750838201355b600019600387901b1c1916600186901b178355610ada565b600083815260209020601f19861690835b828110156145e357868501358255602094850194600190920191016145c3565b50868210156146005760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000808335601e1984360301811261462957600080fd5b83018035915067ffffffffffffffff82111561464457600080fd5b6020019150600581901b3603821315610c1957600080fd5b67ffffffffffffffff83111561467457614674613cac565b6801000000000000000083111561468d5761468d613cac565b8054838255808410156146b3578160005260206000206146b18282018683016143a0565b505b50818160005260208060002060005b868110156146dc57833582820155928201926001016146c2565b50505050505050565b600081356108288161406f565b8135601e1983360301811261470657600080fd5b8201803567ffffffffffffffff81111561471f57600080fd5b60208201915080360382131561473457600080fd5b61473f818385614552565b505061474e6020830183614612565b61475c81836001860161465c565b505061476b6040830183614612565b61477981836002860161465c565b5050606082013560038201556147ad614794608084016146e5565b6004830160ff1981541660ff8315151681178255505050565b60a082013560058201555050565b8082018082111561082857610828614322565b6000602082840312156147e057600080fd5b813561331d816144ae565b60008084546147f9816142cb565b60018281168015614811576001811461482657614855565b60ff1984168752821515830287019450614855565b8860005260208060002060005b8581101561484c5781548a820152908401908201614833565b50505082870194505b505050508351614869818360208801613a81565b01949350505050565b6001600160781b03828116828216039080821115610d3857610d38614322565b8181038181111561082857610828614322565b6000602082840312156148b757600080fd5b5051919050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526148f06080830184613aa5565b9695505050505050565b60006020828403121561490c57600080fd5b815161331d816139ea56fea26469706673582212208aa65f1082630c6215b1df281244e08bcf72a7cdcc2c436f2d30d3daa279b5c364736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103415760003560e01c806372abc8b7116101bd578063a350820d116100f9578063bf5bf5f8116100a2578063e449f3411161007c578063e449f34114610799578063e582460d146107ac578063e985e9c5146107bf578063f2fde38b146107fb57600080fd5b8063bf5bf5f81461075b578063c87b56dd14610773578063d2d7231f1461078657600080fd5b8063b7c0b8e8116100d3578063b7c0b8e814610722578063b88d4fde14610735578063bb7d1f8f1461074857600080fd5b8063a350820d146106d9578063aae1f2c6146106fc578063ad3c26e71461070f57600080fd5b806395c1c7951161016657806399ccbd7f1161014057806399ccbd7f1461068d5780639cb51136146106a0578063a0e1851f146106b3578063a22cb465146106c657600080fd5b806395c1c7951461065f57806395d89b411461067257806396e8cc0c1461067a57600080fd5b80638462151c116101975780638462151c1461061b5780638906758d1461063b5780638da5cb5b1461064e57600080fd5b806372abc8b7146105d057806373aa9e94146105f55780637aff44261461060857600080fd5b806332cb6b0c1161028c5780635e1bef3211610235578063688f9ac81161020f578063688f9ac81461058d5780636c0360eb146105ad57806370a08231146105b5578063715018a6146105c857600080fd5b80635e1bef32146104fe5780635eac6239146105675780636352211e1461057a57600080fd5b80634571e3a6116102665780634571e3a6146104b55780634b624579146104c857806355f804b3146104eb57600080fd5b806332cb6b0c14610479578063335e15a21461048257806342842e0e146104a257600080fd5b8063136be69d116102ee57806323b872dd116102c857806323b872dd146104215780632a55205a146104345780632ebb0d411461046657600080fd5b8063136be69d146103e957806318160ddd146103fc5780631a87451f1461040e57600080fd5b8063081812fc1161031f578063081812fc14610398578063095ea7b3146103c35780630fbf0a93146103d657600080fd5b806301ffc9a71461034657806304634d8d1461036e57806306fdde0314610383575b600080fd5b610359610354366004613a00565b61080e565b60405190151581526020015b60405180910390f35b61038161037c366004613a39565b61082e565b005b61038b610844565b6040516103659190613ad1565b6103ab6103a6366004613ae4565b6108d6565b6040516001600160a01b039091168152602001610365565b6103816103d1366004613afd565b610963565b6103816103e4366004613b6c565b6109d3565b6103816103f7366004613bae565b6109e7565b60cf545b604051908152602001610365565b60d2546103ab906001600160a01b031681565b61038161042f366004613c02565b610ae1565b610447610442366004613c3e565b610b63565b604080516001600160a01b039093168352602083019190915201610365565b610381610474366004613c60565b610c20565b610400612af881565b610495610490366004613cf3565b610c2c565b6040516103659190613d8d565b6103816104b0366004613c02565b610d3f565b6103816104c3366004613e67565b610dbb565b6103596104d6366004613ae4565b60d56020526000908152604090205460ff1681565b6103816104f9366004613ec5565b610fde565b61053d61050c366004613ae4565b60d36020526000908152604090205461ffff8116906001600160781b03620100008204811691600160881b90041683565b6040805161ffff90941684526001600160781b039283166020850152911690820152606001610365565b610381610575366004613b6c565b610ff2565b6103ab610588366004613ae4565b610ffd565b6105a061059b366004613cf3565b61109d565b6040516103659190613efa565b61038b61115c565b6104006105c3366004613f40565b6111ea565b6103816112cf565b6103596105de366004613ae4565b600090815260d3602052604090205461ffff161590565b610381610603366004613f40565b6112e3565b610381610616366004613ae4565b611320565b61062e610629366004613f40565b611335565b6040516103659190613f5b565b610381610649366004613f40565b6113fc565b6033546001600160a01b03166103ab565b61038161066d366004613f93565b611426565b61038b6114ca565b610381610688366004613ae4565b6114d9565b61038161069b366004613fcd565b611544565b61062e6106ae366004613b6c565b6115ab565b6103816106c136600461402c565b61164d565b6103816106d436600461407d565b61168d565b6106ec6106e7366004613ae4565b6116ac565b60405161036594939291906140a9565b61038161070a3660046140d8565b611762565b61038161071d366004613bae565b61185e565b610381610730366004614136565b611951565b610381610743366004614153565b61196c565b6103816107563660046141cf565b6119e9565b60d1546103ab9061010090046001600160a01b031681565b61038b610781366004613ae4565b611b2c565b610400610794366004613ae4565b611bdf565b6103816107a7366004613b6c565b61201d565b6103816107ba366004613bae565b612028565b6103596107cd366004614298565b6001600160a01b03918216600090815260cd6020908152604080832093909416825291909152205460ff1690565b610381610809366004613f40565b61211e565b6000610819826121ab565b8061082857506108288261224c565b92915050565b6108366122b3565b610840828261230d565b5050565b606060c98054610853906142cb565b80601f016020809104026020016040519081016040528092919081815260200182805461087f906142cb565b80156108cc5780601f106108a1576101008083540402835291602001916108cc565b820191906000526020600020905b8154815290600101906020018083116108af57829003601f168201915b5050505050905090565b60006108e182612427565b6109475760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b50600090815260cc60205260409020546001600160a01b031690565b8160d15460ff16156109785761097881612471565b600082815260d3602052604090205461ffff16156109c45760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b6109ce83836124b5565b505050565b61084060d05483836109e23390565b6125c5565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa158015610a5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a809190614305565b905080610acf5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b610ada858585612774565b5050505050565b826001600160a01b0381163314610b065760d15460ff1615610b0657610b0633612471565b600082815260d3602052604090205461ffff1615610b525760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b610b5d848484612919565b50505050565b60008281526098602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046bffffffffffffffffffffffff16928201929092528291610be25750604080518082019091526097546001600160a01b0381168252600160a01b90046bffffffffffffffffffffffff1660208201525b602081015160009061271090610c06906bffffffffffffffffffffffff1687614338565b610c10919061434f565b91519350909150505b9250929050565b6109ce838383336125c5565b60606000825167ffffffffffffffff811115610c4a57610c4a613cac565b604051908082528060200260200182016040528015610c7d57816020015b6060815260200190600190039081610c685790505b50905060005b8351811015610d38576000848281518110610ca057610ca0614371565b602090810291909101810151600081815260d383526040908190205481519384018390526001600160781b03620100008204811692850192909252600160881b8104909116606084015261ffff166080830152915060a001604051602081830303815290604052838381518110610d1957610d19614371565b6020026020010181905250508080610d3090614387565b915050610c83565b5092915050565b826001600160a01b0381163314610d645760d15460ff1615610d6457610d6433612471565b600082815260d3602052604090205461ffff1615610db05760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b610b5d8484846129a0565b600054610100900460ff1615808015610ddb5750600054600160ff909116105b80610df55750303b158015610df5575060005460ff166001145b610e675760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161093e565b6000805460ff191660011790558015610e8a576000805461ff0019166101001790555b610efe6040518060400160405280600a81526020017f54686520506c61677565000000000000000000000000000000000000000000008152506040518060400160405280600481526020017f46524f47000000000000000000000000000000000000000000000000000000008152506129bb565b610f06612a30565b610f0e612aa3565b610f16612b0e565b60d1805460ff19166001179055610f35610f2d3390565b6103e861230d565b600260d05560d280546001600160a01b0319166001600160a01b038681169190911790915560d1805474ffffffffffffffffffffffffffffffffffffffff0019166101009286169290920291909117905560ce610f9283826143ee565b508015610b5d576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b610fe66122b3565b60ce61084082826143ee565b610840828233612b2d565b60008060cb838154811061101357611013614371565b6000918252602090912001546001600160a01b03169050806108285760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e0000000000000000000000000000000000000000000000606482015260840161093e565b60606000825167ffffffffffffffff8111156110bb576110bb613cac565b6040519080825280602002602001820160405280156110e4578160200160208202803683370190505b50905060005b8351811015610d385761112784828151811061110857611108614371565b6020026020010151600090815260d3602052604090205461ffff161590565b1582828151811061113a5761113a614371565b911515602092830291909101909101528061115481614387565b9150506110ea565b60ce8054611169906142cb565b80601f0160208091040260200160405190810160405280929190818152602001828054611195906142cb565b80156111e25780601f106111b7576101008083540402835291602001916111e2565b820191906000526020600020905b8154815290600101906020018083116111c557829003601f168201915b505050505081565b60006001600160a01b0382166112685760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f206164647265737300000000000000000000000000000000000000000000606482015260840161093e565b60cb54600090815b818110156112c65760cb818154811061128b5761128b614371565b6000918252602090912001546001600160a01b03908116908616036112b6576112b383614387565b92505b6112bf81614387565b9050611270565b50909392505050565b6112d76122b3565b6112e16000612c21565b565b6112eb6122b3565b60d180546001600160a01b039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b6113286122b3565b6113323382612c73565b50565b6060600080611343846111ea565b905060008167ffffffffffffffff81111561136057611360613cac565b604051908082528060200260200182016040528015611389578160200160208202803683370190505b50905060005b8284146113f35761139f81612427565b156113eb57856001600160a01b03166113b782610ffd565b6001600160a01b0316036113eb57808285806001019650815181106113de576113de614371565b6020026020010181815250505b60010161138f565b50949350505050565b6114046122b3565b60d280546001600160a01b0319166001600160a01b0392909216919091179055565b60005b81811015610b5d57600083838381811061144557611445614371565b9050602002013590506114553390565b6001600160a01b031661146782610ffd565b6001600160a01b0316146114a65760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b6114c133868360405180602001604052806000815250612d92565b50600101611429565b606060ca8054610853906142cb565b6114e16122b3565b600081815260d5602052604090205460ff1661153f5760405162461bcd60e51b815260206004820152600660248201527f2176616c69640000000000000000000000000000000000000000000000000000604482015260640161093e565b60d055565b61154c6122b3565b60005b82811015610b5d57600084848381811061156b5761156b614371565b9050602002013590508260d36000838152602001908152602001600020818161159491906144d7565b9050505080806115a390614387565b91505061154f565b60608167ffffffffffffffff8111156115c6576115c6613cac565b6040519080825280602002602001820160405280156115ef578160200160208202803683370190505b50905060005b82811015610d385761161e84848381811061161257611612614371565b90506020020135611bdf565b82828151811061163057611630614371565b60209081029190910101528061164581614387565b9150506115f5565b6116556122b3565b600082815260d460205260409020819061166f82826146f2565b505050600090815260d560205260409020805460ff19166001179055565b8160d15460ff16156116a2576116a281612471565b6109ce8383612e1b565b60d4602052600090815260409020805481906116c7906142cb565b80601f01602080910402602001604051908101604052809291908181526020018280546116f3906142cb565b80156117405780601f1061171557610100808354040283529160200191611740565b820191906000526020600020905b81548152906001019060200180831161172357829003601f168201915b50505050600383015460048401546005909401549293909260ff909116915084565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa1580156117d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117fb9190614305565b90508061184a5760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b611856868686866125c5565b505050505050565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa1580156118d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f79190614305565b9050806119465760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b610ada858585612b2d565b6119596122b3565b60d1805460ff1916911515919091179055565b836001600160a01b03811633146119915760d15460ff16156119915761199133612471565b600083815260d3602052604090205461ffff16156119dd5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b610ada85858585612edf565b6119f16122b3565b60cf548590600090611a049083906147bb565b9050848214611a1257600080fd5b612af8811115611a2157600080fd5b60008060005b84811015611b1d578a8a82818110611a4157611a41614371565b905060200201359250888882818110611a5c57611a5c614371565b9050602002016020810190611a719190613f40565b9150611a7d8284612f67565b868682818110611a8f57611a8f614371565b611aa592602060609092020190810191506147ce565b61ffff16600103611b1557868682818110611ac257611ac2614371565b90506060020160d360008581526020019081526020016000208181611ae791906144d7565b505060405183907f227a473b70d2f893cc7659219575c030a63b5743024fe1e0c1a680e708b1525a90600090a25b600101611a27565b50505060cf5550505050505050565b6060611b3782612427565b611b835760405162461bcd60e51b815260206004820152600760248201527f2165786973747300000000000000000000000000000000000000000000000000604482015260640161093e565b600060ce8054611b92906142cb565b905011611bae5760405180602001604052806000815250610828565b60ce611bb98361308f565b604051602001611bca9291906147eb565b60405160208183030381529060405292915050565b600081815260d360205260408120546201000090046001600160781b031680611c4a5760405162461bcd60e51b815260206004820152600760248201527f217374616b656400000000000000000000000000000000000000000000000000604482015260640161093e565b600083815260d3602090815260408083205461ffff811680855260d49093529083209192600160881b9091046001600160781b03169190611c8b8542614872565b905060008260030154826001600160781b0316611ca8919061434f565b90506000611e31846040518060c0016040529081600082018054611ccb906142cb565b80601f0160208091040260200160405190810160405280929190818152602001828054611cf7906142cb565b8015611d445780601f10611d1957610100808354040283529160200191611d44565b820191906000526020600020905b815481529060010190602001808311611d2757829003601f168201915b5050505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015611d9c57602002820191906000526020600020905b815481526020019060010190808311611d88575b5050505050815260200160028201805480602002602001604051908101604052809291908181526020018280548015611df457602002820191906000526020600020905b815481526020019060010190808311611de0575b505050918352505060038201546020820152600482015460ff1615156040820152600590910154606090910152836001600160781b03861661312f565b9050866001600160781b0316856001600160781b03161115612011576000611e598887614872565b6001600160781b031690506000856003015482611e76919061434f565b90506000611fff876040518060c0016040529081600082018054611e99906142cb565b80601f0160208091040260200160405190810160405280929190818152602001828054611ec5906142cb565b8015611f125780601f10611ee757610100808354040283529160200191611f12565b820191906000526020600020905b815481529060010190602001808311611ef557829003601f168201915b5050505050815260200160018201805480602002602001604051908101604052809291908181526020018280548015611f6a57602002820191906000526020600020905b815481526020019060010190808311611f56575b5050505050815260200160028201805480602002602001604051908101604052809291908181526020018280548015611fc257602002820191906000526020600020905b815481526020019060010190808311611fae575b505050918352505060038201546020820152600482015460ff1615156040820152600590910154606090910152836001600160781b03891661312f565b905061200b8185614892565b93505050505b98975050505050505050565b610840828233612774565b60d154819060009061010090046001600160a01b0316638988eea9336040516001600160e01b031960e084901b1681526001600160a01b039182166004820152908516602482015230604482015260006064820152608401602060405180830381865afa15801561209d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c19190614305565b9050806121105760405162461bcd60e51b815260206004820152601e60248201527f496e76616c69642064656c65676174652d7661756c742070616972696e670000604482015260640161093e565b610ada60d0548686866125c5565b6121266122b3565b6001600160a01b0381166121a25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161093e565b61133281612c21565b60006001600160e01b031982167f80ac58cd00000000000000000000000000000000000000000000000000000000148061220e57506001600160e01b031982167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061081957506001600160e01b031982167f780e9d630000000000000000000000000000000000000000000000000000000014806108285750610828825b60006001600160e01b031982167f2a55205a00000000000000000000000000000000000000000000000000000000148061082857507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b0319831614610828565b6033546001600160a01b031633146112e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161093e565b6127106bffffffffffffffffffffffff821611156123935760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c65507269636500000000000000000000000000000000000000000000606482015260840161093e565b6001600160a01b0382166123e95760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161093e565b604080518082019091526001600160a01b039092168083526bffffffffffffffffffffffff9091166020909201829052600160a01b90910217609755565b60cb5460009082108015610828575060006001600160a01b031660cb838154811061245457612454614371565b6000918252602090912001546001600160a01b0316141592915050565b69c617113400112233445560005230601a5280603a52600080604460166daaeb6d7670e522a718067333cd4e5afa6124ad573d6000803e3d6000fd5b6000603a5250565b60006124c082610ffd565b9050806001600160a01b0316836001600160a01b03160361252d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161093e565b336001600160a01b0382161480612549575061254981336107cd565b6125bb5760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161093e565b6109ce8383613324565b6001841180156125e35750600084815260d5602052604090205460ff165b61262f5760405162461bcd60e51b815260206004820152600760248201527f21636f6e66696700000000000000000000000000000000000000000000000000604482015260640161093e565b60005b82811015610ada57600084848381811061264e5761264e614371565b90506020020135905061267281600090815260d3602052604090205461ffff161590565b6126aa5760405162461bcd60e51b8152602060048201526009602482015268085d5b9b1bd8dad95960ba1b604482015260640161093e565b826001600160a01b03166126bd82610ffd565b6001600160a01b0316146126fc5760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b600081815260d3602052604080822080546001600160781b034216620100000270ffffffffffffffffffffffffffffffffff1990911661ffff8b16171790555182917f227a473b70d2f893cc7659219575c030a63b5743024fe1e0c1a680e708b1525a91a2508061276c81614387565b915050612632565b61277f838383612b2d565b6000805b83811015610ada57600085858381811061279f5761279f614371565b905060200201359050836001600160a01b03166127bb82610ffd565b6001600160a01b0316146127fa5760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b600081815260d3602090815260408083205461ffff8116845260d49092529091206005810154909450620100009091046001600160781b031690156128a55760006128458242614872565b90508460050154816001600160781b0316116128a35760405162461bcd60e51b815260206004820152600860248201527f216d696e696d756d000000000000000000000000000000000000000000000000604482015260640161093e565b505b600082815260d36020526040808220919091555182907f529f395783b74aeb16a02d6320297d8415f7312f2ff2c398cd0d70e30bebc6c9906128fc906001600160781b038516904290918252602082015260400190565b60405180910390a25050808061291190614387565b915050612783565b6129233382613392565b6129955760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161093e565b6109ce83838361347c565b6109ce8383836040518060200160405280600081525061196c565b600054610100900460ff16612a265760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b61084082826135ff565b600054610100900460ff16612a9b5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b6112e16136c8565b600054610100900460ff166112e15760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b6112e1733cc6cdda760b79bafa08df41ecfa224f810dceb6600161373c565b6000805b83811015612bff576000858583818110612b4d57612b4d614371565b905060200201359050836001600160a01b0316612b6982610ffd565b6001600160a01b031614612ba85760405162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015260640161093e565b612bb181611bdf565b600091825260d36020526040909120805470ffffffffffffffffffffffffffffffffff16600160881b426001600160781b031602179055919091019080612bf781614387565b915050612b31565b508015610b5d57610b5d82612c1c83670de0b6b3a7640000614338565b612c73565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60d2546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cf991906148a5565b90508082116109ce5760d2546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038581166004830152602482018590529091169063a9059cbb906044016020604051808303816000875af1158015612d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5d9190614305565b612d9d84848461347c565b612da9848484846137b1565b610b5d5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161093e565b336001600160a01b03831603612e735760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161093e565b33600081815260cd602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b612ee93383613392565b612f5b5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f766564000000000000000000000000000000606482015260840161093e565b610b5d84848484612d92565b6001600160a01b038216612fbd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161093e565b612fc681612427565b156130135760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161093e565b60cb805460018101825560009182527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b0319166001600160a01b0385169081179091556040518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060600061309c83613908565b600101905060008167ffffffffffffffff8111156130bc576130bc613cac565b6040519080825280601f01601f1916602001820160405280156130e6576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846130f057509392505050565b60408301515160009081908180805b8860400151858151811061315457613154614371565b60200260200101519250878310156131b9576131708284614892565b8960200151868151811061318657613186614371565b60200260200101516131989190614338565b6131a290826147bb565b83925090506131b26001866147bb565b94506131be565b600093505b83851061313e57841580156131d35750600088115b156132125787896020015186815181106131ef576131ef614371565b60200260200101516132019190614338565b61320b90826147bb565b9050613259565b87821015613259576132248289614892565b8960200151868151811061323a5761323a614371565b602002602001015161324c9190614338565b61325690826147bb565b90505b60008960a0015111801561327057508860a0015187115b801561327e57508860800151155b801561328957508288115b15613316576000896020015186815181106132a6576132a6614371565b6020026020010151905060008a602001516001886132c49190614892565b815181106132d4576132d4614371565b6020026020010151905084816132ea9190614338565b6132f4868c614892565b6132fe9084614338565b61330891906147bb565b97505050505050505061331d565b9450505050505b9392505050565b600081815260cc6020526040902080546001600160a01b0319166001600160a01b038416908117909155819061335982610ffd565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061339d82612427565b6133fe5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161093e565b600061340983610ffd565b9050806001600160a01b0316846001600160a01b031614806134445750836001600160a01b0316613439846108d6565b6001600160a01b0316145b8061347457506001600160a01b03808216600090815260cd602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661348f82610ffd565b6001600160a01b03161461350b5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e0000000000000000000000000000000000000000000000606482015260840161093e565b6001600160a01b0382166135865760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161093e565b613591600082613324565b8160cb82815481106135a5576135a5614371565b6000918252602082200180546001600160a01b0319166001600160a01b03938416179055604051839285811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9190a4505050565b600054610100900460ff1661366a5760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b60c961367683826143ee565b5060ca61368382826143ee565b505060cb80546001810182556000919091527fa7ce836d032b2bf62b7e2097a8e0a6d8aeb35405ad15271e96d3b0188a1d06fb0180546001600160a01b031916905550565b600054610100900460ff166137335760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b606482015260840161093e565b6112e133612c21565b6001600160a01b0390911690637d3e3dbe8161376957826137625750634420e486613769565b5063a0af29035b8060e01b60005230600452826024526004600060446000806daaeb6d7670e522a718067333cd4e5af16137a7578060005160e01c036137a757600080fd5b5060006024525050565b60006001600160a01b0384163b156138fd57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906137f59033908990889088906004016148be565b6020604051808303816000875af1925050508015613830575060408051601f3d908101601f1916820190925261382d918101906148fa565b60015b6138e3573d80801561385e576040519150601f19603f3d011682016040523d82523d6000602084013e613863565b606091505b5080516000036138db5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e7465720000000000000000000000000000606482015260840161093e565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050613474565b506001949350505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613951577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061397d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061399b57662386f26fc10000830492506010015b6305f5e10083106139b3576305f5e100830492506008015b61271083106139c757612710830492506004015b606483106139d9576064830492506002015b600a83106108285760010192915050565b6001600160e01b03198116811461133257600080fd5b600060208284031215613a1257600080fd5b813561331d816139ea565b80356001600160a01b0381168114613a3457600080fd5b919050565b60008060408385031215613a4c57600080fd5b613a5583613a1d565b915060208301356bffffffffffffffffffffffff81168114613a7657600080fd5b809150509250929050565b60005b83811015613a9c578181015183820152602001613a84565b50506000910152565b60008151808452613abd816020860160208601613a81565b601f01601f19169290920160200192915050565b60208152600061331d6020830184613aa5565b600060208284031215613af657600080fd5b5035919050565b60008060408385031215613b1057600080fd5b613b1983613a1d565b946020939093013593505050565b60008083601f840112613b3957600080fd5b50813567ffffffffffffffff811115613b5157600080fd5b6020830191508360208260051b8501011115610c1957600080fd5b60008060208385031215613b7f57600080fd5b823567ffffffffffffffff811115613b9657600080fd5b613ba285828601613b27565b90969095509350505050565b600080600060408486031215613bc357600080fd5b833567ffffffffffffffff811115613bda57600080fd5b613be686828701613b27565b9094509250613bf9905060208501613a1d565b90509250925092565b600080600060608486031215613c1757600080fd5b613c2084613a1d565b9250613c2e60208501613a1d565b9150604084013590509250925092565b60008060408385031215613c5157600080fd5b50508035926020909101359150565b600080600060408486031215613c7557600080fd5b83359250602084013567ffffffffffffffff811115613c9357600080fd5b613c9f86828701613b27565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715613ceb57613ceb613cac565b604052919050565b60006020808385031215613d0657600080fd5b823567ffffffffffffffff80821115613d1e57600080fd5b818501915085601f830112613d3257600080fd5b813581811115613d4457613d44613cac565b8060051b9150613d55848301613cc2565b8181529183018401918481019088841115613d6f57600080fd5b938501935b8385101561201157843582529385019390850190613d74565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613de257603f19888603018452613dd0858351613aa5565b94509285019290850190600101613db4565b5092979650505050505050565b600067ffffffffffffffff831115613e0957613e09613cac565b613e1c601f8401601f1916602001613cc2565b9050828152838383011115613e3057600080fd5b828260208301376000602084830101529392505050565b600082601f830112613e5857600080fd5b61331d83833560208501613def565b600080600060608486031215613e7c57600080fd5b613e8584613a1d565b9250613e9360208501613a1d565b9150604084013567ffffffffffffffff811115613eaf57600080fd5b613ebb86828701613e47565b9150509250925092565b600060208284031215613ed757600080fd5b813567ffffffffffffffff811115613eee57600080fd5b61347484828501613e47565b6020808252825182820181905260009190848201906040850190845b81811015613f34578351151583529284019291840191600101613f16565b50909695505050505050565b600060208284031215613f5257600080fd5b61331d82613a1d565b6020808252825182820181905260009190848201906040850190845b81811015613f3457835183529284019291840191600101613f77565b600080600060408486031215613fa857600080fd5b613fb184613a1d565b9250602084013567ffffffffffffffff811115613c9357600080fd5b60008060008385036080811215613fe357600080fd5b843567ffffffffffffffff811115613ffa57600080fd5b61400687828801613b27565b9095509350506060601f198201121561401e57600080fd5b506020840190509250925092565b6000806040838503121561403f57600080fd5b82359150602083013567ffffffffffffffff81111561405d57600080fd5b830160c08186031215613a7657600080fd5b801515811461133257600080fd5b6000806040838503121561409057600080fd5b61409983613a1d565b91506020830135613a768161406f565b6080815260006140bc6080830187613aa5565b6020830195909552509115156040830152606090910152919050565b600080600080606085870312156140ee57600080fd5b84359350602085013567ffffffffffffffff81111561410c57600080fd5b61411887828801613b27565b909450925061412b905060408601613a1d565b905092959194509250565b60006020828403121561414857600080fd5b813561331d8161406f565b6000806000806080858703121561416957600080fd5b61417285613a1d565b935061418060208601613a1d565b925060408501359150606085013567ffffffffffffffff8111156141a357600080fd5b8501601f810187136141b457600080fd5b6141c387823560208401613def565b91505092959194509250565b600080600080600080606087890312156141e857600080fd5b863567ffffffffffffffff8082111561420057600080fd5b61420c8a838b01613b27565b9098509650602089013591508082111561422557600080fd5b6142318a838b01613b27565b9096509450604089013591508082111561424a57600080fd5b818901915089601f83011261425e57600080fd5b81358181111561426d57600080fd5b8a602060608302850101111561428257600080fd5b6020830194508093505050509295509295509295565b600080604083850312156142ab57600080fd5b6142b483613a1d565b91506142c260208401613a1d565b90509250929050565b600181811c908216806142df57607f821691505b6020821081036142ff57634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561431757600080fd5b815161331d8161406f565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761082857610828614322565b60008261436c57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b60006001820161439957614399614322565b5060010190565b5b8181101561084057600081556001016143a1565b601f8211156109ce57806000526020600020601f840160051c810160208510156143dc5750805b610ada601f850160051c8301826143a0565b815167ffffffffffffffff81111561440857614408613cac565b61441c8161441684546142cb565b846143b5565b602080601f83116001811461445157600084156144395750858301515b600019600386901b1c1916600185901b178555611856565b600085815260208120601f198616915b8281101561448057888601518255948401946001909101908401614461565b508582101561449e5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61ffff8116811461133257600080fd5b600081356001600160781b038116811461082857600080fd5b81356144e2816144ae565b61ffff8116905081548161ffff19821617835570ffffffffffffffffffffffffffffff0000614513602086016144be565b60101b1670ffffffffffffffffffffffffffffffffff1981848285161717855580614540604088016144be565b60881b16848317178555505050505050565b67ffffffffffffffff83111561456a5761456a613cac565b61457e8361457883546142cb565b836143b5565b6000601f8411600181146145b2576000851561459a5750838201355b600019600387901b1c1916600186901b178355610ada565b600083815260209020601f19861690835b828110156145e357868501358255602094850194600190920191016145c3565b50868210156146005760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b6000808335601e1984360301811261462957600080fd5b83018035915067ffffffffffffffff82111561464457600080fd5b6020019150600581901b3603821315610c1957600080fd5b67ffffffffffffffff83111561467457614674613cac565b6801000000000000000083111561468d5761468d613cac565b8054838255808410156146b3578160005260206000206146b18282018683016143a0565b505b50818160005260208060002060005b868110156146dc57833582820155928201926001016146c2565b50505050505050565b600081356108288161406f565b8135601e1983360301811261470657600080fd5b8201803567ffffffffffffffff81111561471f57600080fd5b60208201915080360382131561473457600080fd5b61473f818385614552565b505061474e6020830183614612565b61475c81836001860161465c565b505061476b6040830183614612565b61477981836002860161465c565b5050606082013560038201556147ad614794608084016146e5565b6004830160ff1981541660ff8315151681178255505050565b60a082013560058201555050565b8082018082111561082857610828614322565b6000602082840312156147e057600080fd5b813561331d816144ae565b60008084546147f9816142cb565b60018281168015614811576001811461482657614855565b60ff1984168752821515830287019450614855565b8860005260208060002060005b8581101561484c5781548a820152908401908201614833565b50505082870194505b505050508351614869818360208801613a81565b01949350505050565b6001600160781b03828116828216039080821115610d3857610d38614322565b8181038181111561082857610828614322565b6000602082840312156148b757600080fd5b5051919050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526148f06080830184613aa5565b9695505050505050565b60006020828403121561490c57600080fd5b815161331d816139ea56fea26469706673582212208aa65f1082630c6215b1df281244e08bcf72a7cdcc2c436f2d30d3daa279b5c364736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.