Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,031 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Quest Rewa... | 21506517 | 49 days ago | IN | 0 ETH | 0.0004075 | ||||
Claim Quest Rewa... | 21492777 | 51 days ago | IN | 0 ETH | 0.00067596 | ||||
Claim Quest Rewa... | 21492070 | 51 days ago | IN | 0 ETH | 0.00050588 | ||||
Claim Quest Rewa... | 21491770 | 51 days ago | IN | 0 ETH | 0.0005152 | ||||
Claim Quest Rewa... | 21470811 | 54 days ago | IN | 0 ETH | 0.00051404 | ||||
Claim Quest Rewa... | 21455744 | 56 days ago | IN | 0 ETH | 0.00064953 | ||||
Claim Quest Rewa... | 21455735 | 56 days ago | IN | 0 ETH | 0.00059267 | ||||
Claim Quest Rewa... | 21427907 | 60 days ago | IN | 0 ETH | 0.00136605 | ||||
Claim Quest Rewa... | 21427798 | 60 days ago | IN | 0 ETH | 0.00124851 | ||||
Claim Quest Rewa... | 21414414 | 62 days ago | IN | 0 ETH | 0.00141891 | ||||
Claim Quest Rewa... | 21414198 | 62 days ago | IN | 0 ETH | 0.00109477 | ||||
Claim Quest Rewa... | 21412680 | 63 days ago | IN | 0 ETH | 0.00121858 | ||||
Claim Quest Rewa... | 21409265 | 63 days ago | IN | 0 ETH | 0.00137491 | ||||
Claim Quest Rewa... | 21399906 | 64 days ago | IN | 0 ETH | 0.00107682 | ||||
Claim Quest Rewa... | 21398186 | 65 days ago | IN | 0 ETH | 0.00125115 | ||||
Claim Quest Rewa... | 21392226 | 65 days ago | IN | 0 ETH | 0.00106661 | ||||
Claim Quest Rewa... | 21390755 | 66 days ago | IN | 0 ETH | 0.00159335 | ||||
Claim Quest Rewa... | 21377405 | 67 days ago | IN | 0 ETH | 0.00124551 | ||||
Claim Quest Rewa... | 21369746 | 69 days ago | IN | 0 ETH | 0.00168535 | ||||
Claim Quest Rewa... | 21362174 | 70 days ago | IN | 0 ETH | 0.00118571 | ||||
Claim Quest Rewa... | 21360513 | 70 days ago | IN | 0 ETH | 0.00140073 | ||||
Claim Quest Rewa... | 21360433 | 70 days ago | IN | 0 ETH | 0.00139453 | ||||
Claim Quest Rewa... | 21359788 | 70 days ago | IN | 0 ETH | 0.00159972 | ||||
Claim Quest Rewa... | 21359539 | 70 days ago | IN | 0 ETH | 0.00140233 | ||||
Claim Quest Rewa... | 21359524 | 70 days ago | IN | 0 ETH | 0.00128219 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
NiftyIslandQuest
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; import {ERC721Holder} from "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import {RewardManager} from "./lib/RewardManager.sol"; import {Quest, RewardDeposit, RewardDepositBatchERC1155} from "./lib/Structs.sol"; import {RewardItemType} from "./lib/Enums.sol"; /** * @title Nifty Island Quest * @notice Allows creators to create quests with rewards, and participants to claim rewards from quests. * @custom:version v1.0.0 */ contract NiftyIslandQuest is RewardManager, ReentrancyGuard, Pausable, Ownable2Step, ERC721Holder, ERC1155Holder { mapping(uint256 => Quest) public quests; mapping(address => bool) public approvedCallers; uint256 public constant MINIMUM_REWARD_EXTRACTION_DELAY = 1 days; uint256 public constant MAXIMUM_REWARD_EXTRACTION_DELAY = 180 days; modifier onlyApprovedCallers() { if (!approvedCallers[msg.sender]) { revert UnapprovedCaller(); } _; } constructor(uint256 _rewardExtractionDelay) { rewardExtractionDelay = _rewardExtractionDelay; } /** * @notice Invoked by quest creator, who provides a trusted 'signer' address. * @dev Responsible for creating a Quest struct and storing it in the quests mapping. * Responsible for transferring rewards from `msg.sender` into the contract. * Responsible for emitting the QuestCreatedWithRewards event. * @param questId id for the created quest * @param startTime timestamp after which claiming will be enabled * @param endTime timestamp marking the end of the quest * @param signer trusted 'signer' address for this quest * @param rewardDeposits array of RewardDeposit structs specifying the rewards for this quest * @param batchERC1155RewardDeposits array of RewardDepositBatchERC1155 structs specifying the ERC1155 rewards for this quest */ function createQuestWithRewards( uint256 questId, uint256 startTime, uint256 endTime, address signer, RewardDeposit[] calldata rewardDeposits, RewardDepositBatchERC1155[] calldata batchERC1155RewardDeposits ) external payable nonReentrant whenNotPaused onlyApprovedCallers { uint256 rewardsLength = rewardDeposits.length; uint256 batchERC1155RewardsLength = batchERC1155RewardDeposits.length; if (rewardsLength == 0 && batchERC1155RewardsLength == 0) { revert RewardDepositArraysEmpty(); } Quest storage quest = quests[questId]; _validateQuestCreation(quest.creator, startTime, endTime); quest.startTime = startTime; quest.endTime = endTime; quest.creator = msg.sender; quest.signer = signer; uint256 nativeRewardsBalance = msg.value; // Transfer rewards from `msg.sender` into the contract for (uint256 i = 0; i < rewardsLength; ) { RewardDeposit calldata deposit = rewardDeposits[i]; // Special case for native rewards if (deposit.itemType == RewardItemType.NATIVE) { if (nativeRewardsBalance < deposit.total) { revert InsufficientNativeRewardBalance(nativeRewardsBalance, deposit.total); } unchecked { nativeRewardsBalance -= deposit.total; } } _handleQuestRewardDeposit(deposit, questId); unchecked { ++i; } } // Transfer batch Rewards from `msg.sender` into the contract. // Used for gas efficiency with ERC1155 reawards. for (uint256 i = 0; i < batchERC1155RewardsLength; ) { _handleBatchERC1155QuestRewardDeposit(batchERC1155RewardDeposits[i], questId); unchecked { ++i; } } if (nativeRewardsBalance > 0) { revert ExcessNativeRewardBalance(nativeRewardsBalance); } emit QuestCreatedWithRewards(questId, startTime, endTime, msg.sender, signer); } /** * @notice Invoked by quest participant, who provides a signature from the trusted 'signer' address. * Can be invoked from the quest start time until `rewardExtractionDelay` seconds after the quest end time. * @dev Responsible for validating the quest reward claim. * Responsible for validating the signature. * Responsible for transfering the quest reward to the participant. * Responsible for emitting the QuestRewardClaimed event. * @param questId id of quest to claim reward from * @param rewardId id of reward to claim * @param claimUId unique identifier for this claim to avoid double-spend using the same siganture * @param signature signature from the trusted 'signer' address */ function claimQuestReward( uint256 questId, uint256 rewardId, uint256 claimUId, bytes calldata signature ) external nonReentrant whenNotPaused { Quest storage quest = quests[questId]; _validateQuestRewardClaim(quest.startTime, quest.endTime); _validateQuestRewardSignature(questId, rewardId, claimUId, quest.signer, signature); _handleQuestRewardClaim(questId, rewardId, claimUId); emit QuestRewardClaimed(questId, rewardId, claimUId, msg.sender); } /** * @notice Invoked by quest participant, who provides a signature from the trusted 'signer' address. * Can be invoked from the quest start time until `rewardExtractionDelay` seconds after the quest end time. * Used to claim multiple rewards from a quest simultaneously. * @param questId id of quest to claim reward from * @param rewardIds id of rewards to claim * @param claimUIds unique identifiers for these claims to avoid double-spend using the same siganture * @param signature signature from the trusted 'signer' address */ function claimQuestRewardsBatch( uint256 questId, uint256[] calldata rewardIds, uint256[] calldata claimUIds, bytes calldata signature ) external nonReentrant whenNotPaused { uint256 totalRewards = rewardIds.length; if (totalRewards != claimUIds.length) { revert ArrayLengthMismatch(); } Quest storage quest = quests[questId]; _validateQuestRewardClaim(quest.startTime, quest.endTime); _validateQuestRewardsBatchSignature(questId, rewardIds, claimUIds, quest.signer, signature); for (uint256 i = 0; i < totalRewards; ) { _handleQuestRewardClaim(questId, rewardIds[i], claimUIds[i]); unchecked { ++i; } } emit QuestRewardsClaimed(questId, rewardIds, claimUIds, msg.sender); } /** * @notice Invoked by quest creator. * Can be invoked only before the quest start time or after `rewardExtractionDelay` seconds after the quest end time. * Used to extract quest rewards that were not claimed by quest participants, and return them to the creator. * @dev Responsible for validating the quest reward extraction. * Responsible for transfering remaining quest rewards to the creator. * @param questId id of the quest to extract rewards from * @param rewardIds ids of rewards to extract */ function extractQuestRewards(uint256 questId, uint256[] calldata rewardIds) external nonReentrant { Quest storage quest = quests[questId]; _validateQuestRewardExtraction(quest.startTime, quest.endTime, quest.creator); _handleQuestRewardExtraction(questId, rewardIds); } /** * @notice Invoked by quest creator. * Can be invoked only before the quest start time or after `rewardExtractionDelay` seconds after the quest end time. * Used to extract unclaimed quest rewards from multiple quests simultaneously. * @param questIds ids of quests to extract rewards from * @param rewardsBatched array of arrays of reward ids to extract */ function extractQuestRewardsBatch( uint256[] calldata questIds, uint256[][] calldata rewardsBatched ) external nonReentrant { uint256 questIdsLength = questIds.length; if (questIdsLength != rewardsBatched.length) { revert ArrayLengthMismatch(); } for (uint256 i = 0; i < questIdsLength; ) { uint256 questId = questIds[i]; Quest storage quest = quests[questId]; _validateQuestRewardExtraction(quest.startTime, quest.endTime, quest.creator); _handleQuestRewardExtraction(questId, rewardsBatched[i]); unchecked { ++i; } } } function pause() external onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } function renounceOwnership() public view override onlyOwner { revert OwnerCannotRenounceOwnership(); } /** * @dev Allows owner to modify the reward extraction delay. */ function setRewardExtractionDelay(uint256 _newDelay) external onlyOwner { if (_newDelay < MINIMUM_REWARD_EXTRACTION_DELAY || _newDelay > MAXIMUM_REWARD_EXTRACTION_DELAY) { revert InvalidRewardExtractionDelay( _newDelay, MINIMUM_REWARD_EXTRACTION_DELAY, MAXIMUM_REWARD_EXTRACTION_DELAY ); } rewardExtractionDelay = _newDelay; emit RewardExtractionDelayUpdated(_newDelay); } /** * @dev Allows owner to modify the state of approved callers. */ function setApprovedCallers(address[] calldata _addresses, bool _enabled) external onlyOwner { uint256 addressesLength = _addresses.length; for (uint256 i = 0; i < addressesLength; ) { approvedCallers[_addresses[i]] = _enabled; unchecked { ++i; } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.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 Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides 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} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. * * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface 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 // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @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.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 IERC721Receiver { /** * @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.9.0) (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) { // 32 is the length in bytes of hash, // enforced by the type signature above /// @solidity memory-safe-assembly assembly { mstore(0x00, "\x19Ethereum Signed Message:\n32") mstore(0x1c, hash) message := keccak256(0x00, 0x3c) } } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) { /// @solidity memory-safe-assembly assembly { let ptr := mload(0x40) mstore(ptr, "\x19\x01") mstore(add(ptr, 0x02), domainSeparator) mstore(add(ptr, 0x22), structHash) data := keccak256(ptr, 0x42) } } /** * @dev Returns an Ethereum Signed Data with intended validator, created from a * `validator` and `data` according to the version 0 of EIP-191. * * See {recover}. */ function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x00", validator, data)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// 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 IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { 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 = Math.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 `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; enum RewardItemType { NATIVE, ERC20, ERC721, ERC1155 }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {RewardItemType} from "../Enums.sol"; import {Reward, RewardDeposit} from "../Structs.sol"; interface IErrorsAndEvents { /** * @dev Revert with an error when the quest has expired. */ error QuestExpired(); /** * @dev Revert with an error when the quest is active. */ error QuestActive(); /** * @dev Revert with an error when the quest is inactive. */ error QuestInactive(); /** * @dev Revert with an error when the quest exists. */ error QuestExists(); /** * @dev Revert with an error when a reward has already been deposited. */ error QuestRewardExists(uint256 rewardId); /** * @dev Revert with an error when the quest reward has already been claimed. */ error QuestRewardAlreadyClaimed(uint256 rewardId, uint256 uid); /** * @dev Revert with an error when the total and or amount per reward are invalid. */ error QuestRewardAmountInvalid(uint256 rewardId, uint256 total, uint256 amountPerReward); /** * @dev Revert with an error if the reward amount is excessive or insufficient. */ error QuestRewardPrecisionInvalid(uint256 rewardId, uint256 amountPerReward, uint256 total); /** * @dev Revert with an error when the reward has no remaining balance. */ error QuestRewardDepleted(uint256 rewardId); /** * @dev Revert with an error when the reward has no remaining balance. */ error QuestHasNoRewards(uint256 questId); /** * @dev Revert with an error when the reward is not part of the quest. */ error QuestRewardNotPartOfQuest(uint256 questId, uint256 rewardId); /** * @dev Revert with an error if the designated quest signer * does not match the recovered address. */ error QuestSignerInvalid(address signer, address recovered); /** * @dev Revert with an error if the quest creator does not match the caller. */ error QuestCreatorInvalid(address creator, address caller); /** * @dev Revert with an error if the rewardDeposits and batchERC1155RewardDeposits arrays are empty. */ error RewardDepositArraysEmpty(); /** * @dev Revert with an error if the rewardIds for a batchERC1155RewardDeposit is empty. */ error BatchERC1155RewardDepositEmpty(); /** * @dev Revert with an error if the rewards array is empty. */ error RewardsArrayEmpty(); /** * @dev Revert with an error if the start time is invalid. */ error InvalidQuestStartTime(uint256 startTime, uint256 endTime); /** * @dev Revert with an error if the end time is invalid. */ error InvalidQuestEndTime(uint256 endTime, uint256 blockTimestamp); /** * @dev Revert with an error if the quest duration is invalid. */ error InvalidQuestDuration(uint256 startTime, uint256 endTime); /** * @dev Revert with an error if the contract address is not a valid contract. */ error InvalidContract(address token); /** * @dev Revert with an error if the transfer returns a bad value. */ error InvalidERC20TransferReturnValue(address token, address from, address to, uint256 amount); /** * @dev Revert with an error if the item type is invalid. */ error InvalidRewardItemType(RewardItemType itemType); /** * @dev Revert with an error if the token transfer fails. */ error TokenTransferFailed(address token, address from, address to, uint256 tokenId, uint256 amount); /** * @dev Revert with an error if the native value is insufficient. */ error InsufficientNativeRewardBalance(uint256 balance, uint256 amount); /** * @dev Revert with an error if there is a remaining native value. */ error ExcessNativeRewardBalance(uint256 balance); /** * @dev Revert with an error if the length of n arrays are not equal. */ error ArrayLengthMismatch(); /** * @dev Emitted when a reward extraction delay is invalid. */ error InvalidRewardExtractionDelay(uint256 delay, uint256 minimumDelay, uint256 maximumDelay); /** * @dev Revert with an error if the owner attempts to renounce their ownership. */ error OwnerCannotRenounceOwnership(); /** * @dev Revert with an error when the caller is not an approved caller. */ error UnapprovedCaller(); /** * @dev Emitted when a quest is created with a batch of rewards. */ event QuestCreatedWithRewards( uint256 indexed questId, uint256 startTime, uint256 endTime, address creator, address signer ); /** * @dev Emitted when the quest creator extracts the remaining rewards. */ event QuestRewardsExtracted(uint256 indexed questId, address creator); /** * @dev Emitted when a quest reward is claimed. */ event QuestRewardClaimed(uint256 indexed questId, uint256 rewardId, uint256 claimUId, address claimer); /** * @dev Emitted when quest rewards are claimed. */ event QuestRewardsClaimed(uint256 indexed questId, uint256[] rewardIds, uint256[] claimUIds, address claimer); /** * @dev Emitted when the reward extraction delay is updated. */ event RewardExtractionDelayUpdated(uint256 _rewardExtractionDelay); }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {TokenTransferrer} from "./TokenTransferrer.sol"; import {Validators} from "./Validators.sol"; import {Reward, RewardDeposit, RewardDepositBatchERC1155} from "./Structs.sol"; import {RewardItemType} from "./Enums.sol"; contract RewardManager is TokenTransferrer, Validators { mapping(uint256 => Reward) public rewards; mapping(uint256 => bool) public claims; function _handleQuestRewardDeposit(RewardDeposit calldata deposit, uint256 questId) internal { _validateQuestRewardDeposit(deposit); Reward storage reward = rewards[deposit.rewardId]; // amountPerReward can never become zero after being initialized if (reward.amountPerReward != 0) { revert QuestRewardExists(deposit.rewardId); } reward.tokenId = deposit.tokenId; reward.total = deposit.total; reward.amountPerReward = deposit.amountPerReward; reward.token = deposit.token; reward.itemType = deposit.itemType; reward.questId = questId; if (deposit.itemType != RewardItemType.NATIVE) { _transferQuestRewardFromCaller(deposit); } } function _handleBatchERC1155QuestRewardDeposit( RewardDepositBatchERC1155 calldata batchERC1155Deposit, uint256 questId ) internal { uint256 batchLength = batchERC1155Deposit.rewardIds.length; if (batchLength == 0) { revert BatchERC1155RewardDepositEmpty(); } if ( batchERC1155Deposit.tokenIds.length != batchLength || batchERC1155Deposit.totals.length != batchLength || batchERC1155Deposit.amountPerRewards.length != batchLength ) { revert ArrayLengthMismatch(); } for (uint256 i = 0; i < batchLength; i++) { uint256 rewardId = batchERC1155Deposit.rewardIds[i]; uint256 total = batchERC1155Deposit.totals[i]; uint256 amountPerReward = batchERC1155Deposit.amountPerRewards[i]; // Ensure that the amount per reward and the total are not zero if (amountPerReward == 0 || total == 0) { revert QuestRewardAmountInvalid(rewardId, total, amountPerReward); } // Ensure the total is an exact multiple of the amount per reward if (total % amountPerReward != 0) { revert QuestRewardPrecisionInvalid(rewardId, total, amountPerReward); } Reward storage reward = rewards[rewardId]; // amountPerReward can never become zero after being initialized if (reward.amountPerReward != 0) { revert QuestRewardExists(rewardId); } reward.tokenId = batchERC1155Deposit.tokenIds[i]; reward.total = total; reward.amountPerReward = amountPerReward; reward.token = batchERC1155Deposit.token; reward.itemType = RewardItemType.ERC1155; reward.questId = questId; } _performERC1155BatchTransfer( batchERC1155Deposit.token, msg.sender, address(this), batchERC1155Deposit.tokenIds, batchERC1155Deposit.totals ); } function _handleQuestRewardClaim(uint256 questId, uint256 rewardId, uint256 claimUId) internal { Reward storage reward = rewards[rewardId]; uint256 rewardTotal = reward.total; uint256 amountPerReward = reward.amountPerReward; if (reward.questId != questId) { revert QuestRewardNotPartOfQuest(questId, rewardId); } if (rewardTotal < amountPerReward) { revert QuestRewardDepleted(rewardId); } if (claims[claimUId]) { revert QuestRewardAlreadyClaimed(rewardId, claimUId); } reward.total = rewardTotal - amountPerReward; claims[claimUId] = true; _transferQuestRewardToCaller(reward.token, reward.tokenId, amountPerReward, reward.itemType); } function _handleQuestRewardExtraction(uint256 questId, uint256[] calldata rewardIds) internal { uint256 rewardIdsLength = rewardIds.length; if (rewardIdsLength == 0) { revert RewardsArrayEmpty(); } for (uint256 i = 0; i < rewardIdsLength; ) { Reward storage reward = rewards[rewardIds[i]]; if (reward.questId != questId) { revert QuestRewardNotPartOfQuest(questId, rewardIds[i]); } uint256 amountToTransfer = reward.total; if (amountToTransfer > 0) { reward.total = 0; _transferQuestRewardToCaller(reward.token, reward.tokenId, amountToTransfer, reward.itemType); } unchecked { ++i; } } emit QuestRewardsExtracted(questId, msg.sender); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {RewardItemType} from "./Enums.sol"; struct Quest { uint256 startTime; uint256 endTime; address creator; address signer; } struct Reward { uint256 tokenId; uint256 total; uint256 amountPerReward; uint256 questId; address token; RewardItemType itemType; } struct RewardDeposit { uint256 rewardId; uint256 tokenId; uint256 total; uint256 amountPerReward; address token; RewardItemType itemType; } struct RewardDepositBatchERC1155 { uint256[] rewardIds; uint256[] tokenIds; uint256[] totals; uint256[] amountPerRewards; address token; }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {IErrorsAndEvents} from "./interfaces/IErrorsAndEvents.sol"; import {RewardItemType} from "./Enums.sol"; import {RewardDeposit} from "./Structs.sol"; contract TokenTransferrer is IErrorsAndEvents { function _transferQuestRewardToCaller( address token, uint256 tokenId, uint256 amount, RewardItemType itemType ) internal { if (itemType == RewardItemType.NATIVE) { _performNativeTransfer(msg.sender, amount); } else if (itemType == RewardItemType.ERC20) { _performERC20Transfer(token, msg.sender, amount); } else if (itemType == RewardItemType.ERC721) { _performERC721Transfer(token, address(this), msg.sender, tokenId); } else if (itemType == RewardItemType.ERC1155) { _performERC1155Transfer(token, address(this), msg.sender, tokenId, amount); } else { revert InvalidRewardItemType(itemType); } } function _transferQuestRewardFromCaller(RewardDeposit calldata deposit) internal { if (deposit.itemType == RewardItemType.ERC20) { _performERC20TransferFrom(deposit.token, msg.sender, address(this), deposit.total); } else if (deposit.itemType == RewardItemType.ERC721) { _performERC721Transfer(deposit.token, msg.sender, address(this), deposit.tokenId); } else if (deposit.itemType == RewardItemType.ERC1155) { _performERC1155Transfer(deposit.token, msg.sender, address(this), deposit.tokenId, deposit.total); } else { revert InvalidRewardItemType(deposit.itemType); } } function _performNativeTransfer(address to, uint256 amount) private { (bool success, ) = payable(to).call{value: amount}(""); if (!success) { revert TokenTransferFailed(address(0), address(this), to, 0, amount); } } function _performERC20Transfer(address token, address to, uint256 amount) internal { SafeERC20.safeTransfer(IERC20(token), to, amount); } function _performERC20TransferFrom(address token, address from, address to, uint256 amount) internal { SafeERC20.safeTransferFrom(IERC20(token), from, to, amount); } function _performERC721Transfer(address token, address from, address to, uint256 tokenId) private { if (token.code.length == 0) { revert InvalidContract(token); } IERC721(token).transferFrom(from, to, tokenId); } function _performERC1155Transfer(address token, address from, address to, uint256 tokenId, uint256 amount) private { if (token.code.length == 0) { revert InvalidContract(token); } IERC1155(token).safeTransferFrom(from, to, tokenId, amount, ""); } function _performERC1155BatchTransfer( address token, address from, address to, uint256[] memory tokenIds, uint256[] memory amounts ) internal { if (token.code.length == 0) { revert InvalidContract(token); } IERC1155(token).safeBatchTransferFrom(from, to, tokenIds, amounts, ""); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.19; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import {RewardDeposit} from "./Structs.sol"; import {RewardItemType} from "./Enums.sol"; import {IErrorsAndEvents} from "./interfaces/IErrorsAndEvents.sol"; contract Validators is IErrorsAndEvents { uint256 public rewardExtractionDelay; using ECDSA for bytes32; function _validateQuestCreation(address creator, uint256 startTime, uint256 endTime) internal view { if (creator != address(0)) { revert QuestExists(); } if (startTime >= endTime) { revert InvalidQuestStartTime(startTime, endTime); } if (endTime <= block.timestamp) { revert InvalidQuestEndTime(endTime, block.timestamp); } } function _validateQuestRewardDeposit(RewardDeposit calldata deposit) internal pure { // Ensure that the amount per reward and the total are not zero if (deposit.amountPerReward == 0 || deposit.total == 0) { revert QuestRewardAmountInvalid(deposit.rewardId, deposit.total, deposit.amountPerReward); } // Ensure the total is an exact multiple of the amount per reward if (deposit.total % deposit.amountPerReward != 0) { revert QuestRewardPrecisionInvalid(deposit.rewardId, deposit.total, deposit.amountPerReward); } if (deposit.itemType == RewardItemType.ERC721 && (deposit.total != 1 || deposit.amountPerReward != 1)) { revert QuestRewardAmountInvalid(deposit.rewardId, deposit.total, deposit.amountPerReward); } } function _validateQuestRewardClaim(uint256 startTime, uint256 endTime) internal view { if (startTime > block.timestamp) { revert QuestInactive(); } if (block.timestamp >= (endTime + rewardExtractionDelay)) { revert QuestExpired(); } } function _validateQuestRewardExtraction(uint256 startTime, uint256 endTime, address creator) internal view { if (creator != msg.sender) { revert QuestCreatorInvalid(creator, msg.sender); } if (block.timestamp >= startTime && block.timestamp <= (endTime + rewardExtractionDelay)) { revert QuestActive(); } } function _validateQuestRewardSignature( uint256 questId, uint256 rewardId, uint256 uid, address signer, bytes calldata signature ) internal view { bytes32 hash = keccak256(abi.encodePacked(questId, rewardId, uid, msg.sender)); address recoveredSigner = hash.toEthSignedMessageHash().recover(signature); if (signer != recoveredSigner) { revert QuestSignerInvalid(signer, recoveredSigner); } } function _validateQuestRewardsBatchSignature( uint256 questId, uint256[] calldata rewardIds, uint256[] calldata uids, address signer, bytes calldata signature ) internal view { bytes32 hash = keccak256(abi.encodePacked(questId, rewardIds, uids, msg.sender)); address recoveredSigner = hash.toEthSignedMessageHash().recover(signature); if (signer != recoveredSigner) { revert QuestSignerInvalid(signer, recoveredSigner); } } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"_rewardExtractionDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BatchERC1155RewardDepositEmpty","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"name":"ExcessNativeRewardBalance","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InsufficientNativeRewardBalance","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"InvalidContract","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InvalidERC20TransferReturnValue","type":"error"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"InvalidQuestDuration","type":"error"},{"inputs":[{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"uint256","name":"blockTimestamp","type":"uint256"}],"name":"InvalidQuestEndTime","type":"error"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"InvalidQuestStartTime","type":"error"},{"inputs":[{"internalType":"uint256","name":"delay","type":"uint256"},{"internalType":"uint256","name":"minimumDelay","type":"uint256"},{"internalType":"uint256","name":"maximumDelay","type":"uint256"}],"name":"InvalidRewardExtractionDelay","type":"error"},{"inputs":[{"internalType":"enum RewardItemType","name":"itemType","type":"uint8"}],"name":"InvalidRewardItemType","type":"error"},{"inputs":[],"name":"OwnerCannotRenounceOwnership","type":"error"},{"inputs":[],"name":"QuestActive","type":"error"},{"inputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"caller","type":"address"}],"name":"QuestCreatorInvalid","type":"error"},{"inputs":[],"name":"QuestExists","type":"error"},{"inputs":[],"name":"QuestExpired","type":"error"},{"inputs":[{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"QuestHasNoRewards","type":"error"},{"inputs":[],"name":"QuestInactive","type":"error"},{"inputs":[{"internalType":"uint256","name":"rewardId","type":"uint256"},{"internalType":"uint256","name":"uid","type":"uint256"}],"name":"QuestRewardAlreadyClaimed","type":"error"},{"inputs":[{"internalType":"uint256","name":"rewardId","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"amountPerReward","type":"uint256"}],"name":"QuestRewardAmountInvalid","type":"error"},{"inputs":[{"internalType":"uint256","name":"rewardId","type":"uint256"}],"name":"QuestRewardDepleted","type":"error"},{"inputs":[{"internalType":"uint256","name":"rewardId","type":"uint256"}],"name":"QuestRewardExists","type":"error"},{"inputs":[{"internalType":"uint256","name":"questId","type":"uint256"},{"internalType":"uint256","name":"rewardId","type":"uint256"}],"name":"QuestRewardNotPartOfQuest","type":"error"},{"inputs":[{"internalType":"uint256","name":"rewardId","type":"uint256"},{"internalType":"uint256","name":"amountPerReward","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"}],"name":"QuestRewardPrecisionInvalid","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"recovered","type":"address"}],"name":"QuestSignerInvalid","type":"error"},{"inputs":[],"name":"RewardDepositArraysEmpty","type":"error"},{"inputs":[],"name":"RewardsArrayEmpty","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenTransferFailed","type":"error"},{"inputs":[],"name":"UnapprovedCaller","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endTime","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"address","name":"signer","type":"address"}],"name":"QuestCreatedWithRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimUId","type":"uint256"},{"indexed":false,"internalType":"address","name":"claimer","type":"address"}],"name":"QuestRewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"rewardIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"claimUIds","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"claimer","type":"address"}],"name":"QuestRewardsClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"}],"name":"QuestRewardsExtracted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_rewardExtractionDelay","type":"uint256"}],"name":"RewardExtractionDelayUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"MAXIMUM_REWARD_EXTRACTION_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINIMUM_REWARD_EXTRACTION_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedCallers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"questId","type":"uint256"},{"internalType":"uint256","name":"rewardId","type":"uint256"},{"internalType":"uint256","name":"claimUId","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claimQuestReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questId","type":"uint256"},{"internalType":"uint256[]","name":"rewardIds","type":"uint256[]"},{"internalType":"uint256[]","name":"claimUIds","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"claimQuestRewardsBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claims","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"questId","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"signer","type":"address"},{"components":[{"internalType":"uint256","name":"rewardId","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"amountPerReward","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"enum RewardItemType","name":"itemType","type":"uint8"}],"internalType":"struct RewardDeposit[]","name":"rewardDeposits","type":"tuple[]"},{"components":[{"internalType":"uint256[]","name":"rewardIds","type":"uint256[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"totals","type":"uint256[]"},{"internalType":"uint256[]","name":"amountPerRewards","type":"uint256[]"},{"internalType":"address","name":"token","type":"address"}],"internalType":"struct RewardDepositBatchERC1155[]","name":"batchERC1155RewardDeposits","type":"tuple[]"}],"name":"createQuestWithRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questId","type":"uint256"},{"internalType":"uint256[]","name":"rewardIds","type":"uint256[]"}],"name":"extractQuestRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"questIds","type":"uint256[]"},{"internalType":"uint256[][]","name":"rewardsBatched","type":"uint256[][]"}],"name":"extractQuestRewardsBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"quests","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardExtractionDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"amountPerReward","type":"uint256"},{"internalType":"uint256","name":"questId","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"enum RewardItemType","name":"itemType","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"bool","name":"_enabled","type":"bool"}],"name":"setApprovedCallers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newDelay","type":"uint256"}],"name":"setRewardExtractionDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162004fba38038062004fba8339818101604052810190620000379190620001cf565b60016003819055506000600460006101000a81548160ff0219169083151502179055506200007a6200006e6200008860201b60201c565b6200009060201b60201c565b806000819055505062000201565b600033905090565b600560006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055620000c681620000c960201b60201c565b50565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b6000819050919050565b620001a98162000194565b8114620001b557600080fd5b50565b600081519050620001c9816200019e565b92915050565b600060208284031215620001e857620001e76200018f565b5b6000620001f884828501620001b8565b91505092915050565b614da980620002116000396000f3fe6080604052600436106101815760003560e01c80638456cb59116100d1578063d5ced3941161008a578063e30c397811610064578063e30c39781461053c578063f23a6e6114610567578063f2fde38b146105a4578063f301af42146105cd57610181565b8063d5ced394146104b7578063dbce662a146104d3578063e085f980146104fc57610181565b80638456cb591461039557806388c8120e146103ac5780638da5cb5b146103d5578063a71975af14610400578063a888c2cd1461043d578063bc197c811461047a57610181565b80633934ff701161013e5780635c975abb116101185780635c975abb14610313578063715018a61461033e57806374d576ef1461035557806379ba50971461037e57610181565b80633934ff70146102a85780633f4ba83a146102d3578063517361db146102ea57610181565b806301ffc9a71461018657806310a9d5c0146101c3578063150b7a02146101ec5780631ccdf3841461022957806321365c3f14610252578063376198f41461027d575b600080fd5b34801561019257600080fd5b506101ad60048036038101906101a891906131d0565b61060f565b6040516101ba9190613218565b60405180910390f35b3480156101cf57600080fd5b506101ea60048036038101906101e591906132ce565b610689565b005b3480156101f857600080fd5b50610213600480360381019061020e91906134f5565b61074b565b6040516102209190613587565b60405180910390f35b34801561023557600080fd5b50610250600480360381019061024b919061364e565b61075f565b005b34801561025e57600080fd5b5061026761086d565b60405161027491906136de565b60405180910390f35b34801561028957600080fd5b50610292610874565b60405161029f91906136de565b60405180910390f35b3480156102b457600080fd5b506102bd61087b565b6040516102ca91906136de565b60405180910390f35b3480156102df57600080fd5b506102e8610881565b005b3480156102f657600080fd5b50610311600480360381019061030c91906136f9565b610893565b005b34801561031f57600080fd5b5061032861093b565b6040516103359190613218565b60405180910390f35b34801561034a57600080fd5b50610353610952565b005b34801561036157600080fd5b5061037c60048036038101906103779190613726565b61098c565b005b34801561038a57600080fd5b506103936109fb565b005b3480156103a157600080fd5b506103aa610a88565b005b3480156103b857600080fd5b506103d360048036038101906103ce9190613786565b610a9a565b005b3480156103e157600080fd5b506103ea610bf2565b6040516103f7919061385e565b60405180910390f35b34801561040c57600080fd5b5061042760048036038101906104229190613879565b610c1c565b6040516104349190613218565b60405180910390f35b34801561044957600080fd5b50610464600480360381019061045f91906136f9565b610c3c565b6040516104719190613218565b60405180910390f35b34801561048657600080fd5b506104a1600480360381019061049c9190613969565b610c5c565b6040516104ae9190613587565b60405180910390f35b6104d160048036038101906104cc9190613ae4565b610c71565b005b3480156104df57600080fd5b506104fa60048036038101906104f59190613c35565b610ff2565b005b34801561050857600080fd5b50610523600480360381019061051e91906136f9565b61109d565b6040516105339493929190613c95565b60405180910390f35b34801561054857600080fd5b5061055161110d565b60405161055e919061385e565b60405180910390f35b34801561057357600080fd5b5061058e60048036038101906105899190613cda565b611137565b60405161059b9190613587565b60405180910390f35b3480156105b057600080fd5b506105cb60048036038101906105c69190613879565b61114c565b005b3480156105d957600080fd5b506105f460048036038101906105ef91906136f9565b6111f9565b60405161060696959493929190613de8565b60405180910390f35b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610682575061068182611262565b5b9050919050565b6106916112cc565b61069961131b565b60006006600087815260200190815260200160002090506106c281600001548260010154611365565b6106f48686868460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876113e9565b6106ff8686866114f9565b857f7407bf4c8098b5adbc62d40dd393483f241c256d1ab27215debccaf02fa3b1bf86863360405161073393929190613e49565b60405180910390a2506107446116a3565b5050505050565b600063150b7a0260e01b9050949350505050565b6107676112cc565b60008484905090508282905081146107ab576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561085d5760008686838181106107cb576107ca613e80565b5b9050602002013590506000600660008381526020019081526020016000209050610822816000015482600101548360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116ad565b6108508287878681811061083957610838613e80565b5b905060200281019061084b9190613ebe565b611778565b82600101925050506107ae565b50506108676116a3565b50505050565b6201518081565b62ed4e0081565b60005481565b610889611906565b610891611984565b565b61089b611906565b620151808110806108ae575062ed4e0081115b156108fa57806201518062ed4e006040517f974703680000000000000000000000000000000000000000000000000000000081526004016108f193929190613f21565b60405180910390fd5b806000819055507f7e97548b38f243174eefee662793667d3738305284f2b1c61a46ae1f515032ed8160405161093091906136de565b60405180910390a150565b6000600460009054906101000a900460ff16905090565b61095a611906565b6040517fd79f908000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109946112cc565b60006006600085815260200190815260200160002090506109e2816000015482600101548360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116ad565b6109ed848484611778565b506109f66116a3565b505050565b6000610a056119e7565b90508073ffffffffffffffffffffffffffffffffffffffff16610a2661110d565b73ffffffffffffffffffffffffffffffffffffffff1614610a7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7390613fdb565b60405180910390fd5b610a85816119ef565b50565b610a90611906565b610a98611a20565b565b610aa26112cc565b610aaa61131b565b6000868690509050848490508114610aee576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600660008a81526020019081526020016000209050610b1781600001548260010154611365565b610b4b89898989898660030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a8a611a83565b60005b82811015610b9e57610b938a8a8a84818110610b6d57610b6c613e80565b5b90506020020135898985818110610b8757610b86613e80565b5b905060200201356114f9565b806001019050610b4e565b50887f4e05395015ad1240d532d417f968d703d75c74bc804eb1fea9b132c6008cc3f58989898933604051610bd7959493929190614076565b60405180910390a25050610be96116a3565b50505050505050565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60076020528060005260406000206000915054906101000a900460ff1681565b60026020528060005260406000206000915054906101000a900460ff1681565b600063bc197c8160e01b905095945050505050565b610c796112cc565b610c8161131b565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d04576040517f910d00c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008484905090506000838390509050600082148015610d245750600081145b15610d5b576040517f1794b43e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600660008c81526020019081526020016000209050610da18160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b611b99565b898160000181905550888160010181905550338160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550878160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600034905060005b84811015610f125736898983818110610e5d57610e5c613e80565b5b905060c00201905060006003811115610e7957610e78613d71565b5b8160a0016020810190610e8c91906140e4565b6003811115610e9e57610e9d613d71565b5b03610efc578060400135831015610ef2578281604001356040517f775c8a0e000000000000000000000000000000000000000000000000000000008152600401610ee9929190614111565b60405180910390fd5b8060400135830392505b610f06818f611c90565b81600101915050610e41565b5060005b83811015610f5757610f4c878783818110610f3457610f33613e80565b5b9050602002810190610f46919061413a565b8e611e11565b806001019050610f16565b506000811115610f9e57806040517fe8b01619000000000000000000000000000000000000000000000000000000008152600401610f9591906136de565b60405180910390fd5b8b7fbaebfb255e06836715619d04745d7e80f8cceeeeeaea534c685d27295e9cd0ad8c8c338d604051610fd49493929190613c95565b60405180910390a250505050610fe86116a3565b5050505050505050565b610ffa611906565b600083839050905060005b8181101561109657826007600087878581811061102557611024613e80565b5b905060200201602081019061103a9190613879565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550806001019050611005565b5050505050565b60066020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600063f23a6e6160e01b905095945050505050565b611154611906565b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166111b4610bf2565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040160149054906101000a900460ff16905086565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600260035403611311576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611308906141ae565b60405180910390fd5b6002600381905550565b61132361093b565b15611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a9061421a565b60405180910390fd5b565b4282111561139f576040517f4812455500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054816113ad9190614269565b42106113e5576040517f7bcc439b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6000868686336040516020016114029493929190614306565b604051602081830303815290604052805190602001209050600061147b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061146d84612224565b61225a90919063ffffffff16565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16146114ef5784816040517f2bca93100000000000000000000000000000000000000000000000000000000081526004016114e6929190614354565b60405180910390fd5b5050505050505050565b60006001600084815260200190815260200160002090506000816001015490506000826002015490508583600301541461156c5785856040517fa80a34de000000000000000000000000000000000000000000000000000000008152600401611563929190614111565b60405180910390fd5b808210156115b157846040517f3bed7dcc0000000000000000000000000000000000000000000000000000000081526004016115a891906136de565b60405180910390fd5b6002600085815260200190815260200160002060009054906101000a900460ff16156116165784846040517f64efba8e00000000000000000000000000000000000000000000000000000000815260040161160d929190614111565b60405180910390fd5b8082611622919061437d565b836001018190555060016002600086815260200190815260200160002060006101000a81548160ff02191690831515021790555061169b8360040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460000154838660040160149054906101000a900460ff16612281565b505050505050565b6001600381905550565b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461171f5780336040517fe5f42068000000000000000000000000000000000000000000000000000000008152600401611716929190614354565b60405180910390fd5b82421015801561173c5750600054826117389190614269565b4211155b15611773576040517f9070ec5b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6000828290509050600081036117ba576040517fbc4734a100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156118c7576000600160008686858181106117de576117dd613e80565b5b905060200201358152602001908152602001600020905085816003015414611858578585858481811061181457611813613e80565b5b905060200201356040517fa80a34de00000000000000000000000000000000000000000000000000000000815260040161184f929190614111565b60405180910390fd5b60008160010154905060008111156118ba57600082600101819055506118b98260040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360000154838560040160149054906101000a900460ff16612281565b5b82600101925050506117bd565b50837f6b1cbb1fa7fe9cd1834b246d7ae0304b45f6905381421b62345c5e09a8854945336040516118f8919061385e565b60405180910390a250505050565b61190e6119e7565b73ffffffffffffffffffffffffffffffffffffffff1661192c610bf2565b73ffffffffffffffffffffffffffffffffffffffff1614611982576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611979906143fd565b60405180910390fd5b565b61198c6123b8565b6000600460006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6119d06119e7565b6040516119dd919061385e565b60405180910390a1565b600033905090565b600560006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055611a1d81612401565b50565b611a2861131b565b6001600460006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611a6c6119e7565b604051611a79919061385e565b60405180910390a1565b6000888888888833604051602001611aa096959493929190614484565b6040516020818303038152906040528051906020012090506000611b1984848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050611b0b84612224565b61225a90919063ffffffff16565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611b8d5784816040517f2bca9310000000000000000000000000000000000000000000000000000000008152600401611b84929190614354565b60405180910390fd5b50505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611bff576040517fc69e1c2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808210611c455781816040517f1955298a000000000000000000000000000000000000000000000000000000008152600401611c3c929190614111565b60405180910390fd5b428111611c8b5780426040517ff7ea8325000000000000000000000000000000000000000000000000000000008152600401611c82929190614111565b60405180910390fd5b505050565b611c99826124c7565b6000600160008460000135815260200190815260200160002090506000816002015414611d015782600001356040517f6e1bb136000000000000000000000000000000000000000000000000000000008152600401611cf891906136de565b60405180910390fd5b826020013581600001819055508260400135816001018190555082606001358160020181905550826080016020810190611d3b9190613879565b8160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260a0016020810190611d9091906140e4565b8160040160146101000a81548160ff02191690836003811115611db657611db5613d71565b5b021790555081816003018190555060006003811115611dd857611dd7613d71565b5b8360a0016020810190611deb91906140e4565b6003811115611dfd57611dfc613d71565b5b14611e0c57611e0b83612648565b5b505050565b6000828060000190611e239190613ebe565b9050905060008103611e61576040517f51516c8b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80838060200190611e729190613ebe565b9050141580611e92575080838060400190611e8d9190613ebe565b905014155b80611eae575080838060600190611ea99190613ebe565b905014155b15611ee5576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612161576000848060000190611f029190613ebe565b83818110611f1357611f12613e80565b5b9050602002013590506000858060400190611f2e9190613ebe565b84818110611f3f57611f3e613e80565b5b9050602002013590506000868060600190611f5a9190613ebe565b85818110611f6b57611f6a613e80565b5b9050602002013590506000811480611f835750600082145b15611fc9578282826040517f2601f12b000000000000000000000000000000000000000000000000000000008152600401611fc093929190613f21565b60405180910390fd5b60008183611fd791906144fd565b1461201d578282826040517f682037d300000000000000000000000000000000000000000000000000000000815260040161201493929190613f21565b60405180910390fd5b6000600160008581526020019081526020016000209050600081600201541461207d57836040517f6e1bb13600000000000000000000000000000000000000000000000000000000815260040161207491906136de565b60405180910390fd5b87806020019061208d9190613ebe565b8681811061209e5761209d613e80565b5b9050602002013581600001819055508281600101819055508181600201819055508760800160208101906120d29190613879565b8160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060038160040160146101000a81548160ff0219169083600381111561213c5761213b613d71565b5b02179055508681600301819055505050505080806121599061452e565b915050611ee8565b5061221f8360800160208101906121789190613879565b333086806020019061218a9190613ebe565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508780604001906121da9190613ebe565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050506127cf565b505050565b60007f19457468657265756d205369676e6564204d6573736167653a0a33320000000060005281601c52603c6000209050919050565b600080600061226985856128a3565b91509150612276816128f4565b819250505092915050565b6000600381111561229557612294613d71565b5b8160038111156122a8576122a7613d71565b5b036122bc576122b73383612a5a565b6123b2565b600160038111156122d0576122cf613d71565b5b8160038111156122e3576122e2613d71565b5b036122f8576122f3843384612b17565b6123b1565b6002600381111561230c5761230b613d71565b5b81600381111561231f5761231e613d71565b5b036123355761233084303386612b27565b6123b0565b60038081111561234857612347613d71565b5b81600381111561235b5761235a613d71565b5b036123725761236d8430338686612bf8565b6123af565b806040517f961dc00a0000000000000000000000000000000000000000000000000000000081526004016123a69190614576565b60405180910390fd5b5b5b5b50505050565b6123c061093b565b6123ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f6906145dd565b60405180910390fd5b565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000816060013514806124de575060008160400135145b15612530578060000135816040013582606001356040517f2601f12b00000000000000000000000000000000000000000000000000000000815260040161252793929190613f21565b60405180910390fd5b60008160600135826040013561254691906144fd565b14612598578060000135816040013582606001356040517f682037d300000000000000000000000000000000000000000000000000000000815260040161258f93929190613f21565b60405180910390fd5b600260038111156125ac576125ab613d71565b5b8160a00160208101906125bf91906140e4565b60038111156125d1576125d0613d71565b5b1480156125f35750600181604001351415806125f257506001816060013514155b5b15612645578060000135816040013582606001356040517f2601f12b00000000000000000000000000000000000000000000000000000000815260040161263c93929190613f21565b60405180910390fd5b50565b6001600381111561265c5761265b613d71565b5b8160a001602081019061266f91906140e4565b600381111561268157612680613d71565b5b036126ad576126a881608001602081019061269c9190613879565b33308460400135612ccc565b6127cc565b600260038111156126c1576126c0613d71565b5b8160a00160208101906126d491906140e4565b60038111156126e6576126e5613d71565b5b036127125761270d8160800160208101906127019190613879565b33308460200135612b27565b6127cb565b60038081111561272557612724613d71565b5b8160a001602081019061273891906140e4565b600381111561274a57612749613d71565b5b0361277b576127768160800160208101906127659190613879565b333084602001358560400135612bf8565b6127ca565b8060a001602081019061278e91906140e4565b6040517f961dc00a0000000000000000000000000000000000000000000000000000000081526004016127c19190614576565b60405180910390fd5b5b5b50565b60008573ffffffffffffffffffffffffffffffffffffffff163b0361282b57846040517fec016484000000000000000000000000000000000000000000000000000000008152600401612822919061385e565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16632eb2c2d6858585856040518563ffffffff1660e01b815260040161286a94939291906146e1565b600060405180830381600087803b15801561288457600080fd5b505af1158015612898573d6000803e3d6000fd5b505050505050505050565b60008060418351036128e45760008060006020860151925060408601519150606086015160001a90506128d887828585612cde565b945094505050506128ed565b60006002915091505b9250929050565b6000600481111561290857612907613d71565b5b81600481111561291b5761291a613d71565b5b0315612a57576001600481111561293557612934613d71565b5b81600481111561294857612947613d71565b5b03612988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161297f90614793565b60405180910390fd5b6002600481111561299c5761299b613d71565b5b8160048111156129af576129ae613d71565b5b036129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e6906147ff565b60405180910390fd5b60036004811115612a0357612a02613d71565b5b816004811115612a1657612a15613d71565b5b03612a56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4d90614891565b60405180910390fd5b5b50565b60008273ffffffffffffffffffffffffffffffffffffffff1682604051612a80906148df565b60006040518083038185875af1925050503d8060008114612abd576040519150601f19603f3d011682016040523d82523d6000602084013e612ac2565b606091505b5050905080612b1257600030846000856040517fab45420f000000000000000000000000000000000000000000000000000000008152600401612b09959493929190614939565b60405180910390fd5b505050565b612b22838383612dc0565b505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b03612b8357836040517fec016484000000000000000000000000000000000000000000000000000000008152600401612b7a919061385e565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff166323b872dd8484846040518463ffffffff1660e01b8152600401612bc09392919061498c565b600060405180830381600087803b158015612bda57600080fd5b505af1158015612bee573d6000803e3d6000fd5b5050505050505050565b60008573ffffffffffffffffffffffffffffffffffffffff163b03612c5457846040517fec016484000000000000000000000000000000000000000000000000000000008152600401612c4b919061385e565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1663f242432a858585856040518563ffffffff1660e01b8152600401612c9394939291906149c3565b600060405180830381600087803b158015612cad57600080fd5b505af1158015612cc1573d6000803e3d6000fd5b505050505050505050565b612cd884848484612e46565b50505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c1115612d19576000600391509150612db7565b600060018787878760405160008152602001604052604051612d3e9493929190614a50565b6020604051602081039080840390855afa158015612d60573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612dae57600060019250925050612db7565b80600092509250505b94509492505050565b612e418363a9059cbb60e01b8484604051602401612ddf929190614a95565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ecf565b505050565b612ec9846323b872dd60e01b858585604051602401612e679392919061498c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ecf565b50505050565b6000612f31826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612f979092919063ffffffff16565b9050600081511480612f53575080806020019051810190612f529190614ad3565b5b612f92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f8990614b72565b60405180910390fd5b505050565b6060612fa68484600085612faf565b90509392505050565b606082471015612ff4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612feb90614c04565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161301d9190614c8a565b60006040518083038185875af1925050503d806000811461305a576040519150601f19603f3d011682016040523d82523d6000602084013e61305f565b606091505b50915091506130708783838761307c565b92505050949350505050565b606083156130de5760008351036130d657613096856130f1565b6130d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130cc90614ced565b60405180910390fd5b5b8290506130e9565b6130e88383613114565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156131275781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161315b9190614d51565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6131ad81613178565b81146131b857600080fd5b50565b6000813590506131ca816131a4565b92915050565b6000602082840312156131e6576131e561316e565b5b60006131f4848285016131bb565b91505092915050565b60008115159050919050565b613212816131fd565b82525050565b600060208201905061322d6000830184613209565b92915050565b6000819050919050565b61324681613233565b811461325157600080fd5b50565b6000813590506132638161323d565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261328e5761328d613269565b5b8235905067ffffffffffffffff8111156132ab576132aa61326e565b5b6020830191508360018202830111156132c7576132c6613273565b5b9250929050565b6000806000806000608086880312156132ea576132e961316e565b5b60006132f888828901613254565b955050602061330988828901613254565b945050604061331a88828901613254565b935050606086013567ffffffffffffffff81111561333b5761333a613173565b5b61334788828901613278565b92509250509295509295909350565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061338182613356565b9050919050565b61339181613376565b811461339c57600080fd5b50565b6000813590506133ae81613388565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613402826133b9565b810181811067ffffffffffffffff82111715613421576134206133ca565b5b80604052505050565b6000613434613164565b905061344082826133f9565b919050565b600067ffffffffffffffff8211156134605761345f6133ca565b5b613469826133b9565b9050602081019050919050565b82818337600083830152505050565b600061349861349384613445565b61342a565b9050828152602081018484840111156134b4576134b36133b4565b5b6134bf848285613476565b509392505050565b600082601f8301126134dc576134db613269565b5b81356134ec848260208601613485565b91505092915050565b6000806000806080858703121561350f5761350e61316e565b5b600061351d8782880161339f565b945050602061352e8782880161339f565b935050604061353f87828801613254565b925050606085013567ffffffffffffffff8111156135605761355f613173565b5b61356c878288016134c7565b91505092959194509250565b61358181613178565b82525050565b600060208201905061359c6000830184613578565b92915050565b60008083601f8401126135b8576135b7613269565b5b8235905067ffffffffffffffff8111156135d5576135d461326e565b5b6020830191508360208202830111156135f1576135f0613273565b5b9250929050565b60008083601f84011261360e5761360d613269565b5b8235905067ffffffffffffffff81111561362b5761362a61326e565b5b60208301915083602082028301111561364757613646613273565b5b9250929050565b600080600080604085870312156136685761366761316e565b5b600085013567ffffffffffffffff81111561368657613685613173565b5b613692878288016135a2565b9450945050602085013567ffffffffffffffff8111156136b5576136b4613173565b5b6136c1878288016135f8565b925092505092959194509250565b6136d881613233565b82525050565b60006020820190506136f360008301846136cf565b92915050565b60006020828403121561370f5761370e61316e565b5b600061371d84828501613254565b91505092915050565b60008060006040848603121561373f5761373e61316e565b5b600061374d86828701613254565b935050602084013567ffffffffffffffff81111561376e5761376d613173565b5b61377a868287016135a2565b92509250509250925092565b60008060008060008060006080888a0312156137a5576137a461316e565b5b60006137b38a828b01613254565b975050602088013567ffffffffffffffff8111156137d4576137d3613173565b5b6137e08a828b016135a2565b9650965050604088013567ffffffffffffffff81111561380357613802613173565b5b61380f8a828b016135a2565b9450945050606088013567ffffffffffffffff81111561383257613831613173565b5b61383e8a828b01613278565b925092505092959891949750929550565b61385881613376565b82525050565b6000602082019050613873600083018461384f565b92915050565b60006020828403121561388f5761388e61316e565b5b600061389d8482850161339f565b91505092915050565b600067ffffffffffffffff8211156138c1576138c06133ca565b5b602082029050602081019050919050565b60006138e56138e0846138a6565b61342a565b9050808382526020820190506020840283018581111561390857613907613273565b5b835b81811015613931578061391d8882613254565b84526020840193505060208101905061390a565b5050509392505050565b600082601f8301126139505761394f613269565b5b81356139608482602086016138d2565b91505092915050565b600080600080600060a086880312156139855761398461316e565b5b60006139938882890161339f565b95505060206139a48882890161339f565b945050604086013567ffffffffffffffff8111156139c5576139c4613173565b5b6139d18882890161393b565b935050606086013567ffffffffffffffff8111156139f2576139f1613173565b5b6139fe8882890161393b565b925050608086013567ffffffffffffffff811115613a1f57613a1e613173565b5b613a2b888289016134c7565b9150509295509295909350565b60008083601f840112613a4e57613a4d613269565b5b8235905067ffffffffffffffff811115613a6b57613a6a61326e565b5b6020830191508360c0820283011115613a8757613a86613273565b5b9250929050565b60008083601f840112613aa457613aa3613269565b5b8235905067ffffffffffffffff811115613ac157613ac061326e565b5b602083019150836020820283011115613add57613adc613273565b5b9250929050565b60008060008060008060008060c0898b031215613b0457613b0361316e565b5b6000613b128b828c01613254565b9850506020613b238b828c01613254565b9750506040613b348b828c01613254565b9650506060613b458b828c0161339f565b955050608089013567ffffffffffffffff811115613b6657613b65613173565b5b613b728b828c01613a38565b945094505060a089013567ffffffffffffffff811115613b9557613b94613173565b5b613ba18b828c01613a8e565b92509250509295985092959890939650565b60008083601f840112613bc957613bc8613269565b5b8235905067ffffffffffffffff811115613be657613be561326e565b5b602083019150836020820283011115613c0257613c01613273565b5b9250929050565b613c12816131fd565b8114613c1d57600080fd5b50565b600081359050613c2f81613c09565b92915050565b600080600060408486031215613c4e57613c4d61316e565b5b600084013567ffffffffffffffff811115613c6c57613c6b613173565b5b613c7886828701613bb3565b93509350506020613c8b86828701613c20565b9150509250925092565b6000608082019050613caa60008301876136cf565b613cb760208301866136cf565b613cc4604083018561384f565b613cd1606083018461384f565b95945050505050565b600080600080600060a08688031215613cf657613cf561316e565b5b6000613d048882890161339f565b9550506020613d158882890161339f565b9450506040613d2688828901613254565b9350506060613d3788828901613254565b925050608086013567ffffffffffffffff811115613d5857613d57613173565b5b613d64888289016134c7565b9150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613db157613db0613d71565b5b50565b6000819050613dc282613da0565b919050565b6000613dd282613db4565b9050919050565b613de281613dc7565b82525050565b600060c082019050613dfd60008301896136cf565b613e0a60208301886136cf565b613e1760408301876136cf565b613e2460608301866136cf565b613e31608083018561384f565b613e3e60a0830184613dd9565b979650505050505050565b6000606082019050613e5e60008301866136cf565b613e6b60208301856136cf565b613e78604083018461384f565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613edb57613eda613eaf565b5b80840192508235915067ffffffffffffffff821115613efd57613efc613eb4565b5b602083019250602082023603831315613f1957613f18613eb9565b5b509250929050565b6000606082019050613f3660008301866136cf565b613f4360208301856136cf565b613f5060408301846136cf565b949350505050565b600082825260208201905092915050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b6000613fc5602983613f58565b9150613fd082613f69565b604082019050919050565b60006020820190508181036000830152613ff481613fb8565b9050919050565b600082825260208201905092915050565b600080fd5b82818337505050565b60006140268385613ffb565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156140595761405861400c565b5b60208302925061406a838584614011565b82840190509392505050565b6000606082019050818103600083015261409181878961401a565b905081810360208301526140a681858761401a565b90506140b5604083018461384f565b9695505050505050565b600481106140cc57600080fd5b50565b6000813590506140de816140bf565b92915050565b6000602082840312156140fa576140f961316e565b5b6000614108848285016140cf565b91505092915050565b600060408201905061412660008301856136cf565b61413360208301846136cf565b9392505050565b60008235600160a00383360303811261415657614155613eaf565b5b80830191505092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614198601f83613f58565b91506141a382614162565b602082019050919050565b600060208201905081810360008301526141c78161418b565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000614204601083613f58565b915061420f826141ce565b602082019050919050565b60006020820190508181036000830152614233816141f7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061427482613233565b915061427f83613233565b92508282019050808211156142975761429661423a565b5b92915050565b6000819050919050565b6142b86142b382613233565b61429d565b82525050565b60008160601b9050919050565b60006142d6826142be565b9050919050565b60006142e8826142cb565b9050919050565b6143006142fb82613376565b6142dd565b82525050565b600061431282876142a7565b60208201915061432282866142a7565b60208201915061433282856142a7565b60208201915061434282846142ef565b60148201915081905095945050505050565b6000604082019050614369600083018561384f565b614376602083018461384f565b9392505050565b600061438882613233565b915061439383613233565b92508282039050818111156143ab576143aa61423a565b5b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006143e7602083613f58565b91506143f2826143b1565b602082019050919050565b60006020820190508181036000830152614416816143da565b9050919050565b600081905092915050565b6000614434838561441d565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156144675761446661400c565b5b602083029250614478838584614011565b82840190509392505050565b600061449082896142a7565b6020820191506144a1828789614428565b91506144ae828587614428565b91506144ba82846142ef565b601482019150819050979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061450882613233565b915061451383613233565b925082614523576145226144ce565b5b828206905092915050565b600061453982613233565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361456b5761456a61423a565b5b600182019050919050565b600060208201905061458b6000830184613dd9565b92915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006145c7601483613f58565b91506145d282614591565b602082019050919050565b600060208201905081810360008301526145f6816145ba565b9050919050565b600081519050919050565b6000819050602082019050919050565b61462181613233565b82525050565b60006146338383614618565b60208301905092915050565b6000602082019050919050565b6000614657826145fd565b6146618185613ffb565b935061466c83614608565b8060005b8381101561469d5781516146848882614627565b975061468f8361463f565b925050600181019050614670565b5085935050505092915050565b600082825260208201905092915050565b50565b60006146cb6000836146aa565b91506146d6826146bb565b600082019050919050565b600060a0820190506146f6600083018761384f565b614703602083018661384f565b8181036040830152614715818561464c565b90508181036060830152614729818461464c565b9050818103608083015261473c816146be565b905095945050505050565b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b600061477d601883613f58565b915061478882614747565b602082019050919050565b600060208201905081810360008301526147ac81614770565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b60006147e9601f83613f58565b91506147f4826147b3565b602082019050919050565b60006020820190508181036000830152614818816147dc565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b600061487b602283613f58565b91506148868261481f565b604082019050919050565b600060208201905081810360008301526148aa8161486e565b9050919050565b600081905092915050565b60006148c96000836148b1565b91506148d4826146bb565b600082019050919050565b60006148ea826148bc565b9150819050919050565b6000819050919050565b6000819050919050565b600061492361491e614919846148f4565b6148fe565b613233565b9050919050565b61493381614908565b82525050565b600060a08201905061494e600083018861384f565b61495b602083018761384f565b614968604083018661384f565b614975606083018561492a565b61498260808301846136cf565b9695505050505050565b60006060820190506149a1600083018661384f565b6149ae602083018561384f565b6149bb60408301846136cf565b949350505050565b600060a0820190506149d8600083018761384f565b6149e5602083018661384f565b6149f260408301856136cf565b6149ff60608301846136cf565b8181036080830152614a10816146be565b905095945050505050565b6000819050919050565b614a2e81614a1b565b82525050565b600060ff82169050919050565b614a4a81614a34565b82525050565b6000608082019050614a656000830187614a25565b614a726020830186614a41565b614a7f6040830185614a25565b614a8c6060830184614a25565b95945050505050565b6000604082019050614aaa600083018561384f565b614ab760208301846136cf565b9392505050565b600081519050614acd81613c09565b92915050565b600060208284031215614ae957614ae861316e565b5b6000614af784828501614abe565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614b5c602a83613f58565b9150614b6782614b00565b604082019050919050565b60006020820190508181036000830152614b8b81614b4f565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000614bee602683613f58565b9150614bf982614b92565b604082019050919050565b60006020820190508181036000830152614c1d81614be1565b9050919050565b600081519050919050565b60005b83811015614c4d578082015181840152602081019050614c32565b60008484015250505050565b6000614c6482614c24565b614c6e81856148b1565b9350614c7e818560208601614c2f565b80840191505092915050565b6000614c968284614c59565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000614cd7601d83613f58565b9150614ce282614ca1565b602082019050919050565b60006020820190508181036000830152614d0681614cca565b9050919050565b600081519050919050565b6000614d2382614d0d565b614d2d8185613f58565b9350614d3d818560208601614c2f565b614d46816133b9565b840191505092915050565b60006020820190508181036000830152614d6b8184614d18565b90509291505056fea2646970667358221220ebb6dc24d7f2244a100042ed30a5ea1e87841590676beee7d8a2f93c92aa7b4f64736f6c6343000813003300000000000000000000000000000000000000000000000000000000004f1a00
Deployed Bytecode
0x6080604052600436106101815760003560e01c80638456cb59116100d1578063d5ced3941161008a578063e30c397811610064578063e30c39781461053c578063f23a6e6114610567578063f2fde38b146105a4578063f301af42146105cd57610181565b8063d5ced394146104b7578063dbce662a146104d3578063e085f980146104fc57610181565b80638456cb591461039557806388c8120e146103ac5780638da5cb5b146103d5578063a71975af14610400578063a888c2cd1461043d578063bc197c811461047a57610181565b80633934ff701161013e5780635c975abb116101185780635c975abb14610313578063715018a61461033e57806374d576ef1461035557806379ba50971461037e57610181565b80633934ff70146102a85780633f4ba83a146102d3578063517361db146102ea57610181565b806301ffc9a71461018657806310a9d5c0146101c3578063150b7a02146101ec5780631ccdf3841461022957806321365c3f14610252578063376198f41461027d575b600080fd5b34801561019257600080fd5b506101ad60048036038101906101a891906131d0565b61060f565b6040516101ba9190613218565b60405180910390f35b3480156101cf57600080fd5b506101ea60048036038101906101e591906132ce565b610689565b005b3480156101f857600080fd5b50610213600480360381019061020e91906134f5565b61074b565b6040516102209190613587565b60405180910390f35b34801561023557600080fd5b50610250600480360381019061024b919061364e565b61075f565b005b34801561025e57600080fd5b5061026761086d565b60405161027491906136de565b60405180910390f35b34801561028957600080fd5b50610292610874565b60405161029f91906136de565b60405180910390f35b3480156102b457600080fd5b506102bd61087b565b6040516102ca91906136de565b60405180910390f35b3480156102df57600080fd5b506102e8610881565b005b3480156102f657600080fd5b50610311600480360381019061030c91906136f9565b610893565b005b34801561031f57600080fd5b5061032861093b565b6040516103359190613218565b60405180910390f35b34801561034a57600080fd5b50610353610952565b005b34801561036157600080fd5b5061037c60048036038101906103779190613726565b61098c565b005b34801561038a57600080fd5b506103936109fb565b005b3480156103a157600080fd5b506103aa610a88565b005b3480156103b857600080fd5b506103d360048036038101906103ce9190613786565b610a9a565b005b3480156103e157600080fd5b506103ea610bf2565b6040516103f7919061385e565b60405180910390f35b34801561040c57600080fd5b5061042760048036038101906104229190613879565b610c1c565b6040516104349190613218565b60405180910390f35b34801561044957600080fd5b50610464600480360381019061045f91906136f9565b610c3c565b6040516104719190613218565b60405180910390f35b34801561048657600080fd5b506104a1600480360381019061049c9190613969565b610c5c565b6040516104ae9190613587565b60405180910390f35b6104d160048036038101906104cc9190613ae4565b610c71565b005b3480156104df57600080fd5b506104fa60048036038101906104f59190613c35565b610ff2565b005b34801561050857600080fd5b50610523600480360381019061051e91906136f9565b61109d565b6040516105339493929190613c95565b60405180910390f35b34801561054857600080fd5b5061055161110d565b60405161055e919061385e565b60405180910390f35b34801561057357600080fd5b5061058e60048036038101906105899190613cda565b611137565b60405161059b9190613587565b60405180910390f35b3480156105b057600080fd5b506105cb60048036038101906105c69190613879565b61114c565b005b3480156105d957600080fd5b506105f460048036038101906105ef91906136f9565b6111f9565b60405161060696959493929190613de8565b60405180910390f35b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610682575061068182611262565b5b9050919050565b6106916112cc565b61069961131b565b60006006600087815260200190815260200160002090506106c281600001548260010154611365565b6106f48686868460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876113e9565b6106ff8686866114f9565b857f7407bf4c8098b5adbc62d40dd393483f241c256d1ab27215debccaf02fa3b1bf86863360405161073393929190613e49565b60405180910390a2506107446116a3565b5050505050565b600063150b7a0260e01b9050949350505050565b6107676112cc565b60008484905090508282905081146107ab576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561085d5760008686838181106107cb576107ca613e80565b5b9050602002013590506000600660008381526020019081526020016000209050610822816000015482600101548360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116ad565b6108508287878681811061083957610838613e80565b5b905060200281019061084b9190613ebe565b611778565b82600101925050506107ae565b50506108676116a3565b50505050565b6201518081565b62ed4e0081565b60005481565b610889611906565b610891611984565b565b61089b611906565b620151808110806108ae575062ed4e0081115b156108fa57806201518062ed4e006040517f974703680000000000000000000000000000000000000000000000000000000081526004016108f193929190613f21565b60405180910390fd5b806000819055507f7e97548b38f243174eefee662793667d3738305284f2b1c61a46ae1f515032ed8160405161093091906136de565b60405180910390a150565b6000600460009054906101000a900460ff16905090565b61095a611906565b6040517fd79f908000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109946112cc565b60006006600085815260200190815260200160002090506109e2816000015482600101548360020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116ad565b6109ed848484611778565b506109f66116a3565b505050565b6000610a056119e7565b90508073ffffffffffffffffffffffffffffffffffffffff16610a2661110d565b73ffffffffffffffffffffffffffffffffffffffff1614610a7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7390613fdb565b60405180910390fd5b610a85816119ef565b50565b610a90611906565b610a98611a20565b565b610aa26112cc565b610aaa61131b565b6000868690509050848490508114610aee576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600660008a81526020019081526020016000209050610b1781600001548260010154611365565b610b4b89898989898660030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a8a611a83565b60005b82811015610b9e57610b938a8a8a84818110610b6d57610b6c613e80565b5b90506020020135898985818110610b8757610b86613e80565b5b905060200201356114f9565b806001019050610b4e565b50887f4e05395015ad1240d532d417f968d703d75c74bc804eb1fea9b132c6008cc3f58989898933604051610bd7959493929190614076565b60405180910390a25050610be96116a3565b50505050505050565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60076020528060005260406000206000915054906101000a900460ff1681565b60026020528060005260406000206000915054906101000a900460ff1681565b600063bc197c8160e01b905095945050505050565b610c796112cc565b610c8161131b565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d04576040517f910d00c000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008484905090506000838390509050600082148015610d245750600081145b15610d5b576040517f1794b43e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600660008c81526020019081526020016000209050610da18160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168b8b611b99565b898160000181905550888160010181905550338160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550878160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600034905060005b84811015610f125736898983818110610e5d57610e5c613e80565b5b905060c00201905060006003811115610e7957610e78613d71565b5b8160a0016020810190610e8c91906140e4565b6003811115610e9e57610e9d613d71565b5b03610efc578060400135831015610ef2578281604001356040517f775c8a0e000000000000000000000000000000000000000000000000000000008152600401610ee9929190614111565b60405180910390fd5b8060400135830392505b610f06818f611c90565b81600101915050610e41565b5060005b83811015610f5757610f4c878783818110610f3457610f33613e80565b5b9050602002810190610f46919061413a565b8e611e11565b806001019050610f16565b506000811115610f9e57806040517fe8b01619000000000000000000000000000000000000000000000000000000008152600401610f9591906136de565b60405180910390fd5b8b7fbaebfb255e06836715619d04745d7e80f8cceeeeeaea534c685d27295e9cd0ad8c8c338d604051610fd49493929190613c95565b60405180910390a250505050610fe86116a3565b5050505050505050565b610ffa611906565b600083839050905060005b8181101561109657826007600087878581811061102557611024613e80565b5b905060200201602081019061103a9190613879565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550806001019050611005565b5050505050565b60066020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600063f23a6e6160e01b905095945050505050565b611154611906565b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166111b4610bf2565b73ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60016020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040160149054906101000a900460ff16905086565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600260035403611311576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611308906141ae565b60405180910390fd5b6002600381905550565b61132361093b565b15611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a9061421a565b60405180910390fd5b565b4282111561139f576040517f4812455500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600054816113ad9190614269565b42106113e5576040517f7bcc439b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050565b6000868686336040516020016114029493929190614306565b604051602081830303815290604052805190602001209050600061147b84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061146d84612224565b61225a90919063ffffffff16565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16146114ef5784816040517f2bca93100000000000000000000000000000000000000000000000000000000081526004016114e6929190614354565b60405180910390fd5b5050505050505050565b60006001600084815260200190815260200160002090506000816001015490506000826002015490508583600301541461156c5785856040517fa80a34de000000000000000000000000000000000000000000000000000000008152600401611563929190614111565b60405180910390fd5b808210156115b157846040517f3bed7dcc0000000000000000000000000000000000000000000000000000000081526004016115a891906136de565b60405180910390fd5b6002600085815260200190815260200160002060009054906101000a900460ff16156116165784846040517f64efba8e00000000000000000000000000000000000000000000000000000000815260040161160d929190614111565b60405180910390fd5b8082611622919061437d565b836001018190555060016002600086815260200190815260200160002060006101000a81548160ff02191690831515021790555061169b8360040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168460000154838660040160149054906101000a900460ff16612281565b505050505050565b6001600381905550565b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461171f5780336040517fe5f42068000000000000000000000000000000000000000000000000000000008152600401611716929190614354565b60405180910390fd5b82421015801561173c5750600054826117389190614269565b4211155b15611773576040517f9070ec5b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6000828290509050600081036117ba576040517fbc4734a100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b818110156118c7576000600160008686858181106117de576117dd613e80565b5b905060200201358152602001908152602001600020905085816003015414611858578585858481811061181457611813613e80565b5b905060200201356040517fa80a34de00000000000000000000000000000000000000000000000000000000815260040161184f929190614111565b60405180910390fd5b60008160010154905060008111156118ba57600082600101819055506118b98260040160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168360000154838560040160149054906101000a900460ff16612281565b5b82600101925050506117bd565b50837f6b1cbb1fa7fe9cd1834b246d7ae0304b45f6905381421b62345c5e09a8854945336040516118f8919061385e565b60405180910390a250505050565b61190e6119e7565b73ffffffffffffffffffffffffffffffffffffffff1661192c610bf2565b73ffffffffffffffffffffffffffffffffffffffff1614611982576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611979906143fd565b60405180910390fd5b565b61198c6123b8565b6000600460006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6119d06119e7565b6040516119dd919061385e565b60405180910390a1565b600033905090565b600560006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055611a1d81612401565b50565b611a2861131b565b6001600460006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611a6c6119e7565b604051611a79919061385e565b60405180910390a1565b6000888888888833604051602001611aa096959493929190614484565b6040516020818303038152906040528051906020012090506000611b1984848080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050611b0b84612224565b61225a90919063ffffffff16565b90508073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614611b8d5784816040517f2bca9310000000000000000000000000000000000000000000000000000000008152600401611b84929190614354565b60405180910390fd5b50505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611bff576040517fc69e1c2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808210611c455781816040517f1955298a000000000000000000000000000000000000000000000000000000008152600401611c3c929190614111565b60405180910390fd5b428111611c8b5780426040517ff7ea8325000000000000000000000000000000000000000000000000000000008152600401611c82929190614111565b60405180910390fd5b505050565b611c99826124c7565b6000600160008460000135815260200190815260200160002090506000816002015414611d015782600001356040517f6e1bb136000000000000000000000000000000000000000000000000000000008152600401611cf891906136de565b60405180910390fd5b826020013581600001819055508260400135816001018190555082606001358160020181905550826080016020810190611d3b9190613879565b8160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260a0016020810190611d9091906140e4565b8160040160146101000a81548160ff02191690836003811115611db657611db5613d71565b5b021790555081816003018190555060006003811115611dd857611dd7613d71565b5b8360a0016020810190611deb91906140e4565b6003811115611dfd57611dfc613d71565b5b14611e0c57611e0b83612648565b5b505050565b6000828060000190611e239190613ebe565b9050905060008103611e61576040517f51516c8b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80838060200190611e729190613ebe565b9050141580611e92575080838060400190611e8d9190613ebe565b905014155b80611eae575080838060600190611ea99190613ebe565b905014155b15611ee5576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015612161576000848060000190611f029190613ebe565b83818110611f1357611f12613e80565b5b9050602002013590506000858060400190611f2e9190613ebe565b84818110611f3f57611f3e613e80565b5b9050602002013590506000868060600190611f5a9190613ebe565b85818110611f6b57611f6a613e80565b5b9050602002013590506000811480611f835750600082145b15611fc9578282826040517f2601f12b000000000000000000000000000000000000000000000000000000008152600401611fc093929190613f21565b60405180910390fd5b60008183611fd791906144fd565b1461201d578282826040517f682037d300000000000000000000000000000000000000000000000000000000815260040161201493929190613f21565b60405180910390fd5b6000600160008581526020019081526020016000209050600081600201541461207d57836040517f6e1bb13600000000000000000000000000000000000000000000000000000000815260040161207491906136de565b60405180910390fd5b87806020019061208d9190613ebe565b8681811061209e5761209d613e80565b5b9050602002013581600001819055508281600101819055508181600201819055508760800160208101906120d29190613879565b8160040160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060038160040160146101000a81548160ff0219169083600381111561213c5761213b613d71565b5b02179055508681600301819055505050505080806121599061452e565b915050611ee8565b5061221f8360800160208101906121789190613879565b333086806020019061218a9190613ebe565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050508780604001906121da9190613ebe565b80806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050506127cf565b505050565b60007f19457468657265756d205369676e6564204d6573736167653a0a33320000000060005281601c52603c6000209050919050565b600080600061226985856128a3565b91509150612276816128f4565b819250505092915050565b6000600381111561229557612294613d71565b5b8160038111156122a8576122a7613d71565b5b036122bc576122b73383612a5a565b6123b2565b600160038111156122d0576122cf613d71565b5b8160038111156122e3576122e2613d71565b5b036122f8576122f3843384612b17565b6123b1565b6002600381111561230c5761230b613d71565b5b81600381111561231f5761231e613d71565b5b036123355761233084303386612b27565b6123b0565b60038081111561234857612347613d71565b5b81600381111561235b5761235a613d71565b5b036123725761236d8430338686612bf8565b6123af565b806040517f961dc00a0000000000000000000000000000000000000000000000000000000081526004016123a69190614576565b60405180910390fd5b5b5b5b50505050565b6123c061093b565b6123ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f6906145dd565b60405180910390fd5b565b6000600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600460016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000816060013514806124de575060008160400135145b15612530578060000135816040013582606001356040517f2601f12b00000000000000000000000000000000000000000000000000000000815260040161252793929190613f21565b60405180910390fd5b60008160600135826040013561254691906144fd565b14612598578060000135816040013582606001356040517f682037d300000000000000000000000000000000000000000000000000000000815260040161258f93929190613f21565b60405180910390fd5b600260038111156125ac576125ab613d71565b5b8160a00160208101906125bf91906140e4565b60038111156125d1576125d0613d71565b5b1480156125f35750600181604001351415806125f257506001816060013514155b5b15612645578060000135816040013582606001356040517f2601f12b00000000000000000000000000000000000000000000000000000000815260040161263c93929190613f21565b60405180910390fd5b50565b6001600381111561265c5761265b613d71565b5b8160a001602081019061266f91906140e4565b600381111561268157612680613d71565b5b036126ad576126a881608001602081019061269c9190613879565b33308460400135612ccc565b6127cc565b600260038111156126c1576126c0613d71565b5b8160a00160208101906126d491906140e4565b60038111156126e6576126e5613d71565b5b036127125761270d8160800160208101906127019190613879565b33308460200135612b27565b6127cb565b60038081111561272557612724613d71565b5b8160a001602081019061273891906140e4565b600381111561274a57612749613d71565b5b0361277b576127768160800160208101906127659190613879565b333084602001358560400135612bf8565b6127ca565b8060a001602081019061278e91906140e4565b6040517f961dc00a0000000000000000000000000000000000000000000000000000000081526004016127c19190614576565b60405180910390fd5b5b5b50565b60008573ffffffffffffffffffffffffffffffffffffffff163b0361282b57846040517fec016484000000000000000000000000000000000000000000000000000000008152600401612822919061385e565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff16632eb2c2d6858585856040518563ffffffff1660e01b815260040161286a94939291906146e1565b600060405180830381600087803b15801561288457600080fd5b505af1158015612898573d6000803e3d6000fd5b505050505050505050565b60008060418351036128e45760008060006020860151925060408601519150606086015160001a90506128d887828585612cde565b945094505050506128ed565b60006002915091505b9250929050565b6000600481111561290857612907613d71565b5b81600481111561291b5761291a613d71565b5b0315612a57576001600481111561293557612934613d71565b5b81600481111561294857612947613d71565b5b03612988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161297f90614793565b60405180910390fd5b6002600481111561299c5761299b613d71565b5b8160048111156129af576129ae613d71565b5b036129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e6906147ff565b60405180910390fd5b60036004811115612a0357612a02613d71565b5b816004811115612a1657612a15613d71565b5b03612a56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a4d90614891565b60405180910390fd5b5b50565b60008273ffffffffffffffffffffffffffffffffffffffff1682604051612a80906148df565b60006040518083038185875af1925050503d8060008114612abd576040519150601f19603f3d011682016040523d82523d6000602084013e612ac2565b606091505b5050905080612b1257600030846000856040517fab45420f000000000000000000000000000000000000000000000000000000008152600401612b09959493929190614939565b60405180910390fd5b505050565b612b22838383612dc0565b505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b03612b8357836040517fec016484000000000000000000000000000000000000000000000000000000008152600401612b7a919061385e565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff166323b872dd8484846040518463ffffffff1660e01b8152600401612bc09392919061498c565b600060405180830381600087803b158015612bda57600080fd5b505af1158015612bee573d6000803e3d6000fd5b5050505050505050565b60008573ffffffffffffffffffffffffffffffffffffffff163b03612c5457846040517fec016484000000000000000000000000000000000000000000000000000000008152600401612c4b919061385e565b60405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1663f242432a858585856040518563ffffffff1660e01b8152600401612c9394939291906149c3565b600060405180830381600087803b158015612cad57600080fd5b505af1158015612cc1573d6000803e3d6000fd5b505050505050505050565b612cd884848484612e46565b50505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08360001c1115612d19576000600391509150612db7565b600060018787878760405160008152602001604052604051612d3e9493929190614a50565b6020604051602081039080840390855afa158015612d60573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612dae57600060019250925050612db7565b80600092509250505b94509492505050565b612e418363a9059cbb60e01b8484604051602401612ddf929190614a95565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ecf565b505050565b612ec9846323b872dd60e01b858585604051602401612e679392919061498c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ecf565b50505050565b6000612f31826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16612f979092919063ffffffff16565b9050600081511480612f53575080806020019051810190612f529190614ad3565b5b612f92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f8990614b72565b60405180910390fd5b505050565b6060612fa68484600085612faf565b90509392505050565b606082471015612ff4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612feb90614c04565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161301d9190614c8a565b60006040518083038185875af1925050503d806000811461305a576040519150601f19603f3d011682016040523d82523d6000602084013e61305f565b606091505b50915091506130708783838761307c565b92505050949350505050565b606083156130de5760008351036130d657613096856130f1565b6130d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130cc90614ced565b60405180910390fd5b5b8290506130e9565b6130e88383613114565b5b949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000825111156131275781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161315b9190614d51565b60405180910390fd5b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6131ad81613178565b81146131b857600080fd5b50565b6000813590506131ca816131a4565b92915050565b6000602082840312156131e6576131e561316e565b5b60006131f4848285016131bb565b91505092915050565b60008115159050919050565b613212816131fd565b82525050565b600060208201905061322d6000830184613209565b92915050565b6000819050919050565b61324681613233565b811461325157600080fd5b50565b6000813590506132638161323d565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261328e5761328d613269565b5b8235905067ffffffffffffffff8111156132ab576132aa61326e565b5b6020830191508360018202830111156132c7576132c6613273565b5b9250929050565b6000806000806000608086880312156132ea576132e961316e565b5b60006132f888828901613254565b955050602061330988828901613254565b945050604061331a88828901613254565b935050606086013567ffffffffffffffff81111561333b5761333a613173565b5b61334788828901613278565b92509250509295509295909350565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061338182613356565b9050919050565b61339181613376565b811461339c57600080fd5b50565b6000813590506133ae81613388565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613402826133b9565b810181811067ffffffffffffffff82111715613421576134206133ca565b5b80604052505050565b6000613434613164565b905061344082826133f9565b919050565b600067ffffffffffffffff8211156134605761345f6133ca565b5b613469826133b9565b9050602081019050919050565b82818337600083830152505050565b600061349861349384613445565b61342a565b9050828152602081018484840111156134b4576134b36133b4565b5b6134bf848285613476565b509392505050565b600082601f8301126134dc576134db613269565b5b81356134ec848260208601613485565b91505092915050565b6000806000806080858703121561350f5761350e61316e565b5b600061351d8782880161339f565b945050602061352e8782880161339f565b935050604061353f87828801613254565b925050606085013567ffffffffffffffff8111156135605761355f613173565b5b61356c878288016134c7565b91505092959194509250565b61358181613178565b82525050565b600060208201905061359c6000830184613578565b92915050565b60008083601f8401126135b8576135b7613269565b5b8235905067ffffffffffffffff8111156135d5576135d461326e565b5b6020830191508360208202830111156135f1576135f0613273565b5b9250929050565b60008083601f84011261360e5761360d613269565b5b8235905067ffffffffffffffff81111561362b5761362a61326e565b5b60208301915083602082028301111561364757613646613273565b5b9250929050565b600080600080604085870312156136685761366761316e565b5b600085013567ffffffffffffffff81111561368657613685613173565b5b613692878288016135a2565b9450945050602085013567ffffffffffffffff8111156136b5576136b4613173565b5b6136c1878288016135f8565b925092505092959194509250565b6136d881613233565b82525050565b60006020820190506136f360008301846136cf565b92915050565b60006020828403121561370f5761370e61316e565b5b600061371d84828501613254565b91505092915050565b60008060006040848603121561373f5761373e61316e565b5b600061374d86828701613254565b935050602084013567ffffffffffffffff81111561376e5761376d613173565b5b61377a868287016135a2565b92509250509250925092565b60008060008060008060006080888a0312156137a5576137a461316e565b5b60006137b38a828b01613254565b975050602088013567ffffffffffffffff8111156137d4576137d3613173565b5b6137e08a828b016135a2565b9650965050604088013567ffffffffffffffff81111561380357613802613173565b5b61380f8a828b016135a2565b9450945050606088013567ffffffffffffffff81111561383257613831613173565b5b61383e8a828b01613278565b925092505092959891949750929550565b61385881613376565b82525050565b6000602082019050613873600083018461384f565b92915050565b60006020828403121561388f5761388e61316e565b5b600061389d8482850161339f565b91505092915050565b600067ffffffffffffffff8211156138c1576138c06133ca565b5b602082029050602081019050919050565b60006138e56138e0846138a6565b61342a565b9050808382526020820190506020840283018581111561390857613907613273565b5b835b81811015613931578061391d8882613254565b84526020840193505060208101905061390a565b5050509392505050565b600082601f8301126139505761394f613269565b5b81356139608482602086016138d2565b91505092915050565b600080600080600060a086880312156139855761398461316e565b5b60006139938882890161339f565b95505060206139a48882890161339f565b945050604086013567ffffffffffffffff8111156139c5576139c4613173565b5b6139d18882890161393b565b935050606086013567ffffffffffffffff8111156139f2576139f1613173565b5b6139fe8882890161393b565b925050608086013567ffffffffffffffff811115613a1f57613a1e613173565b5b613a2b888289016134c7565b9150509295509295909350565b60008083601f840112613a4e57613a4d613269565b5b8235905067ffffffffffffffff811115613a6b57613a6a61326e565b5b6020830191508360c0820283011115613a8757613a86613273565b5b9250929050565b60008083601f840112613aa457613aa3613269565b5b8235905067ffffffffffffffff811115613ac157613ac061326e565b5b602083019150836020820283011115613add57613adc613273565b5b9250929050565b60008060008060008060008060c0898b031215613b0457613b0361316e565b5b6000613b128b828c01613254565b9850506020613b238b828c01613254565b9750506040613b348b828c01613254565b9650506060613b458b828c0161339f565b955050608089013567ffffffffffffffff811115613b6657613b65613173565b5b613b728b828c01613a38565b945094505060a089013567ffffffffffffffff811115613b9557613b94613173565b5b613ba18b828c01613a8e565b92509250509295985092959890939650565b60008083601f840112613bc957613bc8613269565b5b8235905067ffffffffffffffff811115613be657613be561326e565b5b602083019150836020820283011115613c0257613c01613273565b5b9250929050565b613c12816131fd565b8114613c1d57600080fd5b50565b600081359050613c2f81613c09565b92915050565b600080600060408486031215613c4e57613c4d61316e565b5b600084013567ffffffffffffffff811115613c6c57613c6b613173565b5b613c7886828701613bb3565b93509350506020613c8b86828701613c20565b9150509250925092565b6000608082019050613caa60008301876136cf565b613cb760208301866136cf565b613cc4604083018561384f565b613cd1606083018461384f565b95945050505050565b600080600080600060a08688031215613cf657613cf561316e565b5b6000613d048882890161339f565b9550506020613d158882890161339f565b9450506040613d2688828901613254565b9350506060613d3788828901613254565b925050608086013567ffffffffffffffff811115613d5857613d57613173565b5b613d64888289016134c7565b9150509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613db157613db0613d71565b5b50565b6000819050613dc282613da0565b919050565b6000613dd282613db4565b9050919050565b613de281613dc7565b82525050565b600060c082019050613dfd60008301896136cf565b613e0a60208301886136cf565b613e1760408301876136cf565b613e2460608301866136cf565b613e31608083018561384f565b613e3e60a0830184613dd9565b979650505050505050565b6000606082019050613e5e60008301866136cf565b613e6b60208301856136cf565b613e78604083018461384f565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112613edb57613eda613eaf565b5b80840192508235915067ffffffffffffffff821115613efd57613efc613eb4565b5b602083019250602082023603831315613f1957613f18613eb9565b5b509250929050565b6000606082019050613f3660008301866136cf565b613f4360208301856136cf565b613f5060408301846136cf565b949350505050565b600082825260208201905092915050565b7f4f776e61626c6532537465703a2063616c6c6572206973206e6f74207468652060008201527f6e6577206f776e65720000000000000000000000000000000000000000000000602082015250565b6000613fc5602983613f58565b9150613fd082613f69565b604082019050919050565b60006020820190508181036000830152613ff481613fb8565b9050919050565b600082825260208201905092915050565b600080fd5b82818337505050565b60006140268385613ffb565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156140595761405861400c565b5b60208302925061406a838584614011565b82840190509392505050565b6000606082019050818103600083015261409181878961401a565b905081810360208301526140a681858761401a565b90506140b5604083018461384f565b9695505050505050565b600481106140cc57600080fd5b50565b6000813590506140de816140bf565b92915050565b6000602082840312156140fa576140f961316e565b5b6000614108848285016140cf565b91505092915050565b600060408201905061412660008301856136cf565b61413360208301846136cf565b9392505050565b60008235600160a00383360303811261415657614155613eaf565b5b80830191505092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6000614198601f83613f58565b91506141a382614162565b602082019050919050565b600060208201905081810360008301526141c78161418b565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b6000614204601083613f58565b915061420f826141ce565b602082019050919050565b60006020820190508181036000830152614233816141f7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061427482613233565b915061427f83613233565b92508282019050808211156142975761429661423a565b5b92915050565b6000819050919050565b6142b86142b382613233565b61429d565b82525050565b60008160601b9050919050565b60006142d6826142be565b9050919050565b60006142e8826142cb565b9050919050565b6143006142fb82613376565b6142dd565b82525050565b600061431282876142a7565b60208201915061432282866142a7565b60208201915061433282856142a7565b60208201915061434282846142ef565b60148201915081905095945050505050565b6000604082019050614369600083018561384f565b614376602083018461384f565b9392505050565b600061438882613233565b915061439383613233565b92508282039050818111156143ab576143aa61423a565b5b92915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006143e7602083613f58565b91506143f2826143b1565b602082019050919050565b60006020820190508181036000830152614416816143da565b9050919050565b600081905092915050565b6000614434838561441d565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8311156144675761446661400c565b5b602083029250614478838584614011565b82840190509392505050565b600061449082896142a7565b6020820191506144a1828789614428565b91506144ae828587614428565b91506144ba82846142ef565b601482019150819050979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061450882613233565b915061451383613233565b925082614523576145226144ce565b5b828206905092915050565b600061453982613233565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361456b5761456a61423a565b5b600182019050919050565b600060208201905061458b6000830184613dd9565b92915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006145c7601483613f58565b91506145d282614591565b602082019050919050565b600060208201905081810360008301526145f6816145ba565b9050919050565b600081519050919050565b6000819050602082019050919050565b61462181613233565b82525050565b60006146338383614618565b60208301905092915050565b6000602082019050919050565b6000614657826145fd565b6146618185613ffb565b935061466c83614608565b8060005b8381101561469d5781516146848882614627565b975061468f8361463f565b925050600181019050614670565b5085935050505092915050565b600082825260208201905092915050565b50565b60006146cb6000836146aa565b91506146d6826146bb565b600082019050919050565b600060a0820190506146f6600083018761384f565b614703602083018661384f565b8181036040830152614715818561464c565b90508181036060830152614729818461464c565b9050818103608083015261473c816146be565b905095945050505050565b7f45434453413a20696e76616c6964207369676e61747572650000000000000000600082015250565b600061477d601883613f58565b915061478882614747565b602082019050919050565b600060208201905081810360008301526147ac81614770565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265206c656e67746800600082015250565b60006147e9601f83613f58565b91506147f4826147b3565b602082019050919050565b60006020820190508181036000830152614818816147dc565b9050919050565b7f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008201527f7565000000000000000000000000000000000000000000000000000000000000602082015250565b600061487b602283613f58565b91506148868261481f565b604082019050919050565b600060208201905081810360008301526148aa8161486e565b9050919050565b600081905092915050565b60006148c96000836148b1565b91506148d4826146bb565b600082019050919050565b60006148ea826148bc565b9150819050919050565b6000819050919050565b6000819050919050565b600061492361491e614919846148f4565b6148fe565b613233565b9050919050565b61493381614908565b82525050565b600060a08201905061494e600083018861384f565b61495b602083018761384f565b614968604083018661384f565b614975606083018561492a565b61498260808301846136cf565b9695505050505050565b60006060820190506149a1600083018661384f565b6149ae602083018561384f565b6149bb60408301846136cf565b949350505050565b600060a0820190506149d8600083018761384f565b6149e5602083018661384f565b6149f260408301856136cf565b6149ff60608301846136cf565b8181036080830152614a10816146be565b905095945050505050565b6000819050919050565b614a2e81614a1b565b82525050565b600060ff82169050919050565b614a4a81614a34565b82525050565b6000608082019050614a656000830187614a25565b614a726020830186614a41565b614a7f6040830185614a25565b614a8c6060830184614a25565b95945050505050565b6000604082019050614aaa600083018561384f565b614ab760208301846136cf565b9392505050565b600081519050614acd81613c09565b92915050565b600060208284031215614ae957614ae861316e565b5b6000614af784828501614abe565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b6000614b5c602a83613f58565b9150614b6782614b00565b604082019050919050565b60006020820190508181036000830152614b8b81614b4f565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b6000614bee602683613f58565b9150614bf982614b92565b604082019050919050565b60006020820190508181036000830152614c1d81614be1565b9050919050565b600081519050919050565b60005b83811015614c4d578082015181840152602081019050614c32565b60008484015250505050565b6000614c6482614c24565b614c6e81856148b1565b9350614c7e818560208601614c2f565b80840191505092915050565b6000614c968284614c59565b915081905092915050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000614cd7601d83613f58565b9150614ce282614ca1565b602082019050919050565b60006020820190508181036000830152614d0681614cca565b9050919050565b600081519050919050565b6000614d2382614d0d565b614d2d8185613f58565b9350614d3d818560208601614c2f565b614d46816133b9565b840191505092915050565b60006020820190508181036000830152614d6b8184614d18565b90509291505056fea2646970667358221220ebb6dc24d7f2244a100042ed30a5ea1e87841590676beee7d8a2f93c92aa7b4f64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000004f1a00
-----Decoded View---------------
Arg [0] : _rewardExtractionDelay (uint256): 5184000
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000004f1a00
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.