Contract Overview
Balance:
0 AVAX
Token:
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
LoadRewardHandler
Compiler Version
v0.8.14+commit.80d49f37
Optimization Enabled:
Yes with 500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.14; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "../libraries/IRewardReceiver.sol"; import "../libraries/IERC20Mint.sol"; contract LoadRewardHandler is ReentrancyGuard, Ownable, EIP712, ERC721Holder, IRewardReceiver { using ECDSA for bytes32; using SafeERC20 for IERC20; using EnumerableSet for EnumerableSet.UintSet; event NestStaked(address indexed user, uint256 indexed tokenId); event NestWithdrawn(address indexed user, uint256 indexed tokenId); event NestClaimed(address indexed user, uint256 indexed tokenId, address indexed tokenClaimed, uint256 amount); event TreasuryPercentageSet(address indexed user, uint256 oldPercentage, uint256 newPercentage); event TokenBurnPercentageSet(address indexed user, address indexed token, uint256 oldPercentage, uint256 newPercentage); event SenderPermissionAdded(address indexed user, address indexed sender); event SenderPermissionRemoved(address indexed user, address indexed sender); event UpdateSigner(address indexed newSigner); event NestPercentageSet(uint256 indexed newPercentage); event NestContractSet(address indexed newNestContract); event TreasurySet(address indexed newTreasury); event CantMintSet(address indexed newCantMint); event CanMintSet(address indexed newCanMint); event ReceivedTokens(address indexed tokenAddress, uint256 indexed amount); event TransferTokensNoDistribution(address indexed tokenAddress, uint256 indexed amount); event PendingTokensClaimed(address indexed user, address indexed tokenAddress, uint256 indexed amount); struct NestInfo { bool isStaked; address stakerAddress; mapping(address => uint256) pendingRewards; } EnumerableSet.UintSet private stakedNestsSet; address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD; uint256 public constant NEST_COUNT = 25; uint256 public NEST_PERCENTAGE = 100; uint256 public NESTS_STAKED = 0; address public NEST_CONTRACT; address public TREASURY; address public immutable WAVAX_ADDRESS; address public signerAddress; mapping(string => bool) public _usedNonces; mapping(address => bool) public SenderPermissions; mapping(address => uint256) public TokenBurnPercentage; mapping(address => uint256) public TokenTreasuryPercentage; mapping(address => uint256) public PendingTokenRewards; mapping(uint256 => NestInfo) public StakedNests; mapping(address => uint256) public StakedCountForAddress; mapping(address => bool) public CanRewarderMint; constructor( address nestContract, address treasury, address wavax, address signer ) EIP712("Load Reward Handler", "1.01") { require(nestContract != address(0), "must be valid address"); require(treasury != address(0), "must be valid address"); require(wavax != address(0), "must be valid address"); require(signer != address(0), "must be valid address"); NEST_CONTRACT = nestContract; TREASURY = treasury; WAVAX_ADDRESS = wavax; signerAddress = signer; } function receiveTokens(address tokenAddress, uint256 amount) external nonReentrant { require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); require(SenderPermissions[msg.sender], "must be an included address"); if (tokenAddress == WAVAX_ADDRESS) { IERC20 wavaxToken = IERC20(WAVAX_ADDRESS); wavaxToken.safeTransfer(TREASURY, amount); } else { uint256 nestAmount = (amount * NEST_PERCENTAGE) / 10000; uint256 leftOverAmount = amount - nestAmount; distributeGameRewards(tokenAddress, leftOverAmount); distributeNestHolderTokens(tokenAddress, nestAmount); } emit ReceivedTokens(tokenAddress, amount); } function transferTokensNoDistribution(address tokenAddress, uint256 amount) external nonReentrant onlyOwner { require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); IERC20 tokenERC20Contract = IERC20(tokenAddress); tokenERC20Contract.safeTransferFrom(msg.sender, address(this), amount); PendingTokenRewards[tokenAddress] += amount; emit TransferTokensNoDistribution(tokenAddress, amount); } function addSender(address addressToAdd) external onlyOwner { require(addressToAdd != address(0), "invalid address to add"); require(addressToAdd != msg.sender, "sender cannot be added"); if (!SenderPermissions[addressToAdd]) { SenderPermissions[addressToAdd] = true; emit SenderPermissionAdded(msg.sender, addressToAdd); } } function removeSender(address addressToRemove) external onlyOwner { require(addressToRemove != address(0), "invalid address to remove"); require(addressToRemove != msg.sender, "sender cannot be removed"); if (SenderPermissions[addressToRemove]) { SenderPermissions[addressToRemove] = false; emit SenderPermissionRemoved(msg.sender, addressToRemove); } } function setBurnPercentage(address tokenAddress, uint256 percentage) external onlyOwner { require(percentage <= 5000, "REWARD HANLDER: must be less than or equal to 50%"); require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); uint256 current = TokenBurnPercentage[tokenAddress]; TokenBurnPercentage[tokenAddress] = percentage; emit TokenBurnPercentageSet(msg.sender, tokenAddress, current, percentage); } function setTreasuryPercentage(address tokenAddress, uint256 percentage) external onlyOwner { require(percentage <= 2500, "REWARD HANLDER: must be less than or equal to 25%"); require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); uint256 current = TokenTreasuryPercentage[tokenAddress]; TokenTreasuryPercentage[tokenAddress] = percentage; emit TreasuryPercentageSet(msg.sender, current, percentage); } function setCanMint(address tokenAddress) external onlyOwner { require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); if (!CanRewarderMint[tokenAddress]) { CanRewarderMint[tokenAddress] = true; emit CanMintSet(tokenAddress); } } function setCantMint(address tokenAddress) external onlyOwner { require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); if (CanRewarderMint[tokenAddress]) { CanRewarderMint[tokenAddress] = false; emit CantMintSet(tokenAddress); } } function distributeGameRewards(address tokenAddress, uint256 amount) internal { require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); uint256 totalRewards = amount; IERC20 tokenERC20Contract = IERC20(tokenAddress); if (TokenBurnPercentage[tokenAddress] > 0) { uint256 burnAmount = (amount * TokenBurnPercentage[tokenAddress]) / 10000; totalRewards -= burnAmount; tokenERC20Contract.safeTransfer(BURN_ADDRESS, burnAmount); } if (TokenTreasuryPercentage[tokenAddress] > 0) { uint256 treasuryAmount = (amount * TokenTreasuryPercentage[tokenAddress]) / 10000; totalRewards -= treasuryAmount; tokenERC20Contract.safeTransfer(TREASURY, treasuryAmount); } PendingTokenRewards[tokenAddress] += totalRewards; } function distributeNestHolderTokens(address tokenAddress, uint256 amount) internal { if (NESTS_STAKED > 0) { uint256 amountPerNest = amount / NESTS_STAKED; uint256 amountDistributed = 0; uint256 stakedNestsLength = stakedNestsSet.length(); for (uint256 index = 0; index < stakedNestsLength; index++) { uint256 tokenId = stakedNestsSet.at(index); StakedNests[tokenId].pendingRewards[tokenAddress] += amountPerNest; amountDistributed += amountPerNest; } if (amountDistributed < amount) { distributeGameRewards(tokenAddress, amount - amountDistributed); } } else { distributeGameRewards(tokenAddress, amount); } } function claimNestTokens(address tokenAddress, uint256 tokenId) external nonReentrant { require(StakedNests[tokenId].isStaked, "REWARD HANLDER: nest must be staked to claim"); require(StakedNests[tokenId].stakerAddress == msg.sender, "REWARD HANDLER: you must own this nft to claim rewards"); uint256 pendingRewards = StakedNests[tokenId].pendingRewards[tokenAddress]; if (pendingRewards > 0) { IERC20 tokenERC20Contract = IERC20(tokenAddress); tokenERC20Contract.safeTransfer(msg.sender, pendingRewards); StakedNests[tokenId].pendingRewards[tokenAddress] = 0; emit NestClaimed(msg.sender, tokenId, tokenAddress, pendingRewards); } } function pendingNestTokens(address tokenAddress, uint256 tokenId) external view returns (uint256) { return StakedNests[tokenId].pendingRewards[tokenAddress]; } function stakeNest(uint256 tokenId) external nonReentrant { require(tokenId <= NEST_COUNT, "REWARD HANDLER: Nest tokenId must be less than 26"); IERC721 nestContract = IERC721(NEST_CONTRACT); nestContract.safeTransferFrom(msg.sender, address(this), tokenId); StakedNests[tokenId].stakerAddress = msg.sender; StakedNests[tokenId].isStaked = true; stakedNestsSet.add(tokenId); NESTS_STAKED++; StakedCountForAddress[msg.sender]++; emit NestStaked(msg.sender, tokenId); } function withdrawNest(uint256 tokenId) external nonReentrant { require(StakedNests[tokenId].stakerAddress == msg.sender, "REWARD HANDLER: You do not own this NFT"); StakedNests[tokenId].stakerAddress = address(0); StakedNests[tokenId].isStaked = false; stakedNestsSet.remove(tokenId); IERC721 nestContract = IERC721(NEST_CONTRACT); nestContract.safeTransferFrom(address(this), msg.sender, tokenId); NESTS_STAKED--; StakedCountForAddress[msg.sender]--; emit NestWithdrawn(msg.sender, tokenId); } function stakedNestsForAddress(address requestAddress) external view returns (uint256[] memory) { uint256 stakedCount = StakedCountForAddress[requestAddress]; uint256 currentIndex = 0; uint256[] memory stakedIds = new uint256[](stakedCount); for (uint256 index = 0; index < NEST_COUNT; index++) { if (StakedNests[index + 1].isStaked && StakedNests[index + 1].stakerAddress == requestAddress) { stakedIds[currentIndex] = index + 1; currentIndex++; } } return stakedIds; } function hasRewardsForToken(address tokenAddress) external view returns (bool) { require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); return PendingTokenRewards[tokenAddress] > 0; } function claimTokens( address tokenAddress, uint256 amount, bytes memory signature, string memory nonce ) external nonReentrant { require(tokenAddress != address(0), "INVALID_TOKEN_ADDRESS"); require(amount > 0, "BAD_AMOUNT"); require( matchAddresSigner(hashTransaction(msg.sender, tokenAddress, amount, nonce), signature), "DIRECT_CLAIM_DISALLOWED" ); require(!_usedNonces[nonce], "HASH_USED"); _usedNonces[nonce] = true; IERC20 tokenERC20Contract = IERC20(tokenAddress); if (amount <= PendingTokenRewards[tokenAddress]) { tokenERC20Contract.safeTransfer(msg.sender, amount); PendingTokenRewards[tokenAddress] -= amount; } else { require(CanRewarderMint[tokenAddress], "REWARDER_CANNOT_MINT"); uint256 amountPending = amount - PendingTokenRewards[tokenAddress]; IERC20Mint tokenERC20MintingContract = IERC20Mint(tokenAddress); tokenERC20MintingContract.mint(msg.sender, amountPending); tokenERC20MintingContract.transfer(msg.sender, PendingTokenRewards[tokenAddress]); PendingTokenRewards[tokenAddress] = 0; } emit PendingTokensClaimed(msg.sender, tokenAddress, amount); } // verify whether hash matches against tampering function hashTransaction( address sender, address tokenAddress, uint256 claimAmount, string memory nonce ) private view returns (bytes32) { bytes32 hash = _hashTypedDataV4( keccak256( abi.encode( keccak256("Claim(address sender,address tokenAddress,uint256 claimAmount,string nonce)"), sender, tokenAddress, claimAmount, keccak256(bytes(nonce)) ) ) ); return hash; } // match serverside private key sign to set pub key function matchAddresSigner(bytes32 hash, bytes memory signature) private view returns (bool) { require(signerAddress != address(0), "must be a valid address"); return signerAddress == hash.recover(signature); } // change public key for relaunches so signatures get invalidated function setSignerAddress(address addr) external onlyOwner { require(addr != address(0), "must be valid address"); signerAddress = addr; emit UpdateSigner(addr); } function setNestPercentage(uint256 percent) external onlyOwner { require(percent > 0, "REWARD HANDLER: must be greater than 0"); require(percent < 10000, "REWARD HANDLER: must be less than 10_000"); NEST_PERCENTAGE = percent; emit NestPercentageSet(percent); } function setNestContract(address nest) external onlyOwner { require(nest != address(0), "must be valid address"); require(NESTS_STAKED == 0, "REWARD HANDLER: must not have staked nests"); NEST_CONTRACT = nest; emit NestContractSet(nest); } function setTreasury(address treasuryAddress) external onlyOwner { require(treasuryAddress != address(0), "must be valid address"); TREASURY = treasuryAddress; emit TreasurySet(treasuryAddress); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { 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.6.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.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)); } } /** * @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.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 v4.4.1 (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // DragonCryptoGaming - Legend of Aurum Draconis Contract Libaries pragma solidity ^0.8.14; /** * @dev Interfact */ interface IRewardReceiver { /** * @dev Emitted when `value` tokens are moved from in to the receiver contract * * Note that `value` may be zero. */ event TokensReceived(address indexed tokenContract, uint256 indexed value); /** * @dev Tells the receiver contract that tokens have been moved to it. * * Emits a {TokensReceived} event. */ function receiveTokens( address tokenContract, uint256 amount ) external; }
// SPDX-License-Identifier: MIT // DragonCryptoGaming - Legend of Aurum Draconis Contract Libaries import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; pragma solidity ^0.8.14; /** * @dev Interfact */ interface IERC20Mint is IERC20 { function mint(address _to, uint256 _amount) external; }
// 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 v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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 * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason 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 { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
{ "optimizer": { "enabled": true, "runs": 500 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"nestContract","type":"address"},{"internalType":"address","name":"treasury","type":"address"},{"internalType":"address","name":"wavax","type":"address"},{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newCanMint","type":"address"}],"name":"CanMintSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newCantMint","type":"address"}],"name":"CantMintSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"tokenClaimed","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NestClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newNestContract","type":"address"}],"name":"NestContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"NestPercentageSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NestStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NestWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PendingTokensClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReceivedTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"SenderPermissionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"SenderPermissionRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldPercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"TokenBurnPercentageSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TokensReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferTokensNoDistribution","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldPercentage","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newPercentage","type":"uint256"}],"name":"TreasuryPercentageSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newTreasury","type":"address"}],"name":"TreasurySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newSigner","type":"address"}],"name":"UpdateSigner","type":"event"},{"inputs":[],"name":"BURN_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"CanRewarderMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NESTS_STAKED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NEST_CONTRACT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NEST_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NEST_PERCENTAGE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"PendingTokenRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"SenderPermissions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"StakedCountForAddress","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"StakedNests","outputs":[{"internalType":"bool","name":"isStaked","type":"bool"},{"internalType":"address","name":"stakerAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"TokenBurnPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"TokenTreasuryPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WAVAX_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"_usedNonces","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addressToAdd","type":"address"}],"name":"addSender","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"claimNestTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"string","name":"nonce","type":"string"}],"name":"claimTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"hasRewardsForToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"pendingNestTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"receiveTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addressToRemove","type":"address"}],"name":"removeSender","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"setBurnPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setCanMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"setCantMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"nest","type":"address"}],"name":"setNestContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"setNestPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"setSignerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasuryAddress","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"setTreasuryPercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakeNest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"requestAddress","type":"address"}],"name":"stakedNestsForAddress","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferTokensNoDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawNest","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
610160604052606460045560006005553480156200001c57600080fd5b50604051620037b5380380620037b58339810160408190526200003f9162000307565b604080518082018252601381527f4c6f6164205265776172642048616e646c65720000000000000000000000000060208083019190915282518084019093526004835263312e303160e01b908301526001600055906200009f3362000298565b815160209283012081519183019190912060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818301969096526060810194909452608080850193909352308483018190528151808603909301835260c094850190915281519190950120905291909152610120526001600160a01b038416620001795760405162461bcd60e51b815260206004820152601560248201526000805160206200379583398151915260448201526064015b60405180910390fd5b6001600160a01b038316620001c05760405162461bcd60e51b8152602060048201526015602482015260008051602062003795833981519152604482015260640162000170565b6001600160a01b038216620002075760405162461bcd60e51b8152602060048201526015602482015260008051602062003795833981519152604482015260640162000170565b6001600160a01b0381166200024e5760405162461bcd60e51b8152602060048201526015602482015260008051602062003795833981519152604482015260640162000170565b600680546001600160a01b039586166001600160a01b0319918216179091556007805494861694821694909417909355908316610140526008805491909316911617905562000364565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b80516001600160a01b03811681146200030257600080fd5b919050565b600080600080608085870312156200031e57600080fd5b6200032985620002ea565b93506200033960208601620002ea565b92506200034960408601620002ea565b91506200035960608601620002ea565b905092959194509250565b60805160a05160c05160e0516101005161012051610140516133c8620003cd600039600081816102e601528181610af90152610b3501526000612a0301526000612a5201526000612a2d01526000612986015260006129b0015260006129da01526133c86000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c806385063df51161013b578063c2205869116100b8578063e1593ae41161007c578063e1593ae4146105cc578063e976954e146105df578063f0f44260146105f2578063f2fde38b14610605578063fccc28131461061857600080fd5b8063c22058691461055d578063c8a1d5991461057d578063cecb6c3214610586578063d7fca318146105a6578063d8c84d11146105b957600080fd5b8063a6ba55c7116100ff578063a6ba55c7146104ed578063ae4fb3361461051b578063aec1124814610524578063b2f8764314610537578063b697f5311461054a57600080fd5b806385063df51461048057806389739ff1146104a35780638da5cb5b146104b657806393bfbc41146104c757806394d1777b146104da57600080fd5b80632d2c5565116101c95780634ced21cc1161018d5780634ced21cc146104375780635b7633d01461044a578063715018a61461045d5780637d347d2914610465578063843b3efd1461046d57600080fd5b80632d2c5565146103d85780632eaa9562146103eb5780633008e43f146103fe5780633572913014610411578063380f22d61461042457600080fd5b80631a85eb4b116102105780631a85eb4b146102e15780631e9b255214610320578063205461781461035357806322e401501461037357806329ca460c146103c557600080fd5b8063046dc16614610242578063080f2d10146102575780630ec9c89c1461028a578063150b7a02146102aa575b600080fd5b610255610250366004612f89565b610621565b005b610277610265366004612f89565b600b6020526000908152604090205481565b6040519081526020015b60405180910390f35b610277610298366004612f89565b600c6020526000908152604090205481565b6102c86102b8366004613047565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610281565b6103087f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610281565b61034361032e366004612f89565b600a6020526000908152604090205460ff1681565b6040519015158152602001610281565b610277610361366004612f89565b600d6020526000908152604090205481565b6103a66103813660046130af565b600e6020526000908152604090205460ff81169061010090046001600160a01b031682565b6040805192151583526001600160a01b03909116602083015201610281565b600654610308906001600160a01b031681565b600754610308906001600160a01b031681565b6102556103f9366004612f89565b610706565b61025561040c3660046130af565b610809565b61025561041f3660046130c8565b6109f3565b6102556104323660046130af565b610bf5565b6102556104453660046130c8565b610dd5565b600854610308906001600160a01b031681565b610255610f43565b610277601981565b61034361047b366004612f89565b610f97565b61034361048e366004612f89565b60106020526000908152604090205460ff1681565b6102556104b13660046130f2565b611005565b6001546001600160a01b0316610308565b6102556104d5366004612f89565b611413565b6102556104e83660046130af565b611513565b6103436104fb366004613164565b805160208183018101805160098252928201919093012091525460ff1681565b61027760045481565b6102556105323660046130c8565b61164f565b610255610545366004612f89565b6117bf565b610255610558366004612f89565b611920565b61027761056b366004612f89565b600f6020526000908152604090205481565b61027760055481565b610599610594366004612f89565b611a83565b6040516102819190613199565b6102556105b43660046130c8565b611bab565b6102556105c73660046130c8565b611d1a565b6102556105da366004612f89565b611f21565b6102776105ed3660046130c8565b612064565b610255610600366004612f89565b612091565b610255610613366004612f89565b612171565b61030861dead81565b6001546001600160a01b0316331461066e5760405162461bcd60e51b8152602060048201819052602482015260008051602061337383398151915260448201526064015b60405180910390fd5b6001600160a01b0381166106bc5760405162461bcd60e51b81526020600482015260156024820152746d7573742062652076616c6964206164647265737360581b6044820152606401610665565b600880546001600160a01b0319166001600160a01b0383169081179091556040517fc58fcf255cfb5f40bd578a618869378f650ef76609640fa0818a31e0c6e7102a90600090a250565b6001546001600160a01b0316331461074e5760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b03811661079c5760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b6001600160a01b03811660009081526010602052604090205460ff16610806576001600160a01b038116600081815260106020526040808220805460ff19166001179055517fcb4a59320643aef139888426867590d24f978bdfab75a47e1436d3980459ae8a9190a25b50565b60026000540361085b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610665565b600260005560198111156108d75760405162461bcd60e51b815260206004820152603160248201527f5245574152442048414e444c45523a204e65737420746f6b656e4964206d757360448201527f74206265206c657373207468616e2032360000000000000000000000000000006064820152608401610665565b600654604051632142170760e11b8152336004820152306024820152604481018390526001600160a01b039091169081906342842e0e90606401600060405180830381600087803b15801561092b57600080fd5b505af115801561093f573d6000803e3d6000fd5b5050506000838152600e60205260409020805460ff1961010033021674ffffffffffffffffffffffffffffffffffffffffff1990911617600117905550610987600283612227565b5060058054906000610998836131f3565b9091555050336000908152600f602052604081208054916109b8836131f3565b9091555050604051829033907f63b2116f57b05bd3a82d11869d376d9e7642034f6554c554048bf7b9d45c2cc890600090a350506001600055565b600260005403610a455760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610665565b60026000556001600160a01b038216610a985760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b336000908152600a602052604090205460ff16610af75760405162461bcd60e51b815260206004820152601b60248201527f6d75737420626520616e20696e636c75646564206164647265737300000000006044820152606401610665565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031603610b72576007547f000000000000000000000000000000000000000000000000000000000000000090610b6c906001600160a01b0380841691168461223a565b50610bb6565b600061271060045483610b85919061320c565b610b8f919061322b565b90506000610b9d828461324d565b9050610ba984826122b7565b610bb3848361242b565b50505b60405181906001600160a01b038416907f2946de6c4ec03d8d15126164a7c0da68d7c6835173e41827a7a715f8becb07a890600090a350506001600055565b600260005403610c475760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610665565b60026000908155818152600e602052604090205461010090046001600160a01b03163314610cc75760405162461bcd60e51b815260206004820152602760248201527f5245574152442048414e444c45523a20596f7520646f206e6f74206f776e20746044820152661a1a5cc813919560ca1b6064820152608401610665565b6000818152600e60205260409020805474ffffffffffffffffffffffffffffffffffffffffff19169055610cfc6002826124fd565b50600654604051632142170760e11b8152306004820152336024820152604481018390526001600160a01b039091169081906342842e0e90606401600060405180830381600087803b158015610d5157600080fd5b505af1158015610d65573d6000803e3d6000fd5b505060058054925090506000610d7a83613264565b9091555050336000908152600f60205260408120805491610d9a83613264565b9091555050604051829033907fe3fcb41d2f151dca369a661c5074e1e1f00502d2d48f679a4c1f6daa99aedfdd90600090a350506001600055565b6001546001600160a01b03163314610e1d5760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6109c4811115610e955760405162461bcd60e51b815260206004820152603160248201527f5245574152442048414e4c4445523a206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f203235250000000000000000000000000000006064820152608401610665565b6001600160a01b038216610ee35760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b6001600160a01b0382166000908152600c602090815260409182902080549084905582518181529182018490529133917f7b032808458d6ca19b6e22b891395c6c1660ed79cb8efda5db6f7c47169541a6910160405180910390a2505050565b6001546001600160a01b03163314610f8b5760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b610f956000612509565b565b60006001600160a01b038216610fe75760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b506001600160a01b03166000908152600d6020526040902054151590565b6002600054036110575760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610665565b60026000556001600160a01b0384166110aa5760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b600083116110e75760405162461bcd60e51b815260206004820152600a60248201526910905117d05353d5539560b21b6044820152606401610665565b6110fc6110f63386868561255b565b836125e1565b6111485760405162461bcd60e51b815260206004820152601760248201527f4449524543545f434c41494d5f444953414c4c4f5745440000000000000000006044820152606401610665565b60098160405161115891906132a7565b9081526040519081900360200190205460ff16156111a45760405162461bcd60e51b8152602060048201526009602482015268121054d217d554d15160ba1b6044820152606401610665565b60016009826040516111b691906132a7565b9081526040805160209281900383019020805460ff1916931515939093179092556001600160a01b0386166000908152600d90915220548490841161123c576112096001600160a01b038216338661223a565b6001600160a01b0385166000908152600d60205260408120805486929061123190849061324d565b909155506113cf9050565b6001600160a01b03851660009081526010602052604090205460ff166112a45760405162461bcd60e51b815260206004820152601460248201527f52455741524445525f43414e4e4f545f4d494e540000000000000000000000006044820152606401610665565b6001600160a01b0385166000908152600d60205260408120546112c7908661324d565b6040516340c10f1960e01b81523360048201526024810182905290915086906001600160a01b038216906340c10f1990604401600060405180830381600087803b15801561131457600080fd5b505af1158015611328573d6000803e3d6000fd5b505050506001600160a01b038781166000908152600d60205260409081902054905163a9059cbb60e01b815233600482015260248101919091529082169063a9059cbb906044016020604051808303816000875af115801561138e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b291906132c3565b5050506001600160a01b0385166000908152600d60205260408120555b60405184906001600160a01b0387169033907f370eef4a392265375a150401235c689315d7bf7659c0a06ab8e6d6c43f04f0bd90600090a450506001600055505050565b6001546001600160a01b0316331461145b5760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b0381166114a95760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b6001600160a01b03811660009081526010602052604090205460ff1615610806576001600160a01b038116600081815260106020526040808220805460ff19169055517f60f44d1f4aed1177b1bda9ea28cf2b4bc962dac6c08f5685af10df5ad0bd7be99190a250565b6001546001600160a01b0316331461155b5760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b600081116115ba5760405162461bcd60e51b815260206004820152602660248201527f5245574152442048414e444c45523a206d75737420626520677265617465722060448201526507468616e20360d41b6064820152608401610665565b612710811061161c5760405162461bcd60e51b815260206004820152602860248201527f5245574152442048414e444c45523a206d757374206265206c6573732074686160448201526706e2031305f3030360c41b6064820152608401610665565b600481905560405181907f614d4896f567d6d4db41232949d34f9e616303ff5e30af553296c59c6d85361e90600090a250565b6002600054036116a15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610665565b60026000556001546001600160a01b031633146116ee5760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b03821661173c5760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b816117526001600160a01b03821633308561265e565b6001600160a01b0383166000908152600d60205260408120805484929061177a9084906132e5565b909155505060405182906001600160a01b038516907f307c10d63a3856546697b942b5ea9308ee1332b496cacaa3b20287782ea788aa90600090a35050600160005550565b6001546001600160a01b031633146118075760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b03811661185d5760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964206164647265737320746f2072656d6f7665000000000000006044820152606401610665565b336001600160a01b038216036118b55760405162461bcd60e51b815260206004820152601860248201527f73656e6465722063616e6e6f742062652072656d6f76656400000000000000006044820152606401610665565b6001600160a01b0381166000908152600a602052604090205460ff1615610806576001600160a01b0381166000818152600a6020526040808220805460ff191690555133917fadb1d1f65038685f3bac6cbac2b780d3c5eb349870c317313708ff8db71f170991a350565b6001546001600160a01b031633146119685760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b0381166119be5760405162461bcd60e51b815260206004820152601660248201527f696e76616c6964206164647265737320746f20616464000000000000000000006044820152606401610665565b336001600160a01b03821603611a165760405162461bcd60e51b815260206004820152601660248201527f73656e6465722063616e6e6f74206265206164646564000000000000000000006044820152606401610665565b6001600160a01b0381166000908152600a602052604090205460ff16610806576001600160a01b0381166000818152600a6020526040808220805460ff191660011790555133917faf7236c6a7ea76f21c67c1d46330e258c97f0a1c1756e99633be2504e17b6a8491a350565b6001600160a01b0381166000908152600f6020526040812054606091808267ffffffffffffffff811115611ab957611ab9612fa4565b604051908082528060200260200182016040528015611ae2578160200160208202803683370190505b50905060005b6019811015611ba257600e6000611b008360016132e5565b815260208101919091526040016000205460ff168015611b5557506001600160a01b038616600e6000611b348460016132e5565b815260208101919091526040016000205461010090046001600160a01b0316145b15611b9057611b658160016132e5565b828481518110611b7757611b776132fd565b602090810291909101015282611b8c816131f3565b9350505b80611b9a816131f3565b915050611ae8565b50949350505050565b6001546001600160a01b03163314611bf35760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b611388811115611c6b5760405162461bcd60e51b815260206004820152603160248201527f5245574152442048414e4c4445523a206d757374206265206c6573732074686160448201527f6e206f7220657175616c20746f203530250000000000000000000000000000006064820152608401610665565b6001600160a01b038216611cb95760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b6001600160a01b0382166000818152600b60209081526040918290208054908590558251818152918201859052929133917f5ebb9622d2fd8423358c4a9f5ab01a068981b04b53d391fda826824378953f10910160405180910390a3505050565b600260005403611d6c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610665565b60026000908155818152600e602052604090205460ff16611de45760405162461bcd60e51b815260206004820152602c60248201527f5245574152442048414e4c4445523a206e657374206d7573742062652073746160448201526b6b656420746f20636c61696d60a01b6064820152608401610665565b6000818152600e602052604090205461010090046001600160a01b03163314611e755760405162461bcd60e51b815260206004820152603660248201527f5245574152442048414e444c45523a20796f75206d757374206f776e2074686960448201527f73206e667420746f20636c61696d2072657761726473000000000000000000006064820152608401610665565b6000818152600e602090815260408083206001600160a01b03861684526001019091529020548015611f175782611eb66001600160a01b038216338461223a565b6000838152600e602090815260408083206001600160a01b038816808552600190910183528184209390935551848152859133917fb14d8df07dbfedb4625511a735da74b4e6f14199cf851060d9044f7421892098910160405180910390a4505b5050600160005550565b6001546001600160a01b03163314611f695760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b038116611fb75760405162461bcd60e51b81526020600482015260156024820152746d7573742062652076616c6964206164647265737360581b6044820152606401610665565b6005541561201a5760405162461bcd60e51b815260206004820152602a60248201527f5245574152442048414e444c45523a206d757374206e6f742068617665207374604482015269616b6564206e6573747360b01b6064820152608401610665565b600680546001600160a01b0319166001600160a01b0383169081179091556040517f52508115c3eda96b5519b9be0f2c5650ddadbab13d674d01b8e2982e5046e54a90600090a250565b6000818152600e602090815260408083206001600160a01b03861684526001019091529020545b92915050565b6001546001600160a01b031633146120d95760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b0381166121275760405162461bcd60e51b81526020600482015260156024820152746d7573742062652076616c6964206164647265737360581b6044820152606401610665565b600780546001600160a01b0319166001600160a01b0383169081179091556040517f3c864541ef71378c6229510ed90f376565ee42d9c5e0904a984a9e863e6db44f90600090a250565b6001546001600160a01b031633146121b95760405162461bcd60e51b815260206004820181905260248201526000805160206133738339815191526044820152606401610665565b6001600160a01b03811661221e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610665565b61080681612509565b6000612233838361269c565b9392505050565b6040516001600160a01b0383166024820152604481018290526122b290849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909316929092179091526126eb565b505050565b6001600160a01b0382166123055760405162461bcd60e51b8152602060048201526015602482015274494e56414c49445f544f4b454e5f4144445245535360581b6044820152606401610665565b6001600160a01b0382166000908152600b6020526040902054819083901561237e576001600160a01b0384166000908152600b60205260408120546127109061234e908661320c565b612358919061322b565b9050612364818461324d565b925061237c6001600160a01b03831661dead8361223a565b505b6001600160a01b0384166000908152600c6020526040902054156123f8576001600160a01b0384166000908152600c6020526040812054612710906123c3908661320c565b6123cd919061322b565b90506123d9818461324d565b6007549093506123f6906001600160a01b0384811691168361223a565b505b6001600160a01b0384166000908152600d6020526040812080548492906124209084906132e5565b909155505050505050565b600554156124ef57600060055482612443919061322b565b905060008061245260026127bd565b905060005b818110156124cc57600061246c6002836127c7565b6000818152600e602090815260408083206001600160a01b038c1684526001019091528120805492935087929091906124a69084906132e5565b909155506124b6905085856132e5565b93505080806124c4906131f3565b915050612457565b50838210156124e8576124e8856124e3848761324d565b6122b7565b5050505050565b6124f982826122b7565b5050565b600061223383836127d3565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8051602080830191909120604080517f7317d44602127945222934f41d83285bd90b7f8d3953b78e7bb5757681d84b41818501526001600160a01b0388811682840152871660608201526080810186905260a0808201939093528151808203909301835260c0019052805191012060009081906125d7906128c6565b9695505050505050565b6008546000906001600160a01b031661263c5760405162461bcd60e51b815260206004820152601760248201527f6d75737420626520612076616c696420616464726573730000000000000000006044820152606401610665565b6126468383612914565b6008546001600160a01b039182169116149392505050565b6040516001600160a01b03808516602483015283166044820152606481018290526126969085906323b872dd60e01b90608401612266565b50505050565b60008181526001830160205260408120546126e35750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561208b565b50600061208b565b6000612740826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129389092919063ffffffff16565b8051909150156122b2578080602001905181019061275e91906132c3565b6122b25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610665565b600061208b825490565b6000612233838361294f565b600081815260018301602052604081205480156128bc5760006127f760018361324d565b855490915060009061280b9060019061324d565b905081811461287057600086600001828154811061282b5761282b6132fd565b906000526020600020015490508087600001848154811061284e5761284e6132fd565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061288157612881613313565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061208b565b600091505061208b565b600061208b6128d3612979565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006129238585612aa0565b9150915061293081612b0e565b509392505050565b60606129478484600085612cc4565b949350505050565b6000826000018281548110612966576129666132fd565b9060005260206000200154905092915050565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156129d257507f000000000000000000000000000000000000000000000000000000000000000046145b156129fc57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103612ad65760208301516040840151606085015160001a612aca87828585612df5565b94509450505050612b07565b8251604003612aff5760208301516040840151612af4868383612ee2565b935093505050612b07565b506000905060025b9250929050565b6000816004811115612b2257612b22613329565b03612b2a5750565b6001816004811115612b3e57612b3e613329565b03612b8b5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610665565b6002816004811115612b9f57612b9f613329565b03612bec5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610665565b6003816004811115612c0057612c00613329565b03612c585760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610665565b6004816004811115612c6c57612c6c613329565b036108065760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610665565b606082471015612d255760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610665565b6001600160a01b0385163b612d7c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610665565b600080866001600160a01b03168587604051612d9891906132a7565b60006040518083038185875af1925050503d8060008114612dd5576040519150601f19603f3d011682016040523d82523d6000602084013e612dda565b606091505b5091509150612dea828286612f34565b979650505050505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612e2c5750600090506003612ed9565b8460ff16601b14158015612e4457508460ff16601c14155b15612e555750600090506004612ed9565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612ea9573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612ed257600060019250925050612ed9565b9150600090505b94509492505050565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681612f1860ff86901c601b6132e5565b9050612f2687828885612df5565b935093505050935093915050565b60608315612f43575081612233565b825115612f535782518084602001fd5b8160405162461bcd60e51b8152600401610665919061333f565b80356001600160a01b0381168114612f8457600080fd5b919050565b600060208284031215612f9b57600080fd5b61223382612f6d565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612fcb57600080fd5b813567ffffffffffffffff80821115612fe657612fe6612fa4565b604051601f8301601f19908116603f0116810190828211818310171561300e5761300e612fa4565b8160405283815286602085880101111561302757600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806080858703121561305d57600080fd5b61306685612f6d565b935061307460208601612f6d565b925060408501359150606085013567ffffffffffffffff81111561309757600080fd5b6130a387828801612fba565b91505092959194509250565b6000602082840312156130c157600080fd5b5035919050565b600080604083850312156130db57600080fd5b6130e483612f6d565b946020939093013593505050565b6000806000806080858703121561310857600080fd5b61311185612f6d565b935060208501359250604085013567ffffffffffffffff8082111561313557600080fd5b61314188838901612fba565b9350606087013591508082111561315757600080fd5b506130a387828801612fba565b60006020828403121561317657600080fd5b813567ffffffffffffffff81111561318d57600080fd5b61294784828501612fba565b6020808252825182820181905260009190848201906040850190845b818110156131d1578351835292840192918401916001016131b5565b50909695505050505050565b634e487b7160e01b600052601160045260246000fd5b600060018201613205576132056131dd565b5060010190565b6000816000190483118215151615613226576132266131dd565b500290565b60008261324857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561325f5761325f6131dd565b500390565b600081613273576132736131dd565b506000190190565b60005b8381101561329657818101518382015260200161327e565b838111156126965750506000910152565b600082516132b981846020870161327b565b9190910192915050565b6000602082840312156132d557600080fd5b8151801515811461223357600080fd5b600082198211156132f8576132f86131dd565b500190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b602081526000825180602084015261335e81604085016020870161327b565b601f01601f1916919091016040019291505056fe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220c77a2e93d6aa329c9ad775c6e7d32eee659fd9cb53e1eef7ad5217b525db008664736f6c634300080e00336d7573742062652076616c6964206164647265737300000000000000000000000000000000000000000000007333753e4cabada6de4c44081a25804776a5b23d0000000000000000000000008ae449127eed88859a4d1d68e32bbfb2b78c71fb000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c70000000000000000000000008ae449127eed88859a4d1d68e32bbfb2b78c71fb
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000007333753e4cabada6de4c44081a25804776a5b23d0000000000000000000000008ae449127eed88859a4d1d68e32bbfb2b78c71fb000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c70000000000000000000000008ae449127eed88859a4d1d68e32bbfb2b78c71fb
-----Decoded View---------------
Arg [0] : nestContract (address): 0x7333753e4cabada6de4c44081a25804776a5b23d
Arg [1] : treasury (address): 0x8ae449127eed88859a4d1d68e32bbfb2b78c71fb
Arg [2] : wavax (address): 0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7
Arg [3] : signer (address): 0x8ae449127eed88859a4d1d68e32bbfb2b78c71fb
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000007333753e4cabada6de4c44081a25804776a5b23d
Arg [1] : 0000000000000000000000008ae449127eed88859a4d1d68e32bbfb2b78c71fb
Arg [2] : 000000000000000000000000b31f66aa3c1e785363f0875a1b74e27b85fd66c7
Arg [3] : 0000000000000000000000008ae449127eed88859a4d1d68e32bbfb2b78c71fb
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|