More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 29 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Multi Claim | 7027593 | 8 hrs ago | IN | 0 S | 0.01480879 | ||||
Multi Claim | 7022577 | 9 hrs ago | IN | 0 S | 0.01225241 | ||||
Multi Claim | 6978760 | 19 hrs ago | IN | 0 S | 0.00659602 | ||||
Multi Claim | 6954989 | 24 hrs ago | IN | 0 S | 0.00929536 | ||||
Claim | 6910459 | 31 hrs ago | IN | 0 S | 0.00548653 | ||||
Claim | 6903952 | 32 hrs ago | IN | 0 S | 0.00440121 | ||||
Claim | 6893364 | 34 hrs ago | IN | 0 S | 0.00489577 | ||||
Claim | 6893316 | 34 hrs ago | IN | 0 S | 0.00435226 | ||||
Multi Claim | 6892108 | 35 hrs ago | IN | 0 S | 0.01337116 | ||||
Claim | 6891358 | 35 hrs ago | IN | 0 S | 0.00548735 | ||||
Claim | 6890680 | 35 hrs ago | IN | 0 S | 0.00548609 | ||||
Claim | 6886919 | 36 hrs ago | IN | 0 S | 0.00528731 | ||||
Claim | 6883810 | 37 hrs ago | IN | 0 S | 0.00512143 | ||||
Claim | 6882310 | 37 hrs ago | IN | 0 S | 0.00561481 | ||||
Multi Claim | 6881286 | 37 hrs ago | IN | 0 S | 0.01510899 | ||||
Multi Claim | 6880366 | 38 hrs ago | IN | 0 S | 0.01516185 | ||||
Multi Claim | 6876741 | 38 hrs ago | IN | 0 S | 0.01282954 | ||||
Multi Claim | 6873592 | 39 hrs ago | IN | 0 S | 0.0149038 | ||||
Emergency Update... | 6873507 | 39 hrs ago | IN | 0 S | 0.00216612 | ||||
Emergency Update... | 6873488 | 39 hrs ago | IN | 0 S | 0.00216678 | ||||
Emergency Update... | 6873459 | 39 hrs ago | IN | 0 S | 0.00216546 | ||||
Emergency Update... | 6873422 | 39 hrs ago | IN | 0 S | 0.00217008 | ||||
Emergency Update... | 6873399 | 39 hrs ago | IN | 0 S | 0.00216876 | ||||
Claim | 6799372 | 2 days ago | IN | 0 S | 0.00834908 | ||||
Claim | 6783458 | 2 days ago | IN | 0 S | 0.00474928 |
Loading...
Loading
Contract Name:
MultiMerkleDistributor
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 9999 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
//██████╗ █████╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ //██╔══██╗██╔══██╗██║ ██╔══██╗██╔══██╗██║████╗ ██║ //██████╔╝███████║██║ ███████║██║ ██║██║██╔██╗ ██║ //██╔═══╝ ██╔══██║██║ ██╔══██║██║ ██║██║██║╚██╗██║ //██║ ██║ ██║███████╗██║ ██║██████╔╝██║██║ ╚████║ //╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝ //SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.20; import "./oz/interfaces/IERC20.sol"; import "./oz/libraries/SafeERC20.sol"; import "./oz/utils/MerkleProof.sol"; import "./utils/Owner.sol"; import "./oz/utils/ReentrancyGuard.sol"; import "./libraries/Errors.sol"; /** @title Quest Multi Merkle Distributor */ /// @author Paladin /* Contract holds ERC20 rewards from Quests Can handle multiple MerkleRoots */ contract MultiMerkleDistributor is Owner, ReentrancyGuard { using SafeERC20 for IERC20; /** @notice Seconds in a Week */ uint256 private constant WEEK = 604800; /** @notice Mapping listing the reward token associated to each Quest ID */ // QuestID => reward token mapping(uint256 => address) public questRewardToken; /** @notice Mapping of tokens this contract is or was distributing */ // token address => boolean mapping(address => bool) public rewardTokens; // Periods: timestamp => start of a week, used as a voting period // in the Curve GaugeController though the timestamp / WEEK * WEEK logic. // Handled through the QuestManager contract. // Those can be fetched through this contract when they are closed, or through the QuestManager contract. /** @notice List of Closed QuestPeriods by Quest ID */ // QuestID => array of periods mapping(uint256 => uint256[]) public questClosedPeriods; /** @notice Merkle Root for each period of a Quest (indexed by Quest ID) */ // QuestID => period => merkleRoot mapping(uint256 => mapping(uint256 => bytes32)) public questMerkleRootPerPeriod; /** @notice Amount of rewards for each period of a Quest (indexed by Quest ID) */ // QuestID => period => totalRewardsAmount mapping(uint256 => mapping(uint256 => uint256)) public questRewardsPerPeriod; /** @notice BitMap of claims for each period of a Quest */ // QuestID => period => claimedBitMap // This is a packed array of booleans. mapping(uint256 => mapping(uint256 => mapping(uint256 => uint256))) private questPeriodClaimedBitMap; /** @notice Address of the QuestBoard contract */ address public immutable questBoard; // Events /** @notice Event emitted when a user Claims */ event Claimed( uint256 indexed questID, uint256 indexed period, uint256 index, uint256 amount, address rewardToken, address indexed account ); /** @notice Event emitted when a New Quest is added */ event NewQuest(uint256 indexed questID, address rewardToken); /** @notice Event emitted when a Period of a Quest is updated (when the Merkle Root is added) */ event QuestPeriodUpdated(uint256 indexed questID, uint256 indexed period, bytes32 merkleRoot); // Modifier /** @notice Check the caller is either the admin or the QuestBoard contract */ modifier onlyAllowed(){ if(msg.sender != questBoard && msg.sender != owner()) revert Errors.CallerNotAllowed(); _; } // Constructor constructor(address _questBoard){ if(_questBoard == address(0)) revert Errors.AddressZero(); questBoard = _questBoard; } // Functions /** * @notice Checks if the rewards were claimed for a user on a given period * @dev Checks if the rewards were claimed for a user (based on the index) on a given period * @param questID ID of the Quest * @param period Amount of underlying to borrow * @param index Index of the claim * @return bool : true if already claimed */ function isClaimed(uint256 questID, uint256 period, uint256 index) public view returns (bool) { uint256 claimedWordIndex = index >> 8; uint256 claimedBitIndex = index & 0xff; uint256 claimedWord = questPeriodClaimedBitMap[questID][period][claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask != 0; } /** * @dev Sets the rewards as claimed for the index on the given period * @param questID ID of the Quest * @param period Timestamp of the period * @param index Index of the claim */ function _setClaimed(uint256 questID, uint256 period, uint256 index) private { uint256 claimedWordIndex = index >> 8; uint256 claimedBitIndex = index & 0xff; questPeriodClaimedBitMap[questID][period][claimedWordIndex] |= (1 << claimedBitIndex); } //Basic Claim /** * @notice Claims the reward for a user for a given period of a Quest * @dev Claims the reward for a user for a given period of a Quest if the correct proof was given * @param questID ID of the Quest * @param period Timestamp of the period * @param index Index in the Merkle Tree * @param account Address of the user claiming the rewards * @param amount Amount of rewards to claim * @param merkleProof Proof to claim the rewards */ function claim(uint256 questID, uint256 period, uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) public nonReentrant { if(account == address(0)) revert Errors.AddressZero(); if(questMerkleRootPerPeriod[questID][period] == 0) revert Errors.MerkleRootNotUpdated(); if(isClaimed(questID, period, index)) revert Errors.AlreadyClaimed(); // Check that the given parameters match the given Proof bytes32 node = keccak256(abi.encodePacked(questID, period, index, account, amount)); if(!MerkleProof.verify(merkleProof, questMerkleRootPerPeriod[questID][period], node)) revert Errors.InvalidProof(); // Set the rewards as claimed for that period // And transfer the rewards to the user address rewardToken = questRewardToken[questID]; _setClaimed(questID, period, index); questRewardsPerPeriod[questID][period] -= amount; IERC20(rewardToken).safeTransfer(account, amount); emit Claimed(questID, period, index, amount, rewardToken, account); } //Struct ClaimParams struct ClaimParams { uint256 questID; uint256 period; uint256 index; uint256 amount; bytes32[] merkleProof; } //Multi Claim /** * @notice Claims multiple rewards for a given list * @dev Calls the claim() method for each entry in the claims array * @param account Address of the user claiming the rewards * @param claims List of ClaimParams struct data to claim */ function multiClaim(address account, ClaimParams[] calldata claims) external { uint256 length = claims.length; if(length == 0) revert Errors.EmptyParameters(); for(uint256 i; i < length;){ claim(claims[i].questID, claims[i].period, claims[i].index, account, claims[i].amount, claims[i].merkleProof); unchecked{ ++i; } } } //FullQuest Claim (form of Multi Claim but for only one Quest => only one ERC20 transfer) //Only works for the given periods (in ClaimParams) for the Quest. Any omitted period will be skipped /** * @notice Claims the reward for all the given periods of a Quest, and transfer all the rewards at once * @dev Sums up all the rewards for given periods of a Quest, and executes only one transfer * @param account Address of the user claiming the rewards * @param questID ID of the Quest * @param claims List of ClaimParams struct data to claim */ function claimQuest(address account, uint256 questID, ClaimParams[] calldata claims) external nonReentrant { if(account == address(0)) revert Errors.AddressZero(); uint256 length = claims.length; if(length == 0) revert Errors.EmptyParameters(); // Total amount claimable, to transfer at once uint256 totalClaimAmount; address rewardToken = questRewardToken[questID]; for(uint256 i; i < length;){ if(claims[i].questID != questID) revert Errors.IncorrectQuestID(); if(questMerkleRootPerPeriod[questID][claims[i].period] == 0) revert Errors.MerkleRootNotUpdated(); if(isClaimed(questID, claims[i].period, claims[i].index)) revert Errors.AlreadyClaimed(); // For each period given, if the proof matches the given parameters, // set as claimed and add to the to total to transfer bytes32 node = keccak256(abi.encodePacked(questID, claims[i].period, claims[i].index, account, claims[i].amount)); if(!MerkleProof.verify(claims[i].merkleProof, questMerkleRootPerPeriod[questID][claims[i].period], node)) revert Errors.InvalidProof(); _setClaimed(questID, claims[i].period, claims[i].index); questRewardsPerPeriod[questID][claims[i].period] -= claims[i].amount; totalClaimAmount += claims[i].amount; emit Claimed(questID, claims[i].period, claims[i].index, claims[i].amount, rewardToken, account); unchecked{ ++i; } } // Transfer the total claimed amount IERC20(rewardToken).safeTransfer(account, totalClaimAmount); } /** * @notice Returns all current Closed periods for the given Quest ID * @dev Returns all current Closed periods for the given Quest ID * @param questID ID of the Quest * @return uint256[] : List of closed periods */ function getClosedPeriodsByQuests(uint256 questID) external view returns (uint256[] memory) { return questClosedPeriods[questID]; } // Manager functions /** * @notice Adds a new Quest to the listing * @dev Adds a new Quest ID and the associated reward token * @param questID ID of the Quest * @param token Address of the ERC20 reward token * @return bool : success */ function addQuest(uint256 questID, address token) external returns(bool) { if(msg.sender != questBoard) revert Errors.CallerNotAllowed(); if(questRewardToken[questID] != address(0)) revert Errors.QuestAlreadyListed(); if(token == address(0)) revert Errors.TokenNotWhitelisted(); // Add a new Quest using the QuestID, and list the reward token for that Quest questRewardToken[questID] = token; if(!rewardTokens[token]) rewardTokens[token] = true; emit NewQuest(questID, token); return true; } /** * @notice Adds a new period & the rewards of this period for a Quest * @dev Adds a new period & the rewards of this period for a Quest * @param questID ID of the Quest * @param period Timestamp of the period * @param totalRewardAmount Total amount of rewards to distribute for the period * @return bool : success */ function addQuestPeriod(uint256 questID, uint256 period, uint256 totalRewardAmount) external returns(bool) { period = (period / WEEK) * WEEK; if(msg.sender != questBoard) revert Errors.CallerNotAllowed(); if(questRewardToken[questID] == address(0)) revert Errors.QuestNotListed(); if(questRewardsPerPeriod[questID][period] != 0) revert Errors.PeriodAlreadyUpdated(); if(period == 0) revert Errors.IncorrectPeriod(); if(totalRewardAmount == 0) revert Errors.NullAmount(); questRewardsPerPeriod[questID][period] = totalRewardAmount; return true; } function fixQuestPeriod(uint256 questID, uint256 period, uint256 newTotalRewardAmount) external returns(bool) { if(msg.sender != questBoard) revert Errors.CallerNotAllowed(); period = (period / WEEK) * WEEK; if(questRewardToken[questID] == address(0)) revert Errors.QuestNotListed(); if(period == 0) revert Errors.IncorrectPeriod(); if(questRewardsPerPeriod[questID][period] == 0) revert Errors.PeriodNotListed(); uint256 previousTotalRewardAmount = questRewardsPerPeriod[questID][period]; questRewardsPerPeriod[questID][period] = newTotalRewardAmount; if(previousTotalRewardAmount > newTotalRewardAmount){ // Send back the extra amount of reward token that was incorrectly sent // In the case of missing reward token, the Board will send them to this contract uint256 extraAmount = previousTotalRewardAmount - newTotalRewardAmount; IERC20(questRewardToken[questID]).safeTransfer(questBoard, extraAmount); } return true; } /** * @notice Updates the period of a Quest by adding the Merkle Root * @dev Add the Merkle Root for the eriod of the given Quest * @param questID ID of the Quest * @param period timestamp of the period * @param totalAmount sum of all rewards for the Merkle Tree * @param merkleRoot MerkleRoot to add * @return bool: success */ function updateQuestPeriod(uint256 questID, uint256 period, uint256 totalAmount, bytes32 merkleRoot) external onlyAllowed returns(bool) { period = (period / WEEK) * WEEK; if(questRewardToken[questID] == address(0)) revert Errors.QuestNotListed(); if(period == 0) revert Errors.IncorrectPeriod(); if(questRewardsPerPeriod[questID][period] == 0) revert Errors.PeriodNotListed(); if(questMerkleRootPerPeriod[questID][period] != 0) revert Errors.PeriodAlreadyUpdated(); if(merkleRoot == 0) revert Errors.EmptyMerkleRoot(); // Add a new Closed Period for the Quest questClosedPeriods[questID].push(period); if(totalAmount != questRewardsPerPeriod[questID][period]) revert Errors.IncorrectRewardAmount(); // Add the new MerkleRoot for that Closed Period questMerkleRootPerPeriod[questID][period] = merkleRoot; emit QuestPeriodUpdated(questID, period, merkleRoot); return true; } // Admin functions /** * @notice Recovers ERC2O tokens sent by mistake to the contract * @dev Recovers ERC2O tokens sent by mistake to the contract * @param token Address tof the EC2O token * @return bool: success */ function recoverERC20(address token) external onlyOwner nonReentrant returns(bool) { if(rewardTokens[token]) revert Errors.CannotRecoverToken(); uint256 amount = IERC20(token).balanceOf(address(this)); if(amount == 0) revert Errors.NullAmount(); IERC20(token).safeTransfer(owner(), amount); return true; } // /** * @notice Allows to update the MerkleRoot for a given period of a Quest if the current Root is incorrect * @dev Updates the MerkleRoot for the period of the Quest * @param questID ID of the Quest * @param period Timestamp of the period * @param merkleRoot New MerkleRoot to add * @return bool : success */ function emergencyUpdateQuestPeriod(uint256 questID, uint256 period, uint256 addedRewardAmount, bytes32 merkleRoot) external onlyOwner returns(bool) { // In case the given MerkleRoot was incorrect: // Process: // 1 - block claims for the Quest period by using this method to set an incorrect MerkleRoot, where no proof matches the root // 2 - prepare a new Merkle Tree, taking in account user previous claims on that period, and missing/overpaid rewards // a - for all new claims to be added, set them after the last index of the previous Merkle Tree // b - for users that did not claim, keep the same index, and adjust the amount to claim if needed // c - for indexes that were claimed, place an empty node in the Merkle Tree (with an amount at 0 & the address 0xdead as the account) // 3 - update the Quest period with the correct MerkleRoot // (no need to change the Bitmap, as the new MerkleTree will account for the indexes already claimed) period = (period / WEEK) * WEEK; if(questRewardToken[questID] == address(0)) revert Errors.QuestNotListed(); if(period == 0) revert Errors.IncorrectPeriod(); if(questMerkleRootPerPeriod[questID][period] == 0) revert Errors.PeriodNotClosed(); if(merkleRoot == 0) revert Errors.EmptyMerkleRoot(); questMerkleRootPerPeriod[questID][period] = merkleRoot; questRewardsPerPeriod[questID][period] += addedRewardAmount; emit QuestPeriodUpdated(questID, period, merkleRoot); return true; } }
pragma solidity ^0.8.16; //SPDX-License-Identifier: MIT library Errors { // Common Errors error AddressZero(); error NullAmount(); error CallerNotAllowed(); error IncorrectRewardToken(); error SameAddress(); error InequalArraySizes(); error EmptyArray(); error EmptyParameters(); error AlreadyInitialized(); error InvalidParameter(); error CannotRecoverToken(); error ForbiddenCall(); error CannotBeOwner(); error CallerNotPendingOwner(); error Killed(); error AlreadyKilled(); error NotKilled(); error KillDelayExpired(); error KillDelayNotExpired(); // Merkle Errors error MerkleRootNotUpdated(); error AlreadyClaimed(); error InvalidProof(); error EmptyMerkleRoot(); error IncorrectRewardAmount(); error MerkleRootFrozen(); error NotFrozen(); error AlreadyFrozen(); // Quest Errors error CallerNotQuestBoard(); error IncorrectQuestID(); error IncorrectPeriod(); error TokenNotWhitelisted(); error QuestAlreadyListed(); error QuestNotListed(); error PeriodAlreadyUpdated(); error PeriodNotClosed(); error PeriodStillActive(); error PeriodNotListed(); error EmptyQuest(); error EmptyPeriod(); error ExpiredQuest(); error QuestNotStarted(); error QuestTypeForbidden(); error NotInitialized(); error NoDistributorSet(); error DisitributorFail(); error InvalidGauge(); error InvalidQuestID(); error InvalidPeriod(); error ObjectiveTooLow(); error NewObjectiveTooLow(); error RewardPerVoteTooLow(); error MinValueOverMaxValue(); error IncorrectDuration(); error IncorrectAddDuration(); error IncorrectTotalRewardAmount(); error IncorrectAddedRewardAmount(); error IncorrectFeeAmount(); error InvalidQuestType(); error QuestTypesIncompatible(); error CalletNotQuestCreator(); error LowerRewardPerVote(); error LowerObjective(); error CreatorNotAllowed(); error AlreadyListed(); error NotListed(); error MaxListSize(); error BoardIsNotAllowedDistributor(); // Proxy error InvalidChainID(); error InvalidCaller(); error PeriodBiasNotUpdated(); error GaugeAlreadyAdded(); error AmountExceedsBalance(); error RecoverFailed(); //Math error NumberExceed48Bits(); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../interfaces/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; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library 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.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev 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.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]) : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { unchecked { return hashes[totalHashes - 1]; } } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "./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 anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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 pragma solidity 0.8.20; import "../oz/utils/Ownable.sol"; import "../libraries/Errors.sol"; /** @title 2-step Ownership */ /// @author Paladin /* Extends OZ Ownable contract to add 2-step ownership transfer */ contract Owner is Ownable { address public pendingOwner; event NewPendingOwner(address indexed previousPendingOwner, address indexed newPendingOwner); function transferOwnership(address newOwner) public override virtual onlyOwner { if(newOwner == address(0)) revert Errors.AddressZero(); if(newOwner == owner()) revert Errors.CannotBeOwner(); address oldPendingOwner = pendingOwner; pendingOwner = newOwner; emit NewPendingOwner(oldPendingOwner, newOwner); } function acceptOwnership() public virtual { if(msg.sender != pendingOwner) revert Errors.CallerNotPendingOwner(); address newOwner = pendingOwner; _transferOwnership(pendingOwner); pendingOwner = address(0); emit NewPendingOwner(newOwner, address(0)); } }
{ "optimizer": { "enabled": true, "runs": 9999 }, "viaIR": false, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_questBoard","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AddressZero","type":"error"},{"inputs":[],"name":"AlreadyClaimed","type":"error"},{"inputs":[],"name":"CallerNotAllowed","type":"error"},{"inputs":[],"name":"CallerNotPendingOwner","type":"error"},{"inputs":[],"name":"CannotBeOwner","type":"error"},{"inputs":[],"name":"CannotRecoverToken","type":"error"},{"inputs":[],"name":"EmptyMerkleRoot","type":"error"},{"inputs":[],"name":"EmptyParameters","type":"error"},{"inputs":[],"name":"IncorrectPeriod","type":"error"},{"inputs":[],"name":"IncorrectQuestID","type":"error"},{"inputs":[],"name":"IncorrectRewardAmount","type":"error"},{"inputs":[],"name":"InvalidProof","type":"error"},{"inputs":[],"name":"MerkleRootNotUpdated","type":"error"},{"inputs":[],"name":"NullAmount","type":"error"},{"inputs":[],"name":"PeriodAlreadyUpdated","type":"error"},{"inputs":[],"name":"PeriodNotClosed","type":"error"},{"inputs":[],"name":"PeriodNotListed","type":"error"},{"inputs":[],"name":"QuestAlreadyListed","type":"error"},{"inputs":[],"name":"QuestNotListed","type":"error"},{"inputs":[],"name":"TokenNotWhitelisted","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"questID","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"period","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"rewardToken","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousPendingOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newPendingOwner","type":"address"}],"name":"NewPendingOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"questID","type":"uint256"},{"indexed":false,"internalType":"address","name":"rewardToken","type":"address"}],"name":"NewQuest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"questID","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"period","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"QuestPeriodUpdated","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"address","name":"token","type":"address"}],"name":"addQuest","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"totalRewardAmount","type":"uint256"}],"name":"addQuestPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"questID","type":"uint256"},{"components":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct MultiMerkleDistributor.ClaimParams[]","name":"claims","type":"tuple[]"}],"name":"claimQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"addedRewardAmount","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"emergencyUpdateQuestPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"newTotalRewardAmount","type":"uint256"}],"name":"fixQuestPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"questID","type":"uint256"}],"name":"getClosedPeriodsByQuests","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"components":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"internalType":"struct MultiMerkleDistributor.ClaimParams[]","name":"claims","type":"tuple[]"}],"name":"multiClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"questBoard","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"questClosedPeriods","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"questMerkleRootPerPeriod","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"questRewardToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"questRewardsPerPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"recoverERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardTokens","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":[{"internalType":"uint256","name":"questID","type":"uint256"},{"internalType":"uint256","name":"period","type":"uint256"},{"internalType":"uint256","name":"totalAmount","type":"uint256"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"updateQuestPeriod","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040523480156200001157600080fd5b506040516200274f3803806200274f8339810160408190526200003491620000ce565b6200003f336200007e565b60016002556001600160a01b0381166200006c57604051639fabe1c160e01b815260040160405180910390fd5b6001600160a01b031660805262000100565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000e157600080fd5b81516001600160a01b0381168114620000f957600080fd5b9392505050565b6080516126106200013f600039600081816101a101528181610f570152818161112a015281816112c901528181611476015261196201526126106000f3fe608060405234801561001057600080fd5b50600436106101825760003560e01c8063715018a6116100d857806395861d5c1161008c578063e30c397811610066578063e30c3978146103ac578063f2fde38b146103bf578063f5ab16cc146103d257600080fd5b806395861d5c1461035d5780639e8c708e14610386578063c25a4d9e1461039957600080fd5b806379ba5097116100bd57806379ba5097146103195780638da5cb5b14610321578063933803581461033257600080fd5b8063715018a6146102fe57806375d0d3801461030657600080fd5b8063493b952c1161013a578063657c5e8c11610114578063657c5e8c146102c55780636a9b8ce5146102d85780636ec803bb146102eb57600080fd5b8063493b952c1461023657806358ad40641461026f578063627614ac1461028257600080fd5b806317fea75c1161016b57806317fea75c146101e05780633a3e6a771461020357806346fe84e91461021657600080fd5b80630c3a0fff14610187578063131227981461019c575b600080fd5b61019a610195366004612118565b6103f5565b005b6101c37f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101f36101ee366004612193565b6106dd565b60405190151581526020016101d7565b61019a6102113660046121c5565b61089d565b61022961022436600461221f565b610ee8565b6040516101d79190612238565b61026161024436600461227c565b600760209081526000928352604080842090915290825290205481565b6040519081526020016101d7565b6101f361027d36600461229e565b610f4a565b6101f36102903660046122ca565b60009283526008602081815260408086209486529381528385209183901c855252912054600160ff9092169190911b16151590565b6101f36102d33660046122ca565b61111d565b61019a6102e63660046122f6565b6112fb565b6102616102f936600461227c565b611424565b61019a611455565b6101f3610314366004612193565b611469565b61019a611722565b6000546001600160a01b03166101c3565b61026161034036600461227c565b600660209081526000928352604080842090915290825290205481565b6101c361036b36600461221f565b6003602052600090815260409020546001600160a01b031681565b6101f3610394366004612349565b6117dc565b6101f36103a73660046122ca565b61193b565b6001546101c3906001600160a01b031681565b61019a6103cd366004612349565b611aeb565b6101f36103e0366004612349565b60046020526000908152604090205460ff1681565b6103fd611bf3565b6001600160a01b03841661043d576040517f9fabe1c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000878152600660209081526040808320898452909152812054900361048f576040517fbc68df3f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008781526008602081815260408084208a855282528084209289901c8452919052902054600160ff87161b16156104f3576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160208101899052908101879052606080820187905285901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660808201526094810184905260009060b4016040516020818303038152906040528051906020012090506105b183838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508d81526006602090815260408083208f84529091529020549250859150611c699050565b6105e7576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008881526003602090815260408083205460088084528285208c86528452828520908b901c855283528184208054600160ff8d161b1790558b8452600783528184208b8552909252822080546001600160a01b0390921692879261064d908490612393565b9091555061066790506001600160a01b0382168787611c7f565b856001600160a01b0316888a7f9a5376f7dcf8631c2b6249c9bec3d715cb97bdd4c82d92e55d147f6b4eea41978a89866040516106c09392919092835260208301919091526001600160a01b0316604082015260600190565b60405180910390a450506106d46001600255565b50505050505050565b60006106e7611d04565b62093a806106f581866123a6565b6106ff91906123e1565b6000868152600360205260409020549094506001600160a01b0316610750576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600003610789576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260066020908152604080832087845290915281205490036107db576040517f226e5a6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000829003610816576040517f85ac2b9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000858152600660209081526040808320878452825280832085905587835260078252808320878452909152812080548592906108549084906123f8565b9091555050604051828152849086907f1d3b13bb6ce947c806a76a3476eafd33ec751e6ed2cbbdf7ab8503a4fb76a1ee906020015b60405180910390a35060015b949350505050565b6108a5611bf3565b6001600160a01b0384166108e5576040517f9fabe1c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000819003610921576040517fb68370bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848152600360205260408120546001600160a01b0316815b83811015610ec057868686838181106109565761095661240b565b9050602002810190610968919061243a565b35146109a0576040517f27140a4b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000878152600660205260408120908787848181106109c1576109c161240b565b90506020028101906109d3919061243a565b602001358152602001908152602001600020546000801b03610a21576040517fbc68df3f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aaa87878784818110610a3757610a3761240b565b9050602002810190610a49919061243a565b60200135888885818110610a5f57610a5f61240b565b9050602002810190610a71919061243a565b6040013560009283526008602081815260408086209486529381528385209183901c855252912054600160ff9092169190911b16151590565b15610ae1576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600087878784818110610af657610af661240b565b9050602002810190610b08919061243a565b60200135888885818110610b1e57610b1e61240b565b9050602002810190610b30919061243a565b604001358b8a8a87818110610b4757610b4761240b565b9050602002810190610b59919061243a565b604080516020810196909652850193909352606080850192909252811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660808401520135609482015260b401604051602081830303815290604052805190602001209050610c70878784818110610bd457610bd461240b565b9050602002810190610be6919061243a565b610bf4906080810190612478565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508d8152600660205260408120935091508b90508a87818110610c4557610c4561240b565b9050602002810190610c57919061243a565b6020013581526020019081526020016000205483611c69565b610ca6576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d3288888885818110610cbc57610cbc61240b565b9050602002810190610cce919061243a565b60200135898986818110610ce457610ce461240b565b9050602002810190610cf6919061243a565b6040013560009283526008602081815260408086209486529381528385209183901c85525291208054600160ff9093169290921b919091179055565b868683818110610d4457610d4461240b565b9050602002810190610d56919061243a565b60600135600760008a81526020019081526020016000206000898986818110610d8157610d8161240b565b9050602002810190610d93919061243a565b6020013581526020019081526020016000206000828254610db49190612393565b909155508790508683818110610dcc57610dcc61240b565b9050602002810190610dde919061243a565b610dec9060600135856123f8565b9350886001600160a01b0316878784818110610e0a57610e0a61240b565b9050602002810190610e1c919061243a565b60200135897f9a5376f7dcf8631c2b6249c9bec3d715cb97bdd4c82d92e55d147f6b4eea41978a8a87818110610e5457610e5461240b565b9050602002810190610e66919061243a565b604001358b8b88818110610e7c57610e7c61240b565b9050602002810190610e8e919061243a565b6040805192835260609182013560208401526001600160a01b038a16908301520160405180910390a45060010161093b565b50610ed56001600160a01b0382168884611c7f565b505050610ee26001600255565b50505050565b600081815260056020908152604091829020805483518184028101840190945280845260609392830182828015610f3e57602002820191906000526020600020905b815481526020019060010190808311610f2a575b50505050509050919050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610fae576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600360205260409020546001600160a01b031615610ffd576040517f83d2396d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03821661103d576040517ff84835a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600083815260036020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387169081179091558352600490915290205460ff166110d5576001600160a01b038216600090815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b6040516001600160a01b038316815283907f6746344851206b5fc2dc76bcb3512131fd07c324969cd3ee22781928054779619060200160405180910390a25060015b92915050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611181576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62093a8061118f81856123a6565b61119991906123e1565b6000858152600360205260409020549093506001600160a01b03166111ea576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600003611223576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008481526007602090815260408083208684529091528120549003611275576040517f48a0a74d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008481526007602090815260408083208684529091529020805490839055828111156112f05760006112a88483612393565b6000878152600360205260409020549091506112ee906001600160a01b03167f000000000000000000000000000000000000000000000000000000000000000083611c7f565b505b506001949350505050565b806000819003611337576040517fb68370bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561141d576114158484838181106113575761135761240b565b9050602002810190611369919061243a565b3585858481811061137c5761137c61240b565b905060200281019061138e919061243a565b602001358686858181106113a4576113a461240b565b90506020028101906113b6919061243a565b60400135888888878181106113cd576113cd61240b565b90506020028101906113df919061243a565b606001358989888181106113f5576113f561240b565b9050602002810190611407919061243a565b610195906080810190612478565b60010161133a565b5050505050565b6005602052816000526040600020818154811061144057600080fd5b90600052602060002001600091509150505481565b61145d611d04565b6114676000611d78565b565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015906114af57506000546001600160a01b03163314155b156114e6576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62093a806114f481866123a6565b6114fe91906123e1565b6000868152600360205260409020549094506001600160a01b031661154f576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600003611588576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260076020908152604080832087845290915281205490036115da576040517f48a0a74d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526006602090815260408083208784529091529020541561162b576040517f4daee9d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000829003611666576040517f85ac2b9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526005602090815260408083208054600181018255908452828420018790558783526007825280832087845290915290205483146116d4576040517f7b510d6600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526006602090815260408083208784528252918290208490559051838152859187917f1d3b13bb6ce947c806a76a3476eafd33ec751e6ed2cbbdf7ab8503a4fb76a1ee9101610889565b6001546001600160a01b03163314611766576040517f2f02da5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546001600160a01b031661177b81611d78565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040516000906001600160a01b038316907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b908390a350565b60006117e6611d04565b6117ee611bf3565b6001600160a01b03821660009081526004602052604090205460ff1615611841576040517f80eb2a0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156118a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c591906124e0565b905080600003611901576040517fe5a7449000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6119276119166000546001600160a01b031690565b6001600160a01b0385169083611c7f565b60019150506119366001600255565b919050565b600062093a8061194b81856123a6565b61195591906123e1565b9250336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146119b9576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848152600360205260409020546001600160a01b0316611a07576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600084815260076020908152604080832086845290915290205415611a58576040517f4daee9d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600003611a91576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600003611acb576040517fe5a7449000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000928352600760209081526040808520938552929052912055600190565b611af3611d04565b6001600160a01b038116611b33576040517f9fabe1c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546001600160a01b03166001600160a01b0316816001600160a01b031603611b89576040517fd5e889bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b90600090a35050565b6002805403611c63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60028055565b600082611c768584611de0565b14949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611cff908490611e2d565b505050565b6000546001600160a01b03163314611467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611c5a565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b8451811015611e2557611e1182868381518110611e0457611e0461240b565b6020026020010151611f2c565b915080611e1d816124f9565b915050611de5565b509392505050565b6000611e82826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f5e9092919063ffffffff16565b805190915015611cff5780806020019051810190611ea09190612531565b611cff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401611c5a565b6000818310611f48576000828152602084905260409020611f57565b60008381526020839052604090205b9392505050565b6060610895848460008585600080866001600160a01b03168587604051611f859190612577565b60006040518083038185875af1925050503d8060008114611fc2576040519150601f19603f3d011682016040523d82523d6000602084013e611fc7565b606091505b5091509150611fd887838387611fe3565b979650505050505050565b6060831561206c578251600003612065576001600160a01b0385163b612065576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611c5a565b5081610895565b61089583838151156120815781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5a9190612589565b80356001600160a01b038116811461193657600080fd5b60008083601f8401126120de57600080fd5b50813567ffffffffffffffff8111156120f657600080fd5b6020830191508360208260051b850101111561211157600080fd5b9250929050565b600080600080600080600060c0888a03121561213357600080fd5b873596506020880135955060408801359450612151606089016120b5565b93506080880135925060a088013567ffffffffffffffff81111561217457600080fd5b6121808a828b016120cc565b989b979a50959850939692959293505050565b600080600080608085870312156121a957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600080606085870312156121db57600080fd5b6121e4856120b5565b935060208501359250604085013567ffffffffffffffff81111561220757600080fd5b612213878288016120cc565b95989497509550505050565b60006020828403121561223157600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b8181101561227057835183529284019291840191600101612254565b50909695505050505050565b6000806040838503121561228f57600080fd5b50508035926020909101359150565b600080604083850312156122b157600080fd5b823591506122c1602084016120b5565b90509250929050565b6000806000606084860312156122df57600080fd5b505081359360208301359350604090920135919050565b60008060006040848603121561230b57600080fd5b612314846120b5565b9250602084013567ffffffffffffffff81111561233057600080fd5b61233c868287016120cc565b9497909650939450505050565b60006020828403121561235b57600080fd5b611f57826120b5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561111757611117612364565b6000826123dc577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b808202811582820484141761111757611117612364565b8082018082111561111757611117612364565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261246e57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126124ad57600080fd5b83018035915067ffffffffffffffff8211156124c857600080fd5b6020019150600581901b360382131561211157600080fd5b6000602082840312156124f257600080fd5b5051919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361252a5761252a612364565b5060010190565b60006020828403121561254357600080fd5b81518015158114611f5757600080fd5b60005b8381101561256e578181015183820152602001612556565b50506000910152565b6000825161246e818460208701612553565b60208152600082518060208401526125a8816040850160208701612553565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220bbf13e02827760c975549521b8a657e6326f063d426426a673d75d82773a87d064736f6c6343000814003300000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c635
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101825760003560e01c8063715018a6116100d857806395861d5c1161008c578063e30c397811610066578063e30c3978146103ac578063f2fde38b146103bf578063f5ab16cc146103d257600080fd5b806395861d5c1461035d5780639e8c708e14610386578063c25a4d9e1461039957600080fd5b806379ba5097116100bd57806379ba5097146103195780638da5cb5b14610321578063933803581461033257600080fd5b8063715018a6146102fe57806375d0d3801461030657600080fd5b8063493b952c1161013a578063657c5e8c11610114578063657c5e8c146102c55780636a9b8ce5146102d85780636ec803bb146102eb57600080fd5b8063493b952c1461023657806358ad40641461026f578063627614ac1461028257600080fd5b806317fea75c1161016b57806317fea75c146101e05780633a3e6a771461020357806346fe84e91461021657600080fd5b80630c3a0fff14610187578063131227981461019c575b600080fd5b61019a610195366004612118565b6103f5565b005b6101c37f00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c63581565b6040516001600160a01b0390911681526020015b60405180910390f35b6101f36101ee366004612193565b6106dd565b60405190151581526020016101d7565b61019a6102113660046121c5565b61089d565b61022961022436600461221f565b610ee8565b6040516101d79190612238565b61026161024436600461227c565b600760209081526000928352604080842090915290825290205481565b6040519081526020016101d7565b6101f361027d36600461229e565b610f4a565b6101f36102903660046122ca565b60009283526008602081815260408086209486529381528385209183901c855252912054600160ff9092169190911b16151590565b6101f36102d33660046122ca565b61111d565b61019a6102e63660046122f6565b6112fb565b6102616102f936600461227c565b611424565b61019a611455565b6101f3610314366004612193565b611469565b61019a611722565b6000546001600160a01b03166101c3565b61026161034036600461227c565b600660209081526000928352604080842090915290825290205481565b6101c361036b36600461221f565b6003602052600090815260409020546001600160a01b031681565b6101f3610394366004612349565b6117dc565b6101f36103a73660046122ca565b61193b565b6001546101c3906001600160a01b031681565b61019a6103cd366004612349565b611aeb565b6101f36103e0366004612349565b60046020526000908152604090205460ff1681565b6103fd611bf3565b6001600160a01b03841661043d576040517f9fabe1c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000878152600660209081526040808320898452909152812054900361048f576040517fbc68df3f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008781526008602081815260408084208a855282528084209289901c8452919052902054600160ff87161b16156104f3576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160208101899052908101879052606080820187905285901b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660808201526094810184905260009060b4016040516020818303038152906040528051906020012090506105b183838080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508d81526006602090815260408083208f84529091529020549250859150611c699050565b6105e7576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008881526003602090815260408083205460088084528285208c86528452828520908b901c855283528184208054600160ff8d161b1790558b8452600783528184208b8552909252822080546001600160a01b0390921692879261064d908490612393565b9091555061066790506001600160a01b0382168787611c7f565b856001600160a01b0316888a7f9a5376f7dcf8631c2b6249c9bec3d715cb97bdd4c82d92e55d147f6b4eea41978a89866040516106c09392919092835260208301919091526001600160a01b0316604082015260600190565b60405180910390a450506106d46001600255565b50505050505050565b60006106e7611d04565b62093a806106f581866123a6565b6106ff91906123e1565b6000868152600360205260409020549094506001600160a01b0316610750576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600003610789576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260066020908152604080832087845290915281205490036107db576040517f226e5a6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000829003610816576040517f85ac2b9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000858152600660209081526040808320878452825280832085905587835260078252808320878452909152812080548592906108549084906123f8565b9091555050604051828152849086907f1d3b13bb6ce947c806a76a3476eafd33ec751e6ed2cbbdf7ab8503a4fb76a1ee906020015b60405180910390a35060015b949350505050565b6108a5611bf3565b6001600160a01b0384166108e5576040517f9fabe1c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000819003610921576040517fb68370bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848152600360205260408120546001600160a01b0316815b83811015610ec057868686838181106109565761095661240b565b9050602002810190610968919061243a565b35146109a0576040517f27140a4b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000878152600660205260408120908787848181106109c1576109c161240b565b90506020028101906109d3919061243a565b602001358152602001908152602001600020546000801b03610a21576040517fbc68df3f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610aaa87878784818110610a3757610a3761240b565b9050602002810190610a49919061243a565b60200135888885818110610a5f57610a5f61240b565b9050602002810190610a71919061243a565b6040013560009283526008602081815260408086209486529381528385209183901c855252912054600160ff9092169190911b16151590565b15610ae1576040517f646cf55800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600087878784818110610af657610af661240b565b9050602002810190610b08919061243a565b60200135888885818110610b1e57610b1e61240b565b9050602002810190610b30919061243a565b604001358b8a8a87818110610b4757610b4761240b565b9050602002810190610b59919061243a565b604080516020810196909652850193909352606080850192909252811b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001660808401520135609482015260b401604051602081830303815290604052805190602001209050610c70878784818110610bd457610bd461240b565b9050602002810190610be6919061243a565b610bf4906080810190612478565b8080602002602001604051908101604052809392919081815260200183836020028082843760009201829052508d8152600660205260408120935091508b90508a87818110610c4557610c4561240b565b9050602002810190610c57919061243a565b6020013581526020019081526020016000205483611c69565b610ca6576040517f09bde33900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610d3288888885818110610cbc57610cbc61240b565b9050602002810190610cce919061243a565b60200135898986818110610ce457610ce461240b565b9050602002810190610cf6919061243a565b6040013560009283526008602081815260408086209486529381528385209183901c85525291208054600160ff9093169290921b919091179055565b868683818110610d4457610d4461240b565b9050602002810190610d56919061243a565b60600135600760008a81526020019081526020016000206000898986818110610d8157610d8161240b565b9050602002810190610d93919061243a565b6020013581526020019081526020016000206000828254610db49190612393565b909155508790508683818110610dcc57610dcc61240b565b9050602002810190610dde919061243a565b610dec9060600135856123f8565b9350886001600160a01b0316878784818110610e0a57610e0a61240b565b9050602002810190610e1c919061243a565b60200135897f9a5376f7dcf8631c2b6249c9bec3d715cb97bdd4c82d92e55d147f6b4eea41978a8a87818110610e5457610e5461240b565b9050602002810190610e66919061243a565b604001358b8b88818110610e7c57610e7c61240b565b9050602002810190610e8e919061243a565b6040805192835260609182013560208401526001600160a01b038a16908301520160405180910390a45060010161093b565b50610ed56001600160a01b0382168884611c7f565b505050610ee26001600255565b50505050565b600081815260056020908152604091829020805483518184028101840190945280845260609392830182828015610f3e57602002820191906000526020600020905b815481526020019060010190808311610f2a575b50505050509050919050565b6000336001600160a01b037f00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c6351614610fae576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600360205260409020546001600160a01b031615610ffd576040517f83d2396d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03821661103d576040517ff84835a000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600083815260036020908152604080832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387169081179091558352600490915290205460ff166110d5576001600160a01b038216600090815260046020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b6040516001600160a01b038316815283907f6746344851206b5fc2dc76bcb3512131fd07c324969cd3ee22781928054779619060200160405180910390a25060015b92915050565b6000336001600160a01b037f00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c6351614611181576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62093a8061118f81856123a6565b61119991906123e1565b6000858152600360205260409020549093506001600160a01b03166111ea576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600003611223576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008481526007602090815260408083208684529091528120549003611275576040517f48a0a74d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008481526007602090815260408083208684529091529020805490839055828111156112f05760006112a88483612393565b6000878152600360205260409020549091506112ee906001600160a01b03167f00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c63583611c7f565b505b506001949350505050565b806000819003611337576040517fb68370bb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8181101561141d576114158484838181106113575761135761240b565b9050602002810190611369919061243a565b3585858481811061137c5761137c61240b565b905060200281019061138e919061243a565b602001358686858181106113a4576113a461240b565b90506020028101906113b6919061243a565b60400135888888878181106113cd576113cd61240b565b90506020028101906113df919061243a565b606001358989888181106113f5576113f561240b565b9050602002810190611407919061243a565b610195906080810190612478565b60010161133a565b5050505050565b6005602052816000526040600020818154811061144057600080fd5b90600052602060002001600091509150505481565b61145d611d04565b6114676000611d78565b565b6000336001600160a01b037f00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c63516148015906114af57506000546001600160a01b03163314155b156114e6576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b62093a806114f481866123a6565b6114fe91906123e1565b6000868152600360205260409020549094506001600160a01b031661154f576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b83600003611588576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600085815260076020908152604080832087845290915281205490036115da576040517f48a0a74d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526006602090815260408083208784529091529020541561162b576040517f4daee9d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000829003611666576040517f85ac2b9900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526005602090815260408083208054600181018255908452828420018790558783526007825280832087845290915290205483146116d4576040517f7b510d6600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008581526006602090815260408083208784528252918290208490559051838152859187917f1d3b13bb6ce947c806a76a3476eafd33ec751e6ed2cbbdf7ab8503a4fb76a1ee9101610889565b6001546001600160a01b03163314611766576040517f2f02da5800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001546001600160a01b031661177b81611d78565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040516000906001600160a01b038316907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b908390a350565b60006117e6611d04565b6117ee611bf3565b6001600160a01b03821660009081526004602052604090205460ff1615611841576040517f80eb2a0100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa1580156118a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118c591906124e0565b905080600003611901576040517fe5a7449000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6119276119166000546001600160a01b031690565b6001600160a01b0385169083611c7f565b60019150506119366001600255565b919050565b600062093a8061194b81856123a6565b61195591906123e1565b9250336001600160a01b037f00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c63516146119b9576040517f2af07d2000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000848152600360205260409020546001600160a01b0316611a07576040517fe72eafc300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600084815260076020908152604080832086845290915290205415611a58576040517f4daee9d200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b82600003611a91576040517e7af3d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600003611acb576040517fe5a7449000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000928352600760209081526040808520938552929052912055600190565b611af3611d04565b6001600160a01b038116611b33576040517f9fabe1c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000546001600160a01b03166001600160a01b0316816001600160a01b031603611b89576040517fd5e889bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907fb3d55174552271a4f1aaf36b72f50381e892171636b3fb5447fe00e995e7a37b90600090a35050565b6002805403611c63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b60028055565b600082611c768584611de0565b14949350505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611cff908490611e2d565b505050565b6000546001600160a01b03163314611467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401611c5a565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081815b8451811015611e2557611e1182868381518110611e0457611e0461240b565b6020026020010151611f2c565b915080611e1d816124f9565b915050611de5565b509392505050565b6000611e82826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611f5e9092919063ffffffff16565b805190915015611cff5780806020019051810190611ea09190612531565b611cff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401611c5a565b6000818310611f48576000828152602084905260409020611f57565b60008381526020839052604090205b9392505050565b6060610895848460008585600080866001600160a01b03168587604051611f859190612577565b60006040518083038185875af1925050503d8060008114611fc2576040519150601f19603f3d011682016040523d82523d6000602084013e611fc7565b606091505b5091509150611fd887838387611fe3565b979650505050505050565b6060831561206c578251600003612065576001600160a01b0385163b612065576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401611c5a565b5081610895565b61089583838151156120815781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5a9190612589565b80356001600160a01b038116811461193657600080fd5b60008083601f8401126120de57600080fd5b50813567ffffffffffffffff8111156120f657600080fd5b6020830191508360208260051b850101111561211157600080fd5b9250929050565b600080600080600080600060c0888a03121561213357600080fd5b873596506020880135955060408801359450612151606089016120b5565b93506080880135925060a088013567ffffffffffffffff81111561217457600080fd5b6121808a828b016120cc565b989b979a50959850939692959293505050565b600080600080608085870312156121a957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600080606085870312156121db57600080fd5b6121e4856120b5565b935060208501359250604085013567ffffffffffffffff81111561220757600080fd5b612213878288016120cc565b95989497509550505050565b60006020828403121561223157600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b8181101561227057835183529284019291840191600101612254565b50909695505050505050565b6000806040838503121561228f57600080fd5b50508035926020909101359150565b600080604083850312156122b157600080fd5b823591506122c1602084016120b5565b90509250929050565b6000806000606084860312156122df57600080fd5b505081359360208301359350604090920135919050565b60008060006040848603121561230b57600080fd5b612314846120b5565b9250602084013567ffffffffffffffff81111561233057600080fd5b61233c868287016120cc565b9497909650939450505050565b60006020828403121561235b57600080fd5b611f57826120b5565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561111757611117612364565b6000826123dc577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b808202811582820484141761111757611117612364565b8082018082111561111757611117612364565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6183360301811261246e57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126124ad57600080fd5b83018035915067ffffffffffffffff8211156124c857600080fd5b6020019150600581901b360382131561211157600080fd5b6000602082840312156124f257600080fd5b5051919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361252a5761252a612364565b5060010190565b60006020828403121561254357600080fd5b81518015158114611f5757600080fd5b60005b8381101561256e578181015183820152602001612556565b50506000910152565b6000825161246e818460208701612553565b60208152600082518060208401526125a8816040850160208701612553565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea2646970667358221220bbf13e02827760c975549521b8a657e6326f063d426426a673d75d82773a87d064736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c635
-----Decoded View---------------
Arg [0] : _questBoard (address): 0x85B66887D4Bf9a6116C12A27c91a10F86995C635
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000085b66887d4bf9a6116c12a27c91a10f86995c635
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.