ERC-20
Overview
Max Total Supply
8,857 veNFTW
Holders
3,346
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
9 veNFTWValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
NFTWEscrow
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "./TransferHelper.sol"; import "./INFTWEscrow.sol"; import "./INFTWRental.sol"; import "./INFTWRouter.sol"; import "./INFTW_ERC721.sol"; contract NFTWEscrow is Context, ERC165, INFTWEscrow, ERC20Permit, ERC20Votes, Ownable, ReentrancyGuard { using SafeCast for uint; using ECDSA for bytes32; address immutable WRLD_ERC20_ADDR; INFTW_ERC721 immutable NFTW_ERC721; INFTWRental private NFTWRental; INFTWRouter private NFTWRouter; WorldInfo[10001] private worldInfo; // NFTW tokenId is in N [1,10000] RewardsPeriod public rewardsPeriod; RewardsPerWeight public rewardsPerWeight; mapping (address => UserRewards) public rewards; mapping (address => bool) private isPredicate; // Polygon bridge predicate mapping (address => uint) public userBridged; uint private bridged; address private signer; // ======== Admin functions ======== constructor(address wrld, address nftw) ERC20("Vote-escrowed NFTWorld", "veNFTW") ERC20Permit("Vote-escrowed NFTWorld") { require(wrld != address(0), "E0"); // E0: addr err require(nftw != address(0), "E0"); WRLD_ERC20_ADDR = wrld; NFTW_ERC721 = INFTW_ERC721(nftw); } // Set a rewards schedule // rate is in wei per second for all users // This must be called AFTER some worlds are staked (or ensure at least 1 world is staked before the start timestamp) function setRewards(uint32 start, uint32 end, uint96 rate) external virtual onlyOwner { require(start <= end, "E1"); // E1: Incorrect input // some safeguard, value TBD. (2b over 5 years is 12.68 per sec) require(rate > 0.03 ether && rate < 30 ether, "E2"); // E2: Rate incorrect require(WRLD_ERC20_ADDR != address(0), "E3"); // E3: Rewards token not set require(block.timestamp.toUint32() < rewardsPeriod.start || block.timestamp.toUint32() > rewardsPeriod.end, "E4"); // E4: Rewards already set rewardsPeriod.start = start; rewardsPeriod.end = end; rewardsPerWeight.lastUpdated = start; rewardsPerWeight.rate = rate; emit RewardsSet(start, end, rate); } function setWeight(uint[] calldata tokenIds, uint[] calldata weights) external onlyOwner { require(tokenIds.length == weights.length, "E6"); for (uint i = 0; i < tokenIds.length; i++) { uint tokenId = tokenIds[i]; require(worldInfo[tokenId].weight == 0, "E8"); worldInfo[tokenId].weight = weights[i].toUint16(); } } // signing key does not require high security and can be put on an API server and rotated periodically, as signatures are issued dynamically function setSigner(address _signer) external onlyOwner { signer = _signer; } function setRentalContract(INFTWRental _contract) external onlyOwner { require(_contract.supportsInterface(type(INFTWRental).interfaceId),"E0"); NFTWRental = _contract; } function setRouterContract(INFTWRouter _contract) external onlyOwner { NFTWRouter = _contract; } function setPredicate(address _contract, bool _allow) external onlyOwner { require(_contract != address(0), "E0"); // E0: addr err isPredicate[_contract] = _allow; } // ======== Public functions ======== // Stake worlds for a first time. You may optionally stake to a different wallet. Ownership will be transferred to the stakeTo address. // Initial weights passed as input parameters, which are secured by a dev signature. weight = 40003 - 3 * rank // When you stake you can set rental conditions for all of them. // Initialized and uninitialized stake can be mixed into one tx using this method. // If you set rentalPerDay to 0 and rentableUntil to some time in the future, then anyone can rent for free // until the rentableUntil timestamp with no way of backing out function initialStake(uint[] calldata tokenIds, uint[] calldata weights, address stakeTo, uint16 _deposit, uint16 _rentalPerDay, uint16 _minRentDays, uint32 _rentableUntil, uint32 _maxTimestamp, bytes calldata _signature) external virtual override nonReentrant { require(uint(_deposit) <= uint(_rentalPerDay) * (uint(_minRentDays) + 1), "ER"); // ER: Rental rate incorrect // security measure against input length attack require(tokenIds.length == weights.length, "E6"); // E6: Input length mismatch require(block.timestamp <= _maxTimestamp, "EX"); // EX: Signature expired // verifying signature here is much cheaper than verifying merkle root require(_verifySignerSignature(keccak256( abi.encode(tokenIds, weights, _msgSender(), _maxTimestamp, address(this))), _signature), "E7"); // E7: Invalid signature // ensure stakeTo is EOA or ERC721Receiver to avoid token lockup _ensureEOAorERC721Receiver(stakeTo); require(stakeTo != address(this), "ES"); // ES: Stake to escrow uint totalWeights = 0; for (uint i = 0; i < tokenIds.length; i++) { { // scope to avoid stack too deep errors uint tokenId = tokenIds[i]; uint _weight = worldInfo[tokenId].weight; require(_weight == 0 || _weight == weights[i], "E8"); // E8: Initialized weight cannot be changed require(NFTW_ERC721.ownerOf(tokenId) == _msgSender(), "E9"); // E9: Not your world NFTW_ERC721.safeTransferFrom(_msgSender(), address(this), tokenId); emit WorldStaked(tokenId, stakeTo); } worldInfo[tokenIds[i]] = WorldInfo(weights[i].toUint16(), stakeTo, _deposit, _rentalPerDay, _minRentDays, _rentableUntil); totalWeights += weights[i]; } // update rewards _updateRewardsPerWeight(totalWeights.toUint32(), true); _updateUserRewards(stakeTo, totalWeights.toUint32(), true); // mint veNFTW _mint(stakeTo, tokenIds.length * 1e18); } // subsequent staking does not require dev signature function stake(uint[] calldata tokenIds, address stakeTo, uint16 _deposit, uint16 _rentalPerDay, uint16 _minRentDays, uint32 _rentableUntil) external virtual override nonReentrant { require(uint(_deposit) <= uint(_rentalPerDay) * (uint(_minRentDays) + 1), "ER"); // ER: Rental rate incorrect // ensure stakeTo is EOA or ERC721Receiver to avoid token lockup _ensureEOAorERC721Receiver(stakeTo); require(stakeTo != address(this), "ES"); // ES: Stake to escrow uint totalWeights = 0; for (uint i = 0; i < tokenIds.length; i++) { uint tokenId = tokenIds[i]; uint16 _weight = worldInfo[tokenId].weight; require(_weight != 0, "EA"); // EA: Weight not initialized require(NFTW_ERC721.ownerOf(tokenId) == _msgSender(), "E9"); // E9: Not your world NFTW_ERC721.safeTransferFrom(_msgSender(), address(this), tokenId); totalWeights += _weight; worldInfo[tokenId] = WorldInfo(_weight, stakeTo, _deposit, _rentalPerDay, _minRentDays, _rentableUntil); emit WorldStaked(tokenId, stakeTo); } // update rewards _updateRewardsPerWeight(totalWeights.toUint32(), true); _updateUserRewards(stakeTo, totalWeights.toUint32(), true); // mint veNFTW _mint(stakeTo, tokenIds.length * 1e18); } // Update rental conditions as long as therer's no ongoing rent. // setting rentableUntil to 0 makes the world unrentable. function updateRent(uint[] calldata tokenIds, uint16 _deposit, uint16 _rentalPerDay, uint16 _minRentDays, uint32 _rentableUntil) external virtual override { require(uint(_deposit) <= uint(_rentalPerDay) * (uint(_minRentDays) + 1), "ER"); // ER: Rental rate incorrect for (uint i = 0; i < tokenIds.length; i++) { uint tokenId = tokenIds[i]; WorldInfo storage worldInfo_ = worldInfo[tokenId]; require(worldInfo_.weight != 0, "EA"); // EA: Weight not initialized require(NFTW_ERC721.ownerOf(tokenId) == address(this) && worldInfo_.owner == _msgSender(), "E9"); // E9: Not your world require(!NFTWRental.isRentActive(tokenId), "EB"); // EB: Ongoing rent worldInfo_.deposit = _deposit; worldInfo_.rentalPerDay = _rentalPerDay; worldInfo_.minRentDays = _minRentDays; worldInfo_.rentableUntil = _rentableUntil; } } // Extend rental period of ongoing rent function extendRentalPeriod(uint tokenId, uint32 _rentableUntil) external virtual override { WorldInfo storage worldInfo_ = worldInfo[tokenId]; require(worldInfo_.weight != 0, "EA"); // EA: Weight not initialized require(NFTW_ERC721.ownerOf(tokenId) == address(this) && worldInfo_.owner == _msgSender(), "E9"); // E9: Not your world worldInfo_.rentableUntil = _rentableUntil; } function unstake(uint[] calldata tokenIds, address unstakeTo) external virtual override nonReentrant { // ensure unstakeTo is EOA or ERC721Receiver to avoid token lockup _ensureEOAorERC721Receiver(unstakeTo); require(unstakeTo != address(this), "ES"); // ES: Unstake to escrow require(balanceOf(_msgSender()) - userBridged[_msgSender()] >= tokenIds.length * 1e18, "EP"); // EP: veNFTW bridged to polygon uint totalWeights = 0; for (uint i = 0; i < tokenIds.length; i++) { uint tokenId = tokenIds[i]; require(worldInfo[tokenId].owner == _msgSender(), "E9"); // E9: Not your world require(!NFTWRental.isRentActive(tokenId), "EB"); // EB: Ongoing rent NFTW_ERC721.safeTransferFrom(address(this), unstakeTo, tokenId); uint16 _weight = worldInfo[tokenId].weight; totalWeights += _weight; worldInfo[tokenId] = WorldInfo(_weight,address(0),0,0,0,0); emit WorldUnstaked(tokenId, _msgSender()); // World `id` unstaked from `address` } // update rewards _updateRewardsPerWeight(totalWeights.toUint32(), false); _updateUserRewards(_msgSender(), totalWeights.toUint32(), false); // burn veNFTW _burn(_msgSender(), tokenIds.length * 1e18); } function setRoutingDataIPFSHash(uint tokenId, string calldata _ipfsHash) external { require((worldInfo[tokenId].owner == _msgSender() && !NFTWRental.isRentActive(tokenId)) || (worldInfo[tokenId].owner != address(0) && NFTWRental.getTenant(tokenId) == _msgSender()), "EH"); // EH: Not your world or not rented NFTWRouter.setRoutingDataIPFSHash(tokenId, _ipfsHash); } function removeRoutingDataIPFSHash(uint tokenId) external { require((worldInfo[tokenId].owner == _msgSender() && !NFTWRental.isRentActive(tokenId)) || (worldInfo[tokenId].owner != address(0) && NFTWRental.getTenant(tokenId) == _msgSender()), "EH"); // EH: Not your world or not rented NFTWRouter.removeRoutingDataIPFSHash(tokenId); } function updateMetadata(uint tokenId, string calldata _tokenMetadataIPFSHash) external virtual { require((worldInfo[tokenId].owner == _msgSender() && !NFTWRental.isRentActive(tokenId)) || (worldInfo[tokenId].owner != address(0) && NFTWRental.getTenant(tokenId) == _msgSender()), "EH"); // EH: Not your world or not rented NFTW_ERC721.updateMetadataIPFSHash(tokenId, _tokenMetadataIPFSHash); } // Claim all rewards from caller into a given address function claim(address to) external virtual override nonReentrant { _updateRewardsPerWeight(0, false); uint rewardAmount = _updateUserRewards(_msgSender(), 0, false); rewards[_msgSender()].accumulated = 0; TransferHelper.safeTransfer(WRLD_ERC20_ADDR, to, rewardAmount); emit RewardClaimed(to, rewardAmount); } // ======== View only functions ======== function getWorldInfo(uint tokenId) external view override returns(WorldInfo memory) { return worldInfo[tokenId]; } function checkUserRewards(address user) external virtual view override returns(uint) { RewardsPerWeight memory rewardsPerWeight_ = rewardsPerWeight; UserRewards memory userRewards_ = rewards[user]; // Find out the unaccounted time uint32 end = min(block.timestamp.toUint32(), rewardsPeriod.end); uint256 unaccountedTime = end - rewardsPerWeight_.lastUpdated; // Cast to uint256 to avoid overflows later on if (unaccountedTime != 0) { // Calculate and update the new value of the accumulator. unaccountedTime casts it into uint256, which is desired. // If the first mint happens mid-program, we don't update the accumulator, no one gets the rewards for that period. if (rewardsPerWeight_.totalWeight != 0) { rewardsPerWeight_.accumulated = (rewardsPerWeight_.accumulated + unaccountedTime * rewardsPerWeight_.rate / rewardsPerWeight_.totalWeight).toUint96(); } } // Calculate and update the new value user reserves. userRewards_.stakedWeight casts it into uint256, which is desired. return userRewards_.accumulated + userRewards_.stakedWeight * (rewardsPerWeight_.accumulated - userRewards_.checkpoint); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(INFTWEscrow).interfaceId || super.supportsInterface(interfaceId); } // ======== internal functions ======== function _verifySignerSignature(bytes32 hash, bytes calldata signature) internal view returns(bool) { return hash.toEthSignedMessageHash().recover(signature) == signer; } function min(uint32 x, uint32 y) internal pure returns (uint32 z) { z = (x < y) ? x : y; } // Updates the rewards per weight accumulator. // Needs to be called on each staking/unstaking event. function _updateRewardsPerWeight(uint32 weight, bool increase) internal virtual { RewardsPerWeight memory rewardsPerWeight_ = rewardsPerWeight; RewardsPeriod memory rewardsPeriod_ = rewardsPeriod; // We skip the update if the program hasn't started if (block.timestamp.toUint32() >= rewardsPeriod_.start) { // Find out the unaccounted time uint32 end = min(block.timestamp.toUint32(), rewardsPeriod_.end); uint256 unaccountedTime = end - rewardsPerWeight_.lastUpdated; // Cast to uint256 to avoid overflows later on if (unaccountedTime != 0) { // Calculate and update the new value of the accumulator. // If the first mint happens mid-program, we don't update the accumulator, no one gets the rewards for that period. if (rewardsPerWeight_.totalWeight != 0) { rewardsPerWeight_.accumulated = (rewardsPerWeight_.accumulated + unaccountedTime * rewardsPerWeight_.rate / rewardsPerWeight_.totalWeight).toUint96(); } rewardsPerWeight_.lastUpdated = end; } } if (increase) { rewardsPerWeight_.totalWeight += weight; } else { rewardsPerWeight_.totalWeight -= weight; } rewardsPerWeight = rewardsPerWeight_; emit RewardsPerWeightUpdated(rewardsPerWeight_.accumulated); } // Accumulate rewards for an user. // Needs to be called on each staking/unstaking event. function _updateUserRewards(address user, uint32 weight, bool increase) internal virtual returns (uint96) { UserRewards memory userRewards_ = rewards[user]; RewardsPerWeight memory rewardsPerWeight_ = rewardsPerWeight; // Calculate and update the new value user reserves. userRewards_.accumulated = userRewards_.accumulated + userRewards_.stakedWeight * (rewardsPerWeight_.accumulated - userRewards_.checkpoint); userRewards_.checkpoint = rewardsPerWeight_.accumulated; if (weight != 0) { if (increase) { userRewards_.stakedWeight += weight; } else { userRewards_.stakedWeight -= weight; } emit WeightUpdated(user, increase, weight, block.timestamp); } rewards[user] = userRewards_; emit UserRewardsUpdated(user, userRewards_.accumulated, userRewards_.checkpoint); return userRewards_.accumulated; } function _ensureEOAorERC721Receiver(address to) internal virtual { uint32 size; assembly { size := extcodesize(to) } if (size > 0) { try IERC721Receiver(to).onERC721Received(address(this), address(this), 0, "") returns (bytes4 retval) { require(retval == IERC721Receiver.onERC721Received.selector, "ET"); // ET: neither EOA nor ERC721Receiver } catch (bytes memory) { revert("ET"); // ET: neither EOA nor ERC721Receiver } } } // ======== function overrides ======== function _beforeTokenTransfer(address from, address to, uint256 amount) internal override { require(from == address(0) || to == address(0) || isPredicate[from] || isPredicate[to], "ERC20: Non-transferrable"); // bridge back from polygon if (isPredicate[from]) { bridged -= amount; userBridged[to] -= amount; super._burn(to, amount); } // bridge to polygon if (isPredicate[to]) { bridged += amount; userBridged[from] += amount; super._mint(from, amount); } super._beforeTokenTransfer(from, to, amount); } function totalSupply() public view override(ERC20, IERC20) returns (uint256 supply) { supply = super.totalSupply() - bridged; } // Prevent sending ERC721 tokens directly to this contract function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external view override returns (bytes4) { from; tokenId; data; // supress solidity warnings if (operator == address(this)) { return this.onERC721Received.selector; } else { return 0x00000000; } } // The following functions are overrides required by Solidity. function _afterTokenTransfer(address from, address to, uint256 amount) internal override(ERC20, ERC20Votes) { super._afterTokenTransfer(from, to, amount); } function _mint(address to, uint256 amount) internal override(ERC20, ERC20Votes) { super._mint(to, amount); } function _burn(address account, uint256 amount) internal override(ERC20, ERC20Votes) { super._burn(account, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-ERC20Permit.sol) pragma solidity ^0.8.0; import "./draft-IERC20Permit.sol"; import "../ERC20.sol"; import "../../../utils/cryptography/draft-EIP712.sol"; import "../../../utils/cryptography/ECDSA.sol"; import "../../../utils/Counters.sol"; /** * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ */ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC20 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @dev See {IERC20Permit-permit}. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); _approve(owner, spender, value); } /** * @dev See {IERC20Permit-nonces}. */ function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Votes.sol) pragma solidity ^0.8.0; import "./draft-ERC20Permit.sol"; import "../../../utils/math/Math.sol"; import "../../../governance/utils/IVotes.sol"; import "../../../utils/math/SafeCast.sol"; import "../../../utils/cryptography/ECDSA.sol"; /** * @dev Extension of ERC20 to support Compound-like voting and delegation. This version is more generic than Compound's, * and supports token supply up to 2^224^ - 1, while COMP is limited to 2^96^ - 1. * * NOTE: If exact COMP compatibility is required, use the {ERC20VotesComp} variant of this module. * * This extension keeps a history (checkpoints) of each account's vote power. Vote power can be delegated either * by calling the {delegate} function directly, or by providing a signature to be used with {delegateBySig}. Voting * power can be queried through the public accessors {getVotes} and {getPastVotes}. * * By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it * requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked. * * _Available since v4.2._ */ abstract contract ERC20Votes is IVotes, ERC20Permit { struct Checkpoint { uint32 fromBlock; uint224 votes; } bytes32 private constant _DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); mapping(address => address) private _delegates; mapping(address => Checkpoint[]) private _checkpoints; Checkpoint[] private _totalSupplyCheckpoints; /** * @dev Get the `pos`-th checkpoint for `account`. */ function checkpoints(address account, uint32 pos) public view virtual returns (Checkpoint memory) { return _checkpoints[account][pos]; } /** * @dev Get number of checkpoints for `account`. */ function numCheckpoints(address account) public view virtual returns (uint32) { return SafeCast.toUint32(_checkpoints[account].length); } /** * @dev Get the address `account` is currently delegating to. */ function delegates(address account) public view virtual override returns (address) { return _delegates[account]; } /** * @dev Gets the current votes balance for `account` */ function getVotes(address account) public view virtual override returns (uint256) { uint256 pos = _checkpoints[account].length; return pos == 0 ? 0 : _checkpoints[account][pos - 1].votes; } /** * @dev Retrieve the number of votes for `account` at the end of `blockNumber`. * * Requirements: * * - `blockNumber` must have been already mined */ function getPastVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_checkpoints[account], blockNumber); } /** * @dev Retrieve the `totalSupply` at the end of `blockNumber`. Note, this value is the sum of all balances. * It is but NOT the sum of all the delegated votes! * * Requirements: * * - `blockNumber` must have been already mined */ function getPastTotalSupply(uint256 blockNumber) public view virtual override returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_totalSupplyCheckpoints, blockNumber); } /** * @dev Lookup a value in a list of (sorted) checkpoints. */ function _checkpointsLookup(Checkpoint[] storage ckpts, uint256 blockNumber) private view returns (uint256) { // We run a binary search to look for the earliest checkpoint taken after `blockNumber`. // // During the loop, the index of the wanted checkpoint remains in the range [low-1, high). // With each iteration, either `low` or `high` is moved towards the middle of the range to maintain the invariant. // - If the middle checkpoint is after `blockNumber`, we look in [low, mid) // - If the middle checkpoint is before or equal to `blockNumber`, we look in [mid+1, high) // Once we reach a single value (when low == high), we've found the right checkpoint at the index high-1, if not // out of bounds (in which case we're looking too far in the past and the result is 0). // Note that if the latest checkpoint available is exactly for `blockNumber`, we end up with an index that is // past the end of the array, so we technically don't find a checkpoint after `blockNumber`, but it works out // the same. uint256 high = ckpts.length; uint256 low = 0; while (low < high) { uint256 mid = Math.average(low, high); if (ckpts[mid].fromBlock > blockNumber) { high = mid; } else { low = mid + 1; } } return high == 0 ? 0 : ckpts[high - 1].votes; } /** * @dev Delegate votes from the sender to `delegatee`. */ function delegate(address delegatee) public virtual override { _delegate(_msgSender(), delegatee); } /** * @dev Delegates votes from signer to `delegatee` */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= expiry, "ERC20Votes: signature expired"); address signer = ECDSA.recover( _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))), v, r, s ); require(nonce == _useNonce(signer), "ERC20Votes: invalid nonce"); _delegate(signer, delegatee); } /** * @dev Maximum token supply. Defaults to `type(uint224).max` (2^224^ - 1). */ function _maxSupply() internal view virtual returns (uint224) { return type(uint224).max; } /** * @dev Snapshots the totalSupply after it has been increased. */ function _mint(address account, uint256 amount) internal virtual override { super._mint(account, amount); require(totalSupply() <= _maxSupply(), "ERC20Votes: total supply risks overflowing votes"); _writeCheckpoint(_totalSupplyCheckpoints, _add, amount); } /** * @dev Snapshots the totalSupply after it has been decreased. */ function _burn(address account, uint256 amount) internal virtual override { super._burn(account, amount); _writeCheckpoint(_totalSupplyCheckpoints, _subtract, amount); } /** * @dev Move voting power when tokens are transferred. * * Emits a {DelegateVotesChanged} event. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual override { super._afterTokenTransfer(from, to, amount); _moveVotingPower(delegates(from), delegates(to), amount); } /** * @dev Change delegation for `delegator` to `delegatee`. * * Emits events {DelegateChanged} and {DelegateVotesChanged}. */ function _delegate(address delegator, address delegatee) internal virtual { address currentDelegate = delegates(delegator); uint256 delegatorBalance = balanceOf(delegator); _delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveVotingPower(currentDelegate, delegatee, delegatorBalance); } function _moveVotingPower( address src, address dst, uint256 amount ) private { if (src != dst && amount > 0) { if (src != address(0)) { (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[src], _subtract, amount); emit DelegateVotesChanged(src, oldWeight, newWeight); } if (dst != address(0)) { (uint256 oldWeight, uint256 newWeight) = _writeCheckpoint(_checkpoints[dst], _add, amount); emit DelegateVotesChanged(dst, oldWeight, newWeight); } } } function _writeCheckpoint( Checkpoint[] storage ckpts, function(uint256, uint256) view returns (uint256) op, uint256 delta ) private returns (uint256 oldWeight, uint256 newWeight) { uint256 pos = ckpts.length; oldWeight = pos == 0 ? 0 : ckpts[pos - 1].votes; newWeight = op(oldWeight, delta); if (pos > 0 && ckpts[pos - 1].fromBlock == block.number) { ckpts[pos - 1].votes = SafeCast.toUint224(newWeight); } else { ckpts.push(Checkpoint({fromBlock: SafeCast.toUint32(block.number), votes: SafeCast.toUint224(newWeight)})); } } function _add(uint256 a, uint256 b) private pure returns (uint256) { return a + b; } function _subtract(uint256 a, uint256 b) private pure returns (uint256) { return a - b; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; /** helper methods for interacting with ERC20 tokens that do not consistently return true/false with the addition of a transfer function to send eth or an erc20 token */ library TransferHelper { function safeApprove(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: APPROVE_FAILED"); } function safeTransfer(address token, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FAILED"); } function safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FROM_FAILED"); } // sends ETH or an erc20 token function safeTransferBaseToken(address token, address payable to, uint value, bool isERC20) internal { if (!isERC20) { to.transfer(value); } else { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FAILED"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface INFTWEscrow is IERC165, IERC20, IERC721Receiver { event WeightUpdated(address indexed user, bool increase, uint weight, uint timestamp); event WorldStaked(uint256 indexed tokenId, address indexed user); event WorldUnstaked(uint256 indexed tokenId, address indexed user); event RewardsSet(uint32 start, uint32 end, uint256 rate); event RewardsUpdated(uint32 start, uint32 end, uint256 rate); event RewardsPerWeightUpdated(uint256 accumulated); event UserRewardsUpdated(address user, uint256 userRewards, uint256 paidRewardPerWeight); event RewardClaimed(address receiver, uint256 claimed); struct WorldInfo { uint16 weight; // weight based on rarity address owner; // staked to, otherwise owner == 0 uint16 deposit; // unit is ether, paid in WRLD. The deposit is deducted from the last payment(s) since the deposit is non-custodial uint16 rentalPerDay; // unit is ether, paid in WRLD. Total is deposit + rentalPerDay * days uint16 minRentDays; // must rent for at least min rent days, otherwise deposit is forfeited up to this amount uint32 rentableUntil; // timestamp in unix epoch } struct RewardsPeriod { uint32 start; // reward start time, in unix epoch uint32 end; // reward end time, in unix epoch } struct RewardsPerWeight { uint32 totalWeight; uint96 accumulated; uint32 lastUpdated; uint96 rate; } struct UserRewards { uint32 stakedWeight; uint96 accumulated; uint96 checkpoint; } // view functions function getWorldInfo(uint tokenId) external view returns(WorldInfo memory); function checkUserRewards(address user) external view returns(uint); function onERC721Received(address, address, uint256, bytes calldata) external view override returns(bytes4); // public functions function initialStake(uint[] calldata tokenIds, uint[] calldata weights, address stakeTo, uint16 _deposit, uint16 _rentalPerDay, uint16 _minRentDays, uint32 _rentableUntil, uint32 _maxTimestamp, bytes calldata _signature) external; function stake(uint[] calldata tokenIds, address stakeTo, uint16 _deposit, uint16 _rentalPerDay, uint16 _minRentDays, uint32 _rentableUntil) external; function updateRent(uint[] calldata tokenIds, uint16 _deposit, uint16 _rentalPerDay, uint16 _minRentDays, uint32 _rentableUntil) external; function extendRentalPeriod(uint tokenId, uint32 _rentableUntil) external; function unstake(uint[] calldata tokenIds, address unstakeTo) external; function claim(address to) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; interface INFTWRental is IERC165 { event WorldRented(uint256 indexed tokenId, address indexed tenant, uint256 payment); event RentalPaid(uint256 indexed tokenId, address indexed tenant, uint256 payment); event RentalTerminated(uint256 indexed tokenId, address indexed tenant); struct WorldRentInfo { address tenant; // rented to, otherwise tenant == 0 uint32 rentStartTime; // timestamp in unix epoch uint32 rentalPaid; // total rental paid since the beginning including the deposit uint32 paymentAlert; // alert time before next rent payment in seconds (used by frontend only) } function isRentActive(uint tokenId) external view returns(bool); function getTenant(uint tokenId) external view returns(address); function rentedByIndex(address tenant, uint index) external view returns(uint); function isRentable(uint tokenId) external view returns(bool state); function rentalPaidUntil(uint tokenId) external view returns(uint paidUntil); function rentWorld(uint tokenId, uint32 _paymentAlert, uint32 initialPayment) external; function payRent(uint tokenId, uint32 payment) external; function terminateRental(uint tokenId) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; interface INFTWRouter { function setRoutingDataIPFSHash(uint _worldTokenId, string calldata _ipfsHash) external; function removeRoutingDataIPFSHash(uint _worldTokenId) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; interface INFTW_ERC721 is IERC721 { function updateMetadataIPFSHash(uint _tokenId, string calldata _tokenMetadataIPFSHash) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, _allowances[owner][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = _allowances[owner][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Spend `amount` form the allowance of `owner` toward `spender`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts 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 Counters { 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.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @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 / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (governance/utils/IVotes.sol) pragma solidity ^0.8.0; /** * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. * * _Available since v4.5._ */ interface IVotes { /** * @dev Emitted when an account changes their delegate. */ event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /** * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of votes. */ event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /** * @dev Returns the current amount of votes that `account` has. */ function getVotes(address account) external view returns (uint256); /** * @dev Returns the amount of votes that `account` had at the end of a past block (`blockNumber`). */ function getPastVotes(address account, uint256 blockNumber) external view returns (uint256); /** * @dev Returns the total supply of votes available at the end of a past block (`blockNumber`). * * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. * Votes that have not been delegated are still part of total supply, even though they would not participate in a * vote. */ function getPastTotalSupply(uint256 blockNumber) external view returns (uint256); /** * @dev Returns the delegate that `account` has chosen. */ function delegates(address account) external view returns (address); /** * @dev Delegates votes from the sender to `delegatee`. */ function delegate(address delegatee) external; /** * @dev Delegates votes from signer to `delegatee`. */ function delegateBySig( address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
{ "optimizer": { "enabled": true, "runs": 500 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"wrld","type":"address"},{"internalType":"address","name":"nftw","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"claimed","type":"uint256"}],"name":"RewardClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"accumulated","type":"uint256"}],"name":"RewardsPerWeightUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"start","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"end","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"RewardsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"start","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"end","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"RewardsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"userRewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paidRewardPerWeight","type":"uint256"}],"name":"UserRewardsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"bool","name":"increase","type":"bool"},{"indexed":false,"internalType":"uint256","name":"weight","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"WeightUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WorldStaked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"WorldUnstaked","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"checkUserRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint32","name":"pos","type":"uint32"}],"name":"checkpoints","outputs":[{"components":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint224","name":"votes","type":"uint224"}],"internalType":"struct ERC20Votes.Checkpoint","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint32","name":"_rentableUntil","type":"uint32"}],"name":"extendRentalPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getWorldInfo","outputs":[{"components":[{"internalType":"uint16","name":"weight","type":"uint16"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint16","name":"deposit","type":"uint16"},{"internalType":"uint16","name":"rentalPerDay","type":"uint16"},{"internalType":"uint16","name":"minRentDays","type":"uint16"},{"internalType":"uint32","name":"rentableUntil","type":"uint32"}],"internalType":"struct INFTWEscrow.WorldInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"weights","type":"uint256[]"},{"internalType":"address","name":"stakeTo","type":"address"},{"internalType":"uint16","name":"_deposit","type":"uint16"},{"internalType":"uint16","name":"_rentalPerDay","type":"uint16"},{"internalType":"uint16","name":"_minRentDays","type":"uint16"},{"internalType":"uint32","name":"_rentableUntil","type":"uint32"},{"internalType":"uint32","name":"_maxTimestamp","type":"uint32"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"initialStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"removeRoutingDataIPFSHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint32","name":"stakedWeight","type":"uint32"},{"internalType":"uint96","name":"accumulated","type":"uint96"},{"internalType":"uint96","name":"checkpoint","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsPerWeight","outputs":[{"internalType":"uint32","name":"totalWeight","type":"uint32"},{"internalType":"uint96","name":"accumulated","type":"uint96"},{"internalType":"uint32","name":"lastUpdated","type":"uint32"},{"internalType":"uint96","name":"rate","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsPeriod","outputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_contract","type":"address"},{"internalType":"bool","name":"_allow","type":"bool"}],"name":"setPredicate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INFTWRental","name":"_contract","type":"address"}],"name":"setRentalContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"start","type":"uint32"},{"internalType":"uint32","name":"end","type":"uint32"},{"internalType":"uint96","name":"rate","type":"uint96"}],"name":"setRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INFTWRouter","name":"_contract","type":"address"}],"name":"setRouterContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_ipfsHash","type":"string"}],"name":"setRoutingDataIPFSHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_signer","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"weights","type":"uint256[]"}],"name":"setWeight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"stakeTo","type":"address"},{"internalType":"uint16","name":"_deposit","type":"uint16"},{"internalType":"uint16","name":"_rentalPerDay","type":"uint16"},{"internalType":"uint16","name":"_minRentDays","type":"uint16"},{"internalType":"uint32","name":"_rentableUntil","type":"uint32"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"supply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"unstakeTo","type":"address"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_tokenMetadataIPFSHash","type":"string"}],"name":"updateMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint16","name":"_deposit","type":"uint16"},{"internalType":"uint16","name":"_rentalPerDay","type":"uint16"},{"internalType":"uint16","name":"_minRentDays","type":"uint16"},{"internalType":"uint32","name":"_rentableUntil","type":"uint32"}],"name":"updateRent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBridged","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101a06040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610140523480156200003757600080fd5b5060405162005e2938038062005e298339810160408190526200005a916200037f565b6040518060400160405280601681526020017f566f74652d657363726f776564204e4654576f726c640000000000000000000081525080604051806040016040528060018152602001603160f81b8152506040518060400160405280601681526020017f566f74652d657363726f776564204e4654576f726c64000000000000000000008152506040518060400160405280600681526020016576654e46545760d01b815250816003908051906020019062000118929190620002bc565b5080516200012e906004906020840190620002bc565b5050825160209384012082519284019290922060e08390526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818901819052818301979097526060810194909452608080850193909352308483018190528151808603909301835260c0948501909152815191909601209052929092526101205250620001cd9050336200026a565b6001600a556001600160a01b038216620002135760405162461bcd60e51b8152602060048201526002602482015261045360f41b60448201526064015b60405180910390fd5b6001600160a01b038116620002505760405162461bcd60e51b8152602060048201526002602482015261045360f41b60448201526064016200020a565b6001600160a01b03918216610160521661018052620003f4565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002ca90620003b7565b90600052602060002090601f016020900481019282620002ee576000855562000339565b82601f106200030957805160ff191683800117855562000339565b8280016001018555821562000339579182015b82811115620003395782518255916020019190600101906200031c565b50620003479291506200034b565b5090565b5b808211156200034757600081556001016200034c565b80516001600160a01b03811681146200037a57600080fd5b919050565b600080604083850312156200039357600080fd5b6200039e8362000362565b9150620003ae6020840162000362565b90509250929050565b600181811c90821680620003cc57607f821691505b60208210811415620003ee57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e051610100516101205161014051610160516101805161598c6200049d60003960008181610c1e0152818161105f015281816115890152818161199701528181611a4701528181611e2701528181612d1e0152612dce015260008181610a9b015261244b01526000612a7e01526000613e3701526000613e8601526000613e6101526000613dba01526000613de401526000613e0e015261598c6000f3fe608060405234801561001057600080fd5b50600436106103205760003560e01c80636e68dbeb116101a7578063a457c2d7116100ee578063dbb37abf11610097578063f2fde38b11610071578063f2fde38b1461082d578063fbee335514610840578063fc196d081461085357600080fd5b8063dbb37abf146107a4578063dd62ed3e146107b7578063f1127ed8146107f057600080fd5b8063c19b4ccd116100c8578063c19b4ccd14610704578063c3cda5201461077e578063d505accf1461079157600080fd5b8063a457c2d7146106cb578063a9059cbb146106de578063bfa22c67146106f157600080fd5b80638da5cb5b116101505780639a1e9c331161012a5780639a1e9c33146106925780639ab24eb0146106a5578063a354f39e146106b857600080fd5b80638da5cb5b146106665780638e539e8c1461067757806395d89b411461068a57600080fd5b8063715018a611610181578063715018a6146106385780637b892e00146106405780637ecebe001461065357600080fd5b80636e68dbeb146105d45780636fcfff45146105e757806370a082311461060f57600080fd5b8063363315211161026b578063587cde1e1161021457806364fe8577116101ee57806364fe85771461059b5780636c19e783146105ae5780636cc91bca146105c157600080fd5b8063587cde1e146105315780635a63427e146105755780635c19a95c1461058857600080fd5b80633a46b1a8116102455780633a46b1a8146104f857806350395f091461050b57806353c8388e1461051e57600080fd5b806336331521146104ca5780633644e515146104dd57806339509351146104e557600080fd5b806318160ddd116102cd57806326ae2b78116102a757806326ae2b781461046f5780632cd8d4d7146104a8578063313ce567146104bb57600080fd5b806318160ddd1461043f5780631e83409a1461044757806323b872dd1461045c57600080fd5b8063095ea7b3116102fe578063095ea7b3146103d157806310aeb108146103e4578063150b7a021461041357600080fd5b806301ffc9a71461032557806306fdde031461034d5780630700037d14610362575b600080fd5b610338610333366004614e96565b6108c1565b60405190151581526020015b60405180910390f35b6103556108f8565b6040516103449190614edf565b6103a5610370366004614f37565b6127206020526000908152604090205463ffffffff8116906001600160601b03600160201b8204811691600160801b90041683565b6040805163ffffffff90941684526001600160601b039283166020850152911690820152606001610344565b6103386103df366004614f54565b61098a565b6104056103f2366004614f37565b6127226020526000908152604090205481565b604051908152602001610344565b610426610421366004614fc2565b6109a2565b6040516001600160e01b03199091168152602001610344565b6104056109d0565b61045a610455366004614f37565b6109ee565b005b61033861046a366004615035565b610b0c565b61271e5461048b9063ffffffff80821691600160201b90041682565b6040805163ffffffff938416815292909116602083015201610344565b61045a6104b63660046150e1565b610b30565b60405160128152602001610344565b61045a6104d8366004615166565b610dfb565b61040561127f565b6103386104f3366004614f54565b611289565b610405610506366004614f54565b6112c8565b61045a6105193660046151cb565b611342565b61045a61052c366004615204565b6113f1565b61055d61053f366004614f37565b6001600160a01b039081166000908152600660205260409020541690565b6040516001600160a01b039091168152602001610344565b61045a610583366004614f37565b6115f0565b61045a610596366004614f37565b6116fa565b61045a6105a9366004615250565b611707565b61045a6105bc366004614f37565b611ce1565b61045a6105cf366004614f37565b611d4c565b61045a6105e2366004615360565b611db6565b6105fa6105f5366004614f37565b611f0d565b60405163ffffffff9091168152602001610344565b61040561061d366004614f37565b6001600160a01b031660009081526020819052604090205490565b61045a611f2f565b61045a61064e36600461538c565b611f83565b610405610661366004614f37565b6120cb565b6009546001600160a01b031661055d565b6104056106853660046153f8565b6120e9565b610355612145565b6104056106a0366004614f37565b612154565b6104056106b3366004614f37565b6122d9565b61045a6106c6366004615411565b61235f565b6103386106d9366004614f54565b6125cb565b6103386106ec366004614f54565b61265d565b61045a6106ff3660046153f8565b61266b565b6107176107123660046153f8565b612846565b6040516103449190600060c08201905061ffff8084511683526001600160a01b0360208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401525063ffffffff60a08401511660a083015292915050565b61045a61078c36600461546a565b6128fd565b61045a61079f3660046154c4565b612a2a565b61045a6107b2366004615532565b612b8e565b6104056107c53660046155ca565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108036107fe3660046155f8565b612ffc565b60408051825163ffffffff1681526020928301516001600160e01b03169281019290925201610344565b61045a61083b366004614f37565b61307f565b61045a61084e366004615204565b613135565b61271f5461088a9063ffffffff808216916001600160601b03600160201b8204811692600160801b83041691600160a01b90041684565b6040805163ffffffff95861681526001600160601b0394851660208201529490921691840191909152166060820152608001610344565b60006001600160e01b03198216639bc30fb360e01b14806108f257506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606003805461090790615624565b80601f016020809104026020016040519081016040528092919081815260200182805461093390615624565b80156109805780601f1061095557610100808354040283529160200191610980565b820191906000526020600020905b81548152906001019060200180831161096357829003601f168201915b5050505050905090565b6000336109988185856132ea565b5060019392505050565b60006001600160a01b0386163014156109c35750630a85bd0160e11b6109c7565b5060005b95945050505050565b6000612723546109df60025490565b6109e9919061566f565b905090565b6002600a541415610a465760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600a55610a5660008061340e565b6000610a6433600080613621565b3360009081526127206020526040902080546fffffffffffffffffffffffff00000000191690556001600160601b03169050610ac17f0000000000000000000000000000000000000000000000000000000000000000838361387d565b604080516001600160a01b0384168152602081018390527f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f7241910160405180910390a150506001600a55565b600033610b1a858285613991565b610b25858585613a23565b506001949350505050565b610b3f61ffff83166001615686565b610b4d9061ffff851661569e565b8461ffff161115610b855760405162461bcd60e51b815260206004820152600260248201526122a960f11b6044820152606401610a3d565b60005b85811015610df2576000878783818110610ba457610ba46156bd565b9050602002013590506000600d826127118110610bc357610bc36156bd565b01805490915061ffff16610bfe5760405162461bcd60e51b8152602060048201526002602482015261454160f01b6044820152606401610a3d565b6040516331a9108f60e11b81526004810183905230906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa158015610c65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8991906156d3565b6001600160a01b0316148015610caf575080546001600160a01b03620100009091041633145b610ce05760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b600b54604051633339a29360e11b8152600481018490526001600160a01b0390911690636673452690602401602060405180830381865afa158015610d29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4d91906156f0565b15610d7f5760405162461bcd60e51b815260206004820152600260248201526122a160f11b6044820152606401610a3d565b805463ffffffff60b01b1916600160b01b61ffff8981169190910261ffff60c01b191691909117600160c01b88831602176001600160d01b0316600160d01b918716919091026001600160e01b031617600160e01b63ffffffff8616021790555080610dea8161570d565b915050610b88565b50505050505050565b6002600a541415610e4e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3d565b6002600a55610e5c81613c02565b6001600160a01b038116301415610e9a5760405162461bcd60e51b8152602060048201526002602482015261455360f01b6044820152606401610a3d565b610eac82670de0b6b3a764000061569e565b336000818152612722602052604090205490610ec79061061d565b610ed1919061566f565b1015610f045760405162461bcd60e51b8152602060048201526002602482015261045560f41b6044820152606401610a3d565b6000805b83811015611230576000858583818110610f2457610f246156bd565b905060200201359050610f343390565b6001600160a01b0316600d826127118110610f5157610f516156bd565b01546201000090046001600160a01b031614610f945760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b600b54604051633339a29360e11b8152600481018390526001600160a01b0390911690636673452690602401602060405180830381865afa158015610fdd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100191906156f0565b156110335760405162461bcd60e51b815260206004820152600260248201526122a160f11b6044820152606401610a3d565b604051632142170760e11b81523060048201526001600160a01b038581166024830152604482018390527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b1580156110a357600080fd5b505af11580156110b7573d6000803e3d6000fd5b505050506000600d8261271181106110d1576110d16156bd565b015461ffff1690506110e38185615686565b6040805160c08101825261ffff84168152600060208201819052918101829052606081018290526080810182905260a0810191909152909450600d836127118110611130576111306156bd565b825191018054602084015160408501516060860151608087015160a09097015163ffffffff16600160e01b026001600160e01b0361ffff988916600160d01b02166001600160d01b03928916600160c01b0261ffff60c01b19948a16600160b01b029490941663ffffffff60b01b196001600160a01b0390961662010000026001600160b01b031990971699909816989098179490941792909216949094179390931792909216929092171790556111e53390565b6001600160a01b0316827ffa3da614f910b1404dc8190d3b3592514bbeda644f073679a843be160f262add60405160405180910390a3505080806112289061570d565b915050610f08565b5061124461123d82613d3a565b600061340e565b6112583361125183613d3a565b6000613621565b506112743361126f85670de0b6b3a764000061569e565b613da3565b50506001600a555050565b60006109e9613dad565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061099890829086906112c3908790615686565b6132ea565b60004382106113195760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e6564006044820152606401610a3d565b6001600160a01b038316600090815260076020526040902061133b9083613ed4565b9392505050565b6009546001600160a01b0316331461138a5760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b6001600160a01b0382166113c55760405162461bcd60e51b8152602060048201526002602482015261045360f41b6044820152606401610a3d565b6001600160a01b0391909116600090815261272160205260409020805460ff1916911515919091179055565b33600d846127118110611406576114066156bd565b01546201000090046001600160a01b031614801561148e5750600b54604051633339a29360e11b8152600481018590526001600160a01b0390911690636673452690602401602060405180830381865afa158015611468573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148c91906156f0565b155b8061154157506000600d8461271181106114aa576114aa6156bd565b01546201000090046001600160a01b031614801590611541575033600b546040516355fd83e560e01b8152600481018690526001600160a01b0392831692909116906355fd83e590602401602060405180830381865afa158015611512573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153691906156d3565b6001600160a01b0316145b6115725760405162461bcd60e51b815260206004820152600260248201526108a960f31b6044820152606401610a3d565b604051636756328360e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ceac6506906115c290869086908690600401615728565b600060405180830381600087803b1580156115dc57600080fd5b505af1158015610df2573d6000803e3d6000fd5b6009546001600160a01b031633146116385760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b6040516301ffc9a760e01b815263a465369160e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015611683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a791906156f0565b6116d85760405162461bcd60e51b8152602060048201526002602482015261045360f41b6044820152606401610a3d565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6117043382613f90565b50565b6002600a54141561175a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3d565b6002600a5561176e61ffff86166001615686565b61177c9061ffff881661569e565b8761ffff1611156117b45760405162461bcd60e51b815260206004820152600260248201526122a960f11b6044820152606401610a3d565b8a89146117e85760405162461bcd60e51b8152602060048201526002602482015261229b60f11b6044820152606401610a3d565b8263ffffffff164211156118235760405162461bcd60e51b815260206004820152600260248201526108ab60f31b6044820152606401610a3d565b6118608c8c8c8c33883060405160200161184397969594939291906157ad565b604051602081830303815290604052805190602001208383614009565b6118915760405162461bcd60e51b8152602060048201526002602482015261453760f01b6044820152606401610a3d565b61189a88613c02565b6001600160a01b0388163014156118d85760405162461bcd60e51b8152602060048201526002602482015261455360f01b6044820152606401610a3d565b6000805b8c811015611c895760008e8e838181106118f8576118f86156bd565b9050602002013590506000600d826127118110611917576119176156bd565b015461ffff16905080158061194357508d8d84818110611939576119396156bd565b9050602002013581145b6119745760405162461bcd60e51b815260206004820152600260248201526108a760f31b6044820152606401610a3d565b336040516331a9108f60e11b8152600481018490526001600160a01b03918216917f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa1580156119de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0291906156d3565b6001600160a01b031614611a3d5760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166342842e0e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101859052606401600060405180830381600087803b158015611abb57600080fd5b505af1158015611acf573d6000803e3d6000fd5b50506040516001600160a01b038f1692508491507f386d7662103b38221201a01f5f88ff9c8c03246b5349135976c5dec31f07b7ef90600090a350506040518060c00160405280611b378e8e85818110611b2b57611b2b6156bd565b90506020020135614076565b61ffff1681526020018b6001600160a01b031681526020018a61ffff1681526020018961ffff1681526020018861ffff1681526020018763ffffffff16815250600d8f8f84818110611b8b57611b8b6156bd565b905060200201356127118110611ba357611ba36156bd565b825191018054602084015160408501516060860151608087015160a09097015163ffffffff16600160e01b026001600160e01b0361ffff988916600160d01b02166001600160d01b03928916600160c01b0261ffff60c01b19948a16600160b01b029490941663ffffffff60b01b196001600160a01b0390961662010000026001600160b01b031990971699909816989098179490941792909216949094179390931792909216929092171790558b8b82818110611c6357611c636156bd565b9050602002013582611c759190615686565b915080611c818161570d565b9150506118dc565b50611c9d611c9682613d3a565b600161340e565b611cb189611caa83613d3a565b6001613621565b50611ccd89611cc88e670de0b6b3a764000061569e565b6140d9565b50506001600a555050505050505050505050565b6009546001600160a01b03163314611d295760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b61272480546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b03163314611d945760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b6000600d836127118110611dcc57611dcc6156bd565b01805490915061ffff16611e075760405162461bcd60e51b8152602060048201526002602482015261454160f01b6044820152606401610a3d565b6040516331a9108f60e11b81526004810184905230906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa158015611e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9291906156d3565b6001600160a01b0316148015611eb8575080546001600160a01b03620100009091041633145b611ee95760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b805463ffffffff909216600160e01b026001600160e01b0390921691909117905550565b6001600160a01b0381166000908152600760205260408120546108f290613d3a565b6009546001600160a01b03163314611f775760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b611f8160006140e3565b565b6009546001600160a01b03163314611fcb5760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b828114611fff5760405162461bcd60e51b8152602060048201526002602482015261229b60f11b6044820152606401610a3d565b60005b838110156120c457600085858381811061201e5761201e6156bd565b905060200201359050600d81612711811061203b5761203b6156bd565b015461ffff16156120735760405162461bcd60e51b815260206004820152600260248201526108a760f31b6044820152606401610a3d565b612088848484818110611b2b57611b2b6156bd565b600d82612711811061209c5761209c6156bd565b01805461ffff191661ffff9290921691909117905550806120bc8161570d565b915050612002565b5050505050565b6001600160a01b0381166000908152600560205260408120546108f2565b600043821061213a5760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e6564006044820152606401610a3d565b6108f2600883613ed4565b60606004805461090790615624565b6040805160808101825261271f5463ffffffff80821683526001600160601b03600160201b8084048216602080870191909152600160801b808604851687890152600160a01b90950483166060808801919091526001600160a01b0389166000908152612720835288812089519283018a52549586168252928504841691810191909152939092041693820193909352826122076121f142613d3a565b61271e54600160201b900463ffffffff16614135565b9050600083604001518261221b9190615807565b63ffffffff169050801561229157835163ffffffff161561229157835160608501516122829163ffffffff169061225b906001600160601b03168461569e565b612265919061582c565b85602001516001600160601b031661227d9190615686565b614157565b6001600160601b031660208501525b826040015184602001516122a5919061584e565b83516122b7919063ffffffff1661586e565b83602001516122c6919061589d565b6001600160601b03169695505050505050565b6001600160a01b038116600090815260076020526040812054801561234c576001600160a01b038316600090815260076020526040902061231b60018361566f565b8154811061232b5761232b6156bd565b600091825260209091200154600160201b90046001600160e01b031661234f565b60005b6001600160e01b03169392505050565b6009546001600160a01b031633146123a75760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b8163ffffffff168363ffffffff1611156123e85760405162461bcd60e51b8152602060048201526002602482015261453160f01b6044820152606401610a3d565b666a94d74f430000816001600160601b031611801561241857506801a055690d9db80000816001600160601b0316105b6124495760405162461bcd60e51b8152602060048201526002602482015261229960f11b6044820152606401610a3d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166124a45760405162461bcd60e51b8152602060048201526002602482015261453360f01b6044820152606401610a3d565b61271e5463ffffffff166124b742613d3a565b63ffffffff1610806124e6575061271e54600160201b900463ffffffff166124de42613d3a565b63ffffffff16115b6125175760405162461bcd60e51b8152602060048201526002602482015261114d60f21b6044820152606401610a3d565b61271e805463ffffffff85811667ffffffffffffffff199092168217600160201b9186169182021790925561271f80546fffffffffffffffffffffffffffffffff16600160801b83026001600160a01b031617600160a01b6001600160601b03861690810291909117909155604080519283526020830193909352918101919091527f95efd8a2a0aa591f48fd9673cf5d13c2150ca7a1fe1cbe438dd3f0ae470646639060600160405180910390a1505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156126505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610a3d565b610b2582868684036132ea565b600033610998818585613a23565b33600d826127118110612680576126806156bd565b01546201000090046001600160a01b03161480156127085750600b54604051633339a29360e11b8152600481018390526001600160a01b0390911690636673452690602401602060405180830381865afa1580156126e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270691906156f0565b155b806127bb57506000600d826127118110612724576127246156bd565b01546201000090046001600160a01b0316148015906127bb575033600b546040516355fd83e560e01b8152600481018490526001600160a01b0392831692909116906355fd83e590602401602060405180830381865afa15801561278c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b091906156d3565b6001600160a01b0316145b6127ec5760405162461bcd60e51b815260206004820152600260248201526108a960f31b6044820152606401610a3d565b600c5460405163bfa22c6760e01b8152600481018390526001600160a01b039091169063bfa22c6790602401600060405180830381600087803b15801561283257600080fd5b505af11580156120c4573d6000803e3d6000fd5b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152600d82612711811061288c5761288c6156bd565b6040805160c081018252929091015461ffff80821684526001600160a01b03620100008304166020850152600160b01b8204811692840192909252600160c01b810482166060840152600160d01b8104909116608083015263ffffffff600160e01b9091041660a082015292915050565b8342111561294d5760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606401610a3d565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906129c7906129bf9060a001604051602081830303815290604052805190602001206141bf565b85858561420d565b90506129d281614235565b8614612a205760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606401610a3d565b610df28188613f90565b83421115612a7a5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610a3d565b60007f0000000000000000000000000000000000000000000000000000000000000000888888612aa98c614235565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000612b04826141bf565b90506000612b148287878761420d565b9050896001600160a01b0316816001600160a01b031614612b775760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610a3d565b612b828a8a8a6132ea565b50505050505050505050565b6002600a541415612be15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3d565b6002600a55612bf561ffff83166001615686565b612c039061ffff851661569e565b8461ffff161115612c3b5760405162461bcd60e51b815260206004820152600260248201526122a960f11b6044820152606401610a3d565b612c4485613c02565b6001600160a01b038516301415612c825760405162461bcd60e51b8152602060048201526002602482015261455360f01b6044820152606401610a3d565b6000805b87811015612fbc576000898983818110612ca257612ca26156bd565b9050602002013590506000600d826127118110612cc157612cc16156bd565b015461ffff16905080612cfb5760405162461bcd60e51b8152602060048201526002602482015261454160f01b6044820152606401610a3d565b336040516331a9108f60e11b8152600481018490526001600160a01b03918216917f00000000000000000000000000000000000000000000000000000000000000001690636352211e90602401602060405180830381865afa158015612d65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8991906156d3565b6001600160a01b031614612dc45760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166342842e0e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101859052606401600060405180830381600087803b158015612e4257600080fd5b505af1158015612e56573d6000803e3d6000fd5b505050508061ffff1684612e6a9190615686565b93506040518060c001604052808261ffff1681526020018a6001600160a01b031681526020018961ffff1681526020018861ffff1681526020018761ffff1681526020018663ffffffff16815250600d836127118110612ecc57612ecc6156bd565b82519101805460208401516040808601516060870151608088015160a09098015161ffff9788166001600160b01b031990961695909517620100006001600160a01b03958616021763ffffffff60b01b1916600160b01b9288169290920261ffff60c01b191691909117600160c01b91871691909102176001600160d01b0316600160d01b95909616949094026001600160e01b031694909417600160e01b63ffffffff9092169190910217905551908a169083907f386d7662103b38221201a01f5f88ff9c8c03246b5349135976c5dec31f07b7ef90600090a350508080612fb49061570d565b915050612c86565b50612fc9611c9682613d3a565b612fd686611caa83613d3a565b50612fed86611cc889670de0b6b3a764000061569e565b50506001600a55505050505050565b60408051808201909152600080825260208201526001600160a01b0383166000908152600760205260409020805463ffffffff8416908110613040576130406156bd565b60009182526020918290206040805180820190915291015463ffffffff81168252600160201b90046001600160e01b0316918101919091529392505050565b6009546001600160a01b031633146130c75760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b6001600160a01b03811661312c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a3d565b611704816140e3565b33600d84612711811061314a5761314a6156bd565b01546201000090046001600160a01b03161480156131d25750600b54604051633339a29360e11b8152600481018590526001600160a01b0390911690636673452690602401602060405180830381865afa1580156131ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131d091906156f0565b155b8061328557506000600d8461271181106131ee576131ee6156bd565b01546201000090046001600160a01b031614801590613285575033600b546040516355fd83e560e01b8152600481018690526001600160a01b0392831692909116906355fd83e590602401602060405180830381865afa158015613256573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061327a91906156d3565b6001600160a01b0316145b6132b65760405162461bcd60e51b815260206004820152600260248201526108a960f31b6044820152606401610a3d565b600c5460405163fbee335560e01b81526001600160a01b039091169063fbee3355906115c290869086908690600401615728565b6001600160a01b03831661334c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610a3d565b6001600160a01b0382166133ad5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610a3d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6040805160808101825261271f5463ffffffff8082168352600160201b8083046001600160601b03908116602080870191909152600160801b8504841686880152600160a01b909404166060850152845180860190955261271e548083168087529190049091169184019190915290919061348842613d3a565b63ffffffff161061351e5760006134ab6134a142613d3a565b8360200151614135565b905060008360400151826134bf9190615807565b63ffffffff169050801561351b57835163ffffffff161561350e57835160608501516134ff9163ffffffff169061225b906001600160601b03168461569e565b6001600160601b031660208501525b63ffffffff821660408501525b50505b821561354457838260000181815161353691906158c8565b63ffffffff16905250613560565b83826000018181516135569190615807565b63ffffffff169052505b815161271f805460208086015160408088015160608901516001600160601b03908116600160a01b026001600160a01b0363ffffffff938416600160801b02166fffffffffffffffffffffffffffffffff92909516600160201b81026fffffffffffffffffffffffffffffffff19909816939099169290921795909517949094169190911792909217909255519182527faac1802288db8019f8ec43430efc11a152c72473c57d6ddcde3b6dd0c8926067910160405180910390a150505050565b6001600160a01b038316600090815261272060209081526040808320815160608082018452915463ffffffff80821683526001600160601b03600160201b808404821685890152600160801b938490048216858801908152875160808101895261271f54808616825292830484169981018a905294820490931696840196909652600160a01b909504909416928101929092529151919290916136c39161584e565b82516136d5919063ffffffff1661586e565b82602001516136e4919061589d565b6001600160601b0390811660208085019190915282015116604083015263ffffffff8516156137a257831561373357848260000181815161372591906158c8565b63ffffffff1690525061374f565b84826000018181516137459190615807565b63ffffffff169052505b60408051851515815263ffffffff87166020820152428183015290516001600160a01b038816917fb1de227711aba68cec92891ccaabad9474a3f417d166ca8f57e7d616f467d343919081900360600190a25b6001600160a01b038616600081815261272060209081526040918290208551815487840151888601516001600160601b03908116600160801b81027fffffffff000000000000000000000000ffffffffffffffffffffffffffffffff92909316600160201b81026fffffffffffffffffffffffffffffffff1990951663ffffffff90961695909517939093171617909255835194855291840191909152908201527f5b9aaf4cc5141c090a75f8b8a627863eba92df81f0c83c096350da9b79aedd049060600160405180910390a15060200151949350505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916138d991906158e7565b6000604051808303816000865af19150503d8060008114613916576040519150601f19603f3d011682016040523d82523d6000602084013e61391b565b606091505b509150915081801561394557508051158061394557508080602001905181019061394591906156f0565b6120c45760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c4544006044820152606401610a3d565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114613a1d5781811015613a105760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610a3d565b613a1d84848484036132ea565b50505050565b6001600160a01b038316613a875760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610a3d565b6001600160a01b038216613ae95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610a3d565b613af483838361425d565b6001600160a01b03831660009081526020819052604090205481811015613b6c5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610a3d565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290613ba3908490615686565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613bef91815260200190565b60405180910390a3613a1d8484846143ff565b803b63ffffffff811615613d3657604051630a85bd0160e11b8152306004820181905260248201526000604482018190526080606483015260848201526001600160a01b0383169063150b7a029060a4016020604051808303816000875af1925050508015613c8e575060408051601f3d908101601f19168201909252613c8b91810190615903565b60015b613cef573d808015613cbc576040519150601f19603f3d011682016040523d82523d6000602084013e613cc1565b606091505b5060405162461bcd60e51b8152602060048201526002602482015261115560f21b6044820152606401610a3d565b6001600160e01b03198116630a85bd0160e11b14613d345760405162461bcd60e51b8152602060048201526002602482015261115560f21b6044820152606401610a3d565b505b5050565b600063ffffffff821115613d9f5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610a3d565b5090565b613d36828261440a565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015613e0657507f000000000000000000000000000000000000000000000000000000000000000046145b15613e3057507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b8154600090815b81811015613f38576000613eef8284614422565b905084868281548110613f0457613f046156bd565b60009182526020909120015463ffffffff161115613f2457809250613f32565b613f2f816001615686565b91505b50613edb565b8115613f7b5784613f4a60018461566f565b81548110613f5a57613f5a6156bd565b600091825260209091200154600160201b90046001600160e01b0316613f7e565b60005b6001600160e01b031695945050505050565b6001600160a01b038281166000818152600660208181526040808420805485845282862054949093528787166001600160a01b03198416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4613a1d82848361443d565b61272454604080516020601f85018190048102820181019092528381526000926001600160a01b0316916140649190869086908190840183828082843760009201919091525061405e925089915061457a9050565b906145cd565b6001600160a01b031614949350505050565b600061ffff821115613d9f5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201526536206269747360d01b6064820152608401610a3d565b613d3682826145f1565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008163ffffffff168363ffffffff1610614150578161133b565b5090919050565b60006001600160601b03821115613d9f5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201526536206269747360d01b6064820152608401610a3d565b60006108f26141cc613dad565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061421e8787878761468d565b9150915061422b8161477a565b5095945050505050565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b6001600160a01b038316158061427a57506001600160a01b038216155b8061429e57506001600160a01b0383166000908152612721602052604090205460ff165b806142c257506001600160a01b0382166000908152612721602052604090205460ff165b61430e5760405162461bcd60e51b815260206004820152601860248201527f45524332303a204e6f6e2d7472616e736665727261626c6500000000000000006044820152606401610a3d565b6001600160a01b0383166000908152612721602052604090205460ff161561438157806127236000828254614343919061566f565b90915550506001600160a01b038216600090815261272260205260408120805483929061437190849061566f565b909155506143819050828261440a565b6001600160a01b0382166000908152612721602052604090205460ff16156143f4578061272360008282546143b69190615686565b90915550506001600160a01b03831660009081526127226020526040812080548392906143e4908490615686565b909155506143f4905083826145f1565b613d34838383613d34565b613d34838383614935565b6144148282614972565b613a1d6008614ad383614adf565b6000614431600284841861582c565b61133b90848416615686565b816001600160a01b0316836001600160a01b03161415801561445f5750600081115b15613d34576001600160a01b038316156144ed576001600160a01b0383166000908152600760205260408120819061449a90614ad385614adf565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516144e2929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615613d34576001600160a01b0382166000908152600760205260408120819061452390614c5685614adf565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161456b929190918252602082015260400190565b60405180910390a25050505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060006145dc8585614c62565b915091506145e98161477a565b509392505050565b6145fb8282614cd2565b6001600160e01b0361460b6109d0565b111561467f5760405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201527f766572666c6f77696e6720766f746573000000000000000000000000000000006064820152608401610a3d565b613a1d6008614c5683614adf565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156146c45750600090506003614771565b8460ff16601b141580156146dc57508460ff16601c14155b156146ed5750600090506004614771565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614741573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661476a57600060019250925050614771565b9150600090505b94509492505050565b600081600481111561478e5761478e615920565b14156147975750565b60018160048111156147ab576147ab615920565b14156147f95760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a3d565b600281600481111561480d5761480d615920565b141561485b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a3d565b600381600481111561486f5761486f615920565b14156148c85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a3d565b60048160048111156148dc576148dc615920565b14156117045760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a3d565b614940838383613d34565b6001600160a01b03838116600090815260066020526040808220548584168352912054613d349291821691168361443d565b6001600160a01b0382166149d25760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610a3d565b6149de8260008361425d565b6001600160a01b03821660009081526020819052604090205481811015614a525760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610a3d565b6001600160a01b0383166000908152602081905260408120838303905560028054849290614a8190849061566f565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3613d34836000846143ff565b600061133b828461566f565b825460009081908015614b295785614af860018361566f565b81548110614b0857614b086156bd565b600091825260209091200154600160201b90046001600160e01b0316614b2c565b60005b6001600160e01b03169250614b4583858763ffffffff16565b9150600081118015614b8357504386614b5f60018461566f565b81548110614b6f57614b6f6156bd565b60009182526020909120015463ffffffff16145b15614be357614b9182614dc5565b86614b9d60018461566f565b81548110614bad57614bad6156bd565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550614c4d565b856040518060400160405280614bf843613d3a565b63ffffffff168152602001614c0c85614dc5565b6001600160e01b039081169091528254600181018455600093845260209384902083519490930151909116600160201b0263ffffffff909316929092179101555b50935093915050565b600061133b8284615686565b600080825160411415614c995760208301516040840151606085015160001a614c8d8782858561468d565b94509450505050614ccb565b825160401415614cc35760208301516040840151614cb8868383614e2e565b935093505050614ccb565b506000905060025b9250929050565b6001600160a01b038216614d285760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610a3d565b614d346000838361425d565b8060026000828254614d469190615686565b90915550506001600160a01b03821660009081526020819052604081208054839290614d73908490615686565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3613d36600083836143ff565b60006001600160e01b03821115613d9f5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608401610a3d565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681614e6460ff86901c601b615686565b9050614e728782888561468d565b935093505050935093915050565b6001600160e01b03198116811461170457600080fd5b600060208284031215614ea857600080fd5b813561133b81614e80565b60005b83811015614ece578181015183820152602001614eb6565b83811115613a1d5750506000910152565b6020815260008251806020840152614efe816040850160208701614eb3565b601f01601f19169190910160400192915050565b6001600160a01b038116811461170457600080fd5b8035614f3281614f12565b919050565b600060208284031215614f4957600080fd5b813561133b81614f12565b60008060408385031215614f6757600080fd5b8235614f7281614f12565b946020939093013593505050565b60008083601f840112614f9257600080fd5b50813567ffffffffffffffff811115614faa57600080fd5b602083019150836020828501011115614ccb57600080fd5b600080600080600060808688031215614fda57600080fd5b8535614fe581614f12565b94506020860135614ff581614f12565b935060408601359250606086013567ffffffffffffffff81111561501857600080fd5b61502488828901614f80565b969995985093965092949392505050565b60008060006060848603121561504a57600080fd5b833561505581614f12565b9250602084013561506581614f12565b929592945050506040919091013590565b60008083601f84011261508857600080fd5b50813567ffffffffffffffff8111156150a057600080fd5b6020830191508360208260051b8501011115614ccb57600080fd5b803561ffff81168114614f3257600080fd5b803563ffffffff81168114614f3257600080fd5b60008060008060008060a087890312156150fa57600080fd5b863567ffffffffffffffff81111561511157600080fd5b61511d89828a01615076565b90975095506151309050602088016150bb565b935061513e604088016150bb565b925061514c606088016150bb565b915061515a608088016150cd565b90509295509295509295565b60008060006040848603121561517b57600080fd5b833567ffffffffffffffff81111561519257600080fd5b61519e86828701615076565b90945092505060208401356151b281614f12565b809150509250925092565b801515811461170457600080fd5b600080604083850312156151de57600080fd5b82356151e981614f12565b915060208301356151f9816151bd565b809150509250929050565b60008060006040848603121561521957600080fd5b83359250602084013567ffffffffffffffff81111561523757600080fd5b61524386828701614f80565b9497909650939450505050565b6000806000806000806000806000806000806101208d8f03121561527357600080fd5b67ffffffffffffffff8d35111561528957600080fd5b6152968e8e358f01615076565b909c509a5067ffffffffffffffff60208e013511156152b457600080fd5b6152c48e60208f01358f01615076565b909a5098506152d560408e01614f27565b97506152e360608e016150bb565b96506152f160808e016150bb565b95506152ff60a08e016150bb565b945061530d60c08e016150cd565b935061531b60e08e016150cd565b925067ffffffffffffffff6101008e0135111561533757600080fd5b6153488e6101008f01358f01614f80565b81935080925050509295989b509295989b509295989b565b6000806040838503121561537357600080fd5b82359150615383602084016150cd565b90509250929050565b600080600080604085870312156153a257600080fd5b843567ffffffffffffffff808211156153ba57600080fd5b6153c688838901615076565b909650945060208701359150808211156153df57600080fd5b506153ec87828801615076565b95989497509550505050565b60006020828403121561540a57600080fd5b5035919050565b60008060006060848603121561542657600080fd5b61542f846150cd565b925061543d602085016150cd565b915060408401356001600160601b03811681146151b257600080fd5b803560ff81168114614f3257600080fd5b60008060008060008060c0878903121561548357600080fd5b863561548e81614f12565b955060208701359450604087013593506154aa60608801615459565b92506080870135915060a087013590509295509295509295565b600080600080600080600060e0888a0312156154df57600080fd5b87356154ea81614f12565b965060208801356154fa81614f12565b9550604088013594506060880135935061551660808901615459565b925060a0880135915060c0880135905092959891949750929550565b600080600080600080600060c0888a03121561554d57600080fd5b873567ffffffffffffffff81111561556457600080fd5b6155708a828b01615076565b909850965050602088013561558481614f12565b9450615592604089016150bb565b93506155a0606089016150bb565b92506155ae608089016150bb565b91506155bc60a089016150cd565b905092959891949750929550565b600080604083850312156155dd57600080fd5b82356155e881614f12565b915060208301356151f981614f12565b6000806040838503121561560b57600080fd5b823561561681614f12565b9150615383602084016150cd565b600181811c9082168061563857607f821691505b6020821081141561425757634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561568157615681615659565b500390565b6000821982111561569957615699615659565b500190565b60008160001904831182151516156156b8576156b8615659565b500290565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156156e557600080fd5b815161133b81614f12565b60006020828403121561570257600080fd5b815161133b816151bd565b600060001982141561572157615721615659565b5060010190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561579057600080fd5b8260051b8083602087013760009401602001938452509192915050565b60a0815260006157c160a08301898b61575e565b82810360208401526157d481888a61575e565b6001600160a01b03968716604085015263ffffffff95909516606084015250509216608090920191909152949350505050565b600063ffffffff8381169083168181101561582457615824615659565b039392505050565b60008261584957634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160601b038381169083168181101561582457615824615659565b60006001600160601b038083168185168183048111821515161561589457615894615659565b02949350505050565b60006001600160601b038083168185168083038211156158bf576158bf615659565b01949350505050565b600063ffffffff8083168185168083038211156158bf576158bf615659565b600082516158f9818460208701614eb3565b9190910192915050565b60006020828403121561591557600080fd5b815161133b81614e80565b634e487b7160e01b600052602160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220dfb81354c0a7b7cda7199b40bff1eaa9d53c7aab7865a7aa3808261f94ed239b64736f6c634300080b0033000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e9000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103205760003560e01c80636e68dbeb116101a7578063a457c2d7116100ee578063dbb37abf11610097578063f2fde38b11610071578063f2fde38b1461082d578063fbee335514610840578063fc196d081461085357600080fd5b8063dbb37abf146107a4578063dd62ed3e146107b7578063f1127ed8146107f057600080fd5b8063c19b4ccd116100c8578063c19b4ccd14610704578063c3cda5201461077e578063d505accf1461079157600080fd5b8063a457c2d7146106cb578063a9059cbb146106de578063bfa22c67146106f157600080fd5b80638da5cb5b116101505780639a1e9c331161012a5780639a1e9c33146106925780639ab24eb0146106a5578063a354f39e146106b857600080fd5b80638da5cb5b146106665780638e539e8c1461067757806395d89b411461068a57600080fd5b8063715018a611610181578063715018a6146106385780637b892e00146106405780637ecebe001461065357600080fd5b80636e68dbeb146105d45780636fcfff45146105e757806370a082311461060f57600080fd5b8063363315211161026b578063587cde1e1161021457806364fe8577116101ee57806364fe85771461059b5780636c19e783146105ae5780636cc91bca146105c157600080fd5b8063587cde1e146105315780635a63427e146105755780635c19a95c1461058857600080fd5b80633a46b1a8116102455780633a46b1a8146104f857806350395f091461050b57806353c8388e1461051e57600080fd5b806336331521146104ca5780633644e515146104dd57806339509351146104e557600080fd5b806318160ddd116102cd57806326ae2b78116102a757806326ae2b781461046f5780632cd8d4d7146104a8578063313ce567146104bb57600080fd5b806318160ddd1461043f5780631e83409a1461044757806323b872dd1461045c57600080fd5b8063095ea7b3116102fe578063095ea7b3146103d157806310aeb108146103e4578063150b7a021461041357600080fd5b806301ffc9a71461032557806306fdde031461034d5780630700037d14610362575b600080fd5b610338610333366004614e96565b6108c1565b60405190151581526020015b60405180910390f35b6103556108f8565b6040516103449190614edf565b6103a5610370366004614f37565b6127206020526000908152604090205463ffffffff8116906001600160601b03600160201b8204811691600160801b90041683565b6040805163ffffffff90941684526001600160601b039283166020850152911690820152606001610344565b6103386103df366004614f54565b61098a565b6104056103f2366004614f37565b6127226020526000908152604090205481565b604051908152602001610344565b610426610421366004614fc2565b6109a2565b6040516001600160e01b03199091168152602001610344565b6104056109d0565b61045a610455366004614f37565b6109ee565b005b61033861046a366004615035565b610b0c565b61271e5461048b9063ffffffff80821691600160201b90041682565b6040805163ffffffff938416815292909116602083015201610344565b61045a6104b63660046150e1565b610b30565b60405160128152602001610344565b61045a6104d8366004615166565b610dfb565b61040561127f565b6103386104f3366004614f54565b611289565b610405610506366004614f54565b6112c8565b61045a6105193660046151cb565b611342565b61045a61052c366004615204565b6113f1565b61055d61053f366004614f37565b6001600160a01b039081166000908152600660205260409020541690565b6040516001600160a01b039091168152602001610344565b61045a610583366004614f37565b6115f0565b61045a610596366004614f37565b6116fa565b61045a6105a9366004615250565b611707565b61045a6105bc366004614f37565b611ce1565b61045a6105cf366004614f37565b611d4c565b61045a6105e2366004615360565b611db6565b6105fa6105f5366004614f37565b611f0d565b60405163ffffffff9091168152602001610344565b61040561061d366004614f37565b6001600160a01b031660009081526020819052604090205490565b61045a611f2f565b61045a61064e36600461538c565b611f83565b610405610661366004614f37565b6120cb565b6009546001600160a01b031661055d565b6104056106853660046153f8565b6120e9565b610355612145565b6104056106a0366004614f37565b612154565b6104056106b3366004614f37565b6122d9565b61045a6106c6366004615411565b61235f565b6103386106d9366004614f54565b6125cb565b6103386106ec366004614f54565b61265d565b61045a6106ff3660046153f8565b61266b565b6107176107123660046153f8565b612846565b6040516103449190600060c08201905061ffff8084511683526001600160a01b0360208501511660208401528060408501511660408401528060608501511660608401528060808501511660808401525063ffffffff60a08401511660a083015292915050565b61045a61078c36600461546a565b6128fd565b61045a61079f3660046154c4565b612a2a565b61045a6107b2366004615532565b612b8e565b6104056107c53660046155ca565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108036107fe3660046155f8565b612ffc565b60408051825163ffffffff1681526020928301516001600160e01b03169281019290925201610344565b61045a61083b366004614f37565b61307f565b61045a61084e366004615204565b613135565b61271f5461088a9063ffffffff808216916001600160601b03600160201b8204811692600160801b83041691600160a01b90041684565b6040805163ffffffff95861681526001600160601b0394851660208201529490921691840191909152166060820152608001610344565b60006001600160e01b03198216639bc30fb360e01b14806108f257506301ffc9a760e01b6001600160e01b03198316145b92915050565b60606003805461090790615624565b80601f016020809104026020016040519081016040528092919081815260200182805461093390615624565b80156109805780601f1061095557610100808354040283529160200191610980565b820191906000526020600020905b81548152906001019060200180831161096357829003601f168201915b5050505050905090565b6000336109988185856132ea565b5060019392505050565b60006001600160a01b0386163014156109c35750630a85bd0160e11b6109c7565b5060005b95945050505050565b6000612723546109df60025490565b6109e9919061566f565b905090565b6002600a541415610a465760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600a55610a5660008061340e565b6000610a6433600080613621565b3360009081526127206020526040902080546fffffffffffffffffffffffff00000000191690556001600160601b03169050610ac17f000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e9838361387d565b604080516001600160a01b0384168152602081018390527f106f923f993c2149d49b4255ff723acafa1f2d94393f561d3eda32ae348f7241910160405180910390a150506001600a55565b600033610b1a858285613991565b610b25858585613a23565b506001949350505050565b610b3f61ffff83166001615686565b610b4d9061ffff851661569e565b8461ffff161115610b855760405162461bcd60e51b815260206004820152600260248201526122a960f11b6044820152606401610a3d565b60005b85811015610df2576000878783818110610ba457610ba46156bd565b9050602002013590506000600d826127118110610bc357610bc36156bd565b01805490915061ffff16610bfe5760405162461bcd60e51b8152602060048201526002602482015261454160f01b6044820152606401610a3d565b6040516331a9108f60e11b81526004810183905230906001600160a01b037f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af1690636352211e90602401602060405180830381865afa158015610c65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8991906156d3565b6001600160a01b0316148015610caf575080546001600160a01b03620100009091041633145b610ce05760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b600b54604051633339a29360e11b8152600481018490526001600160a01b0390911690636673452690602401602060405180830381865afa158015610d29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4d91906156f0565b15610d7f5760405162461bcd60e51b815260206004820152600260248201526122a160f11b6044820152606401610a3d565b805463ffffffff60b01b1916600160b01b61ffff8981169190910261ffff60c01b191691909117600160c01b88831602176001600160d01b0316600160d01b918716919091026001600160e01b031617600160e01b63ffffffff8616021790555080610dea8161570d565b915050610b88565b50505050505050565b6002600a541415610e4e5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3d565b6002600a55610e5c81613c02565b6001600160a01b038116301415610e9a5760405162461bcd60e51b8152602060048201526002602482015261455360f01b6044820152606401610a3d565b610eac82670de0b6b3a764000061569e565b336000818152612722602052604090205490610ec79061061d565b610ed1919061566f565b1015610f045760405162461bcd60e51b8152602060048201526002602482015261045560f41b6044820152606401610a3d565b6000805b83811015611230576000858583818110610f2457610f246156bd565b905060200201359050610f343390565b6001600160a01b0316600d826127118110610f5157610f516156bd565b01546201000090046001600160a01b031614610f945760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b600b54604051633339a29360e11b8152600481018390526001600160a01b0390911690636673452690602401602060405180830381865afa158015610fdd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100191906156f0565b156110335760405162461bcd60e51b815260206004820152600260248201526122a160f11b6044820152606401610a3d565b604051632142170760e11b81523060048201526001600160a01b038581166024830152604482018390527f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af16906342842e0e90606401600060405180830381600087803b1580156110a357600080fd5b505af11580156110b7573d6000803e3d6000fd5b505050506000600d8261271181106110d1576110d16156bd565b015461ffff1690506110e38185615686565b6040805160c08101825261ffff84168152600060208201819052918101829052606081018290526080810182905260a0810191909152909450600d836127118110611130576111306156bd565b825191018054602084015160408501516060860151608087015160a09097015163ffffffff16600160e01b026001600160e01b0361ffff988916600160d01b02166001600160d01b03928916600160c01b0261ffff60c01b19948a16600160b01b029490941663ffffffff60b01b196001600160a01b0390961662010000026001600160b01b031990971699909816989098179490941792909216949094179390931792909216929092171790556111e53390565b6001600160a01b0316827ffa3da614f910b1404dc8190d3b3592514bbeda644f073679a843be160f262add60405160405180910390a3505080806112289061570d565b915050610f08565b5061124461123d82613d3a565b600061340e565b6112583361125183613d3a565b6000613621565b506112743361126f85670de0b6b3a764000061569e565b613da3565b50506001600a555050565b60006109e9613dad565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061099890829086906112c3908790615686565b6132ea565b60004382106113195760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e6564006044820152606401610a3d565b6001600160a01b038316600090815260076020526040902061133b9083613ed4565b9392505050565b6009546001600160a01b0316331461138a5760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b6001600160a01b0382166113c55760405162461bcd60e51b8152602060048201526002602482015261045360f41b6044820152606401610a3d565b6001600160a01b0391909116600090815261272160205260409020805460ff1916911515919091179055565b33600d846127118110611406576114066156bd565b01546201000090046001600160a01b031614801561148e5750600b54604051633339a29360e11b8152600481018590526001600160a01b0390911690636673452690602401602060405180830381865afa158015611468573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061148c91906156f0565b155b8061154157506000600d8461271181106114aa576114aa6156bd565b01546201000090046001600160a01b031614801590611541575033600b546040516355fd83e560e01b8152600481018690526001600160a01b0392831692909116906355fd83e590602401602060405180830381865afa158015611512573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061153691906156d3565b6001600160a01b0316145b6115725760405162461bcd60e51b815260206004820152600260248201526108a960f31b6044820152606401610a3d565b604051636756328360e11b81526001600160a01b037f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af169063ceac6506906115c290869086908690600401615728565b600060405180830381600087803b1580156115dc57600080fd5b505af1158015610df2573d6000803e3d6000fd5b6009546001600160a01b031633146116385760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b6040516301ffc9a760e01b815263a465369160e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015611683573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a791906156f0565b6116d85760405162461bcd60e51b8152602060048201526002602482015261045360f41b6044820152606401610a3d565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6117043382613f90565b50565b6002600a54141561175a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3d565b6002600a5561176e61ffff86166001615686565b61177c9061ffff881661569e565b8761ffff1611156117b45760405162461bcd60e51b815260206004820152600260248201526122a960f11b6044820152606401610a3d565b8a89146117e85760405162461bcd60e51b8152602060048201526002602482015261229b60f11b6044820152606401610a3d565b8263ffffffff164211156118235760405162461bcd60e51b815260206004820152600260248201526108ab60f31b6044820152606401610a3d565b6118608c8c8c8c33883060405160200161184397969594939291906157ad565b604051602081830303815290604052805190602001208383614009565b6118915760405162461bcd60e51b8152602060048201526002602482015261453760f01b6044820152606401610a3d565b61189a88613c02565b6001600160a01b0388163014156118d85760405162461bcd60e51b8152602060048201526002602482015261455360f01b6044820152606401610a3d565b6000805b8c811015611c895760008e8e838181106118f8576118f86156bd565b9050602002013590506000600d826127118110611917576119176156bd565b015461ffff16905080158061194357508d8d84818110611939576119396156bd565b9050602002013581145b6119745760405162461bcd60e51b815260206004820152600260248201526108a760f31b6044820152606401610a3d565b336040516331a9108f60e11b8152600481018490526001600160a01b03918216917f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af1690636352211e90602401602060405180830381865afa1580156119de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a0291906156d3565b6001600160a01b031614611a3d5760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b6001600160a01b037f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af166342842e0e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101859052606401600060405180830381600087803b158015611abb57600080fd5b505af1158015611acf573d6000803e3d6000fd5b50506040516001600160a01b038f1692508491507f386d7662103b38221201a01f5f88ff9c8c03246b5349135976c5dec31f07b7ef90600090a350506040518060c00160405280611b378e8e85818110611b2b57611b2b6156bd565b90506020020135614076565b61ffff1681526020018b6001600160a01b031681526020018a61ffff1681526020018961ffff1681526020018861ffff1681526020018763ffffffff16815250600d8f8f84818110611b8b57611b8b6156bd565b905060200201356127118110611ba357611ba36156bd565b825191018054602084015160408501516060860151608087015160a09097015163ffffffff16600160e01b026001600160e01b0361ffff988916600160d01b02166001600160d01b03928916600160c01b0261ffff60c01b19948a16600160b01b029490941663ffffffff60b01b196001600160a01b0390961662010000026001600160b01b031990971699909816989098179490941792909216949094179390931792909216929092171790558b8b82818110611c6357611c636156bd565b9050602002013582611c759190615686565b915080611c818161570d565b9150506118dc565b50611c9d611c9682613d3a565b600161340e565b611cb189611caa83613d3a565b6001613621565b50611ccd89611cc88e670de0b6b3a764000061569e565b6140d9565b50506001600a555050505050505050505050565b6009546001600160a01b03163314611d295760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b61272480546001600160a01b0319166001600160a01b0392909216919091179055565b6009546001600160a01b03163314611d945760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b6000600d836127118110611dcc57611dcc6156bd565b01805490915061ffff16611e075760405162461bcd60e51b8152602060048201526002602482015261454160f01b6044820152606401610a3d565b6040516331a9108f60e11b81526004810184905230906001600160a01b037f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af1690636352211e90602401602060405180830381865afa158015611e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9291906156d3565b6001600160a01b0316148015611eb8575080546001600160a01b03620100009091041633145b611ee95760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b805463ffffffff909216600160e01b026001600160e01b0390921691909117905550565b6001600160a01b0381166000908152600760205260408120546108f290613d3a565b6009546001600160a01b03163314611f775760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b611f8160006140e3565b565b6009546001600160a01b03163314611fcb5760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b828114611fff5760405162461bcd60e51b8152602060048201526002602482015261229b60f11b6044820152606401610a3d565b60005b838110156120c457600085858381811061201e5761201e6156bd565b905060200201359050600d81612711811061203b5761203b6156bd565b015461ffff16156120735760405162461bcd60e51b815260206004820152600260248201526108a760f31b6044820152606401610a3d565b612088848484818110611b2b57611b2b6156bd565b600d82612711811061209c5761209c6156bd565b01805461ffff191661ffff9290921691909117905550806120bc8161570d565b915050612002565b5050505050565b6001600160a01b0381166000908152600560205260408120546108f2565b600043821061213a5760405162461bcd60e51b815260206004820152601f60248201527f4552433230566f7465733a20626c6f636b206e6f7420796574206d696e6564006044820152606401610a3d565b6108f2600883613ed4565b60606004805461090790615624565b6040805160808101825261271f5463ffffffff80821683526001600160601b03600160201b8084048216602080870191909152600160801b808604851687890152600160a01b90950483166060808801919091526001600160a01b0389166000908152612720835288812089519283018a52549586168252928504841691810191909152939092041693820193909352826122076121f142613d3a565b61271e54600160201b900463ffffffff16614135565b9050600083604001518261221b9190615807565b63ffffffff169050801561229157835163ffffffff161561229157835160608501516122829163ffffffff169061225b906001600160601b03168461569e565b612265919061582c565b85602001516001600160601b031661227d9190615686565b614157565b6001600160601b031660208501525b826040015184602001516122a5919061584e565b83516122b7919063ffffffff1661586e565b83602001516122c6919061589d565b6001600160601b03169695505050505050565b6001600160a01b038116600090815260076020526040812054801561234c576001600160a01b038316600090815260076020526040902061231b60018361566f565b8154811061232b5761232b6156bd565b600091825260209091200154600160201b90046001600160e01b031661234f565b60005b6001600160e01b03169392505050565b6009546001600160a01b031633146123a75760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b8163ffffffff168363ffffffff1611156123e85760405162461bcd60e51b8152602060048201526002602482015261453160f01b6044820152606401610a3d565b666a94d74f430000816001600160601b031611801561241857506801a055690d9db80000816001600160601b0316105b6124495760405162461bcd60e51b8152602060048201526002602482015261229960f11b6044820152606401610a3d565b7f000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e96001600160a01b03166124a45760405162461bcd60e51b8152602060048201526002602482015261453360f01b6044820152606401610a3d565b61271e5463ffffffff166124b742613d3a565b63ffffffff1610806124e6575061271e54600160201b900463ffffffff166124de42613d3a565b63ffffffff16115b6125175760405162461bcd60e51b8152602060048201526002602482015261114d60f21b6044820152606401610a3d565b61271e805463ffffffff85811667ffffffffffffffff199092168217600160201b9186169182021790925561271f80546fffffffffffffffffffffffffffffffff16600160801b83026001600160a01b031617600160a01b6001600160601b03861690810291909117909155604080519283526020830193909352918101919091527f95efd8a2a0aa591f48fd9673cf5d13c2150ca7a1fe1cbe438dd3f0ae470646639060600160405180910390a1505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156126505760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610a3d565b610b2582868684036132ea565b600033610998818585613a23565b33600d826127118110612680576126806156bd565b01546201000090046001600160a01b03161480156127085750600b54604051633339a29360e11b8152600481018390526001600160a01b0390911690636673452690602401602060405180830381865afa1580156126e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061270691906156f0565b155b806127bb57506000600d826127118110612724576127246156bd565b01546201000090046001600160a01b0316148015906127bb575033600b546040516355fd83e560e01b8152600481018490526001600160a01b0392831692909116906355fd83e590602401602060405180830381865afa15801561278c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127b091906156d3565b6001600160a01b0316145b6127ec5760405162461bcd60e51b815260206004820152600260248201526108a960f31b6044820152606401610a3d565b600c5460405163bfa22c6760e01b8152600481018390526001600160a01b039091169063bfa22c6790602401600060405180830381600087803b15801561283257600080fd5b505af11580156120c4573d6000803e3d6000fd5b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a0810191909152600d82612711811061288c5761288c6156bd565b6040805160c081018252929091015461ffff80821684526001600160a01b03620100008304166020850152600160b01b8204811692840192909252600160c01b810482166060840152600160d01b8104909116608083015263ffffffff600160e01b9091041660a082015292915050565b8342111561294d5760405162461bcd60e51b815260206004820152601d60248201527f4552433230566f7465733a207369676e617475726520657870697265640000006044820152606401610a3d565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906129c7906129bf9060a001604051602081830303815290604052805190602001206141bf565b85858561420d565b90506129d281614235565b8614612a205760405162461bcd60e51b815260206004820152601960248201527f4552433230566f7465733a20696e76616c6964206e6f6e6365000000000000006044820152606401610a3d565b610df28188613f90565b83421115612a7a5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610a3d565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888612aa98c614235565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000612b04826141bf565b90506000612b148287878761420d565b9050896001600160a01b0316816001600160a01b031614612b775760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610a3d565b612b828a8a8a6132ea565b50505050505050505050565b6002600a541415612be15760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a3d565b6002600a55612bf561ffff83166001615686565b612c039061ffff851661569e565b8461ffff161115612c3b5760405162461bcd60e51b815260206004820152600260248201526122a960f11b6044820152606401610a3d565b612c4485613c02565b6001600160a01b038516301415612c825760405162461bcd60e51b8152602060048201526002602482015261455360f01b6044820152606401610a3d565b6000805b87811015612fbc576000898983818110612ca257612ca26156bd565b9050602002013590506000600d826127118110612cc157612cc16156bd565b015461ffff16905080612cfb5760405162461bcd60e51b8152602060048201526002602482015261454160f01b6044820152606401610a3d565b336040516331a9108f60e11b8152600481018490526001600160a01b03918216917f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af1690636352211e90602401602060405180830381865afa158015612d65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d8991906156d3565b6001600160a01b031614612dc45760405162461bcd60e51b8152602060048201526002602482015261453960f01b6044820152606401610a3d565b6001600160a01b037f000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af166342842e0e336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015230602482015260448101859052606401600060405180830381600087803b158015612e4257600080fd5b505af1158015612e56573d6000803e3d6000fd5b505050508061ffff1684612e6a9190615686565b93506040518060c001604052808261ffff1681526020018a6001600160a01b031681526020018961ffff1681526020018861ffff1681526020018761ffff1681526020018663ffffffff16815250600d836127118110612ecc57612ecc6156bd565b82519101805460208401516040808601516060870151608088015160a09098015161ffff9788166001600160b01b031990961695909517620100006001600160a01b03958616021763ffffffff60b01b1916600160b01b9288169290920261ffff60c01b191691909117600160c01b91871691909102176001600160d01b0316600160d01b95909616949094026001600160e01b031694909417600160e01b63ffffffff9092169190910217905551908a169083907f386d7662103b38221201a01f5f88ff9c8c03246b5349135976c5dec31f07b7ef90600090a350508080612fb49061570d565b915050612c86565b50612fc9611c9682613d3a565b612fd686611caa83613d3a565b50612fed86611cc889670de0b6b3a764000061569e565b50506001600a55505050505050565b60408051808201909152600080825260208201526001600160a01b0383166000908152600760205260409020805463ffffffff8416908110613040576130406156bd565b60009182526020918290206040805180820190915291015463ffffffff81168252600160201b90046001600160e01b0316918101919091529392505050565b6009546001600160a01b031633146130c75760405162461bcd60e51b815260206004820181905260248201526000805160206159378339815191526044820152606401610a3d565b6001600160a01b03811661312c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a3d565b611704816140e3565b33600d84612711811061314a5761314a6156bd565b01546201000090046001600160a01b03161480156131d25750600b54604051633339a29360e11b8152600481018590526001600160a01b0390911690636673452690602401602060405180830381865afa1580156131ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131d091906156f0565b155b8061328557506000600d8461271181106131ee576131ee6156bd565b01546201000090046001600160a01b031614801590613285575033600b546040516355fd83e560e01b8152600481018690526001600160a01b0392831692909116906355fd83e590602401602060405180830381865afa158015613256573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061327a91906156d3565b6001600160a01b0316145b6132b65760405162461bcd60e51b815260206004820152600260248201526108a960f31b6044820152606401610a3d565b600c5460405163fbee335560e01b81526001600160a01b039091169063fbee3355906115c290869086908690600401615728565b6001600160a01b03831661334c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610a3d565b6001600160a01b0382166133ad5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610a3d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6040805160808101825261271f5463ffffffff8082168352600160201b8083046001600160601b03908116602080870191909152600160801b8504841686880152600160a01b909404166060850152845180860190955261271e548083168087529190049091169184019190915290919061348842613d3a565b63ffffffff161061351e5760006134ab6134a142613d3a565b8360200151614135565b905060008360400151826134bf9190615807565b63ffffffff169050801561351b57835163ffffffff161561350e57835160608501516134ff9163ffffffff169061225b906001600160601b03168461569e565b6001600160601b031660208501525b63ffffffff821660408501525b50505b821561354457838260000181815161353691906158c8565b63ffffffff16905250613560565b83826000018181516135569190615807565b63ffffffff169052505b815161271f805460208086015160408088015160608901516001600160601b03908116600160a01b026001600160a01b0363ffffffff938416600160801b02166fffffffffffffffffffffffffffffffff92909516600160201b81026fffffffffffffffffffffffffffffffff19909816939099169290921795909517949094169190911792909217909255519182527faac1802288db8019f8ec43430efc11a152c72473c57d6ddcde3b6dd0c8926067910160405180910390a150505050565b6001600160a01b038316600090815261272060209081526040808320815160608082018452915463ffffffff80821683526001600160601b03600160201b808404821685890152600160801b938490048216858801908152875160808101895261271f54808616825292830484169981018a905294820490931696840196909652600160a01b909504909416928101929092529151919290916136c39161584e565b82516136d5919063ffffffff1661586e565b82602001516136e4919061589d565b6001600160601b0390811660208085019190915282015116604083015263ffffffff8516156137a257831561373357848260000181815161372591906158c8565b63ffffffff1690525061374f565b84826000018181516137459190615807565b63ffffffff169052505b60408051851515815263ffffffff87166020820152428183015290516001600160a01b038816917fb1de227711aba68cec92891ccaabad9474a3f417d166ca8f57e7d616f467d343919081900360600190a25b6001600160a01b038616600081815261272060209081526040918290208551815487840151888601516001600160601b03908116600160801b81027fffffffff000000000000000000000000ffffffffffffffffffffffffffffffff92909316600160201b81026fffffffffffffffffffffffffffffffff1990951663ffffffff90961695909517939093171617909255835194855291840191909152908201527f5b9aaf4cc5141c090a75f8b8a627863eba92df81f0c83c096350da9b79aedd049060600160405180910390a15060200151949350505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b17905291516000928392908716916138d991906158e7565b6000604051808303816000865af19150503d8060008114613916576040519150601f19603f3d011682016040523d82523d6000602084013e61391b565b606091505b509150915081801561394557508051158061394557508080602001905181019061394591906156f0565b6120c45760405162461bcd60e51b815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c4544006044820152606401610a3d565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114613a1d5781811015613a105760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610a3d565b613a1d84848484036132ea565b50505050565b6001600160a01b038316613a875760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610a3d565b6001600160a01b038216613ae95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610a3d565b613af483838361425d565b6001600160a01b03831660009081526020819052604090205481811015613b6c5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610a3d565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290613ba3908490615686565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613bef91815260200190565b60405180910390a3613a1d8484846143ff565b803b63ffffffff811615613d3657604051630a85bd0160e11b8152306004820181905260248201526000604482018190526080606483015260848201526001600160a01b0383169063150b7a029060a4016020604051808303816000875af1925050508015613c8e575060408051601f3d908101601f19168201909252613c8b91810190615903565b60015b613cef573d808015613cbc576040519150601f19603f3d011682016040523d82523d6000602084013e613cc1565b606091505b5060405162461bcd60e51b8152602060048201526002602482015261115560f21b6044820152606401610a3d565b6001600160e01b03198116630a85bd0160e11b14613d345760405162461bcd60e51b8152602060048201526002602482015261115560f21b6044820152606401610a3d565b505b5050565b600063ffffffff821115613d9f5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610a3d565b5090565b613d36828261440a565b6000306001600160a01b037f00000000000000000000000069f0b8c5e94f6b64d832b7d9b15f3a88cb2f6f4b16148015613e0657507f000000000000000000000000000000000000000000000000000000000000000146145b15613e3057507fc4c1b173223d01a2c134095453fb41e0b06cb9b28af5b49022776b7c755ef5af90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527fcea9aa76dd0d968a589876743311036d7089d029ffa3cbf07e5fe162caf3611f828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b8154600090815b81811015613f38576000613eef8284614422565b905084868281548110613f0457613f046156bd565b60009182526020909120015463ffffffff161115613f2457809250613f32565b613f2f816001615686565b91505b50613edb565b8115613f7b5784613f4a60018461566f565b81548110613f5a57613f5a6156bd565b600091825260209091200154600160201b90046001600160e01b0316613f7e565b60005b6001600160e01b031695945050505050565b6001600160a01b038281166000818152600660208181526040808420805485845282862054949093528787166001600160a01b03198416811790915590519190951694919391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4613a1d82848361443d565b61272454604080516020601f85018190048102820181019092528381526000926001600160a01b0316916140649190869086908190840183828082843760009201919091525061405e925089915061457a9050565b906145cd565b6001600160a01b031614949350505050565b600061ffff821115613d9f5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203160448201526536206269747360d01b6064820152608401610a3d565b613d3682826145f1565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008163ffffffff168363ffffffff1610614150578161133b565b5090919050565b60006001600160601b03821115613d9f5760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203960448201526536206269747360d01b6064820152608401610a3d565b60006108f26141cc613dad565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061421e8787878761468d565b9150915061422b8161477a565b5095945050505050565b6001600160a01b03811660009081526005602052604090208054600181018255905b50919050565b6001600160a01b038316158061427a57506001600160a01b038216155b8061429e57506001600160a01b0383166000908152612721602052604090205460ff165b806142c257506001600160a01b0382166000908152612721602052604090205460ff165b61430e5760405162461bcd60e51b815260206004820152601860248201527f45524332303a204e6f6e2d7472616e736665727261626c6500000000000000006044820152606401610a3d565b6001600160a01b0383166000908152612721602052604090205460ff161561438157806127236000828254614343919061566f565b90915550506001600160a01b038216600090815261272260205260408120805483929061437190849061566f565b909155506143819050828261440a565b6001600160a01b0382166000908152612721602052604090205460ff16156143f4578061272360008282546143b69190615686565b90915550506001600160a01b03831660009081526127226020526040812080548392906143e4908490615686565b909155506143f4905083826145f1565b613d34838383613d34565b613d34838383614935565b6144148282614972565b613a1d6008614ad383614adf565b6000614431600284841861582c565b61133b90848416615686565b816001600160a01b0316836001600160a01b03161415801561445f5750600081115b15613d34576001600160a01b038316156144ed576001600160a01b0383166000908152600760205260408120819061449a90614ad385614adf565b91509150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516144e2929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615613d34576001600160a01b0382166000908152600760205260408120819061452390614c5685614adf565b91509150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161456b929190918252602082015260400190565b60405180910390a25050505050565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01604051602081830303815290604052805190602001209050919050565b60008060006145dc8585614c62565b915091506145e98161477a565b509392505050565b6145fb8282614cd2565b6001600160e01b0361460b6109d0565b111561467f5760405162461bcd60e51b815260206004820152603060248201527f4552433230566f7465733a20746f74616c20737570706c79207269736b73206f60448201527f766572666c6f77696e6720766f746573000000000000000000000000000000006064820152608401610a3d565b613a1d6008614c5683614adf565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156146c45750600090506003614771565b8460ff16601b141580156146dc57508460ff16601c14155b156146ed5750600090506004614771565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614741573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661476a57600060019250925050614771565b9150600090505b94509492505050565b600081600481111561478e5761478e615920565b14156147975750565b60018160048111156147ab576147ab615920565b14156147f95760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610a3d565b600281600481111561480d5761480d615920565b141561485b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a3d565b600381600481111561486f5761486f615920565b14156148c85760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a3d565b60048160048111156148dc576148dc615920565b14156117045760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a3d565b614940838383613d34565b6001600160a01b03838116600090815260066020526040808220548584168352912054613d349291821691168361443d565b6001600160a01b0382166149d25760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610a3d565b6149de8260008361425d565b6001600160a01b03821660009081526020819052604090205481811015614a525760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610a3d565b6001600160a01b0383166000908152602081905260408120838303905560028054849290614a8190849061566f565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3613d34836000846143ff565b600061133b828461566f565b825460009081908015614b295785614af860018361566f565b81548110614b0857614b086156bd565b600091825260209091200154600160201b90046001600160e01b0316614b2c565b60005b6001600160e01b03169250614b4583858763ffffffff16565b9150600081118015614b8357504386614b5f60018461566f565b81548110614b6f57614b6f6156bd565b60009182526020909120015463ffffffff16145b15614be357614b9182614dc5565b86614b9d60018461566f565b81548110614bad57614bad6156bd565b9060005260206000200160000160046101000a8154816001600160e01b0302191690836001600160e01b03160217905550614c4d565b856040518060400160405280614bf843613d3a565b63ffffffff168152602001614c0c85614dc5565b6001600160e01b039081169091528254600181018455600093845260209384902083519490930151909116600160201b0263ffffffff909316929092179101555b50935093915050565b600061133b8284615686565b600080825160411415614c995760208301516040840151606085015160001a614c8d8782858561468d565b94509450505050614ccb565b825160401415614cc35760208301516040840151614cb8868383614e2e565b935093505050614ccb565b506000905060025b9250929050565b6001600160a01b038216614d285760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610a3d565b614d346000838361425d565b8060026000828254614d469190615686565b90915550506001600160a01b03821660009081526020819052604081208054839290614d73908490615686565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3613d36600083836143ff565b60006001600160e01b03821115613d9f5760405162461bcd60e51b815260206004820152602760248201527f53616665436173743a2076616c756520646f65736e27742066697420696e20326044820152663234206269747360c81b6064820152608401610a3d565b6000807f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831681614e6460ff86901c601b615686565b9050614e728782888561468d565b935093505050935093915050565b6001600160e01b03198116811461170457600080fd5b600060208284031215614ea857600080fd5b813561133b81614e80565b60005b83811015614ece578181015183820152602001614eb6565b83811115613a1d5750506000910152565b6020815260008251806020840152614efe816040850160208701614eb3565b601f01601f19169190910160400192915050565b6001600160a01b038116811461170457600080fd5b8035614f3281614f12565b919050565b600060208284031215614f4957600080fd5b813561133b81614f12565b60008060408385031215614f6757600080fd5b8235614f7281614f12565b946020939093013593505050565b60008083601f840112614f9257600080fd5b50813567ffffffffffffffff811115614faa57600080fd5b602083019150836020828501011115614ccb57600080fd5b600080600080600060808688031215614fda57600080fd5b8535614fe581614f12565b94506020860135614ff581614f12565b935060408601359250606086013567ffffffffffffffff81111561501857600080fd5b61502488828901614f80565b969995985093965092949392505050565b60008060006060848603121561504a57600080fd5b833561505581614f12565b9250602084013561506581614f12565b929592945050506040919091013590565b60008083601f84011261508857600080fd5b50813567ffffffffffffffff8111156150a057600080fd5b6020830191508360208260051b8501011115614ccb57600080fd5b803561ffff81168114614f3257600080fd5b803563ffffffff81168114614f3257600080fd5b60008060008060008060a087890312156150fa57600080fd5b863567ffffffffffffffff81111561511157600080fd5b61511d89828a01615076565b90975095506151309050602088016150bb565b935061513e604088016150bb565b925061514c606088016150bb565b915061515a608088016150cd565b90509295509295509295565b60008060006040848603121561517b57600080fd5b833567ffffffffffffffff81111561519257600080fd5b61519e86828701615076565b90945092505060208401356151b281614f12565b809150509250925092565b801515811461170457600080fd5b600080604083850312156151de57600080fd5b82356151e981614f12565b915060208301356151f9816151bd565b809150509250929050565b60008060006040848603121561521957600080fd5b83359250602084013567ffffffffffffffff81111561523757600080fd5b61524386828701614f80565b9497909650939450505050565b6000806000806000806000806000806000806101208d8f03121561527357600080fd5b67ffffffffffffffff8d35111561528957600080fd5b6152968e8e358f01615076565b909c509a5067ffffffffffffffff60208e013511156152b457600080fd5b6152c48e60208f01358f01615076565b909a5098506152d560408e01614f27565b97506152e360608e016150bb565b96506152f160808e016150bb565b95506152ff60a08e016150bb565b945061530d60c08e016150cd565b935061531b60e08e016150cd565b925067ffffffffffffffff6101008e0135111561533757600080fd5b6153488e6101008f01358f01614f80565b81935080925050509295989b509295989b509295989b565b6000806040838503121561537357600080fd5b82359150615383602084016150cd565b90509250929050565b600080600080604085870312156153a257600080fd5b843567ffffffffffffffff808211156153ba57600080fd5b6153c688838901615076565b909650945060208701359150808211156153df57600080fd5b506153ec87828801615076565b95989497509550505050565b60006020828403121561540a57600080fd5b5035919050565b60008060006060848603121561542657600080fd5b61542f846150cd565b925061543d602085016150cd565b915060408401356001600160601b03811681146151b257600080fd5b803560ff81168114614f3257600080fd5b60008060008060008060c0878903121561548357600080fd5b863561548e81614f12565b955060208701359450604087013593506154aa60608801615459565b92506080870135915060a087013590509295509295509295565b600080600080600080600060e0888a0312156154df57600080fd5b87356154ea81614f12565b965060208801356154fa81614f12565b9550604088013594506060880135935061551660808901615459565b925060a0880135915060c0880135905092959891949750929550565b600080600080600080600060c0888a03121561554d57600080fd5b873567ffffffffffffffff81111561556457600080fd5b6155708a828b01615076565b909850965050602088013561558481614f12565b9450615592604089016150bb565b93506155a0606089016150bb565b92506155ae608089016150bb565b91506155bc60a089016150cd565b905092959891949750929550565b600080604083850312156155dd57600080fd5b82356155e881614f12565b915060208301356151f981614f12565b6000806040838503121561560b57600080fd5b823561561681614f12565b9150615383602084016150cd565b600181811c9082168061563857607f821691505b6020821081141561425757634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561568157615681615659565b500390565b6000821982111561569957615699615659565b500190565b60008160001904831182151516156156b8576156b8615659565b500290565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156156e557600080fd5b815161133b81614f12565b60006020828403121561570257600080fd5b815161133b816151bd565b600060001982141561572157615721615659565b5060010190565b83815260406020820152816040820152818360608301376000818301606090810191909152601f909201601f1916010192915050565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561579057600080fd5b8260051b8083602087013760009401602001938452509192915050565b60a0815260006157c160a08301898b61575e565b82810360208401526157d481888a61575e565b6001600160a01b03968716604085015263ffffffff95909516606084015250509216608090920191909152949350505050565b600063ffffffff8381169083168181101561582457615824615659565b039392505050565b60008261584957634e487b7160e01b600052601260045260246000fd5b500490565b60006001600160601b038381169083168181101561582457615824615659565b60006001600160601b038083168185168183048111821515161561589457615894615659565b02949350505050565b60006001600160601b038083168185168083038211156158bf576158bf615659565b01949350505050565b600063ffffffff8083168185168083038211156158bf576158bf615659565b600082516158f9818460208701614eb3565b9190910192915050565b60006020828403121561591557600080fd5b815161133b81614e80565b634e487b7160e01b600052602160045260246000fdfe4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220dfb81354c0a7b7cda7199b40bff1eaa9d53c7aab7865a7aa3808261f94ed239b64736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e9000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af
-----Decoded View---------------
Arg [0] : wrld (address): 0xD5d86FC8d5C0Ea1aC1Ac5Dfab6E529c9967a45E9
Arg [1] : nftw (address): 0xBD4455dA5929D5639EE098ABFaa3241e9ae111Af
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000d5d86fc8d5c0ea1ac1ac5dfab6e529c9967a45e9
Arg [1] : 000000000000000000000000bd4455da5929d5639ee098abfaa3241e9ae111af
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.