Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 16338037 | 623 days ago | IN | 0 ETH | 0.0592664 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Rental
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "erc721a-upgradeable/contracts/IERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./interface/IRental.sol"; import "./Abstract/ARental.sol"; contract Rental is Initializable, ReentrancyGuardUpgradeable, IRental, ARental { using Strings for uint256; bytes32 public rootOfRewards; uint256 public rewardTime; bool public updatePausable; address public admin; function initialize( address _owner, address _landContract, address _lordContract, bytes32 _rootLand, bytes32 _rootLord, uint256[] calldata _landWeight, uint256[] calldata _lordWeight ) external initializer { owner = _owner; rootLand = _rootLand; rootLord = _rootLord; landContract = _landContract; lordContract = _lordContract; landWeight.push(_landWeight[0]); landWeight.push(_landWeight[1]); landWeight.push(_landWeight[2]); lordWeight.push(_lordWeight[0]); lordWeight.push(_lordWeight[1]); lordWeight.push(_lordWeight[2]); } function blacklistMalicious(address account, bool value) external onlyOwner nonReentrant { isBlacklisted[account] = value; emit Blacklisted(account, value); } function setLandContract(address _landContract) external nonReentrant onlyOwner { address oldContract = landContract; landContract = _landContract; emit UpdateLandContract(_landContract, oldContract); } function setLordContract(address _lordContract) external nonReentrant onlyOwner { address oldContract = lordContract; lordContract = _lordContract; emit UpdateLandContract(_lordContract, oldContract); } function setOwner(address _owner) external nonReentrant onlyOwner { owner = _owner; emit UpdateOwner(msg.sender, owner); } function setRootLand(bytes32 _rootLand) external nonReentrant onlyOwner { rootLand = _rootLand; } function setRootLord(bytes32 _rootLord) external nonReentrant onlyOwner { rootLord = _rootLord; } function pause(bool _state) external nonReentrant onlyOwner { paused = _state; emit Pausable(_state); } function setLandWeight( uint256 _basicLandWeight, uint256 _platniumLandWeight, uint256 _primeLandWeight ) external nonReentrant onlyOwner { landWeight.push(_basicLandWeight); landWeight.push(_platniumLandWeight); landWeight.push(_primeLandWeight); } function setPool( uint256 _poolTimeSlot, uint256 _poolRoyalty, uint256[] calldata _poolTotalWeight, uint256 _poolMonth ) external payable onlyOwner { require(msg.value >= (_poolRoyalty * _poolMonth), "value not send"); availablePoolId += 1; uint256 poolStartTime = availablePoolId == 1 ? block.timestamp : poolInfo[availablePoolId - 1].poolEndTime; uint256 poolEndTime = poolStartTime + _poolTimeSlot * _poolMonth; poolInfo[availablePoolId] = Pool( _poolTimeSlot, _poolRoyalty, _poolTotalWeight, _poolMonth, poolStartTime, poolEndTime ); } function emergencyWithdraw() external nonReentrant { require(owner == msg.sender, "not owner"); _transferETH(address(this).balance); } function depositLandLords( Deposite memory deposite, corrdinate memory cordinate, bytes32[] memory _merkleProofland1, bytes32[] memory _merkleProofland2, bytes32[] memory _merkleProofland3, bytes32[] memory _merkleProoflord ) external nonReentrant isMerkelProofValid( cordinate, deposite._landId, deposite._lordId, deposite._landCatorgy, deposite._lordCatory, _merkleProofland1, _merkleProofland2, _merkleProofland3, _merkleProoflord ) { stacklandlord(deposite); } function withdrawLandLords(uint256 _rewardId) external nonReentrant whenNotPaused //isRewardIdExist(_rewardId) isOwnerOfId(_rewardId) { require(_rewardId != 0, "not zero"); require(landLordsInfo[_rewardId].status, "RewardId unstake"); for (uint256 i = 0; i < landLordsInfo[_rewardId].landId.length; i++) { _transfer( landContract, address(this), msg.sender, landLordsInfo[_rewardId].landId[i] ); } _transferA( lordContract, address(this), msg.sender, landLordsInfo[_rewardId].lordId ); totalLandWeights = totalLandWeights - landLordsInfo[_rewardId].totalLandWeight; landLordsInfo[_rewardId].status = false; uint256 poolId = currentPoolId(); uint256 currentMonth = _currentMonth(poolId); poolInfo[poolId].poolTotalWeight[currentMonth - 1] = totalLandWeights; _withdraw(_rewardId); emit WithdrawLandLord( msg.sender, _rewardId, landLordsInfo[_rewardId].landId, landLordsInfo[_rewardId].lordId ); } function claimRewards( uint256 _rewardId, bytes32[] memory _merkleProof, uint256 _rewards ) external //isRewardIdExist(_rewardId) isOwnerOfId(_rewardId) { require(landLordsInfo[_rewardId].status, "RewardId unstake"); require( !rewardAccess[_rewardId][msg.sender][rootOfRewards], "already claim" ); bytes32 leafToCheck = keccak256( abi.encodePacked(_rewardId.toString(), ",", _rewards.toString()) ); require( MerkleProofUpgradeable.verify( _merkleProof, rootOfRewards, leafToCheck ), "Incorrect land proof" ); rewardAccess[_rewardId][msg.sender][rootOfRewards] = true; (bool success, ) = msg.sender.call{value: _rewards}(""); require(success, "refund failed"); } function getPoolInfo(uint256 _poolId) external view returns (Pool memory) { return poolInfo[_poolId]; } function getLandLordsInfo(uint256 _rewardId) external view returns (LandLords memory) { return landLordsInfo[_rewardId]; } function getCurrentRewrdId() external view returns (uint256) { return _getCurrentRewrdId(); } function getUserClaim(uint256 _rewardId, uint256 _poolId) external view returns (uint256) { require(!updatePausable, "paused the function"); return userClaimPerPool[_rewardId][_poolId]; } function currrentTime() external view returns (uint256) { return block.timestamp; } function getcalculateRewards(uint256 _rewardId) external view returns ( //isRewardIdExist(_rewardId) uint256, uint256 ) { require(!updatePausable, "paused the function"); require(landLordsInfo[_rewardId].status, "RewardId unstake"); uint256 _currentPoolId = currentPoolId(); uint256 claimAmount; uint256 userclaim = userClaimPerPool[_rewardId][_currentPoolId]; uint256 lastClaimTime = landLordsInfo[_rewardId].lastClaimTime; uint256 userPoolId = landLordsInfo[_rewardId].currentPoolId; bool loop; while (!loop) { if (_currentPoolId == userPoolId) { ( uint256 reward, uint256 time, uint256 claims ) = _rewardForCurrentPool( _currentPoolId, _rewardId, lastClaimTime, userclaim ); claimAmount += reward; userclaim = claims; lastClaimTime = time; loop = true; } else { uint256 poolId = landLordsInfo[_rewardId].currentPoolId; (uint256 reward, uint256 time) = _rewardsForPreviousPool( poolId, _rewardId, lastClaimTime ); claimAmount += reward; userPoolId += 1; lastClaimTime = time; } } return (claimAmount, lastClaimTime); } function getUserRewardId(address _user) external view returns (uint256[] memory) { return rewardIdInfo[_user]; } function onERC721Received( address, address from, uint256, bytes calldata ) external pure returns (bytes4) { return IERC721ReceiverUpgradeable.onERC721Received.selector; } function setAdmin(address _admin) external nonReentrant onlyOwner { admin = _admin; } function setRootRewards(bytes32 _root) external nonReentrant { require(admin == msg.sender, "not admin"); rootOfRewards = _root; } function setRewardTime(uint256 _time) external nonReentrant onlyOwner { rewardTime = _time; } function setPaused(bool _status) external nonReentrant onlyOwner { updatePausable = _status; } function _rewardForPool(uint256 rewardIds) external view returns (uint256) { require(landLordsInfo[rewardIds].status, "RewardId unstake"); uint256 _rewardId = rewardIds; uint256 poolId = currentPoolId(); uint256 currentMonth = _currentMonth(poolId); uint256 weight = _poolWeight(poolId, currentMonth); uint256 rewards = ((poolInfo[poolId].poolRoyalty * rewardTime) / (weight * poolInfo[poolId].poolTimeSlot)) * landLordsInfo[_rewardId].totalLandWeight; return (rewards); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Internal function that returns the initialized version. Returns `_initialized` */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Internal function that returns the initialized version. Returns `_initializing` */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuardUpgradeable is Initializable { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721ReceiverUpgradeable { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library CountersUpgradeable { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Tree proofs. * * The tree and the proofs can be generated using our * https://github.com/OpenZeppelin/merkle-tree[JavaScript library]. * You will find a quickstart guide in the readme. * * WARNING: You should avoid using leaf values that are 64 bytes long prior to * hashing, or use a hash function other than keccak256 for hashing leaves. * This is because the concatenation of a sorted pair of internal nodes in * the merkle tree could be reinterpreted as a leaf value. * OpenZeppelin's JavaScript library generates merkle trees that are safe * against this attack out of the box. */ library MerkleProofUpgradeable { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Calldata version of {verify} * * _Available since v4.7._ */ function verifyCalldata( bytes32[] calldata proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Calldata version of {processProof} * * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { computedHash = _hashPair(computedHash, proof[i]); } return computedHash; } /** * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, bool[] memory proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProof(proof, proofFlags, leaves) == root; } /** * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32 root, bytes32[] memory leaves ) internal pure returns (bool) { return processMultiProofCalldata(proof, proofFlags, leaves) == root; } /** * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false * respectively. * * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). * * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, bool[] memory proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } /** * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. * * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, bool[] calldata proofFlags, bytes32[] memory leaves ) internal pure returns (bytes32 merkleRoot) { // This function rebuild the root hash by traversing the tree up from the leaves. The root is rebuilt by // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of // the merkle tree. uint256 leavesLen = leaves.length; uint256 totalHashes = proofFlags.length; // Check proof validity. require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof"); // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop". bytes32[] memory hashes = new bytes32[](totalHashes); uint256 leafPos = 0; uint256 hashPos = 0; uint256 proofPos = 0; // At each step, we compute the next hash using two values: // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we // get the next hash. // - depending on the flag, either another value for the "main queue" (merging branches) or an element from the // `proof` array. for (uint256 i = 0; i < totalHashes; i++) { bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++]; bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++]; hashes[i] = _hashPair(a, b); } if (totalHashes > 0) { return hashes[totalHashes - 1]; } else if (leavesLen > 0) { return leaves[0]; } else { return proof[0]; } } function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) { return a < b ? _efficientHash(a, b) : _efficientHash(b, a); } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { /// @solidity memory-safe-assembly assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; import "../interface/IRental.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "erc721a-upgradeable/contracts/IERC721AUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol"; import "../interface/IRLand.sol"; abstract contract ARental is IRental { using Strings for uint256; using CountersUpgradeable for CountersUpgradeable.Counter; CountersUpgradeable.Counter public rewardId; address public owner; address public landContract; address public lordContract; uint256[] public landWeight; uint256[] public lordWeight; uint256 public totalLandWeights; uint256 public availablePoolId; bytes32 public rootLand; bytes32 public rootLord; bool public paused; mapping(address => bool) public isBlacklisted; mapping(uint256 => LandLords) landLordsInfo; mapping(uint256 => Pool) poolInfo; mapping(address => uint256[]) rewardIdInfo; mapping(uint256 => uint256) index; mapping(uint256 => mapping(uint256 => uint256)) userClaimPerPool; mapping(uint256 => mapping(address => mapping(bytes32 => bool))) rewardAccess; modifier isBlacklist(address _user) { require(!isBlacklisted[_user], "Eth amount not enough"); _; } modifier isContractApprove() { require( IERC721Upgradeable(landContract).isApprovedForAll( msg.sender, address(this) ) && IERC721Upgradeable(lordContract).isApprovedForAll( msg.sender, address(this) ), "Nft not approved to contract" ); _; } modifier isCatorgyValid( uint256[] memory _landCatorgy, uint256 _lordCatory ) { require(catorgyValid(_landCatorgy, _lordCatory), "not valid catory"); _; } modifier isNonzero( uint256 _landId, uint256 _landCatorgy, uint256 _lordCatory ) { require( _landId != 0 && _landCatorgy != 0 && _lordCatory != 0, "not null" ); _; } modifier isLandValid(uint256 length, uint256 _lordCatory) { require(lordWeight[_lordCatory - 1] >= length, "length mismatch"); _; } modifier onlyOwner() { require(owner == msg.sender, "not owner"); _; } modifier isOwnerOfId(uint256 _rewardId) { require( msg.sender == landLordsInfo[_rewardId].owner, "not rewardId owner" ); _; } // modifier isRewardIdExist(uint256 _rewardId) { // require( // rewardId.current() >= _rewardId && isRewardId(_rewardId), // "rewardId not exist" // ); // _; // } modifier isMerkelProofValid( corrdinate memory cordinate, uint256[] memory _landId, uint256 _lordId, uint256[] memory _landCatorgy, uint256 _lordCatory, bytes32[] memory _merkleProofland1, bytes32[] memory _merkleProofland2, bytes32[] memory _merkleProofland3, bytes32[] memory _merkleProoflord ) { landProof( cordinate, _landId, _landCatorgy, _merkleProofland1, _merkleProofland2, _merkleProofland3 ); lordProof(_lordId, _lordCatory, _merkleProoflord); checkCoordinate(cordinate, _landId); _; } modifier whenNotPaused() { require(!paused, "contract paused"); _; } function checkCoordinate( corrdinate memory cordinate, uint256[] memory _landId ) internal view { if (_landId.length == 1) { require( IRLand(landContract).getTokenId( cordinate.land1[0], cordinate.land1[1] ) == _landId[0], "not correct tokenId" ); } else if (_landId.length == 2) { require( IRLand(landContract).getTokenId( cordinate.land1[0], cordinate.land1[1] ) == _landId[0], "not correct tokenId" ); require( IRLand(landContract).getTokenId( cordinate.land2[0], cordinate.land2[1] ) == _landId[1], "not correct tokenId" ); } else if (_landId.length == 3) { require( IRLand(landContract).getTokenId( cordinate.land1[0], cordinate.land1[1] ) == _landId[0], "not correct tokenId" ); require( IRLand(landContract).getTokenId( cordinate.land2[0], cordinate.land2[1] ) == _landId[1], "not correct tokenId" ); require( IRLand(landContract).getTokenId( cordinate.land3[0], cordinate.land3[1] ) == _landId[2], "not correct tokenId" ); } } function claminingTime( uint256 preMonth, uint256 currentMonth, uint256 lastClaimTime, uint256 poolId ) internal view returns (uint256 claimableTime, uint256 lastClaim) { uint256 monthLasttime = poolInfo[poolId].poolStartTime + (poolInfo[poolId].poolTimeSlot * (preMonth + 1)); if (currentMonth == (preMonth + 1) && block.timestamp < monthLasttime) { claimableTime = block.timestamp - lastClaimTime; lastClaim = block.timestamp; } else { claimableTime = monthLasttime - lastClaimTime; lastClaim = monthLasttime; } } function _currentMonth(uint256 _poolId) public view returns (uint256) { require(currentPoolId() == _poolId, "pass correct pool id"); uint256 poolTime = poolInfo[_poolId].poolTimeSlot; uint256 poolMonth = poolInfo[_poolId].poolMonth; uint256 leftTime = block.timestamp - poolInfo[_poolId].poolStartTime; //require(leftTime < (poolTime * poolMonth), "Wrong pool id"); if (leftTime > (poolTime * poolMonth)) { return poolMonth; } uint256 currentMonth = leftTime / poolTime; return currentMonth == poolMonth ? poolMonth : currentMonth + 1; } function currentPoolId() public view returns (uint256) { if (availablePoolId > 0) { return _calcuatePoolId(); } else { return 0; } } function _calcuatePoolId() internal view returns (uint256 poolId) { for (uint256 i = 0; i < availablePoolId; i++) { if ( poolInfo[i + 1].poolEndTime > block.timestamp && poolInfo[i + 1].poolStartTime < block.timestamp ) { return i + 1; } else { if (i + 1 == availablePoolId) { return availablePoolId; } } } } function catorgyValid(uint256[] memory _landCatorgy, uint256 _lordCatory) internal pure returns (bool) { for (uint256 i = 0; i < _landCatorgy.length; i++) { if (_landCatorgy[i] >= 4 || _lordCatory >= 4) { return false; } } return true; } function _calculateRewards(uint256 _rewardId) internal returns (uint256) { uint256 _currentPoolId = currentPoolId(); uint256 claimAmount; bool loop; while (!loop) { if (_currentPoolId == landLordsInfo[_rewardId].currentPoolId) { ( uint256 reward, uint256 time, uint256 claims ) = _rewardForCurrentPool( _currentPoolId, _rewardId, landLordsInfo[_rewardId].lastClaimTime, userClaimPerPool[_rewardId][_currentPoolId] ); claimAmount += reward; userClaimPerPool[_rewardId][_currentPoolId] = claims; landLordsInfo[_rewardId].lastClaimTime = time; loop = true; } else { uint256 poolId = landLordsInfo[_rewardId].currentPoolId; (uint256 reward, uint256 time) = _rewardsForPreviousPool( poolId, _rewardId, landLordsInfo[_rewardId].lastClaimTime ); claimAmount += reward; userClaimPerPool[_rewardId][poolId] = poolInfo[poolId] .poolMonth; landLordsInfo[_rewardId].currentPoolId += 1; landLordsInfo[_rewardId].lastClaimTime = time; } } return claimAmount; } function _deposite( uint256[] memory _landId, uint256 _lordId, uint256[] memory _landCatorgy, uint256 _lordCatory, uint256 _currentPoolId ) internal { rewardId.increment(); uint256 totalLandWeight; for (uint256 i = 0; i < _landCatorgy.length; i++) { totalLandWeight += landWeight[_landCatorgy[i] - 1]; } landLordsInfo[rewardId.current()] = LandLords( msg.sender, _landId, _lordId, _landCatorgy, _lordCatory, block.timestamp, _currentPoolId, totalLandWeight, true ); totalLandWeights += totalLandWeight; index[rewardId.current()] = rewardIdInfo[msg.sender].length; rewardIdInfo[msg.sender].push(rewardId.current()); _monthTotalWeight(rewardId.current(), _currentPoolId, totalLandWeights); for (uint256 i = 0; i < _landId.length; i++) { _transfer(landContract, msg.sender, address(this), _landId[i]); } _transferA(lordContract, msg.sender, address(this), _lordId); emit DepositeLandLord( msg.sender, rewardId.current(), _landId, _lordId, _landCatorgy, _lordCatory ); } function _getCurrentRewrdId() internal view returns (uint256) { return rewardId.current(); } function isRewardId(uint256 _rewardId) internal view returns (bool) { for (uint256 i = 0; i < rewardIdInfo[msg.sender].length; i++) { if (rewardIdInfo[msg.sender][i] == _rewardId) { return true; } } return false; } function lordProof( uint256 _lordId, uint256 _lordCatory, bytes32[] memory _merkleProoflord ) internal view { bytes32 leafToCheck = keccak256( abi.encodePacked(_lordId.toString(), ",", _lordCatory.toString()) ); require( MerkleProofUpgradeable.verify( _merkleProoflord, rootLord, leafToCheck ), "Incorrect lord proof" ); } function landProof( corrdinate memory cordinate, uint256[] memory _landId, uint256[] memory _landCatorgy, bytes32[] memory _merkleProofland1, bytes32[] memory _merkleProofland2, bytes32[] memory _merkleProofland3 ) internal view { if (_landId.length == 1) { merkelProof( cordinate.land1[0], cordinate.land1[1], _landCatorgy[0], _merkleProofland1 ); } else if (_landId.length == 2) { merkelProof( cordinate.land1[0], cordinate.land1[1], _landCatorgy[0], _merkleProofland1 ); merkelProof( cordinate.land2[0], cordinate.land2[1], _landCatorgy[1], _merkleProofland2 ); } else if (_landId.length == 3) { merkelProof( cordinate.land1[0], cordinate.land1[1], _landCatorgy[0], _merkleProofland1 ); merkelProof( cordinate.land2[0], cordinate.land2[1], _landCatorgy[1], _merkleProofland2 ); merkelProof( cordinate.land3[0], cordinate.land3[1], _landCatorgy[2], _merkleProofland3 ); } } function _monthTotalWeight( uint256 _rewardId, uint256 _poolId, uint256 _totalLandWeight ) internal { uint256 currentMonth = _currentMonth(_poolId); poolInfo[_poolId].poolTotalWeight[currentMonth - 1] = _totalLandWeight; userClaimPerPool[_rewardId][_poolId] = currentMonth - 1; } function merkelProof( uint256 x, uint256 y, uint256 _landCatorgy, bytes32[] memory _merkleProofland ) internal view { bytes32 leafToCheck = keccak256( abi.encodePacked( x.toString(), ",", y.toString(), ",", _landCatorgy.toString() ) ); require( MerkleProofUpgradeable.verify( _merkleProofland, rootLand, leafToCheck ), "Incorrect land proof" ); } function _poolMonthWeight(uint256 _poolId, uint256 _month) internal view returns (uint256) { uint256 month = _month; if (_poolId == 0) { return totalLandWeights; } else { for (uint256 i = 0; i < _month; i++) { if (poolInfo[_poolId].poolTotalWeight[month - 1] > 0) { return poolInfo[_poolId].poolTotalWeight[month - 1]; } else { month -= 1; } } } return 0; } function _poolWeight(uint256 _poolId, uint256 _month) public view returns (uint256) { uint256 weight; uint256 poolId = _poolId; uint256 month = _month; for (uint256 i = 0; i < availablePoolId; i++) { weight = _poolMonthWeight(poolId, month); if (weight == 0) { poolId -= 1; month = poolInfo[poolId].poolMonth; } else { return weight; } } return totalLandWeights; } function _rewardsForPreviousPool( uint256 _poolId, uint256 _rewardId, uint256 _lastClaimTime ) internal view returns (uint256, uint256) { uint256 lastClaimTime = _lastClaimTime; uint256 totalRewards; uint256 poolId = _poolId; for ( uint256 i = userClaimPerPool[_rewardId][poolId]; i < poolInfo[poolId].poolMonth; i++ ) { uint256 monthTime = poolInfo[poolId].poolStartTime + (poolInfo[poolId].poolTimeSlot * (i + 1)); uint256 claimableTime = monthTime - lastClaimTime; uint256 weight = _poolWeight(poolId, i + 1); uint256 rewards = ((poolInfo[poolId].poolRoyalty * claimableTime) / (weight * poolInfo[poolId].poolTimeSlot)) * landLordsInfo[_rewardId].totalLandWeight; totalRewards += rewards; lastClaimTime = monthTime; } return (totalRewards, lastClaimTime); } function _rewardForCurrentPool( uint256 _poolId, uint256 rewardIds, uint256 _lastClaimTime, uint256 _userClaim ) internal view returns ( uint256, uint256, uint256 ) { uint256 _rewardId = rewardIds; uint256 lastClaimTime = _lastClaimTime; uint256 totalRewards; uint256 currentMonth = _currentMonth(_poolId); uint256 poolId = _poolId; uint256 claiming; uint256 weights; uint256 userClaim = _userClaim == currentMonth ? _userClaim - 1 : _userClaim; if (currentMonth != 0) { for (uint256 i = userClaim; i < currentMonth; i++) { (uint256 claimableTime, uint256 monthTime) = claminingTime( i, currentMonth, lastClaimTime, poolId ); claiming = claimableTime; uint256 weight = _poolWeight(poolId, i + 1); weights = weight; uint256 rewards = ((poolInfo[poolId].poolRoyalty * claimableTime) / (weight * poolInfo[poolId].poolTimeSlot)) * landLordsInfo[_rewardId].totalLandWeight; totalRewards += rewards; lastClaimTime = monthTime; } } return (totalRewards, lastClaimTime, currentMonth); } function stacklandlord(Deposite memory deposite) internal isNonzero( deposite._landId.length, deposite._landCatorgy.length, deposite._lordCatory ) isCatorgyValid(deposite._landCatorgy, deposite._lordCatory) isContractApprove isLandValid(deposite._landId.length, deposite._lordCatory) { uint256 currentPoolIds = currentPoolId(); require(currentPoolIds > 0, "deposite not allowed"); _deposite( deposite._landId, deposite._lordId, deposite._landCatorgy, deposite._lordCatory, currentPoolIds ); } function _transfer( address _contract, address _from, address _to, uint256 _tokenId ) internal { IERC721Upgradeable(_contract).transferFrom(_from, _to, _tokenId); } function _transferA( address _contract, address _from, address _to, uint256 _tokenId ) internal { IERC721AUpgradeable(_contract).safeTransferFrom(_from, _to, _tokenId); } function _transferETH(uint256 _amount) internal { (bool success, ) = msg.sender.call{value: _amount}(""); require(success, "refund failed"); } function _withdraw(uint256 _rewardId) internal { uint256 lastrewardId = rewardIdInfo[msg.sender][ (rewardIdInfo[msg.sender].length - 1) ]; index[lastrewardId] = index[_rewardId]; rewardIdInfo[msg.sender][(index[_rewardId])] = lastrewardId; rewardIdInfo[msg.sender].pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IRental { struct LandLords { address owner; uint256[] landId; uint256 lordId; uint256[] LandCatorgy; uint256 LordCatorgy; uint256 lastClaimTime; uint256 currentPoolId; uint256 totalLandWeight; bool status; } struct Pool { uint256 poolTimeSlot; uint256 poolRoyalty; uint256[] poolTotalWeight; uint256 poolMonth; uint256 poolStartTime; uint256 poolEndTime; } struct Deposite { uint256[] _landId; uint256 _lordId; uint256[] _landCatorgy; uint256 _lordCatory; } struct corrdinate { uint256[] land1; uint256[] land2; uint256[] land3; } event Blacklisted(address account, bool value); event DepositeLandLord( address owner, uint256 _rewardId, uint256[] landId, uint256 lordId, uint256[] landCatorgy, uint256 lordCatory ); event Pausable(bool state); event UpdateOwner(address oldOwner, address newOwner); event UpdateLandContract(address newContract, address oldContract); event UpdateLordContract(address newContract, address oldContract); event WithdrawLandLord( address owner, uint256 _rewardId, uint256[] landId, uint256 lordId ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IRLand { function getTokenId(uint256 x, uint256 y) external view returns (uint256); }
// SPDX-License-Identifier: MIT // ERC721A Contracts v4.2.3 // Creator: Chiru Labs pragma solidity ^0.8.4; /** * @dev Interface of ERC721A. */ interface IERC721AUpgradeable { /** * The caller must own the token or be an approved operator. */ error ApprovalCallerNotOwnerNorApproved(); /** * The token does not exist. */ error ApprovalQueryForNonexistentToken(); /** * Cannot query the balance for the zero address. */ error BalanceQueryForZeroAddress(); /** * Cannot mint to the zero address. */ error MintToZeroAddress(); /** * The quantity of tokens minted must be more than zero. */ error MintZeroQuantity(); /** * The token does not exist. */ error OwnerQueryForNonexistentToken(); /** * The caller must own the token or be an approved operator. */ error TransferCallerNotOwnerNorApproved(); /** * The token must be owned by `from`. */ error TransferFromIncorrectOwner(); /** * Cannot safely transfer to a contract that does not implement the * ERC721Receiver interface. */ error TransferToNonERC721ReceiverImplementer(); /** * Cannot transfer to the zero address. */ error TransferToZeroAddress(); /** * The token does not exist. */ error URIQueryForNonexistentToken(); /** * The `quantity` minted with ERC2309 exceeds the safety limit. */ error MintERC2309QuantityExceedsLimit(); /** * The `extraData` cannot be set on an unintialized ownership slot. */ error OwnershipNotInitializedForExtraData(); // ============================================================= // STRUCTS // ============================================================= struct TokenOwnership { // The address of the owner. address addr; // Stores the start time of ownership with minimal overhead for tokenomics. uint64 startTimestamp; // Whether the token has been burned. bool burned; // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. uint24 extraData; } // ============================================================= // TOKEN COUNTERS // ============================================================= /** * @dev Returns the total number of tokens in existence. * Burned tokens will reduce the count. * To get the total number of tokens minted, please see {_totalMinted}. */ function totalSupply() external view returns (uint256); // ============================================================= // IERC165 // ============================================================= /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) * to learn more about how these ids are created. * * This function call must use less than 30000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); // ============================================================= // IERC721 // ============================================================= /** * @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`, * 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, bytes calldata data ) external payable; /** * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external payable; /** * @dev Transfers `tokenId` 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 payable; /** * @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 payable; /** * @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); // ============================================================= // IERC721Metadata // ============================================================= /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); // ============================================================= // IERC2309 // ============================================================= /** * @dev Emitted when tokens in `fromTokenId` to `toTokenId` * (inclusive) is transferred from `from` to `to`, as defined in the * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. * * See {_mintERC2309} for more details. */ event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"Blacklisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_rewardId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"landId","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"lordId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"landCatorgy","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"lordCatory","type":"uint256"}],"name":"DepositeLandLord","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"state","type":"bool"}],"name":"Pausable","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newContract","type":"address"},{"indexed":false,"internalType":"address","name":"oldContract","type":"address"}],"name":"UpdateLandContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newContract","type":"address"},{"indexed":false,"internalType":"address","name":"oldContract","type":"address"}],"name":"UpdateLordContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"UpdateOwner","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"_rewardId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"landId","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"lordId","type":"uint256"}],"name":"WithdrawLandLord","type":"event"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"_currentMonth","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"},{"internalType":"uint256","name":"_month","type":"uint256"}],"name":"_poolWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"rewardIds","type":"uint256"}],"name":"_rewardForPool","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"availablePoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bool","name":"value","type":"bool"}],"name":"blacklistMalicious","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardId","type":"uint256"},{"internalType":"bytes32[]","name":"_merkleProof","type":"bytes32[]"},{"internalType":"uint256","name":"_rewards","type":"uint256"}],"name":"claimRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentPoolId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currrentTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256[]","name":"_landId","type":"uint256[]"},{"internalType":"uint256","name":"_lordId","type":"uint256"},{"internalType":"uint256[]","name":"_landCatorgy","type":"uint256[]"},{"internalType":"uint256","name":"_lordCatory","type":"uint256"}],"internalType":"struct IRental.Deposite","name":"deposite","type":"tuple"},{"components":[{"internalType":"uint256[]","name":"land1","type":"uint256[]"},{"internalType":"uint256[]","name":"land2","type":"uint256[]"},{"internalType":"uint256[]","name":"land3","type":"uint256[]"}],"internalType":"struct IRental.corrdinate","name":"cordinate","type":"tuple"},{"internalType":"bytes32[]","name":"_merkleProofland1","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_merkleProofland2","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_merkleProofland3","type":"bytes32[]"},{"internalType":"bytes32[]","name":"_merkleProoflord","type":"bytes32[]"}],"name":"depositLandLords","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getCurrentRewrdId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardId","type":"uint256"}],"name":"getLandLordsInfo","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256[]","name":"landId","type":"uint256[]"},{"internalType":"uint256","name":"lordId","type":"uint256"},{"internalType":"uint256[]","name":"LandCatorgy","type":"uint256[]"},{"internalType":"uint256","name":"LordCatorgy","type":"uint256"},{"internalType":"uint256","name":"lastClaimTime","type":"uint256"},{"internalType":"uint256","name":"currentPoolId","type":"uint256"},{"internalType":"uint256","name":"totalLandWeight","type":"uint256"},{"internalType":"bool","name":"status","type":"bool"}],"internalType":"struct IRental.LandLords","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"getPoolInfo","outputs":[{"components":[{"internalType":"uint256","name":"poolTimeSlot","type":"uint256"},{"internalType":"uint256","name":"poolRoyalty","type":"uint256"},{"internalType":"uint256[]","name":"poolTotalWeight","type":"uint256[]"},{"internalType":"uint256","name":"poolMonth","type":"uint256"},{"internalType":"uint256","name":"poolStartTime","type":"uint256"},{"internalType":"uint256","name":"poolEndTime","type":"uint256"}],"internalType":"struct IRental.Pool","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardId","type":"uint256"},{"internalType":"uint256","name":"_poolId","type":"uint256"}],"name":"getUserClaim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserRewardId","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardId","type":"uint256"}],"name":"getcalculateRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_landContract","type":"address"},{"internalType":"address","name":"_lordContract","type":"address"},{"internalType":"bytes32","name":"_rootLand","type":"bytes32"},{"internalType":"bytes32","name":"_rootLord","type":"bytes32"},{"internalType":"uint256[]","name":"_landWeight","type":"uint256[]"},{"internalType":"uint256[]","name":"_lordWeight","type":"uint256[]"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isBlacklisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"landContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"landWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lordContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lordWeight","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_state","type":"bool"}],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardId","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rootLand","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rootLord","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rootOfRewards","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_landContract","type":"address"}],"name":"setLandContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_basicLandWeight","type":"uint256"},{"internalType":"uint256","name":"_platniumLandWeight","type":"uint256"},{"internalType":"uint256","name":"_primeLandWeight","type":"uint256"}],"name":"setLandWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lordContract","type":"address"}],"name":"setLordContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_status","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_poolTimeSlot","type":"uint256"},{"internalType":"uint256","name":"_poolRoyalty","type":"uint256"},{"internalType":"uint256[]","name":"_poolTotalWeight","type":"uint256[]"},{"internalType":"uint256","name":"_poolMonth","type":"uint256"}],"name":"setPool","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_time","type":"uint256"}],"name":"setRewardTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_rootLand","type":"bytes32"}],"name":"setRootLand","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_rootLord","type":"bytes32"}],"name":"setRootLord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_root","type":"bytes32"}],"name":"setRootRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalLandWeights","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"updatePausable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardId","type":"uint256"}],"name":"withdrawLandLords","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506146d3806100206000396000f3fe6080604052600436106102fd5760003560e01c80639781f8d01161018f578063de680dfb116100e1578063f851a4401161008a578063fbaf9e1911610064578063fbaf9e19146108aa578063fbd7e9f3146108ca578063fe575a87146108ea57600080fd5b8063f851a44014610838578063f91daf611461085d578063fa24e1ee1461088a57600080fd5b8063ebc5163b116100bb578063ebc5163b146107e3578063f4c8ad14146107f8578063f6c0f78c1461081857600080fd5b8063de680dfb14610790578063e69f8ac7146107b0578063e86dd092146107c357600080fd5b8063c00b479211610143578063d592bf921161011d578063d592bf921461073b578063d89293421461075b578063db2e21bc1461077b57600080fd5b8063c00b4792146106e5578063ca8957ff14610705578063cd53722b1461072557600080fd5b8063afafa9be11610174578063afafa9be1461068f578063b48641f4146106a5578063bd015b0f146106c557600080fd5b80639781f8d014610647578063a3bf2f541461065a57600080fd5b80634fb5d310116102535780636c7a9e21116101fc578063818fd119116101d6578063818fd119146105f15780638da5cb5b1461061157806391b66fd51461063157600080fd5b80636c7a9e2114610597578063704b6c02146105b157806380e55fe0146105d157600080fd5b80635c975abb1161022d5780635c975abb1461052b5780635cf443bf14610555578063681a96bc1461056a57600080fd5b80634fb5d310146104d457806352690725146104f45780635b402eaf1461051457600080fd5b8063150b7a02116102b55780632215b4dc1161028f5780632215b4dc146104715780632f380b35146104875780633fd1a4a2146104b457600080fd5b8063150b7a02146103bb57806316c38b3c14610431578063177c67cb1461045157600080fd5b80630c266545116102e65780630c2665451461036157806313af40351461038557806313ff842d146103a557600080fd5b806302329a291461030257806303d0734014610324575b600080fd5b34801561030e57600080fd5b5061032261031d366004614098565b61091a565b005b34801561033057600080fd5b50603554610344906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561036d57600080fd5b50610377603a5481565b604051908152602001610358565b34801561039157600080fd5b506103226103a0366004613efe565b6109be565b3480156103b157600080fd5b5061037760455481565b3480156103c757600080fd5b506104006103d6366004613fcc565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610358565b34801561043d57600080fd5b5061032261044c366004614098565b610a61565b34801561045d57600080fd5b5061032261046c3660046141ee565b610ac4565b34801561047d57600080fd5b50610377603c5481565b34801561049357600080fd5b506104a76104a23660046140d0565b610d44565b604051610358919061452b565b3480156104c057600080fd5b506103776104cf36600461423c565b610e1a565b3480156104e057600080fd5b506103776104ef36600461423c565b610e92565b34801561050057600080fd5b5061032261050f3660046142b6565b610f07565b34801561052057600080fd5b506033546103779081565b34801561053757600080fd5b50603d546105459060ff1681565b6040519015158152602001610358565b34801561056157600080fd5b50610377610fb2565b34801561057657600080fd5b5061058a610585366004613efe565b610fc1565b604051610358919061446d565b3480156105a357600080fd5b506047546105459060ff1681565b3480156105bd57600080fd5b506103226105cc366004613efe565b61102d565b3480156105dd57600080fd5b506103226105ec3660046140d0565b6110b9565b3480156105fd57600080fd5b5061037761060c3660046140d0565b61112e565b34801561061d57600080fd5b50603454610344906001600160a01b031681565b34801561063d57600080fd5b5061037760465481565b61032261065536600461425d565b61114f565b34801561066657600080fd5b5061067a6106753660046140d0565b611316565b60408051928352602083019190915201610358565b34801561069b57600080fd5b5061037760395481565b3480156106b157600080fd5b506103776106c03660046140d0565b61149b565b3480156106d157600080fd5b506103226106e03660046140d0565b611567565b3480156106f157600080fd5b50610322610700366004613f18565b6115c3565b34801561071157600080fd5b50610322610720366004613efe565b6118ca565b34801561073157600080fd5b50610377603b5481565b34801561074757600080fd5b50603654610344906001600160a01b031681565b34801561076757600080fd5b50610322610776366004614062565b61197e565b34801561078757600080fd5b50610322611a38565b34801561079c57600080fd5b506103776107ab3660046140d0565b611a9a565b3480156107bc57600080fd5b5042610377565b3480156107cf57600080fd5b506103226107de366004613efe565b611aaa565b3480156107ef57600080fd5b50610377611b50565b34801561080457600080fd5b506103226108133660046140d0565b611b69565b34801561082457600080fd5b506103226108333660046140e8565b611bc5565b34801561084457600080fd5b506047546103449061010090046001600160a01b031681565b34801561086957600080fd5b5061087d6108783660046140d0565b611c24565b6040516103589190614480565b34801561089657600080fd5b506103226108a53660046140d0565b611d9d565b3480156108b657600080fd5b506103776108c53660046140d0565b611df9565b3480156108d657600080fd5b506103226108e53660046140d0565b611edf565b3480156108f657600080fd5b50610545610905366004613efe565b603e6020526000908152604090205460ff1681565b6109226121fc565b6034546001600160a01b0316331461096d5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064015b60405180910390fd5b603d805460ff19168215159081179091556040519081527fd50aa5e7250de744184760fe907adb5d01955537ddb35ac6d3bd5b8c1fffde12906020015b60405180910390a16109bb60018055565b50565b6109c66121fc565b6034546001600160a01b03163314610a0c5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603480546001600160a01b0319166001600160a01b0383169081179091556040805133815260208101929092527fe2c7d1c4da37855e682bde14f17826d185497973b73fba7554daa6da467058d991016109aa565b610a696121fc565b6034546001600160a01b03163314610aaf5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b6047805460ff19168215151790556001805550565b6000838152603f602052604090205483906001600160a01b03163314610b2c5760405162461bcd60e51b815260206004820152601260248201527f6e6f74207265776172644964206f776e657200000000000000000000000000006044820152606401610964565b6000848152603f602052604090206008015460ff16610b805760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b60008481526044602090815260408083203384528252808320604554845290915290205460ff1615610bf45760405162461bcd60e51b815260206004820152600d60248201527f616c726561647920636c61696d000000000000000000000000000000000000006044820152606401610964565b6000610bff85612256565b610c0884612256565b604051602001610c19929190614354565b604051602081830303815290604052805190602001209050610c3e846045548361230e565b610c8a5760405162461bcd60e51b815260206004820152601460248201527f496e636f7272656374206c616e642070726f6f660000000000000000000000006044820152606401610964565b6000858152604460209081526040808320338085529083528184206045548552909252808320805460ff191660011790555185908381818185875af1925050503d8060008114610cf6576040519150601f19603f3d011682016040523d82523d6000602084013e610cfb565b606091505b5050905080610d3c5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b6044820152606401610964565b505050505050565b610d7d6040518060c001604052806000815260200160008152602001606081526020016000815260200160008152602001600081525090565b60008281526040602081815291819020815160c08101835281548152600182015481850152600282018054845181870281018701865281815292959394860193830182828015610dec57602002820191906000526020600020905b815481526020019060010190808311610dd8575b5050505050815260200160038201548152602001600482015481526020016005820154815250509050919050565b60475460009060ff1615610e705760405162461bcd60e51b815260206004820152601360248201527f706175736564207468652066756e6374696f6e000000000000000000000000006044820152606401610964565b5060008281526043602090815260408083208484529091529020545b92915050565b6000808383825b603a54811015610ef957610ead8383612324565b935083610edb57610ebf600184614631565b6000818152604060208190529020600301549093509150610ee7565b83945050505050610e8c565b80610ef181614648565b915050610e99565b505060395495945050505050565b610f0f6121fc565b6034546001600160a01b03163314610f555760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603780546001818101835560008390527f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae918201869055825480820184558201859055825490810190925501819055610fad60018055565b505050565b6000610fbc612404565b905090565b6001600160a01b03811660009081526041602090815260409182902080548351818402810184019094528084526060939283018282801561102157602002820191906000526020600020905b81548152602001906001019080831161100d575b50505050509050919050565b6110356121fc565b6034546001600160a01b0316331461107b5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b604780547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b038416021790556001805550565b6110c16121fc565b60475461010090046001600160a01b031633146111205760405162461bcd60e51b815260206004820152600960248201527f6e6f742061646d696e00000000000000000000000000000000000000000000006044820152606401610964565b60458190556109bb60018055565b6038818154811061113e57600080fd5b600091825260209091200154905081565b6034546001600160a01b031633146111955760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b61119f8185614612565b3410156111ee5760405162461bcd60e51b815260206004820152600e60248201527f76616c7565206e6f742073656e640000000000000000000000000000000000006044820152606401610964565b6001603a600082825461120191906145da565b9091555050603a5460009060011461123d57604060006001603a546112269190614631565b81526020019081526020016000206005015461123f565b425b9050600061124d8388614612565b61125790836145da565b90506040518060c001604052808881526020018781526020018686808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250938552505050602080830187905260408084018790526060909301859052603a54825282815290829020835181558382015160018201559183015180516112ec9260028501920190613c87565b50606082015160038201556080820151600482015560a09091015160059091015550505050505050565b604754600090819060ff161561136e5760405162461bcd60e51b815260206004820152601360248201527f706175736564207468652066756e6374696f6e000000000000000000000000006044820152606401610964565b6000838152603f602052604090206008015460ff166113c25760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b60006113cc611b50565b6000858152604360209081526040808320848452825280832054888452603f909252822060058101546006909101549394509192909190835b8061148d5781861415611445576000806000611423898d888a61240f565b9194509250905061143483896145da565b975095509350600191506114059050565b6000898152603f60205260408120600601549080611464838d8861251b565b909250905061147382896145da565b97506114806001866145da565b9450809550505050611405565b509297909650945050505050565b6000816114a6611b50565b146114f35760405162461bcd60e51b815260206004820152601460248201527f7061737320636f727265637420706f6f6c2069640000000000000000000000006044820152606401610964565b60008281526040602081905281208054600382015460049092015490929061151b9042614631565b90506115278284614612565b81111561153657509392505050565b600061154284836145f2565b905082811461155b576115568160016145da565b61155d565b825b9695505050505050565b61156f6121fc565b6034546001600160a01b031633146115b55760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603c8190556109bb60018055565b600054610100900460ff16158080156115e35750600054600160ff909116105b806115fd5750303b1580156115fd575060005460ff166001145b61166f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610964565b6000805460ff191660011790558015611692576000805461ff0019166101001790555b603480546001600160a01b03808d166001600160a01b031992831617909255603b899055603c889055603580548c841690831617905560368054928b1692909116919091179055603785856000816116fa57634e487b7160e01b600052603260045260246000fd5b8354600180820186556000958652602095869020929095029390930135920191909155506037908690869081811061174257634e487b7160e01b600052603260045260246000fd5b8354600181018555600094855260209485902091909402929092013591909201555060378585600281811061178757634e487b7160e01b600052603260045260246000fd5b835460018101855560009485526020808620920293909301359201919091555060389084908490816117c957634e487b7160e01b600052603260045260246000fd5b8354600180820186556000958652602095869020929095029390930135920191909155506038908490849081811061181157634e487b7160e01b600052603260045260246000fd5b8354600181018555600094855260209485902091909402929092013591909201555060388383600281811061185657634e487b7160e01b600052603260045260246000fd5b8354600181018555600094855260209485902091909402929092013591909201555080156118be576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050505050565b6118d26121fc565b6034546001600160a01b031633146119185760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603680546001600160a01b038381166001600160a01b03198316811790935560408051938452911660208301819052917fcc054e44df1e74bd35301d48ba2d2b27b0c2d34877beddd498a4830197bd81f491015b60405180910390a1506109bb60018055565b6034546001600160a01b031633146119c45760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b6119cc6121fc565b6001600160a01b0382166000818152603e6020908152604091829020805460ff19168515159081179091558251938452908301527fcf3473b85df1594d47b6958f29a32bea0abff9dd68296f7bf33443646793cfd8910160405180910390a1611a3460018055565b5050565b611a406121fc565b6034546001600160a01b03163314611a865760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b611a8f47612650565b611a9860018055565b565b6037818154811061113e57600080fd5b611ab26121fc565b6034546001600160a01b03163314611af85760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603580546001600160a01b038381166001600160a01b03198316811790935560408051938452911660208301819052917fcc054e44df1e74bd35301d48ba2d2b27b0c2d34877beddd498a4830197bd81f4910161196c565b603a5460009015611b6357610fbc6126d8565b50600090565b611b716121fc565b6034546001600160a01b03163314611bb75760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b60468190556109bb60018055565b611bcd6121fc565b84866000015187602001518860400151896060015188888888611bf489898887878761277c565b611bff8786836129bb565b611c098989612a57565b611c128f613106565b505050505050505050610d3c60018055565b611c7e60405180610120016040528060006001600160a01b03168152602001606081526020016000815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581525090565b6000828152603f602090815260409182902082516101208101845281546001600160a01b0316815260018201805485518186028101860190965280865291949293858101939290830182828015611cf457602002820191906000526020600020905b815481526020019060010190808311611ce0575b505050505081526020016002820154815260200160038201805480602002602001604051908101604052809291908181526020018280548015611d5657602002820191906000526020600020905b815481526020019060010190808311611d42575b50505091835250506004820154602082015260058201546040820152600682015460608201526007820154608082015260089091015460ff16151560a09091015292915050565b611da56121fc565b6034546001600160a01b03163314611deb5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603b8190556109bb60018055565b6000818152603f602052604081206008015460ff16611e4d5760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b816000611e58611b50565b90506000611e658261149b565b90506000611e738383610e92565b6000858152603f6020908152604080832060070154878452918190528220549293509091611ea19084614612565b604654600087815260406020819052902060010154611ec09190614612565b611eca91906145f2565b611ed49190614612565b979650505050505050565b611ee76121fc565b603d5460ff1615611f3a5760405162461bcd60e51b815260206004820152600f60248201527f636f6e74726163742070617573656400000000000000000000000000000000006044820152606401610964565b6000818152603f602052604090205481906001600160a01b03163314611fa25760405162461bcd60e51b815260206004820152601260248201527f6e6f74207265776172644964206f776e657200000000000000000000000000006044820152606401610964565b81611fef5760405162461bcd60e51b815260206004820152600860248201527f6e6f74207a65726f0000000000000000000000000000000000000000000000006044820152606401610964565b6000828152603f602052604090206008015460ff166120435760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b60005b6000838152603f60205260409020600101548110156120c8576035546000848152603f6020526040902060010180546120b6926001600160a01b0316913091339190869081106120a657634e487b7160e01b600052603260045260246000fd5b906000526020600020015461343f565b806120c081614648565b915050612046565b506036546000838152603f60205260409020600201546120f5916001600160a01b031690309033906134c9565b6000828152603f60205260409020600701546039546121149190614631565b6039556000828152603f60205260408120600801805460ff19169055612138611b50565b905060006121458261149b565b603954600084815260406020819052902091925090600201612168600184614631565b8154811061218657634e487b7160e01b600052603260045260246000fd5b60009182526020909120015561219b8461351f565b6000848152603f602052604090819020600281015491517f60b9a0acc61a79b572af470a60dbe9aeb530b84888d0fcea2edafc099e07e7b7926121e8923392899260019092019190614404565b60405180910390a15050506109bb60018055565b6002600154141561224f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610964565b6002600155565b6060600061226383613608565b600101905060008167ffffffffffffffff81111561229157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156122bb576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461230157612306565b6122c5565b509392505050565b60008261231b85846136ea565b14949350505050565b60008183612336575050603954610e8c565b60005b838110156123f957600085815260406020819052812060020161235d600185614631565b8154811061237b57634e487b7160e01b600052603260045260246000fd5b906000526020600020015411156123da5760008581526040602081905290206002016123a8600184614631565b815481106123c657634e487b7160e01b600052603260045260246000fd5b906000526020600020015492505050610e8c565b6123e5600183614631565b9150806123f181614648565b915050612339565b506000949350505050565b6000610fbc60335490565b60008080858582806124208b61149b565b90508a600080808b8514612434578b61243f565b61243f60018d614631565b9050841561250557805b858110156125035760008061246083898c8a61373d565b90965086925090506000612479886104ef8660016145da565b60008d8152603f60209081526040808320600701548c84529181905282205492985088935090916124aa9084614612565b60008b8152604060208190529020600101546124c7908790614612565b6124d191906145f2565b6124db9190614612565b90506124e7818c6145da565b9a50829b505050505080806124fb90614648565b915050612449565b505b50939d949c50919a509298505050505050505050565b600082815260436020908152604080832086845290915281205481908390829087905b6000828152604060208190529020600301548110156126415760006125648260016145da565b60008481526040602081905290205461257d9190614612565b60008481526040602081905290206004015461259991906145da565b905060006125a78683614631565b905060006125ba856104ef8660016145da565b60008c8152603f60209081526040808320600701548984529181905282205492935090916125e89084614612565b600088815260406020819052902060010154612605908690614612565b61260f91906145f2565b6126199190614612565b905061262581886145da565b965083975050505050808061263990614648565b91505061253e565b50909791965090945050505050565b604051600090339083908381818185875af1925050503d8060008114612692576040519150601f19603f3d011682016040523d82523d6000602084013e612697565b606091505b5050905080611a345760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b6044820152606401610964565b6000805b603a548110156127785742604060006126f68460016145da565b815260200190815260200160002060050154118015612734575042604060006127208460016145da565b815260200190815260200160002060040154105b1561274a576127448160016145da565b91505090565b603a546127588260016145da565b1415612766575050603a5490565b8061277081614648565b9150506126dc565b5090565b8451600114156128175761281286600001516000815181106127ae57634e487b7160e01b600052603260045260246000fd5b602002602001015187600001516001815181106127db57634e487b7160e01b600052603260045260246000fd5b60200260200101518660008151811061280457634e487b7160e01b600052603260045260246000fd5b6020026020010151866137ce565b610d3c565b8451600214156128d55761284986600001516000815181106127ae57634e487b7160e01b600052603260045260246000fd5b612812866020015160008151811061287157634e487b7160e01b600052603260045260246000fd5b6020026020010151876020015160018151811061289e57634e487b7160e01b600052603260045260246000fd5b6020026020010151866001815181106128c757634e487b7160e01b600052603260045260246000fd5b6020026020010151856137ce565b845160031415610d3c5761290786600001516000815181106127ae57634e487b7160e01b600052603260045260246000fd5b61292f866020015160008151811061287157634e487b7160e01b600052603260045260246000fd5b610d3c866040015160008151811061295757634e487b7160e01b600052603260045260246000fd5b6020026020010151876040015160018151811061298457634e487b7160e01b600052603260045260246000fd5b6020026020010151866002815181106129ad57634e487b7160e01b600052603260045260246000fd5b6020026020010151846137ce565b60006129c684612256565b6129cf84612256565b6040516020016129e0929190614354565b604051602081830303815290604052805190602001209050612a0582603c548361230e565b612a515760405162461bcd60e51b815260206004820152601460248201527f496e636f7272656374206c6f72642070726f6f660000000000000000000000006044820152606401610964565b50505050565b805160011415612bb25780600081518110612a8257634e487b7160e01b600052603260045260246000fd5b6020908102919091010151603554835180516001600160a01b0390921691633112de9a9190600090612ac457634e487b7160e01b600052603260045260246000fd5b60200260200101518560000151600181518110612af157634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612b1f929190918252602082015260400190565b60206040518083038186803b158015612b3757600080fd5b505afa158015612b4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6f91906141d6565b14611a345760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b805160021415612dac5780600081518110612bdd57634e487b7160e01b600052603260045260246000fd5b6020908102919091010151603554835180516001600160a01b0390921691633112de9a9190600090612c1f57634e487b7160e01b600052603260045260246000fd5b60200260200101518560000151600181518110612c4c57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612c7a929190918252602082015260400190565b60206040518083038186803b158015612c9257600080fd5b505afa158015612ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cca91906141d6565b14612d0d5760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b80600181518110612d2e57634e487b7160e01b600052603260045260246000fd5b6020026020010151603560009054906101000a90046001600160a01b03166001600160a01b0316633112de9a8460200151600081518110612d7f57634e487b7160e01b600052603260045260246000fd5b60200260200101518560200151600181518110612af157634e487b7160e01b600052603260045260246000fd5b805160031415611a345780600081518110612dd757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151603554835180516001600160a01b0390921691633112de9a9190600090612e1957634e487b7160e01b600052603260045260246000fd5b60200260200101518560000151600181518110612e4657634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612e74929190918252602082015260400190565b60206040518083038186803b158015612e8c57600080fd5b505afa158015612ea0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec491906141d6565b14612f075760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b80600181518110612f2857634e487b7160e01b600052603260045260246000fd5b6020026020010151603560009054906101000a90046001600160a01b03166001600160a01b0316633112de9a8460200151600081518110612f7957634e487b7160e01b600052603260045260246000fd5b60200260200101518560200151600181518110612fa657634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612fd4929190918252602082015260400190565b60206040518083038186803b158015612fec57600080fd5b505afa158015613000573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302491906141d6565b146130675760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b8060028151811061308857634e487b7160e01b600052603260045260246000fd5b6020026020010151603560009054906101000a90046001600160a01b03166001600160a01b0316633112de9a84604001516000815181106130d957634e487b7160e01b600052603260045260246000fd5b60200260200101518560400151600181518110612af157634e487b7160e01b600052603260045260246000fd5b8051516040820151516060830151821580159061312257508115155b801561312d57508015155b6131795760405162461bcd60e51b815260206004820152600860248201527f6e6f74206e756c6c0000000000000000000000000000000000000000000000006044820152606401610964565b8360400151846060015161318d8282613875565b6131d95760405162461bcd60e51b815260206004820152601060248201527f6e6f742076616c6964206361746f7279000000000000000000000000000000006044820152606401610964565b60355460405163e985e9c560e01b81523360048201523060248201526001600160a01b039091169063e985e9c59060440160206040518083038186803b15801561322257600080fd5b505afa158015613236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061325a91906140b4565b80156132e2575060365460405163e985e9c560e01b81523360048201523060248201526001600160a01b039091169063e985e9c59060440160206040518083038186803b1580156132aa57600080fd5b505afa1580156132be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132e291906140b4565b61332e5760405162461bcd60e51b815260206004820152601c60248201527f4e6674206e6f7420617070726f76656420746f20636f6e7472616374000000006044820152606401610964565b8551516060870151816038613344600184614631565b8154811061336257634e487b7160e01b600052603260045260246000fd5b906000526020600020015410156133bb5760405162461bcd60e51b815260206004820152600f60248201527f6c656e677468206d69736d6174636800000000000000000000000000000000006044820152606401610964565b60006133c5611b50565b9050600081116134175760405162461bcd60e51b815260206004820152601460248201527f6465706f73697465206e6f7420616c6c6f7765640000000000000000000000006044820152606401610964565b61343489600001518a602001518b604001518c60600151856138e5565b505050505050505050565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064015b600060405180830381600087803b1580156134ab57600080fd5b505af11580156134bf573d6000803e3d6000fd5b5050505050505050565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401613491565b336000908152604160205260408120805461353c90600190614631565b8154811061355a57634e487b7160e01b600052603260045260246000fd5b600091825260208083209091015484835260428083526040808520548386528186208190553386526041855290852094879052925282549093508392919081106135b457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092553381526041909152604090208054806135ee57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590555050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613651577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061367d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061369b57662386f26fc10000830492506010015b6305f5e10083106136b3576305f5e100830492506008015b61271083106136c757612710830492506004015b606483106136d9576064830492506002015b600a8310610e8c5760010192915050565b600081815b8451811015612306576137298286838151811061371c57634e487b7160e01b600052603260045260246000fd5b6020026020010151613bd1565b91508061373581614648565b9150506136ef565b6000808061374c8760016145da565b6000858152604060208190529020546137659190614612565b60008581526040602081905290206004015461378191906145da565b905061378e8760016145da565b8614801561379b57508042105b156137b4576137aa8542614631565b92504291506137c4565b6137be8582614631565b92508091505b5094509492505050565b60006137d985612256565b6137e285612256565b6137eb85612256565b6040516020016137fd9392919061437d565b60405160208183030381529060405280519060200120905061382282603b548361230e565b61386e5760405162461bcd60e51b815260206004820152601460248201527f496e636f7272656374206c616e642070726f6f660000000000000000000000006044820152606401610964565b5050505050565b6000805b83518110156138db5760048482815181106138a457634e487b7160e01b600052603260045260246000fd5b60200260200101511015806138ba575060048310155b156138c9576000915050610e8c565b806138d381614648565b915050613879565b5060019392505050565b6138f3603380546001019055565b6000805b845181101561397e576037600186838151811061392457634e487b7160e01b600052603260045260246000fd5b60200260200101516139369190614631565b8154811061395457634e487b7160e01b600052603260045260246000fd5b90600052602060002001548261396a91906145da565b91508061397681614648565b9150506138f7565b50604051806101200160405280336001600160a01b0316815260200187815260200186815260200185815260200184815260200142815260200183815260200182815260200160011515815250603f60006139d860335490565b8152602080820192909252604001600020825181546001600160a01b0319166001600160a01b039091161781558282015180519192613a1f92600185019290910190613c87565b506040820151600282015560608201518051613a45916003840191602090910190613c87565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820155610100909101516008909101805460ff191691151591909117905560398054829190600090613a9e9084906145da565b90915550503360009081526041602052604081205490604290613ac060335490565b8152602080820192909252604090810160009081209390935533835260418252822060338054825460018101845592855292909320015554613b059083603954613c03565b60005b8651811015613b67576035548751613b55916001600160a01b031690339030908b9086908110613b4857634e487b7160e01b600052603260045260246000fd5b602002602001015161343f565b80613b5f81614648565b915050613b08565b50603654613b80906001600160a01b03163330886134c9565b7f20710c8acac7f8475d8dfcdeb77e60a4457e5ec543f177deda3d7e1f05da638f33613bab60335490565b88888888604051613bc1969594939291906143b0565b60405180910390a1505050505050565b6000818310613bed576000828152602084905260409020613bfc565b60008381526020839052604090205b9392505050565b6000613c0e8361149b565b60008481526040602081905290209091508290600201613c2f600184614631565b81548110613c4d57634e487b7160e01b600052603260045260246000fd5b600091825260209091200155613c64600182614631565b600094855260436020908152604080872095875294905292909320919091555050565b828054828255906000526020600020908101928215613cc2579160200282015b82811115613cc2578251825591602001919060010190613ca7565b506127789291505b808211156127785760008155600101613cca565b80356001600160a01b0381168114613cf557600080fd5b919050565b600082601f830112613d0a578081fd5b81356020613d1f613d1a836145b6565b614585565b80838252828201915082860187848660051b8901011115613d3e578586fd5b855b85811015613d5c57813584529284019290840190600101613d40565b5090979650505050505050565b60008083601f840112613d7a578182fd5b50813567ffffffffffffffff811115613d91578182fd5b6020830191508360208260051b8501011115613dac57600080fd5b9250929050565b600060808284031215613dc4578081fd5b6040516080810167ffffffffffffffff8282108183111715613de857613de8614679565b816040528293508435915080821115613e0057600080fd5b613e0c86838701613cfa565b8352602085013560208401526040850135915080821115613e2c57600080fd5b50613e3985828601613cfa565b604083015250606083013560608201525092915050565b600060608284031215613e61578081fd5b6040516060810167ffffffffffffffff8282108183111715613e8557613e85614679565b816040528293508435915080821115613e9d57600080fd5b613ea986838701613cfa565b83526020850135915080821115613ebf57600080fd5b613ecb86838701613cfa565b60208401526040850135915080821115613ee457600080fd5b50613ef185828601613cfa565b6040830152505092915050565b600060208284031215613f0f578081fd5b613bfc82613cde565b600080600080600080600080600060e08a8c031215613f35578485fd5b613f3e8a613cde565b9850613f4c60208b01613cde565b9750613f5a60408b01613cde565b965060608a0135955060808a0135945060a08a013567ffffffffffffffff80821115613f84578586fd5b613f908d838e01613d69565b909650945060c08c0135915080821115613fa8578384fd5b50613fb58c828d01613d69565b915080935050809150509295985092959850929598565b600080600080600060808688031215613fe3578081fd5b613fec86613cde565b9450613ffa60208701613cde565b935060408601359250606086013567ffffffffffffffff8082111561401d578283fd5b818801915088601f830112614030578283fd5b81358181111561403e578384fd5b89602082850101111561404f578384fd5b9699959850939650602001949392505050565b60008060408385031215614074578182fd5b61407d83613cde565b9150602083013561408d8161468f565b809150509250929050565b6000602082840312156140a9578081fd5b8135613bfc8161468f565b6000602082840312156140c5578081fd5b8151613bfc8161468f565b6000602082840312156140e1578081fd5b5035919050565b60008060008060008060c08789031215614100578182fd5b863567ffffffffffffffff80821115614117578384fd5b6141238a838b01613db3565b97506020890135915080821115614138578384fd5b6141448a838b01613e50565b96506040890135915080821115614159578384fd5b6141658a838b01613cfa565b9550606089013591508082111561417a578384fd5b6141868a838b01613cfa565b9450608089013591508082111561419b578384fd5b6141a78a838b01613cfa565b935060a08901359150808211156141bc578283fd5b506141c989828a01613cfa565b9150509295509295509295565b6000602082840312156141e7578081fd5b5051919050565b600080600060608486031215614202578081fd5b83359250602084013567ffffffffffffffff81111561421f578182fd5b61422b86828701613cfa565b925050604084013590509250925092565b6000806040838503121561424e578182fd5b50508035926020909101359150565b600080600080600060808688031215614274578283fd5b8535945060208601359350604086013567ffffffffffffffff811115614298578384fd5b6142a488828901613d69565b96999598509660600135949350505050565b6000806000606084860312156142ca578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b83811015614310578151875295820195908201906001016142f4565b509495945050505050565b60008151815b8181101561433b5760208185018101518683015201614321565b818111156143495782828601525b509290920192915050565b6000614360828561431b565b600b60fa1b8152614374600182018561431b565b95945050505050565b6000614389828661431b565b600b60fa1b80825261439e600183018761431b565b908152905061155d600182018561431b565b6001600160a01b038716815285602082015260c0604082015260006143d860c08301876142e1565b85606084015282810360808401526143f081866142e1565b9150508260a0830152979650505050505050565b6000608082016001600160a01b0387168352602086818501526080604085015281865480845260a0860191508785528285209350845b818110156144565784548352600194850194928401920161443a565b505080935050505082606083015295945050505050565b602081526000613bfc60208301846142e1565b6020815261449a6020820183516001600160a01b03169052565b600060208301516101208060408501526144b86101408501836142e1565b9150604085015160608501526060850151601f198584030160808601526144df83826142e1565b925050608085015160a085015260a085015160c085015260c085015160e085015260e08501516101008181870152808701519150506145218286018215159052565b5090949350505050565b6020815281516020820152602082015160408201526000604083015160c0606084015261455b60e08401826142e1565b905060608401516080840152608084015160a084015260a084015160c08401528091505092915050565b604051601f8201601f1916810167ffffffffffffffff811182821017156145ae576145ae614679565b604052919050565b600067ffffffffffffffff8211156145d0576145d0614679565b5060051b60200190565b600082198211156145ed576145ed614663565b500190565b60008261460d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561462c5761462c614663565b500290565b60008282101561464357614643614663565b500390565b600060001982141561465c5761465c614663565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146109bb57600080fdfea2646970667358221220242a07526af4e25b40df5150991a6af72abb09698e1ab99fde88565015207a9a64736f6c63430008040033
Deployed Bytecode
0x6080604052600436106102fd5760003560e01c80639781f8d01161018f578063de680dfb116100e1578063f851a4401161008a578063fbaf9e1911610064578063fbaf9e19146108aa578063fbd7e9f3146108ca578063fe575a87146108ea57600080fd5b8063f851a44014610838578063f91daf611461085d578063fa24e1ee1461088a57600080fd5b8063ebc5163b116100bb578063ebc5163b146107e3578063f4c8ad14146107f8578063f6c0f78c1461081857600080fd5b8063de680dfb14610790578063e69f8ac7146107b0578063e86dd092146107c357600080fd5b8063c00b479211610143578063d592bf921161011d578063d592bf921461073b578063d89293421461075b578063db2e21bc1461077b57600080fd5b8063c00b4792146106e5578063ca8957ff14610705578063cd53722b1461072557600080fd5b8063afafa9be11610174578063afafa9be1461068f578063b48641f4146106a5578063bd015b0f146106c557600080fd5b80639781f8d014610647578063a3bf2f541461065a57600080fd5b80634fb5d310116102535780636c7a9e21116101fc578063818fd119116101d6578063818fd119146105f15780638da5cb5b1461061157806391b66fd51461063157600080fd5b80636c7a9e2114610597578063704b6c02146105b157806380e55fe0146105d157600080fd5b80635c975abb1161022d5780635c975abb1461052b5780635cf443bf14610555578063681a96bc1461056a57600080fd5b80634fb5d310146104d457806352690725146104f45780635b402eaf1461051457600080fd5b8063150b7a02116102b55780632215b4dc1161028f5780632215b4dc146104715780632f380b35146104875780633fd1a4a2146104b457600080fd5b8063150b7a02146103bb57806316c38b3c14610431578063177c67cb1461045157600080fd5b80630c266545116102e65780630c2665451461036157806313af40351461038557806313ff842d146103a557600080fd5b806302329a291461030257806303d0734014610324575b600080fd5b34801561030e57600080fd5b5061032261031d366004614098565b61091a565b005b34801561033057600080fd5b50603554610344906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561036d57600080fd5b50610377603a5481565b604051908152602001610358565b34801561039157600080fd5b506103226103a0366004613efe565b6109be565b3480156103b157600080fd5b5061037760455481565b3480156103c757600080fd5b506104006103d6366004613fcc565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610358565b34801561043d57600080fd5b5061032261044c366004614098565b610a61565b34801561045d57600080fd5b5061032261046c3660046141ee565b610ac4565b34801561047d57600080fd5b50610377603c5481565b34801561049357600080fd5b506104a76104a23660046140d0565b610d44565b604051610358919061452b565b3480156104c057600080fd5b506103776104cf36600461423c565b610e1a565b3480156104e057600080fd5b506103776104ef36600461423c565b610e92565b34801561050057600080fd5b5061032261050f3660046142b6565b610f07565b34801561052057600080fd5b506033546103779081565b34801561053757600080fd5b50603d546105459060ff1681565b6040519015158152602001610358565b34801561056157600080fd5b50610377610fb2565b34801561057657600080fd5b5061058a610585366004613efe565b610fc1565b604051610358919061446d565b3480156105a357600080fd5b506047546105459060ff1681565b3480156105bd57600080fd5b506103226105cc366004613efe565b61102d565b3480156105dd57600080fd5b506103226105ec3660046140d0565b6110b9565b3480156105fd57600080fd5b5061037761060c3660046140d0565b61112e565b34801561061d57600080fd5b50603454610344906001600160a01b031681565b34801561063d57600080fd5b5061037760465481565b61032261065536600461425d565b61114f565b34801561066657600080fd5b5061067a6106753660046140d0565b611316565b60408051928352602083019190915201610358565b34801561069b57600080fd5b5061037760395481565b3480156106b157600080fd5b506103776106c03660046140d0565b61149b565b3480156106d157600080fd5b506103226106e03660046140d0565b611567565b3480156106f157600080fd5b50610322610700366004613f18565b6115c3565b34801561071157600080fd5b50610322610720366004613efe565b6118ca565b34801561073157600080fd5b50610377603b5481565b34801561074757600080fd5b50603654610344906001600160a01b031681565b34801561076757600080fd5b50610322610776366004614062565b61197e565b34801561078757600080fd5b50610322611a38565b34801561079c57600080fd5b506103776107ab3660046140d0565b611a9a565b3480156107bc57600080fd5b5042610377565b3480156107cf57600080fd5b506103226107de366004613efe565b611aaa565b3480156107ef57600080fd5b50610377611b50565b34801561080457600080fd5b506103226108133660046140d0565b611b69565b34801561082457600080fd5b506103226108333660046140e8565b611bc5565b34801561084457600080fd5b506047546103449061010090046001600160a01b031681565b34801561086957600080fd5b5061087d6108783660046140d0565b611c24565b6040516103589190614480565b34801561089657600080fd5b506103226108a53660046140d0565b611d9d565b3480156108b657600080fd5b506103776108c53660046140d0565b611df9565b3480156108d657600080fd5b506103226108e53660046140d0565b611edf565b3480156108f657600080fd5b50610545610905366004613efe565b603e6020526000908152604090205460ff1681565b6109226121fc565b6034546001600160a01b0316331461096d5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b60448201526064015b60405180910390fd5b603d805460ff19168215159081179091556040519081527fd50aa5e7250de744184760fe907adb5d01955537ddb35ac6d3bd5b8c1fffde12906020015b60405180910390a16109bb60018055565b50565b6109c66121fc565b6034546001600160a01b03163314610a0c5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603480546001600160a01b0319166001600160a01b0383169081179091556040805133815260208101929092527fe2c7d1c4da37855e682bde14f17826d185497973b73fba7554daa6da467058d991016109aa565b610a696121fc565b6034546001600160a01b03163314610aaf5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b6047805460ff19168215151790556001805550565b6000838152603f602052604090205483906001600160a01b03163314610b2c5760405162461bcd60e51b815260206004820152601260248201527f6e6f74207265776172644964206f776e657200000000000000000000000000006044820152606401610964565b6000848152603f602052604090206008015460ff16610b805760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b60008481526044602090815260408083203384528252808320604554845290915290205460ff1615610bf45760405162461bcd60e51b815260206004820152600d60248201527f616c726561647920636c61696d000000000000000000000000000000000000006044820152606401610964565b6000610bff85612256565b610c0884612256565b604051602001610c19929190614354565b604051602081830303815290604052805190602001209050610c3e846045548361230e565b610c8a5760405162461bcd60e51b815260206004820152601460248201527f496e636f7272656374206c616e642070726f6f660000000000000000000000006044820152606401610964565b6000858152604460209081526040808320338085529083528184206045548552909252808320805460ff191660011790555185908381818185875af1925050503d8060008114610cf6576040519150601f19603f3d011682016040523d82523d6000602084013e610cfb565b606091505b5050905080610d3c5760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b6044820152606401610964565b505050505050565b610d7d6040518060c001604052806000815260200160008152602001606081526020016000815260200160008152602001600081525090565b60008281526040602081815291819020815160c08101835281548152600182015481850152600282018054845181870281018701865281815292959394860193830182828015610dec57602002820191906000526020600020905b815481526020019060010190808311610dd8575b5050505050815260200160038201548152602001600482015481526020016005820154815250509050919050565b60475460009060ff1615610e705760405162461bcd60e51b815260206004820152601360248201527f706175736564207468652066756e6374696f6e000000000000000000000000006044820152606401610964565b5060008281526043602090815260408083208484529091529020545b92915050565b6000808383825b603a54811015610ef957610ead8383612324565b935083610edb57610ebf600184614631565b6000818152604060208190529020600301549093509150610ee7565b83945050505050610e8c565b80610ef181614648565b915050610e99565b505060395495945050505050565b610f0f6121fc565b6034546001600160a01b03163314610f555760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603780546001818101835560008390527f42a7b7dd785cd69714a189dffb3fd7d7174edc9ece837694ce50f7078f7c31ae918201869055825480820184558201859055825490810190925501819055610fad60018055565b505050565b6000610fbc612404565b905090565b6001600160a01b03811660009081526041602090815260409182902080548351818402810184019094528084526060939283018282801561102157602002820191906000526020600020905b81548152602001906001019080831161100d575b50505050509050919050565b6110356121fc565b6034546001600160a01b0316331461107b5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b604780547fffffffffffffffffffffff0000000000000000000000000000000000000000ff166101006001600160a01b038416021790556001805550565b6110c16121fc565b60475461010090046001600160a01b031633146111205760405162461bcd60e51b815260206004820152600960248201527f6e6f742061646d696e00000000000000000000000000000000000000000000006044820152606401610964565b60458190556109bb60018055565b6038818154811061113e57600080fd5b600091825260209091200154905081565b6034546001600160a01b031633146111955760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b61119f8185614612565b3410156111ee5760405162461bcd60e51b815260206004820152600e60248201527f76616c7565206e6f742073656e640000000000000000000000000000000000006044820152606401610964565b6001603a600082825461120191906145da565b9091555050603a5460009060011461123d57604060006001603a546112269190614631565b81526020019081526020016000206005015461123f565b425b9050600061124d8388614612565b61125790836145da565b90506040518060c001604052808881526020018781526020018686808060200260200160405190810160405280939291908181526020018383602002808284376000920182905250938552505050602080830187905260408084018790526060909301859052603a54825282815290829020835181558382015160018201559183015180516112ec9260028501920190613c87565b50606082015160038201556080820151600482015560a09091015160059091015550505050505050565b604754600090819060ff161561136e5760405162461bcd60e51b815260206004820152601360248201527f706175736564207468652066756e6374696f6e000000000000000000000000006044820152606401610964565b6000838152603f602052604090206008015460ff166113c25760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b60006113cc611b50565b6000858152604360209081526040808320848452825280832054888452603f909252822060058101546006909101549394509192909190835b8061148d5781861415611445576000806000611423898d888a61240f565b9194509250905061143483896145da565b975095509350600191506114059050565b6000898152603f60205260408120600601549080611464838d8861251b565b909250905061147382896145da565b97506114806001866145da565b9450809550505050611405565b509297909650945050505050565b6000816114a6611b50565b146114f35760405162461bcd60e51b815260206004820152601460248201527f7061737320636f727265637420706f6f6c2069640000000000000000000000006044820152606401610964565b60008281526040602081905281208054600382015460049092015490929061151b9042614631565b90506115278284614612565b81111561153657509392505050565b600061154284836145f2565b905082811461155b576115568160016145da565b61155d565b825b9695505050505050565b61156f6121fc565b6034546001600160a01b031633146115b55760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603c8190556109bb60018055565b600054610100900460ff16158080156115e35750600054600160ff909116105b806115fd5750303b1580156115fd575060005460ff166001145b61166f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610964565b6000805460ff191660011790558015611692576000805461ff0019166101001790555b603480546001600160a01b03808d166001600160a01b031992831617909255603b899055603c889055603580548c841690831617905560368054928b1692909116919091179055603785856000816116fa57634e487b7160e01b600052603260045260246000fd5b8354600180820186556000958652602095869020929095029390930135920191909155506037908690869081811061174257634e487b7160e01b600052603260045260246000fd5b8354600181018555600094855260209485902091909402929092013591909201555060378585600281811061178757634e487b7160e01b600052603260045260246000fd5b835460018101855560009485526020808620920293909301359201919091555060389084908490816117c957634e487b7160e01b600052603260045260246000fd5b8354600180820186556000958652602095869020929095029390930135920191909155506038908490849081811061181157634e487b7160e01b600052603260045260246000fd5b8354600181018555600094855260209485902091909402929092013591909201555060388383600281811061185657634e487b7160e01b600052603260045260246000fd5b8354600181018555600094855260209485902091909402929092013591909201555080156118be576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050505050565b6118d26121fc565b6034546001600160a01b031633146119185760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603680546001600160a01b038381166001600160a01b03198316811790935560408051938452911660208301819052917fcc054e44df1e74bd35301d48ba2d2b27b0c2d34877beddd498a4830197bd81f491015b60405180910390a1506109bb60018055565b6034546001600160a01b031633146119c45760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b6119cc6121fc565b6001600160a01b0382166000818152603e6020908152604091829020805460ff19168515159081179091558251938452908301527fcf3473b85df1594d47b6958f29a32bea0abff9dd68296f7bf33443646793cfd8910160405180910390a1611a3460018055565b5050565b611a406121fc565b6034546001600160a01b03163314611a865760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b611a8f47612650565b611a9860018055565b565b6037818154811061113e57600080fd5b611ab26121fc565b6034546001600160a01b03163314611af85760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603580546001600160a01b038381166001600160a01b03198316811790935560408051938452911660208301819052917fcc054e44df1e74bd35301d48ba2d2b27b0c2d34877beddd498a4830197bd81f4910161196c565b603a5460009015611b6357610fbc6126d8565b50600090565b611b716121fc565b6034546001600160a01b03163314611bb75760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b60468190556109bb60018055565b611bcd6121fc565b84866000015187602001518860400151896060015188888888611bf489898887878761277c565b611bff8786836129bb565b611c098989612a57565b611c128f613106565b505050505050505050610d3c60018055565b611c7e60405180610120016040528060006001600160a01b03168152602001606081526020016000815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581525090565b6000828152603f602090815260409182902082516101208101845281546001600160a01b0316815260018201805485518186028101860190965280865291949293858101939290830182828015611cf457602002820191906000526020600020905b815481526020019060010190808311611ce0575b505050505081526020016002820154815260200160038201805480602002602001604051908101604052809291908181526020018280548015611d5657602002820191906000526020600020905b815481526020019060010190808311611d42575b50505091835250506004820154602082015260058201546040820152600682015460608201526007820154608082015260089091015460ff16151560a09091015292915050565b611da56121fc565b6034546001600160a01b03163314611deb5760405162461bcd60e51b81526020600482015260096024820152683737ba1037bbb732b960b91b6044820152606401610964565b603b8190556109bb60018055565b6000818152603f602052604081206008015460ff16611e4d5760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b816000611e58611b50565b90506000611e658261149b565b90506000611e738383610e92565b6000858152603f6020908152604080832060070154878452918190528220549293509091611ea19084614612565b604654600087815260406020819052902060010154611ec09190614612565b611eca91906145f2565b611ed49190614612565b979650505050505050565b611ee76121fc565b603d5460ff1615611f3a5760405162461bcd60e51b815260206004820152600f60248201527f636f6e74726163742070617573656400000000000000000000000000000000006044820152606401610964565b6000818152603f602052604090205481906001600160a01b03163314611fa25760405162461bcd60e51b815260206004820152601260248201527f6e6f74207265776172644964206f776e657200000000000000000000000000006044820152606401610964565b81611fef5760405162461bcd60e51b815260206004820152600860248201527f6e6f74207a65726f0000000000000000000000000000000000000000000000006044820152606401610964565b6000828152603f602052604090206008015460ff166120435760405162461bcd60e51b815260206004820152601060248201526f526577617264496420756e7374616b6560801b6044820152606401610964565b60005b6000838152603f60205260409020600101548110156120c8576035546000848152603f6020526040902060010180546120b6926001600160a01b0316913091339190869081106120a657634e487b7160e01b600052603260045260246000fd5b906000526020600020015461343f565b806120c081614648565b915050612046565b506036546000838152603f60205260409020600201546120f5916001600160a01b031690309033906134c9565b6000828152603f60205260409020600701546039546121149190614631565b6039556000828152603f60205260408120600801805460ff19169055612138611b50565b905060006121458261149b565b603954600084815260406020819052902091925090600201612168600184614631565b8154811061218657634e487b7160e01b600052603260045260246000fd5b60009182526020909120015561219b8461351f565b6000848152603f602052604090819020600281015491517f60b9a0acc61a79b572af470a60dbe9aeb530b84888d0fcea2edafc099e07e7b7926121e8923392899260019092019190614404565b60405180910390a15050506109bb60018055565b6002600154141561224f5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610964565b6002600155565b6060600061226383613608565b600101905060008167ffffffffffffffff81111561229157634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156122bb576020820181803683370190505b5090508181016020015b600019017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a850494508461230157612306565b6122c5565b509392505050565b60008261231b85846136ea565b14949350505050565b60008183612336575050603954610e8c565b60005b838110156123f957600085815260406020819052812060020161235d600185614631565b8154811061237b57634e487b7160e01b600052603260045260246000fd5b906000526020600020015411156123da5760008581526040602081905290206002016123a8600184614631565b815481106123c657634e487b7160e01b600052603260045260246000fd5b906000526020600020015492505050610e8c565b6123e5600183614631565b9150806123f181614648565b915050612339565b506000949350505050565b6000610fbc60335490565b60008080858582806124208b61149b565b90508a600080808b8514612434578b61243f565b61243f60018d614631565b9050841561250557805b858110156125035760008061246083898c8a61373d565b90965086925090506000612479886104ef8660016145da565b60008d8152603f60209081526040808320600701548c84529181905282205492985088935090916124aa9084614612565b60008b8152604060208190529020600101546124c7908790614612565b6124d191906145f2565b6124db9190614612565b90506124e7818c6145da565b9a50829b505050505080806124fb90614648565b915050612449565b505b50939d949c50919a509298505050505050505050565b600082815260436020908152604080832086845290915281205481908390829087905b6000828152604060208190529020600301548110156126415760006125648260016145da565b60008481526040602081905290205461257d9190614612565b60008481526040602081905290206004015461259991906145da565b905060006125a78683614631565b905060006125ba856104ef8660016145da565b60008c8152603f60209081526040808320600701548984529181905282205492935090916125e89084614612565b600088815260406020819052902060010154612605908690614612565b61260f91906145f2565b6126199190614612565b905061262581886145da565b965083975050505050808061263990614648565b91505061253e565b50909791965090945050505050565b604051600090339083908381818185875af1925050503d8060008114612692576040519150601f19603f3d011682016040523d82523d6000602084013e612697565b606091505b5050905080611a345760405162461bcd60e51b815260206004820152600d60248201526c1c99599d5b990819985a5b1959609a1b6044820152606401610964565b6000805b603a548110156127785742604060006126f68460016145da565b815260200190815260200160002060050154118015612734575042604060006127208460016145da565b815260200190815260200160002060040154105b1561274a576127448160016145da565b91505090565b603a546127588260016145da565b1415612766575050603a5490565b8061277081614648565b9150506126dc565b5090565b8451600114156128175761281286600001516000815181106127ae57634e487b7160e01b600052603260045260246000fd5b602002602001015187600001516001815181106127db57634e487b7160e01b600052603260045260246000fd5b60200260200101518660008151811061280457634e487b7160e01b600052603260045260246000fd5b6020026020010151866137ce565b610d3c565b8451600214156128d55761284986600001516000815181106127ae57634e487b7160e01b600052603260045260246000fd5b612812866020015160008151811061287157634e487b7160e01b600052603260045260246000fd5b6020026020010151876020015160018151811061289e57634e487b7160e01b600052603260045260246000fd5b6020026020010151866001815181106128c757634e487b7160e01b600052603260045260246000fd5b6020026020010151856137ce565b845160031415610d3c5761290786600001516000815181106127ae57634e487b7160e01b600052603260045260246000fd5b61292f866020015160008151811061287157634e487b7160e01b600052603260045260246000fd5b610d3c866040015160008151811061295757634e487b7160e01b600052603260045260246000fd5b6020026020010151876040015160018151811061298457634e487b7160e01b600052603260045260246000fd5b6020026020010151866002815181106129ad57634e487b7160e01b600052603260045260246000fd5b6020026020010151846137ce565b60006129c684612256565b6129cf84612256565b6040516020016129e0929190614354565b604051602081830303815290604052805190602001209050612a0582603c548361230e565b612a515760405162461bcd60e51b815260206004820152601460248201527f496e636f7272656374206c6f72642070726f6f660000000000000000000000006044820152606401610964565b50505050565b805160011415612bb25780600081518110612a8257634e487b7160e01b600052603260045260246000fd5b6020908102919091010151603554835180516001600160a01b0390921691633112de9a9190600090612ac457634e487b7160e01b600052603260045260246000fd5b60200260200101518560000151600181518110612af157634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612b1f929190918252602082015260400190565b60206040518083038186803b158015612b3757600080fd5b505afa158015612b4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b6f91906141d6565b14611a345760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b805160021415612dac5780600081518110612bdd57634e487b7160e01b600052603260045260246000fd5b6020908102919091010151603554835180516001600160a01b0390921691633112de9a9190600090612c1f57634e487b7160e01b600052603260045260246000fd5b60200260200101518560000151600181518110612c4c57634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612c7a929190918252602082015260400190565b60206040518083038186803b158015612c9257600080fd5b505afa158015612ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cca91906141d6565b14612d0d5760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b80600181518110612d2e57634e487b7160e01b600052603260045260246000fd5b6020026020010151603560009054906101000a90046001600160a01b03166001600160a01b0316633112de9a8460200151600081518110612d7f57634e487b7160e01b600052603260045260246000fd5b60200260200101518560200151600181518110612af157634e487b7160e01b600052603260045260246000fd5b805160031415611a345780600081518110612dd757634e487b7160e01b600052603260045260246000fd5b6020908102919091010151603554835180516001600160a01b0390921691633112de9a9190600090612e1957634e487b7160e01b600052603260045260246000fd5b60200260200101518560000151600181518110612e4657634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612e74929190918252602082015260400190565b60206040518083038186803b158015612e8c57600080fd5b505afa158015612ea0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ec491906141d6565b14612f075760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b80600181518110612f2857634e487b7160e01b600052603260045260246000fd5b6020026020010151603560009054906101000a90046001600160a01b03166001600160a01b0316633112de9a8460200151600081518110612f7957634e487b7160e01b600052603260045260246000fd5b60200260200101518560200151600181518110612fa657634e487b7160e01b600052603260045260246000fd5b60200260200101516040518363ffffffff1660e01b8152600401612fd4929190918252602082015260400190565b60206040518083038186803b158015612fec57600080fd5b505afa158015613000573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061302491906141d6565b146130675760405162461bcd60e51b81526020600482015260136024820152721b9bdd0818dbdc9c9958dd081d1bdad95b9259606a1b6044820152606401610964565b8060028151811061308857634e487b7160e01b600052603260045260246000fd5b6020026020010151603560009054906101000a90046001600160a01b03166001600160a01b0316633112de9a84604001516000815181106130d957634e487b7160e01b600052603260045260246000fd5b60200260200101518560400151600181518110612af157634e487b7160e01b600052603260045260246000fd5b8051516040820151516060830151821580159061312257508115155b801561312d57508015155b6131795760405162461bcd60e51b815260206004820152600860248201527f6e6f74206e756c6c0000000000000000000000000000000000000000000000006044820152606401610964565b8360400151846060015161318d8282613875565b6131d95760405162461bcd60e51b815260206004820152601060248201527f6e6f742076616c6964206361746f7279000000000000000000000000000000006044820152606401610964565b60355460405163e985e9c560e01b81523360048201523060248201526001600160a01b039091169063e985e9c59060440160206040518083038186803b15801561322257600080fd5b505afa158015613236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061325a91906140b4565b80156132e2575060365460405163e985e9c560e01b81523360048201523060248201526001600160a01b039091169063e985e9c59060440160206040518083038186803b1580156132aa57600080fd5b505afa1580156132be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132e291906140b4565b61332e5760405162461bcd60e51b815260206004820152601c60248201527f4e6674206e6f7420617070726f76656420746f20636f6e7472616374000000006044820152606401610964565b8551516060870151816038613344600184614631565b8154811061336257634e487b7160e01b600052603260045260246000fd5b906000526020600020015410156133bb5760405162461bcd60e51b815260206004820152600f60248201527f6c656e677468206d69736d6174636800000000000000000000000000000000006044820152606401610964565b60006133c5611b50565b9050600081116134175760405162461bcd60e51b815260206004820152601460248201527f6465706f73697465206e6f7420616c6c6f7765640000000000000000000000006044820152606401610964565b61343489600001518a602001518b604001518c60600151856138e5565b505050505050505050565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd906064015b600060405180830381600087803b1580156134ab57600080fd5b505af11580156134bf573d6000803e3d6000fd5b5050505050505050565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401613491565b336000908152604160205260408120805461353c90600190614631565b8154811061355a57634e487b7160e01b600052603260045260246000fd5b600091825260208083209091015484835260428083526040808520548386528186208190553386526041855290852094879052925282549093508392919081106135b457634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101929092553381526041909152604090208054806135ee57634e487b7160e01b600052603160045260246000fd5b600190038181906000526020600020016000905590555050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310613651577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061367d576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061369b57662386f26fc10000830492506010015b6305f5e10083106136b3576305f5e100830492506008015b61271083106136c757612710830492506004015b606483106136d9576064830492506002015b600a8310610e8c5760010192915050565b600081815b8451811015612306576137298286838151811061371c57634e487b7160e01b600052603260045260246000fd5b6020026020010151613bd1565b91508061373581614648565b9150506136ef565b6000808061374c8760016145da565b6000858152604060208190529020546137659190614612565b60008581526040602081905290206004015461378191906145da565b905061378e8760016145da565b8614801561379b57508042105b156137b4576137aa8542614631565b92504291506137c4565b6137be8582614631565b92508091505b5094509492505050565b60006137d985612256565b6137e285612256565b6137eb85612256565b6040516020016137fd9392919061437d565b60405160208183030381529060405280519060200120905061382282603b548361230e565b61386e5760405162461bcd60e51b815260206004820152601460248201527f496e636f7272656374206c616e642070726f6f660000000000000000000000006044820152606401610964565b5050505050565b6000805b83518110156138db5760048482815181106138a457634e487b7160e01b600052603260045260246000fd5b60200260200101511015806138ba575060048310155b156138c9576000915050610e8c565b806138d381614648565b915050613879565b5060019392505050565b6138f3603380546001019055565b6000805b845181101561397e576037600186838151811061392457634e487b7160e01b600052603260045260246000fd5b60200260200101516139369190614631565b8154811061395457634e487b7160e01b600052603260045260246000fd5b90600052602060002001548261396a91906145da565b91508061397681614648565b9150506138f7565b50604051806101200160405280336001600160a01b0316815260200187815260200186815260200185815260200184815260200142815260200183815260200182815260200160011515815250603f60006139d860335490565b8152602080820192909252604001600020825181546001600160a01b0319166001600160a01b039091161781558282015180519192613a1f92600185019290910190613c87565b506040820151600282015560608201518051613a45916003840191602090910190613c87565b506080820151600482015560a0820151600582015560c0820151600682015560e08201516007820155610100909101516008909101805460ff191691151591909117905560398054829190600090613a9e9084906145da565b90915550503360009081526041602052604081205490604290613ac060335490565b8152602080820192909252604090810160009081209390935533835260418252822060338054825460018101845592855292909320015554613b059083603954613c03565b60005b8651811015613b67576035548751613b55916001600160a01b031690339030908b9086908110613b4857634e487b7160e01b600052603260045260246000fd5b602002602001015161343f565b80613b5f81614648565b915050613b08565b50603654613b80906001600160a01b03163330886134c9565b7f20710c8acac7f8475d8dfcdeb77e60a4457e5ec543f177deda3d7e1f05da638f33613bab60335490565b88888888604051613bc1969594939291906143b0565b60405180910390a1505050505050565b6000818310613bed576000828152602084905260409020613bfc565b60008381526020839052604090205b9392505050565b6000613c0e8361149b565b60008481526040602081905290209091508290600201613c2f600184614631565b81548110613c4d57634e487b7160e01b600052603260045260246000fd5b600091825260209091200155613c64600182614631565b600094855260436020908152604080872095875294905292909320919091555050565b828054828255906000526020600020908101928215613cc2579160200282015b82811115613cc2578251825591602001919060010190613ca7565b506127789291505b808211156127785760008155600101613cca565b80356001600160a01b0381168114613cf557600080fd5b919050565b600082601f830112613d0a578081fd5b81356020613d1f613d1a836145b6565b614585565b80838252828201915082860187848660051b8901011115613d3e578586fd5b855b85811015613d5c57813584529284019290840190600101613d40565b5090979650505050505050565b60008083601f840112613d7a578182fd5b50813567ffffffffffffffff811115613d91578182fd5b6020830191508360208260051b8501011115613dac57600080fd5b9250929050565b600060808284031215613dc4578081fd5b6040516080810167ffffffffffffffff8282108183111715613de857613de8614679565b816040528293508435915080821115613e0057600080fd5b613e0c86838701613cfa565b8352602085013560208401526040850135915080821115613e2c57600080fd5b50613e3985828601613cfa565b604083015250606083013560608201525092915050565b600060608284031215613e61578081fd5b6040516060810167ffffffffffffffff8282108183111715613e8557613e85614679565b816040528293508435915080821115613e9d57600080fd5b613ea986838701613cfa565b83526020850135915080821115613ebf57600080fd5b613ecb86838701613cfa565b60208401526040850135915080821115613ee457600080fd5b50613ef185828601613cfa565b6040830152505092915050565b600060208284031215613f0f578081fd5b613bfc82613cde565b600080600080600080600080600060e08a8c031215613f35578485fd5b613f3e8a613cde565b9850613f4c60208b01613cde565b9750613f5a60408b01613cde565b965060608a0135955060808a0135945060a08a013567ffffffffffffffff80821115613f84578586fd5b613f908d838e01613d69565b909650945060c08c0135915080821115613fa8578384fd5b50613fb58c828d01613d69565b915080935050809150509295985092959850929598565b600080600080600060808688031215613fe3578081fd5b613fec86613cde565b9450613ffa60208701613cde565b935060408601359250606086013567ffffffffffffffff8082111561401d578283fd5b818801915088601f830112614030578283fd5b81358181111561403e578384fd5b89602082850101111561404f578384fd5b9699959850939650602001949392505050565b60008060408385031215614074578182fd5b61407d83613cde565b9150602083013561408d8161468f565b809150509250929050565b6000602082840312156140a9578081fd5b8135613bfc8161468f565b6000602082840312156140c5578081fd5b8151613bfc8161468f565b6000602082840312156140e1578081fd5b5035919050565b60008060008060008060c08789031215614100578182fd5b863567ffffffffffffffff80821115614117578384fd5b6141238a838b01613db3565b97506020890135915080821115614138578384fd5b6141448a838b01613e50565b96506040890135915080821115614159578384fd5b6141658a838b01613cfa565b9550606089013591508082111561417a578384fd5b6141868a838b01613cfa565b9450608089013591508082111561419b578384fd5b6141a78a838b01613cfa565b935060a08901359150808211156141bc578283fd5b506141c989828a01613cfa565b9150509295509295509295565b6000602082840312156141e7578081fd5b5051919050565b600080600060608486031215614202578081fd5b83359250602084013567ffffffffffffffff81111561421f578182fd5b61422b86828701613cfa565b925050604084013590509250925092565b6000806040838503121561424e578182fd5b50508035926020909101359150565b600080600080600060808688031215614274578283fd5b8535945060208601359350604086013567ffffffffffffffff811115614298578384fd5b6142a488828901613d69565b96999598509660600135949350505050565b6000806000606084860312156142ca578081fd5b505081359360208301359350604090920135919050565b6000815180845260208085019450808401835b83811015614310578151875295820195908201906001016142f4565b509495945050505050565b60008151815b8181101561433b5760208185018101518683015201614321565b818111156143495782828601525b509290920192915050565b6000614360828561431b565b600b60fa1b8152614374600182018561431b565b95945050505050565b6000614389828661431b565b600b60fa1b80825261439e600183018761431b565b908152905061155d600182018561431b565b6001600160a01b038716815285602082015260c0604082015260006143d860c08301876142e1565b85606084015282810360808401526143f081866142e1565b9150508260a0830152979650505050505050565b6000608082016001600160a01b0387168352602086818501526080604085015281865480845260a0860191508785528285209350845b818110156144565784548352600194850194928401920161443a565b505080935050505082606083015295945050505050565b602081526000613bfc60208301846142e1565b6020815261449a6020820183516001600160a01b03169052565b600060208301516101208060408501526144b86101408501836142e1565b9150604085015160608501526060850151601f198584030160808601526144df83826142e1565b925050608085015160a085015260a085015160c085015260c085015160e085015260e08501516101008181870152808701519150506145218286018215159052565b5090949350505050565b6020815281516020820152602082015160408201526000604083015160c0606084015261455b60e08401826142e1565b905060608401516080840152608084015160a084015260a084015160c08401528091505092915050565b604051601f8201601f1916810167ffffffffffffffff811182821017156145ae576145ae614679565b604052919050565b600067ffffffffffffffff8211156145d0576145d0614679565b5060051b60200190565b600082198211156145ed576145ed614663565b500190565b60008261460d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561462c5761462c614663565b500290565b60008282101561464357614643614663565b500390565b600060001982141561465c5761465c614663565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146109bb57600080fdfea2646970667358221220242a07526af4e25b40df5150991a6af72abb09698e1ab99fde88565015207a9a64736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.