Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 36 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Sell | 20202216 | 211 days ago | IN | 0 ETH | 0.00150516 | ||||
Sell | 20202197 | 211 days ago | IN | 0 ETH | 0.00436578 | ||||
Sell | 20202184 | 211 days ago | IN | 0 ETH | 0.00488768 | ||||
Sell | 20202136 | 211 days ago | IN | 0 ETH | 0.00335707 | ||||
Sell | 20202062 | 211 days ago | IN | 0 ETH | 0.0034565 | ||||
Sell | 18846266 | 401 days ago | IN | 0 ETH | 0.02634081 | ||||
Sell | 16852519 | 681 days ago | IN | 0 ETH | 0.00336665 | ||||
Sell | 16852501 | 681 days ago | IN | 0 ETH | 0.00501395 | ||||
Sell | 16852490 | 681 days ago | IN | 0 ETH | 0.01219608 | ||||
Sell | 16837712 | 683 days ago | IN | 0 ETH | 0.02368924 | ||||
Sell | 16770605 | 692 days ago | IN | 0 ETH | 0.38768214 | ||||
Sell | 16770578 | 692 days ago | IN | 0 ETH | 0.07436825 | ||||
Sell | 16770533 | 692 days ago | IN | 0 ETH | 0.42987329 | ||||
Buy | 16757151 | 694 days ago | IN | 0.015 ETH | 0.00301394 | ||||
Sell | 16657037 | 708 days ago | IN | 0 ETH | 0.01090473 | ||||
Sell | 16591378 | 718 days ago | IN | 0 ETH | 0.00839058 | ||||
Sell | 16571265 | 720 days ago | IN | 0 ETH | 0.00623171 | ||||
Buy | 16571259 | 720 days ago | IN | 0.005 ETH | 0.00410965 | ||||
Buy | 16568078 | 721 days ago | IN | 0.015 ETH | 0.00236528 | ||||
Buy | 16567779 | 721 days ago | IN | 0.015 ETH | 0.00202127 | ||||
Sell | 16486301 | 732 days ago | IN | 0 ETH | 0.01025729 | ||||
Buy | 16447961 | 738 days ago | IN | 0.005 ETH | 0.0018905 | ||||
Sell | 16447328 | 738 days ago | IN | 0 ETH | 0.01010613 | ||||
Sell | 16441505 | 739 days ago | IN | 0 ETH | 0.01390157 | ||||
Sell | 16435612 | 739 days ago | IN | 0 ETH | 0.01589321 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21082668 | 88 days ago | 100 wei | ||||
20202276 | 211 days ago | 100 wei | ||||
20202272 | 211 days ago | 100 wei | ||||
20202216 | 211 days ago | 100 wei | ||||
20202216 | 211 days ago | 100 wei | ||||
20202216 | 211 days ago | 100 wei | ||||
20202216 | 211 days ago | 100 wei | ||||
20202216 | 211 days ago | 100 wei | ||||
20202216 | 211 days ago | 100 wei | ||||
20202216 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei | ||||
20202197 | 211 days ago | 100 wei |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
TrashBin
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC1155Receiver} from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import {IHashes} from "../../interfaces/IHashes.sol"; import {IHashesDAO} from "../../interfaces/IHashesDAO.sol"; /// @title TrashBin /// @author Cooki.eth /// @notice This contract fulfils the role of being the buyer of last resort for ERC721 and ERC1155 NFTs. /// Any owner of an NFT that conforms to the ERC721 or ERC1155 token standards can sell their NFT /// to this contract in exchange for the specified sellPrice. This can be achieved by either /// safe transfering their NFT to this contract, or by granting the contract approval to transfer /// their NFT and executing the sell function. After an NFT has been sold to this contract /// anyone may purchase it from the contract in exchange for the buyPrice. Discounts on purchases /// of NFTs from this contract are available for Hashes NFT holders, with DAO hashes holders /// getting a higher discount than standard hash holders. contract TrashBin is Ownable, IERC721Receiver, IERC1155Receiver, ReentrancyGuard, Pausable { using SafeMath for uint256; ///////////// //Variables// ///////////// /// @notice A struct used to store all of the relevant information about an NFT sold to this contract. /// The information recorded is the collection address of the NFT, the token ID of the NFT, a /// boolean to distinguish between ERC721 and ERC1155 NFTs ("true" if it is an ERC721 and false /// if it is an ERC1155), and the block that the NFT was sold to the contract. struct nft { address collection; uint256 id; bool isERC721; uint256 blockSold; } /// @notice The array of NFT information used to store data about NFTs currently held by this contract. nft[] public nftStorage; /// @notice The base price, in wei, for a user to buy an NFT from this contract. uint256 public buyPrice; /// @notice The price, in wei, any user will receive for selling an NFT to this contract. uint256 public sellPrice; /// @notice The multiplier discount, in basis points, that a standard hashes NFT holder will receive /// when purchasing an NFT from this contract. uint256 public standardHashDiscount; /// @notice The multiplier discount, in basis points, that a DAO hashes NFT holder will receive when /// purchasing an NFT from this contract. uint256 public daoHashDiscount; /// @notice The time delay, in blocks, that must pass for an NFT to be buyable after it has been sold /// to this contract. This allows NFTs sent to the contract by mistake to be recoverable before /// being bought. uint256 public buyableDelay; /// @notice The minimum balance, in wei, that the contract retains after the owner multi-sig withdraws /// ETH that has been earned by the contract. uint256 public minEthBalance; /// @notice The maximum balance, in wei, that the contract retains after purchases are made from the /// the contract. If the max balance is exceeded, the ETH will automatically be withdrawn via /// a buy. uint256 public maxEthBalance; /// @notice The percentage, in basis points, of profits retained by the owner multi-sig. uint256 public ethPercentageToOwner; /// @notice The Hashes NFT collection address. IHashes public hashes; /// @notice The Hashes DAO contract address. IHashesDAO public hashesDAO; ////////// //Events// ////////// /// @notice The total amount of ETH withdrawn when the withdrawETH function is called. event WithdrawETH(uint256 indexed _amountWithdrawn); /// @notice Details emitted following a removal of an NFT from the contract. These are the collection address and /// the token id. event RemoveNFT(address indexed _collection, uint256 indexed _id); /// @notice Details emitted following a removal of an ERC721 from the contract via the failsafe function withdrawERC721. /// These are the collection address and token id of the NFT. event WithdrawERC721(IERC721 indexed _collection, uint256 indexed _id); /// @notice Details emitted following a removal of an ERC1155 from the contract via the failsafe function withdrawERC1155. /// These are the collection address, token id, and amount transferred of the NFT. event WithdrawERC1155(IERC1155 indexed _collection, uint256 indexed _id, uint256 indexed _amount); /// @notice Details emitted following a removal of an ERC20 from the contract via the failsafe function withdrawERC20. /// These are the token address and amount of tokens. event WithdrawERC20(IERC20 indexed _token, uint256 indexed _amount); /// @notice Details emitted following a removal of an Index from the contract via the failsafe function deleteIndex. /// These are the collection address, token id. event DeleteIndex(address indexed _collection, uint256 indexed _id); /// @notice Details emitted following a settings update. These details are the name of the setting updated, the /// former value, and the new value after the update. event UpdatedSetting(string indexed _setting, uint256 indexed _old, uint256 indexed _new); /// @notice Details emitted following a purchase. These are the collection address, token id, and whether /// or not it was an ERC721 (_isERC721 = true) or an ERC1155 (_isERC721 = false) NFT. event Purchase(address indexed _collection, uint256 indexed _id, bool indexed _isERC721); /// @notice Details emitted following a sale. These are the collection address, token id, whether or not /// it was an ERC721 (_isERC721 = true) or an ERC1155 (_isERC721 = false) NFT, and the block number /// when the NFT was sold. event Sale(address indexed _collection, uint256 indexed _id, bool indexed _isERC721, uint256 _blockSold); ///////////////////////////// //Modifiers and Constructor// ///////////////////////////// /// @notice Unique modifier to only allow owner multi-sig or the Hashes DAO to execute the transfer ownership /// function. modifier onlyOwnerOrHashesDAO() { require( _msgSender() == owner() || _msgSender() == address(hashesDAO), "TrashBin: must be contract owner or Hashes DAO" ); _; } /// @notice Unique modifier to allow anyone to call when not paused and only the Owner to call a function when paused. modifier pausedOnlyOwner() { if (paused()) { _checkOwner(); } _; } /// @notice Constructor of the contract. Both the Hashes NFT, DAO contract, and owner addresses must be /// provided, while the other initial settings are defined. constructor(IHashes _hashes, IHashesDAO _hashesDAO, address _owner) { _transferOwnership(_owner); hashes = _hashes; hashesDAO = _hashesDAO; buyPrice = 0.02e18 wei; sellPrice = 100 wei; standardHashDiscount = 7500; daoHashDiscount = 2500; buyableDelay = 20000; minEthBalance = 0.001e18 wei; maxEthBalance = 0.1e18 wei; ethPercentageToOwner = 2000; } ///////////////////// //Primary Functions// ///////////////////// /// @notice This function allows anyone to purchase multiple NFTs that have been sold to this contract. If the /// contract owns more ETH than the maxEthBalance amount, an auto-withdraw of ETH will be triggered. /// @param indexes An array of indexes that correspond to the nftStorage array of NFTs that the purchaser /// wishes to purchase. The indexes in this array must be monotonically decreasing. /// @param hashId An array that allows the purchaser to enter a Hashes NFT ID that they own in order to receive /// a discount on their purchase. If this array is empty the purchaser will pay the full price. /// If this array has more than one entry, or if the Hashes NFT ID entered is not owned by the /// purchaser the function will not succeed. DAO Hashes NFT owners will receive the DAO hash /// discount while standard Hashes NFT owners will receive the standard hash discount. function buy(uint256[] memory indexes, uint256[] memory hashId) external payable whenNotPaused nonReentrant { require( msg.value >= (_getPriceWithHash(_msgSender(), hashId) * indexes.length), "TrashBin: insufficient ETH payment." ); require( indexes.length <= 100, "TrashBin: a maximum of 100 purchases per transaction." ); for (uint256 i = 0; i < indexes.length; i++) { require( indexes[i] < nftStorage.length, "TrashBin: index out of bounds." ); nft memory boughtNFT = nftStorage[indexes[i]]; require( block.number > (boughtNFT.blockSold + buyableDelay), "TrashBin: insufficient time has passed since sale of this NFT." ); if (boughtNFT.isERC721) { IERC721 collectionAddress = IERC721(boughtNFT.collection); collectionAddress.safeTransferFrom( address(this), _msgSender(), boughtNFT.id ); } else { IERC1155 collectionAddress = IERC1155(boughtNFT.collection); collectionAddress.safeTransferFrom( address(this), _msgSender(), boughtNFT.id, 1, "0x" ); } emit Purchase( boughtNFT.collection, boughtNFT.id, boughtNFT.isERC721 ); } for (uint256 j = 0; j < indexes.length; j++) { if (j > 0) { require( indexes[j - 1] > indexes[j], "Trashbin: indexes array provided is not monotonically decreasing." ); } nftStorage[indexes[j]] = nftStorage[(nftStorage.length - 1)]; nftStorage.pop(); } if (address(this).balance > maxEthBalance) { _withdrawETH(); } } /// @notice This function allows anyone to sell multiple NFTs (either ERC721 or ERC1155) to this contract. Each NFT /// will be sold for the same sell price defined by the sellPrice variable. While the NFTs do not all have to be /// from the same collection, approval for each NFT must be granted to this contract in order for the user to /// sell the NFTs. The collection array, tokenIds array, amounts array, and isERC721s array must be of the same /// length, and the relative index position of each must correspond. For instance: /// collection array = (NFT-A address, NFT-B address, NFT-C address) /// tokenIds array = (NFT-A token Id, NFT-B token Id, NFT-C token Id) /// amounts array = (NFT-A amount, NFT-B amount, NFT-C amount) /// isERC721s array = (NFT-A isERC721, NFT-B isERC721, NFT-C isERC721) /// @param collection An array of contract addresses for each of the NFTs to be sold. /// @param tokenIds An array of token Ids that corresponds to the collection array. /// @param amounts An array of the amounts of each token Id to be sold. When the NFT is an ERC721 the amount is /// inconsequential because each token Id only has one token associated with it. For ERC1155s however, /// the amount may be greater than 1, but should (in most cases) equal 1. /// @param isERC721s An array of boolean values specifying whether or not the collection is an ERC721 (true), or an /// an ERC1155 (false). function sell(address[] memory collection, uint256[] memory tokenIds, uint256[] memory amounts, bool[] memory isERC721s) external { require( (collection.length == tokenIds.length) && (tokenIds.length == amounts.length) && (amounts.length == isERC721s.length), "TrashBin: All arrays must be the same length." ); require( collection.length <= 100, "TrashBin: a maximum of 100 collections per transaction." ); for (uint256 i = 0; i < tokenIds.length; i++) { if (isERC721s[i]) { IERC721 nftCollection = IERC721(collection[i]); require( (nftCollection.getApproved(tokenIds[i]) == address(this) || nftCollection.isApprovedForAll(_msgSender(), address(this))), "TrashBin: TrashBin is not approved to transfer ERC721 NFT." ); nftCollection.safeTransferFrom( _msgSender(), address(this), tokenIds[i] ); } else { require( amounts[i] <= 100, "TrashBin: a maximum of 100 sales per collection." ); IERC1155 nftCollection = IERC1155(collection[i]); require( nftCollection.isApprovedForAll(_msgSender(), address(this)), "TrashBin: TrashBin is not approved to transfer ERC1155 NFTs." ); nftCollection.safeTransferFrom( _msgSender(), address(this), tokenIds[i], amounts[i], "0x" ); } } } /// @notice This function allows anymore to withdraw the revenue from this contract and distribute it to the /// Hashes DAO and owner multi-sig. The owner multi-sig will receive their percentage of the revenue /// in accordance with the ethPercentage variable and the remaining will be distributed to the Hashes /// DAO. A minimum amount of ETH, as defined by the minETHBalance variable, will remain in the contract. function withdrawETH() external pausedOnlyOwner nonReentrant { _withdrawETH(); } /// @notice This function allows DAO Hashes holders to remove an NFT for sale and send the NFT to the owner /// multi-sig. This allows valuable NFTs accidently sent to the contract to be easily removed from sale /// during the buyable delay period. /// @param index The index of the NFT in the nftStorage array to be removed. /// @param hashId The hashes NFT ID used to verify ownership of a DAO hash. function removeNFT(uint256 index, uint256 hashId) external whenNotPaused nonReentrant { require(index < nftStorage.length, "TrashBin: index out of bounds."); require( hashes.ownerOf(hashId) == msg.sender, "TrashBin: message sender does not own the Hashes NFT provided." ); require( (hashId < hashes.governanceCap()) && !hashes.deactivated(hashId), "TrashBin: Hashes NFT Id provided is not a DAO NFT." ); nft memory removedNFT = nftStorage[index]; nftStorage[index] = nftStorage[(nftStorage.length - 1)]; nftStorage.pop(); if (removedNFT.isERC721) { IERC721 collectionAddress = IERC721(removedNFT.collection); collectionAddress.safeTransferFrom( address(this), owner(), removedNFT.id ); } else { IERC1155 collectionAddress = IERC1155(removedNFT.collection); collectionAddress.safeTransferFrom( address(this), owner(), removedNFT.id, 1, "0x" ); } emit RemoveNFT(removedNFT.collection, removedNFT.id); } /// @notice This function allows for an easy way of seeing the number of NFTs held for sale by this contract. /// @return uint256 The length of the nftStorage array. function nftStorageLength() external view returns (uint256) { return nftStorage.length; } /// @notice This function allows for an easy way of seeing if an NFT (determined via an index) is available to buy. /// @param index An index in the nftStroage array. /// @return bool A boolean of whether or not the NFT is available to be bought. function isNFTAvailableToBuy(uint256 index) external view returns (bool) { require( index < nftStorage.length, "TrashBin: index out of bounds." ); require( paused() == false, "TrashBin: paused." ); return (block.number > (nftStorage[index].blockSold + buyableDelay)) ? true : false; } /// @notice This function allows for users to find the index of an NFT held by this contract. The user provides the /// collection address, NFT id, and starting index and the function will test up to 1000 nfts in the nftStorage /// array to find it's location index. /// @param collection The contract address of the NFT to be located. /// @param id The id of NFT to be located. /// @param startingIndex An index in the nftStorage array to begin searching. /// @return uint256 The index of the nft in the nftStorage array function getNFTStorageIndex(address collection, uint256 id, uint256 startingIndex) external view returns (uint256) { require( startingIndex < nftStorage.length, "TrashBin: starting index out of bounds." ); uint256 index = startingIndex; while ((index < nftStorage.length) && (index < (startingIndex + 1000))) { if ((nftStorage[index].collection == collection) && (nftStorage[index].id == id)) { return index; } index++; } revert("NFT index not located. Check that the collection and id values are correct, and/or choose a different starting index."); } ////////////////////// //Failsafe Functions// ////////////////////// /// @notice The function allows the owner multi-sig to retrieve any ERC721 NFTs incorrectly sent to the contract. /// @param collection The ERC721 collection address. /// @param id The token id of the NFT. function withdrawERC721(IERC721 collection, uint256 id) external onlyOwner { collection.safeTransferFrom(address(this), owner(), id); emit WithdrawERC721(collection, id); } /// @notice The function allows the owner multi-sig to retrieve any ERC1155 NFTs or tokens incorrectly sent to the contract. /// @param collection The ERC1155 collection address. /// @param id The token id of the NFT or token. /// @param amount The amount of tokens to be retrieved. function withdrawERC1155(IERC1155 collection, uint256 id, uint256 amount) external onlyOwner { collection.safeTransferFrom(address(this), owner(), id, amount, "0x"); emit WithdrawERC1155(collection, id, amount); } /// @notice The function allows the owner multi-sig to retrieve any ERC20 tokens incorrectly sent to the contract. /// @param token The ERC20 token address. /// @param amount The amount of tokens to be retrieved. function withdrawERC20(IERC20 token, uint256 amount) external onlyOwner { token.transfer(owner(), amount); emit WithdrawERC20(token, amount); } /// @notice The function allows the owner multi-sig to delete an array of indexes from the nftStorage array. Ideally, this /// function will never be needed, but in the event that an NFT is incorrectly withdrawn and a nftStorage /// array entry persists this function can be used to remove the unnecessary index. The indexes array provided /// must be monotonically decreasing. /// @param indexes The index array to be deleted. It must be monotonically decreasing. function deleteIndexes(uint256[] memory indexes) external onlyOwner { for (uint256 j = 0; j < indexes.length; j++) { require(indexes[j] < nftStorage.length, "TrashBin: index out of bounds."); if (j > 0) { require( indexes[j - 1] > indexes[j], "Trashbin: indexes array provided is not monotonically decreasing." ); } nft memory correspondingData = nftStorage[indexes[j]]; nftStorage[indexes[j]] = nftStorage[(nftStorage.length - 1)]; nftStorage.pop(); emit DeleteIndex(correspondingData.collection, correspondingData.id); } } ///////////////////////////////// //Lower Level Primary Functions// ///////////////////////////////// function _sellERC721(address collection, uint256 tokenId) internal whenNotPaused nonReentrant { nft memory newSale = nft(collection, tokenId, true, block.number); nftStorage.push(newSale); emit Sale(collection, tokenId, true, block.number); } function _sellERC1155(address collection, uint256 tokenId) internal whenNotPaused nonReentrant { nft memory newSale = nft(collection, tokenId, false, block.number); nftStorage.push(newSale); emit Sale(collection, tokenId, false, block.number); } function _getPriceWithHash(address buyer, uint256[] memory hashesId) internal view returns (uint256) { if (hashesId.length == 0) { return buyPrice; } require( hashesId.length == 1, "TrashBin: more than one Hashes NFT provided." ); require( hashes.ownerOf(hashesId[0]) == buyer, "TrashBin: buyer does not own hashes NFT provided." ); if ((hashesId[0] < hashes.governanceCap()) && !hashes.deactivated(hashesId[0])) { if (daoHashDiscount == 0) { return 0; } return ((buyPrice * daoHashDiscount) / 10000); } if (standardHashDiscount == 0) { return 0; } return ((buyPrice * standardHashDiscount) / 10000); } function _withdrawETH() internal { uint256 balance = address(this).balance; require( balance > minEthBalance, "TrashBin: contract balance is less than minimum balance amount." ); uint256 totalWithdrawAmount = balance - minEthBalance; uint256 ownerFee = 0; if (ethPercentageToOwner > 0) { ownerFee = (totalWithdrawAmount * ethPercentageToOwner) / 10000; (bool success, ) = (owner()).call{value: ownerFee * 1 wei}(""); require(success, "TrashBin: transfer to owner failed."); } uint256 hashesFee = totalWithdrawAmount - ownerFee; (bool success0, ) = (address(hashesDAO)).call{value: hashesFee * 1 wei}(""); require(success0, "TrashBin: transfer to Hashes failed."); emit WithdrawETH(totalWithdrawAmount); } ////////////////////// //Settings Functions// ////////////////////// /// @notice This function allows the owner to pause or unpause the core functionality of the contract. /// The functions that will be paused/unpaused are the function togglePause() external onlyOwner { paused() ? _unpause() : _pause(); } /// @notice This function allows the multi-sig owner to update all of the settings in a single transaction. /// @param newBuyPrice The updated purchase price of an NFT (in wei). /// @param newSellPrice The updated sale price of an NFT (in wei). /// @param newStandardHashDiscount The updated standard hash discount for purchases (in basis points). /// @param newDaoHashDiscount The updated DAO hash discount for purchases (in basis points). /// @param newBuyableDelay The updated buyable delay after an NFT sale for purchases (in blocks). /// @param newMinEthBalance The updated minimum ETH balance that this contract retains after ETH withdrawals (in wei). /// @param newMaxEthBalance The updated maximum ETH balance that this contract retains before ETH withdrawals (in wei). /// @param newEthPercentageToOwner The updated ETH percentage of revenue that is distributed to the owner multi-sig (in basis points). function updateAllSettings( uint256 newBuyPrice, uint256 newSellPrice, uint256 newStandardHashDiscount, uint256 newDaoHashDiscount, uint256 newBuyableDelay, uint256 newMinEthBalance, uint256 newMaxEthBalance, uint256 newEthPercentageToOwner ) external onlyOwner { _updateBuyPrice(newBuyPrice); _updateSellPrice(newSellPrice); _updateStandardHashDiscount(newStandardHashDiscount); _updateDaoHashDiscount(newDaoHashDiscount); _updateBuyableDelay(newBuyableDelay); _updateMinEthBalance(newMinEthBalance); _updateMaxEthBalance(newMaxEthBalance); _updateEthPercentageToOwner(newEthPercentageToOwner); } /// @notice This function allows the owner to change the buyPrice variable for each NFT purchase. /// @param newBuyPrice The updated buy price in wei. function updateBuyPrice(uint256 newBuyPrice) external onlyOwner { _updateBuyPrice(newBuyPrice); } /// @notice This function allows the owner to change the sellPrice variable for each NFT sale. /// @param newSellPrice The updated sell price in wei. function updateSellPrice(uint256 newSellPrice) external onlyOwner { _updateSellPrice(newSellPrice); } /// @notice This function allows the owner to change the standard Hashes NFT discount variable for each NFT sale. /// @param newStandardHashDiscount The updated discount multiplier in basis points. function updateStandardHashDiscount(uint256 newStandardHashDiscount) external onlyOwner { _updateStandardHashDiscount(newStandardHashDiscount); } /// @notice This function allows the owner to change the DAO Hashes NFT discount variable for each NFT sale. /// @param newDaoHashDiscount The updated discount multiplier in basis points. function updateDaoHashDiscount(uint256 newDaoHashDiscount) external onlyOwner { _updateDaoHashDiscount(newDaoHashDiscount); } /// @notice This function allows the owner to change the Buyable Delay variable after each NFT sale. /// @param newBuyableDelay The updated buyable delay in blocks. function updateBuyableDelay(uint256 newBuyableDelay) external onlyOwner { _updateBuyableDelay(newBuyableDelay); } /// @notice This function allows the owner to change the minETHBalance variable for this contract. /// @param newMinEthBalance The updated minimum ETH balance in wei. function updateMinEthBalance(uint256 newMinEthBalance) external onlyOwner { _updateMinEthBalance(newMinEthBalance); } /// @notice This function allows the owner to change the maxETHBalance variable for this contract. /// @param newMaxEthBalance The updated maximum ETH balance in wei. function updateMaxEthBalance(uint256 newMaxEthBalance) external onlyOwner { _updateMaxEthBalance(newMaxEthBalance); } /// @notice This function allows the owner to change the percentage of ETH revenue they receive when ETH is withdrawn /// from the contract. /// @param newEthPercentageToOwner The updated owner percentage variable in basis points. function updateEthPercentageToOwner(uint256 newEthPercentageToOwner) external onlyOwner { _updateEthPercentageToOwner(newEthPercentageToOwner); } ////////////////////////////////// //Lower Level Settings Functions// ////////////////////////////////// function _updateBuyPrice(uint256 newBuyPrice) internal { require( (newBuyPrice >= 1000000000000) && (newBuyPrice <= 1e18), "TrashBin: newBuyPrice not within the lower and upper bounds." ); uint256 oldBuyPrice = buyPrice; buyPrice = newBuyPrice * 1 wei; emit UpdatedSetting("buyPrice", oldBuyPrice, newBuyPrice); } function _updateSellPrice(uint256 newSellPrice) internal { require( (newSellPrice >= 1) && (newSellPrice <= 1000000000), "TrashBin: newSellPrice not within the lower and upper bounds." ); uint256 oldSellPrice = sellPrice; sellPrice = newSellPrice * 1 wei; emit UpdatedSetting("sellPrice", oldSellPrice, newSellPrice); } function _updateStandardHashDiscount(uint256 newStandardHashDiscount) internal { require( newStandardHashDiscount <= 10000, "TrashBin: updated Standard Hash Discount may not exceed 100%." ); uint256 oldStandardHashDiscount = standardHashDiscount; standardHashDiscount = newStandardHashDiscount; emit UpdatedSetting("standardHashDiscount", oldStandardHashDiscount, newStandardHashDiscount); } function _updateDaoHashDiscount(uint256 newDaoHashDiscount) internal { require( newDaoHashDiscount <= 10000, "TrashBin: updated DAO Hash Discount may not exceed 100%." ); uint256 oldDaoHashDiscount = daoHashDiscount; daoHashDiscount = newDaoHashDiscount; emit UpdatedSetting("daoHashDiscount", oldDaoHashDiscount, newDaoHashDiscount); } function _updateBuyableDelay(uint256 newBuyableDelay) internal { require( (newBuyableDelay >= 10) && (newBuyableDelay <= 100000), "TrashBin: newBuyableDelay not within the lower and upper bounds." ); uint256 oldBuyableDelay = buyableDelay; buyableDelay = newBuyableDelay; emit UpdatedSetting("buyableDelay", oldBuyableDelay, newBuyableDelay); } function _updateMinEthBalance(uint256 newMinEthBalance) internal { require( newMinEthBalance <= 0.1e18, "TrashBin: newMinEthBalance may not exceed 0.1ETH." ); uint256 oldMinEthBalance = minEthBalance; minEthBalance = newMinEthBalance * 1 wei; emit UpdatedSetting("minEthBalance", oldMinEthBalance, newMinEthBalance); } function _updateMaxEthBalance(uint256 newMaxEthBalance) internal { require( (newMaxEthBalance >= 1000000000000) && (newMaxEthBalance <= 1e18), "TrashBin: newMaxEthBalance not within the lower and upper bounds." ); uint256 oldMaxEthBalance = maxEthBalance; maxEthBalance = newMaxEthBalance * 1 wei; emit UpdatedSetting("maxEthBalance", oldMaxEthBalance, newMaxEthBalance); } function _updateEthPercentageToOwner(uint256 newEthPercentageToOwner) internal { require( newEthPercentageToOwner <= 10000, "TrashBin: updated ETH percentage may not exceed 100%." ); uint256 oldEthPercentage = ethPercentageToOwner; ethPercentageToOwner = newEthPercentageToOwner; emit UpdatedSetting("ethPercentageToOwner", oldEthPercentage, newEthPercentageToOwner); } ///////////////////// //Receive Functions// ///////////////////// receive() external payable {} function onERC721Received( address, address from, uint256 tokenId, bytes calldata ) external override returns (bytes4) { address collection = msg.sender; require( IERC721(collection).ownerOf(tokenId) == address(this), "TrashBin: transfer to TrashBin failed." ); _sellERC721(collection, tokenId); (bool success, ) = (from).call{value: sellPrice}(""); require(success, "TrashBin: sale to depositor failed."); return this.onERC721Received.selector; } function onERC1155Received( address, address from, uint256 id, uint256 value, bytes calldata ) external override returns (bytes4) { address collection = msg.sender; require( IERC1155(collection).balanceOf(address(this), id) >= value, "TrashBin: transfer to TrashBin failed." ); require( value <= 100, "TrashBin: a maximum of 100 NFTs per transaction." ); for (uint256 i = 0; i < value; i++) { _sellERC1155(collection, id); } (bool success, ) = (from).call{value: sellPrice}(""); require(success, "TrashBin: sale to depositor failed."); return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata ) external override returns (bytes4) { address collection = msg.sender; require( ids.length <= 100, "TrashBin: a maximum of 100 NFT ids per transaction." ); for (uint256 i = 0; i < ids.length; i++) { require( IERC1155(collection).balanceOf(address(this), ids[i]) >= values[i], "TrashBin: transfer to TrashBin failed." ); require( values[i] <= 100, "TrashBin: a maximum of 100 NFTs per id." ); for (uint256 j = 0; j < values[i]; j++) { _sellERC1155(collection, ids[i]); } } (bool success, ) = (from).call{value: (sellPrice * ids.length)}(""); require(success, "TrashBin: sale to depositor failed."); return this.onERC1155BatchReceived.selector; } ////////////////////// //Ownership Function// ////////////////////// function transferOwnership(address newOwner) public virtual override onlyOwnerOrHashesDAO { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _transferOwnership(newOwner); } ///////////////////////////// //ERC165 Interface Function// ///////////////////////////// function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { if ( (interfaceId == type(Ownable).interfaceId) || (interfaceId == type(Pausable).interfaceId) || (interfaceId == type(IERC721Receiver).interfaceId) || (interfaceId == type(IERC1155Receiver).interfaceId) || (interfaceId == type(ReentrancyGuard).interfaceId) ) { return true; } else { return false; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import { IERC721Enumerable } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; interface IHashes is IERC721Enumerable { function deactivateTokens( address _owner, uint256 _proposalId, bytes memory _signature ) external returns (uint256); function deactivated(uint256 _tokenId) external view returns (bool); function activationFee() external view returns (uint256); function verify( uint256 _tokenId, address _minter, string memory _phrase ) external view returns (bool); function getHash(uint256 _tokenId) external view returns (bytes32); function getPriorVotes(address account, uint256 blockNumber) external view returns (uint256); function governanceCap() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; interface IHashesDAO { enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } struct Receipt { bool hasVoted; bool support; uint256 votes; } function propose( address[] memory _targets, uint256[] memory _values, string[] memory _signatures, bytes[] memory _calldatas, string memory _description ) external returns (uint128); function queue(uint128 _proposalId) external; function execute(uint128 _proposalId) external payable; function cancel(uint128 _proposalId) external; function castVote( uint128 _proposalId, bool _support, bool _deactivate, bytes memory _deactivateSignature ) external; function castVoteBySig( uint128 _proposalId, bool _support, bool _deactivate, bytes memory _deactivateSignature, bytes memory _signature ) external; function veto(uint128 _proposalId, bytes[] memory _signatures) external; function deactivateAuthorities(bytes[] memory _signatures, address[] memory _authorities) external; function getActions(uint128 _proposalId) external view; function getAuthorityStatus(address _authority) external view returns (bool); function getReceipt(uint128 _proposalId, address _voter) external view returns (Receipt memory); function getProposal(uint128 _proposalId) external view; function getIsQueuedTransaction(bytes32 _txHash) external view returns (bool); function getProposalCount() external view returns (uint128); function getLatestProposalId(address _proposer) external view returns (uint128); function state(uint128 _proposalId) external view returns (ProposalState); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IHashes","name":"_hashes","type":"address"},{"internalType":"contract IHashesDAO","name":"_hashesDAO","type":"address"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"DeleteIndex","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":true,"internalType":"bool","name":"_isERC721","type":"bool"}],"name":"Purchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"RemoveNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":true,"internalType":"bool","name":"_isERC721","type":"bool"},{"indexed":false,"internalType":"uint256","name":"_blockSold","type":"uint256"}],"name":"Sale","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"_setting","type":"string"},{"indexed":true,"internalType":"uint256","name":"_old","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_new","type":"uint256"}],"name":"UpdatedSetting","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC1155","name":"_collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WithdrawERC1155","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"_token","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"WithdrawERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC721","name":"_collection","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"WithdrawERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"_amountWithdrawn","type":"uint256"}],"name":"WithdrawETH","type":"event"},{"inputs":[{"internalType":"uint256[]","name":"indexes","type":"uint256[]"},{"internalType":"uint256[]","name":"hashId","type":"uint256[]"}],"name":"buy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"buyPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buyableDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"daoHashDiscount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"indexes","type":"uint256[]"}],"name":"deleteIndexes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ethPercentageToOwner","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"startingIndex","type":"uint256"}],"name":"getNFTStorageIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hashes","outputs":[{"internalType":"contract IHashes","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hashesDAO","outputs":[{"internalType":"contract IHashesDAO","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isNFTAvailableToBuy","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxEthBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minEthBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"nftStorage","outputs":[{"internalType":"address","name":"collection","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bool","name":"isERC721","type":"bool"},{"internalType":"uint256","name":"blockSold","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nftStorageLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"hashId","type":"uint256"}],"name":"removeNFT","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"collection","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bool[]","name":"isERC721s","type":"bool[]"}],"name":"sell","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sellPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"standardHashDiscount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"togglePause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBuyPrice","type":"uint256"},{"internalType":"uint256","name":"newSellPrice","type":"uint256"},{"internalType":"uint256","name":"newStandardHashDiscount","type":"uint256"},{"internalType":"uint256","name":"newDaoHashDiscount","type":"uint256"},{"internalType":"uint256","name":"newBuyableDelay","type":"uint256"},{"internalType":"uint256","name":"newMinEthBalance","type":"uint256"},{"internalType":"uint256","name":"newMaxEthBalance","type":"uint256"},{"internalType":"uint256","name":"newEthPercentageToOwner","type":"uint256"}],"name":"updateAllSettings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBuyPrice","type":"uint256"}],"name":"updateBuyPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBuyableDelay","type":"uint256"}],"name":"updateBuyableDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newDaoHashDiscount","type":"uint256"}],"name":"updateDaoHashDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newEthPercentageToOwner","type":"uint256"}],"name":"updateEthPercentageToOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxEthBalance","type":"uint256"}],"name":"updateMaxEthBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMinEthBalance","type":"uint256"}],"name":"updateMinEthBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newSellPrice","type":"uint256"}],"name":"updateSellPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStandardHashDiscount","type":"uint256"}],"name":"updateStandardHashDiscount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC1155","name":"collection","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC721","name":"collection","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"withdrawERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200424438038062004244833981016040819052620000349162000133565b6200003f33620000ca565b600180556002805460ff191690556200005881620000ca565b50600c80546001600160a01b039384166001600160a01b031991821617909155600d805492909316911617905566470de4df8200006004556064600555611d4c6006556109c4600755614e2060085566038d7ea4c6800060095567016345785d8a0000600a556107d0600b5562000187565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200013057600080fd5b50565b6000806000606084860312156200014957600080fd5b835162000156816200011a565b602085015190935062000169816200011a565b60408501519092506200017c816200011a565b809150509250925092565b6140ad80620001976000396000f3fe60806040526004361061023f5760003560e01c80638da5cb5b1161012e578063c4ae3168116100ab578063e876adaa1161006f578063e876adaa1461069e578063f23a6e61146106be578063f2fde38b146106de578063f3e414f8146106fe578063fe658ee21461071e57600080fd5b8063c4ae3168146105f9578063cc0c73a21461060e578063dae7f6fd1461065e578063e086e5ec14610674578063e7d595dd1461068957600080fd5b8063ab7d6cbc116100f2578063ab7d6cbc1461056d578063b5a791df14610583578063b6318d11146105a3578063bc197c81146105c3578063bf8f2b60146105e357600080fd5b80638da5cb5b146104d9578063960ed402146104f7578063a1db97821461050d578063a40139341461052d578063a81d9bcc1461054d57600080fd5b80635ae8a9f5116101bc57806374eea9481161018057806374eea94814610457578063777525d51461046d5780637bafc8f11461048d5780637fb0fe7a146104ad5780638620410b146104c357600080fd5b80635ae8a9f5146103ca5780635c975abb146103ea57806363f917d614610402578063715018a614610422578063738d3e551461043757600080fd5b806339ead7201161020357806339ead720146103345780634b750334146103545780634d8d64dd1461036a578063543158171461038a578063553602ea146103aa57600080fd5b806301ffc9a71461024b5780630f6dbbcb14610280578063150b7a02146102b8578063335bf2bd146102f157806336cb4d961461031f57600080fd5b3661024657005b600080fd5b34801561025757600080fd5b5061026b610266366004613728565b61073e565b60405190151581526020015b60405180910390f35b34801561028c57600080fd5b50600d546102a0906001600160a01b031681565b6040516001600160a01b039091168152602001610277565b3480156102c457600080fd5b506102d86102d33660046137b0565b6107cd565b6040516001600160e01b03199091168152602001610277565b3480156102fd57600080fd5b5061031161030c366004613823565b6108f3565b604051908152602001610277565b61033261032d36600461392e565b610ab7565b005b34801561034057600080fd5b5061033261034f366004613823565b610ff3565b34801561036057600080fd5b5061031160055481565b34801561037657600080fd5b50610332610385366004613992565b6110ad565b34801561039657600080fd5b506103326103a5366004613a41565b61133d565b3480156103b657600080fd5b506103326103c5366004613b4c565b6118da565b3480156103d657600080fd5b5061026b6103e5366004613b4c565b6118ee565b3480156103f657600080fd5b5060025460ff1661026b565b34801561040e57600080fd5b5061033261041d366004613b4c565b6119a1565b34801561042e57600080fd5b506103326119b2565b34801561044357600080fd5b50610332610452366004613b65565b6119c6565b34801561046357600080fd5b50610311600a5481565b34801561047957600080fd5b50610332610488366004613b4c565b611a20565b34801561049957600080fd5b506103326104a8366004613b4c565b611a31565b3480156104b957600080fd5b50610311600b5481565b3480156104cf57600080fd5b5061031160045481565b3480156104e557600080fd5b506000546001600160a01b03166102a0565b34801561050357600080fd5b5061031160085481565b34801561051957600080fd5b50610332610528366004613bba565b611a42565b34801561053957600080fd5b50610332610548366004613b4c565b611b17565b34801561055957600080fd5b50600c546102a0906001600160a01b031681565b34801561057957600080fd5b5061031160095481565b34801561058f57600080fd5b5061033261059e366004613b4c565b611b28565b3480156105af57600080fd5b506103326105be366004613b4c565b611b39565b3480156105cf57600080fd5b506102d86105de366004613c2b565b611b4a565b3480156105ef57600080fd5b5061031160065481565b34801561060557600080fd5b50610332611e0c565b34801561061a57600080fd5b5061062e610629366004613b4c565b611e2e565b604080516001600160a01b0390951685526020850193909352901515918301919091526060820152608001610277565b34801561066a57600080fd5b5061031160075481565b34801561068057600080fd5b50610332611e75565b34801561069557600080fd5b50600354610311565b3480156106aa57600080fd5b506103326106b9366004613b4c565b611ebd565b3480156106ca57600080fd5b506102d86106d9366004613cea565b611ece565b3480156106ea57600080fd5b506103326106f9366004613d66565b612070565b34801561070a57600080fd5b50610332610719366004613bba565b61216d565b34801561072a57600080fd5b50610332610739366004613d83565b612222565b60006001600160e01b03198216630704183b60e11b148061076f57506001600160e01b03198216635c975abb60e01b145b8061078a57506001600160e01b03198216630a85bd0160e11b145b806107a557506001600160e01b03198216630271189760e51b145b806107b857506001600160e01b03198216155b156107c557506001919050565b506000919050565b6040516331a9108f60e11b815260048101849052600090339030908290636352211e90602401602060405180830381865afa158015610810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108349190613da5565b6001600160a01b0316146108635760405162461bcd60e51b815260040161085a90613dc2565b60405180910390fd5b61086d8186612751565b6005546040516000916001600160a01b038916918381818185875af1925050503d80600081146108b9576040519150601f19603f3d011682016040523d82523d6000602084013e6108be565b606091505b50509050806108df5760405162461bcd60e51b815260040161085a90613e08565b50630a85bd0160e11b979650505050505050565b60035460009082106109575760405162461bcd60e51b815260206004820152602760248201527f547261736842696e3a207374617274696e6720696e646578206f7574206f66206044820152663137bab732399760c91b606482015260840161085a565b815b600354811080156109745750610971836103e8613e61565b81105b156109fe57846001600160a01b03166003828154811061099657610996613e74565b60009182526020909120600490910201546001600160a01b03161480156109e0575083600382815481106109cc576109cc613e74565b906000526020600020906004020160010154145b156109ec579050610ab0565b806109f681613e8a565b915050610959565b60405162461bcd60e51b815260206004820152607560248201527f4e465420696e646578206e6f74206c6f63617465642e20436865636b2074686160448201527f742074686520636f6c6c656374696f6e20616e642069642076616c756573206160648201527f726520636f72726563742c20616e642f6f722063686f6f73652061206469666660848201527432b932b73a1039ba30b93a34b7339034b73232bc1760591b60a482015260c40161085a565b9392505050565b610abf6128c2565b600260015403610ae15760405162461bcd60e51b815260040161085a90613ea3565b60026001558151610af23383612908565b610afc9190613eda565b341015610b575760405162461bcd60e51b815260206004820152602360248201527f547261736842696e3a20696e73756666696369656e7420455448207061796d65604482015262373a1760e91b606482015260840161085a565b606482511115610bc75760405162461bcd60e51b815260206004820152603560248201527f547261736842696e3a2061206d6178696d756d206f662031303020707572636860448201527430b9b2b9903832b9103a3930b739b0b1ba34b7b71760591b606482015260840161085a565b60005b8251811015610e50576003548351849083908110610bea57610bea613e74565b602002602001015110610c0f5760405162461bcd60e51b815260040161085a90613ef1565b60006003848381518110610c2557610c25613e74565b602002602001015181548110610c3d57610c3d613e74565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015460ff1615159082015260039091015460608201819052600854919250610c9e9190613e61565b4311610d125760405162461bcd60e51b815260206004820152603e60248201527f547261736842696e3a20696e73756666696369656e742074696d65206861732060448201527f7061737365642073696e63652073616c65206f662074686973204e46542e0000606482015260840161085a565b806040015115610d8a5780516020820151604051632142170760e11b81526001600160a01b038316916342842e0e91610d52913091339190600401613f28565b600060405180830381600087803b158015610d6c57600080fd5b505af1158015610d80573d6000803e3d6000fd5b5050505050610df7565b80516020820151604051637921219560e11b81526001600160a01b0383169163f242432a91610dc3913091339190600190600401613f4c565b600060405180830381600087803b158015610ddd57600080fd5b505af1158015610df1573d6000803e3d6000fd5b50505050505b80604001511515816020015182600001516001600160a01b03167f1d61142c2c6c7bca70470912f4bb5e385638b745dd1da048b6f9bb4c3ee3500560405160405180910390a45080610e4881613e8a565b915050610bca565b5060005b8251811015610fd8578015610ec057828181518110610e7557610e75613e74565b602002602001015183600183610e8b9190613f8f565b81518110610e9b57610e9b613e74565b602002602001015111610ec05760405162461bcd60e51b815260040161085a90613fa2565b60038054610ed090600190613f8f565b81548110610ee057610ee0613e74565b90600052602060002090600402016003848381518110610f0257610f02613e74565b602002602001015181548110610f1a57610f1a613e74565b60009182526020909120825460049092020180546001600160a01b0319166001600160a01b0390921691909117815560018083015490820155600280830154908201805460ff909216151560ff1990921691909117905560039182015490820155805480610f8a57610f8a614009565b60008281526020812060046000199093019283020180546001600160a01b03191681556001810182905560028101805460ff1916905560030155905580610fd081613e8a565b915050610e54565b50600a54471115610feb57610feb612c18565b505060018055565b610ffb612e8d565b826001600160a01b031663f242432a3061101d6000546001600160a01b031690565b85856040518563ffffffff1660e01b815260040161103e9493929190613f4c565b600060405180830381600087803b15801561105857600080fd5b505af115801561106c573d6000803e3d6000fd5b505050508082846001600160a01b03167f833b472e001ec96e313d7cdf1971af11d9432698050462ed2f2df7e3370cd81b60405160405180910390a4505050565b6110b5612e8d565b60005b81518110156113395760035482518390839081106110d8576110d8613e74565b6020026020010151106110fd5760405162461bcd60e51b815260040161085a90613ef1565b80156111605781818151811061111557611115613e74565b60200260200101518260018361112b9190613f8f565b8151811061113b5761113b613e74565b6020026020010151116111605760405162461bcd60e51b815260040161085a90613fa2565b6000600383838151811061117657611176613e74565b60200260200101518154811061118e5761118e613e74565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018082015494840194909452600281015460ff1615159183019190915260039081015460608301528054919350916111f091613f8f565b8154811061120057611200613e74565b9060005260206000209060040201600384848151811061122257611222613e74565b60200260200101518154811061123a5761123a613e74565b60009182526020909120825460049092020180546001600160a01b0319166001600160a01b0390921691909117815560018083015490820155600280830154908201805460ff909216151560ff19909216919091179055600391820154908201558054806112aa576112aa614009565b6000828152602080822060046000199094019384020180546001600160a01b03191681556001810183905560028101805460ff1916905560030182905591909255820151825160405191926001600160a01b0391909116917fa704554c0202efdac33f094a98f655ebc38e3294c9c90d1213750210c79bd0ba9190a3508061133181613e8a565b9150506110b8565b5050565b8251845114801561134f575081518351145b801561135c575080518251145b6113be5760405162461bcd60e51b815260206004820152602d60248201527f547261736842696e3a20416c6c20617272617973206d7573742062652074686560448201526c1039b0b6b2903632b733ba341760991b606482015260840161085a565b6064845111156114365760405162461bcd60e51b815260206004820152603760248201527f547261736842696e3a2061206d6178696d756d206f662031303020636f6c6c6560448201527f6374696f6e7320706572207472616e73616374696f6e2e000000000000000000606482015260840161085a565b60005b83518110156118d35781818151811061145457611454613e74565b60200260200101511561169257600085828151811061147557611475613e74565b60200260200101519050306001600160a01b0316816001600160a01b031663081812fc8785815181106114aa576114aa613e74565b60200260200101516040518263ffffffff1660e01b81526004016114d091815260200190565b602060405180830381865afa1580156114ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115119190613da5565b6001600160a01b0316148061159f57506001600160a01b03811663e985e9c5336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa15801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f919061401f565b6116115760405162461bcd60e51b815260206004820152603a60248201527f547261736842696e3a20547261736842696e206973206e6f7420617070726f7660448201527f656420746f207472616e7366657220455243373231204e46542e000000000000606482015260840161085a565b6001600160a01b0381166342842e0e333088868151811061163457611634613e74565b60200260200101516040518463ffffffff1660e01b815260040161165a93929190613f28565b600060405180830381600087803b15801561167457600080fd5b505af1158015611688573d6000803e3d6000fd5b50505050506118c1565b60648382815181106116a6576116a6613e74565b602002602001015111156117155760405162461bcd60e51b815260206004820152603060248201527f547261736842696e3a2061206d6178696d756d206f66203130302073616c657360448201526f103832b91031b7b63632b1ba34b7b71760811b606482015260840161085a565b600085828151811061172957611729613e74565b60200260200101519050806001600160a01b031663e985e9c56117493390565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa158015611793573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b7919061401f565b6118295760405162461bcd60e51b815260206004820152603c60248201527f547261736842696e3a20547261736842696e206973206e6f7420617070726f7660448201527f656420746f207472616e736665722045524331313535204e4654732e00000000606482015260840161085a565b6001600160a01b03811663f242432a333088868151811061184c5761184c613e74565b602002602001015188878151811061186657611866613e74565b60200260200101516040518563ffffffff1660e01b815260040161188d9493929190613f4c565b600060405180830381600087803b1580156118a757600080fd5b505af11580156118bb573d6000803e3d6000fd5b50505050505b806118cb81613e8a565b915050611439565b5050505050565b6118e2612e8d565b6118eb81612ee7565b50565b60035460009082106119125760405162461bcd60e51b815260040161085a90613ef1565b60025460ff16156119595760405162461bcd60e51b81526020600482015260116024820152702a3930b9b42134b71d103830bab9b2b21760791b604482015260640161085a565b6008546003838154811061196f5761196f613e74565b90600052602060002090600402016003015461198b9190613e61565b431161199857600061199b565b60015b92915050565b6119a9612e8d565b6118eb81612fb8565b6119ba612e8d565b6119c4600061305c565b565b6119ce612e8d565b6119d7886130ac565b6119e087613169565b6119e98661321f565b6119f285612fb8565b6119fb846132c8565b611a0483613379565b611a0d8261341e565b611a1681612ee7565b5050505050505050565b611a28612e8d565b6118eb81613169565b611a39612e8d565b6118eb816130ac565b611a4a612e8d565b816001600160a01b031663a9059cbb611a6b6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015611ab8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adc919061401f565b5060405181906001600160a01b038416907fbe7426aee8a34d0263892b55ce65ce81d8f4c806eb4719e59015ea49feb92d2290600090a35050565b611b1f612e8d565b6118eb816132c8565b611b30612e8d565b6118eb8161341e565b611b41612e8d565b6118eb81613379565b6000336064871115611bba5760405162461bcd60e51b815260206004820152603360248201527f547261736842696e3a2061206d6178696d756d206f6620313030204e465420696044820152723239903832b9103a3930b739b0b1ba34b7b71760691b606482015260840161085a565b60005b87811015611d7657868682818110611bd757611bd7613e74565b90506020020135826001600160a01b031662fdd58e308c8c86818110611bff57611bff613e74565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401602060405180830381865afa158015611c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c75919061403c565b1015611c935760405162461bcd60e51b815260040161085a90613dc2565b6064878783818110611ca757611ca7613e74565b905060200201351115611d0c5760405162461bcd60e51b815260206004820152602760248201527f547261736842696e3a2061206d6178696d756d206f6620313030204e465473206044820152663832b91034b21760c91b606482015260840161085a565b60005b878783818110611d2157611d21613e74565b90506020020135811015611d6357611d51838b8b85818110611d4557611d45613e74565b905060200201356134ea565b80611d5b81613e8a565b915050611d0f565b5080611d6e81613e8a565b915050611bbd565b506005546000906001600160a01b038b1690611d93908a90613eda565b604051600081818185875af1925050503d8060008114611dcf576040519150601f19603f3d011682016040523d82523d6000602084013e611dd4565b606091505b5050905080611df55760405162461bcd60e51b815260040161085a90613e08565b5063bc197c8160e01b9a9950505050505050505050565b611e14612e8d565b60025460ff16611e26576119c461364c565b6119c46136a6565b60038181548110611e3e57600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b0390921693509160ff169084565b60025460ff1615611e8857611e88612e8d565b600260015403611eaa5760405162461bcd60e51b815260040161085a90613ea3565b6002600155611eb7612c18565b60018055565b611ec5612e8d565b6118eb8161321f565b604051627eeac760e11b81523060048201526024810185905260009033908590829062fdd58e90604401602060405180830381865afa158015611f15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f39919061403c565b1015611f575760405162461bcd60e51b815260040161085a90613dc2565b6064851115611fc15760405162461bcd60e51b815260206004820152603060248201527f547261736842696e3a2061206d6178696d756d206f6620313030204e4654732060448201526f3832b9103a3930b739b0b1ba34b7b71760811b606482015260840161085a565b60005b85811015611fe857611fd682886134ea565b80611fe081613e8a565b915050611fc4565b506005546040516000916001600160a01b038a16918381818185875af1925050503d8060008114612035576040519150601f19603f3d011682016040523d82523d6000602084013e61203a565b606091505b505090508061205b5760405162461bcd60e51b815260040161085a90613e08565b5063f23a6e6160e01b98975050505050505050565b6000546001600160a01b031633148061209c5750600d546001600160a01b0316336001600160a01b0316145b6120ff5760405162461bcd60e51b815260206004820152602e60248201527f547261736842696e3a206d75737420626520636f6e7472616374206f776e657260448201526d206f72204861736865732044414f60901b606482015260840161085a565b6001600160a01b0381166121645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161085a565b6118eb8161305c565b612175612e8d565b816001600160a01b03166342842e0e306121976000546001600160a01b031690565b846040518463ffffffff1660e01b81526004016121b693929190613f28565b600060405180830381600087803b1580156121d057600080fd5b505af11580156121e4573d6000803e3d6000fd5b50506040518392506001600160a01b03851691507fcc7d0949892410da9ebd78d838ca9ba1601b557ad34c4a6cb4b492c5996bd8df90600090a35050565b61222a6128c2565b60026001540361224c5760405162461bcd60e51b815260040161085a90613ea3565b600260015560035482106122725760405162461bcd60e51b815260040161085a90613ef1565b600c546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa1580156122bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122df9190613da5565b6001600160a01b03161461235b5760405162461bcd60e51b815260206004820152603e60248201527f547261736842696e3a206d6573736167652073656e64657220646f6573206e6f60448201527f74206f776e2074686520486173686573204e46542070726f76696465642e0000606482015260840161085a565b600c60009054906101000a90046001600160a01b03166001600160a01b031663b233b3896040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d2919061403c565b8110801561244a5750600c54604051632a266cdb60e21b8152600481018390526001600160a01b039091169063a899b36c90602401602060405180830381865afa158015612424573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612448919061401f565b155b6124b15760405162461bcd60e51b815260206004820152603260248201527f547261736842696e3a20486173686573204e46542049642070726f76696465646044820152711034b9903737ba1030902220a79027232a1760711b606482015260840161085a565b6000600383815481106124c6576124c6613e74565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018082015494840194909452600281015460ff16151591830191909152600390810154606083015280549193509161252891613f8f565b8154811061253857612538613e74565b90600052602060002090600402016003848154811061255957612559613e74565b60009182526020909120825460049092020180546001600160a01b0319166001600160a01b0390921691909117815560018083015490820155600280830154908201805460ff909216151560ff19909216919091179055600391820154908201558054806125c9576125c9614009565b60008281526020812060046000199093019283020180546001600160a01b03191681556001810182905560028101805460ff1916905560030155905560408101511561268e5780516001600160a01b0381166342842e0e306126336000546001600160a01b031690565b85602001516040518463ffffffff1660e01b815260040161265693929190613f28565b600060405180830381600087803b15801561267057600080fd5b505af1158015612684573d6000803e3d6000fd5b505050505061270c565b80516001600160a01b03811663f242432a306126b26000546001600160a01b031690565b856020015160016040518563ffffffff1660e01b81526004016126d89493929190613f4c565b600060405180830381600087803b1580156126f257600080fd5b505af1158015612706573d6000803e3d6000fd5b50505050505b602081015181516040516001600160a01b03909116907f5bed1be92baa67097fd78998bb163fa34dea76f33585504a916fcf3732692ef990600090a350506001805550565b6127596128c2565b60026001540361277b5760405162461bcd60e51b815260040161085a90613ea3565b60026001908155604080516080810182526001600160a01b038581168083526020808401878152848601878152436060870181815260038054808c01825560009190915288517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600490920291820180546001600160a01b031916919099161790975592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c87015590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d8601805460ff191691151591909117905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e9094019390935593519182529193928592917f6a36df4d550e5a2835c70bc386a1c388ee4f827ea50b4d356640c9c5c2e226df91015b60405180910390a450506001805550565b60025460ff16156119c45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161085a565b6000815160000361291c575060045461199b565b81516001146129825760405162461bcd60e51b815260206004820152602c60248201527f547261736842696e3a206d6f7265207468616e206f6e6520486173686573204e60448201526b232a10383937bb34b232b21760a11b606482015260840161085a565b600c5482516001600160a01b03808616921690636352211e9085906000906129ac576129ac613e74565b60200260200101516040518263ffffffff1660e01b81526004016129d291815260200190565b602060405180830381865afa1580156129ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a139190613da5565b6001600160a01b031614612a835760405162461bcd60e51b815260206004820152603160248201527f547261736842696e3a20627579657220646f6573206e6f74206f776e206861736044820152703432b99027232a10383937bb34b232b21760791b606482015260840161085a565b600c60009054906101000a90046001600160a01b03166001600160a01b031663b233b3896040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612afa919061403c565b82600081518110612b0d57612b0d613e74565b6020026020010151108015612bae5750600c5482516001600160a01b039091169063a899b36c908490600090612b4557612b45613e74565b60200260200101516040518263ffffffff1660e01b8152600401612b6b91815260200190565b602060405180830381865afa158015612b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bac919061401f565b155b15612be957600754600003612bc55750600061199b565b612710600754600454612bd89190613eda565b612be29190614055565b905061199b565b600654600003612bfb5750600061199b565b612710600654600454612c0e9190613eda565b610ab09190614055565b60095447908111612c915760405162461bcd60e51b815260206004820152603f60248201527f547261736842696e3a20636f6e74726163742062616c616e6365206973206c6560448201527f7373207468616e206d696e696d756d2062616c616e636520616d6f756e742e00606482015260840161085a565b600060095482612ca19190613f8f565b9050600080600b541115612d9457612710600b5483612cc09190613eda565b612cca9190614055565b90506000612ce06000546001600160a01b031690565b6001600160a01b0316612cf4836001613eda565b604051600081818185875af1925050503d8060008114612d30576040519150601f19603f3d011682016040523d82523d6000602084013e612d35565b606091505b5050905080612d925760405162461bcd60e51b815260206004820152602360248201527f547261736842696e3a207472616e7366657220746f206f776e6572206661696c60448201526232b21760e91b606482015260840161085a565b505b6000612da08284613f8f565b600d549091506000906001600160a01b0316612dbd836001613eda565b604051600081818185875af1925050503d8060008114612df9576040519150601f19603f3d011682016040523d82523d6000602084013e612dfe565b606091505b5050905080612e5b5760405162461bcd60e51b8152602060048201526024808201527f547261736842696e3a207472616e7366657220746f20486173686573206661696044820152633632b21760e11b606482015260840161085a565b60405184907f94effa14ea3a1ef396fa2fd829336d1597f1d76b548c26bfa2332869706638af90600090a25050505050565b6000546001600160a01b031633146119c45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161085a565b612710811115612f575760405162461bcd60e51b815260206004820152603560248201527f547261736842696e3a2075706461746564204554482070657263656e746167656044820152741036b0bc903737ba1032bc31b2b2b210189818129760591b606482015260840161085a565b600b8054908290556040517332ba342832b931b2b73a30b3b2aa37a7bbb732b960611b8152829082906014015b604051908190038120907fbbdfcfc2a308379bae84c163587636c8b19321c21ea453bb3284a2f6f4c1d53290600090a45050565b6127108111156130305760405162461bcd60e51b815260206004820152603860248201527f547261736842696e3a20757064617465642044414f204861736820446973636f60448201527f756e74206d6179206e6f742065786365656420313030252e0000000000000000606482015260840161085a565b60078054908290556040516e19185bd2185cda111a5cd8dbdd5b9d608a1b815282908290600f01612f84565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b64e8d4a5100081101580156130c95750670de0b6b3a76400008111155b61313b5760405162461bcd60e51b815260206004820152603c60248201527f547261736842696e3a206e65774275795072696365206e6f742077697468696e60448201527f20746865206c6f77657220616e6420757070657220626f756e64732e00000000606482015260840161085a565b600454613149826001613eda565b60045560405167627579507269636560c01b815282908290600801612f84565b6001811015801561317e5750633b9aca008111155b6131f05760405162461bcd60e51b815260206004820152603d60248201527f547261736842696e3a206e657753656c6c5072696365206e6f7420776974686960448201527f6e20746865206c6f77657220616e6420757070657220626f756e64732e000000606482015260840161085a565b6005546131fe826001613eda565b6005556040516873656c6c507269636560b81b815282908290600901612f84565b6127108111156132975760405162461bcd60e51b815260206004820152603d60248201527f547261736842696e3a2075706461746564205374616e6461726420486173682060448201527f446973636f756e74206d6179206e6f742065786365656420313030252e000000606482015260840161085a565b6006805490829055604051731cdd185b99185c9912185cda111a5cd8dbdd5b9d60621b815282908290601401612f84565b600a81101580156132dc5750620186a08111155b613350576040805162461bcd60e51b81526020600482015260248101919091527f547261736842696e3a206e657742757961626c6544656c6179206e6f7420776960448201527f7468696e20746865206c6f77657220616e6420757070657220626f756e64732e606482015260840161085a565b60088054908290556040516b62757961626c6544656c617960a01b815282908290600c01612f84565b67016345785d8a00008111156133eb5760405162461bcd60e51b815260206004820152603160248201527f547261736842696e3a206e65774d696e45746842616c616e6365206d6179206e60448201527037ba1032bc31b2b2b210181718a2aa241760791b606482015260840161085a565b6009546133f9826001613eda565b6009556040516c6d696e45746842616c616e636560981b815282908290600d01612f84565b64e8d4a51000811015801561343b5750670de0b6b3a76400008111155b6134b75760405162461bcd60e51b815260206004820152604160248201527f547261736842696e3a206e65774d617845746842616c616e6365206e6f74207760448201527f697468696e20746865206c6f77657220616e6420757070657220626f756e64736064820152601760f91b608482015260a40161085a565b600a546134c5826001613eda565b600a556040516c6d617845746842616c616e636560981b815282908290600d01612f84565b6134f26128c2565b6002600154036135145760405162461bcd60e51b815260040161085a90613ea3565b60026001908155604080516080810182526001600160a01b03858116808352602080840187815260008587018181524360608801818152600380549b8c018155845288517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b6004909c029b8c0180546001600160a01b031916919099161790975592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8a0155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d8901805460ff191691151591909117905593517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e909701969096559351948552919390928592917f6a36df4d550e5a2835c70bc386a1c388ee4f827ea50b4d356640c9c5c2e226df91016128b1565b6136546128c2565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586136893390565b6040516001600160a01b03909116815260200160405180910390a1565b6136ae6136df565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33613689565b60025460ff166119c45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161085a565b60006020828403121561373a57600080fd5b81356001600160e01b031981168114610ab057600080fd5b6001600160a01b03811681146118eb57600080fd5b60008083601f84011261377957600080fd5b50813567ffffffffffffffff81111561379157600080fd5b6020830191508360208285010111156137a957600080fd5b9250929050565b6000806000806000608086880312156137c857600080fd5b85356137d381613752565b945060208601356137e381613752565b935060408601359250606086013567ffffffffffffffff81111561380657600080fd5b61381288828901613767565b969995985093965092949392505050565b60008060006060848603121561383857600080fd5b833561384381613752565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561389757613897613858565b604052919050565b600067ffffffffffffffff8211156138b9576138b9613858565b5060051b60200190565b600082601f8301126138d457600080fd5b813560206138e96138e48361389f565b61386e565b82815260059290921b8401810191818101908684111561390857600080fd5b8286015b84811015613923578035835291830191830161390c565b509695505050505050565b6000806040838503121561394157600080fd5b823567ffffffffffffffff8082111561395957600080fd5b613965868387016138c3565b9350602085013591508082111561397b57600080fd5b50613988858286016138c3565b9150509250929050565b6000602082840312156139a457600080fd5b813567ffffffffffffffff8111156139bb57600080fd5b6139c7848285016138c3565b949350505050565b80151581146118eb57600080fd5b600082601f8301126139ee57600080fd5b813560206139fe6138e48361389f565b82815260059290921b84018101918181019086841115613a1d57600080fd5b8286015b84811015613923578035613a34816139cf565b8352918301918301613a21565b60008060008060808587031215613a5757600080fd5b843567ffffffffffffffff80821115613a6f57600080fd5b818701915087601f830112613a8357600080fd5b81356020613a936138e48361389f565b82815260059290921b8401810191818101908b841115613ab257600080fd5b948201945b83861015613ad9578535613aca81613752565b82529482019490820190613ab7565b98505088013592505080821115613aef57600080fd5b613afb888389016138c3565b94506040870135915080821115613b1157600080fd5b613b1d888389016138c3565b93506060870135915080821115613b3357600080fd5b50613b40878288016139dd565b91505092959194509250565b600060208284031215613b5e57600080fd5b5035919050565b600080600080600080600080610100898b031215613b8257600080fd5b505086359860208801359850604088013597606081013597506080810135965060a0810135955060c0810135945060e0013592509050565b60008060408385031215613bcd57600080fd5b8235613bd881613752565b946020939093013593505050565b60008083601f840112613bf857600080fd5b50813567ffffffffffffffff811115613c1057600080fd5b6020830191508360208260051b85010111156137a957600080fd5b60008060008060008060008060a0898b031215613c4757600080fd5b8835613c5281613752565b97506020890135613c6281613752565b9650604089013567ffffffffffffffff80821115613c7f57600080fd5b613c8b8c838d01613be6565b909850965060608b0135915080821115613ca457600080fd5b613cb08c838d01613be6565b909650945060808b0135915080821115613cc957600080fd5b50613cd68b828c01613767565b999c989b5096995094979396929594505050565b60008060008060008060a08789031215613d0357600080fd5b8635613d0e81613752565b95506020870135613d1e81613752565b94506040870135935060608701359250608087013567ffffffffffffffff811115613d4857600080fd5b613d5489828a01613767565b979a9699509497509295939492505050565b600060208284031215613d7857600080fd5b8135610ab081613752565b60008060408385031215613d9657600080fd5b50508035926020909101359150565b600060208284031215613db757600080fd5b8151610ab081613752565b60208082526026908201527f547261736842696e3a207472616e7366657220746f20547261736842696e206660408201526530b4b632b21760d11b606082015260800190565b60208082526023908201527f547261736842696e3a2073616c6520746f206465706f7369746f72206661696c60408201526232b21760e91b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561199b5761199b613e4b565b634e487b7160e01b600052603260045260246000fd5b600060018201613e9c57613e9c613e4b565b5060010190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b808202811582820484141761199b5761199b613e4b565b6020808252601e908201527f547261736842696e3a20696e646578206f7574206f6620626f756e64732e0000604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260029082015261060f60f31b60c082015260e00190565b8181038181111561199b5761199b613e4b565b60208082526041908201527f547261736862696e3a20696e64657865732061727261792070726f766964656460408201527f206973206e6f74206d6f6e6f746f6e6963616c6c792064656372656173696e676060820152601760f91b608082015260a00190565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561403157600080fd5b8151610ab0816139cf565b60006020828403121561404e57600080fd5b5051919050565b60008261407257634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220a87c868b13ec549f4d3c6eca8cc8dd627c82e9d5f18b754c4215ff7f614d1d4c64736f6c63430008110033000000000000000000000000d07e72b00431af84ad438ca995fd9a7f0207542d000000000000000000000000bd3af18e0b7ebb30d49b253ab00788b92604552c000000000000000000000000da6d27fdf14547405319ba3c691876e283ae062f
Deployed Bytecode
0x60806040526004361061023f5760003560e01c80638da5cb5b1161012e578063c4ae3168116100ab578063e876adaa1161006f578063e876adaa1461069e578063f23a6e61146106be578063f2fde38b146106de578063f3e414f8146106fe578063fe658ee21461071e57600080fd5b8063c4ae3168146105f9578063cc0c73a21461060e578063dae7f6fd1461065e578063e086e5ec14610674578063e7d595dd1461068957600080fd5b8063ab7d6cbc116100f2578063ab7d6cbc1461056d578063b5a791df14610583578063b6318d11146105a3578063bc197c81146105c3578063bf8f2b60146105e357600080fd5b80638da5cb5b146104d9578063960ed402146104f7578063a1db97821461050d578063a40139341461052d578063a81d9bcc1461054d57600080fd5b80635ae8a9f5116101bc57806374eea9481161018057806374eea94814610457578063777525d51461046d5780637bafc8f11461048d5780637fb0fe7a146104ad5780638620410b146104c357600080fd5b80635ae8a9f5146103ca5780635c975abb146103ea57806363f917d614610402578063715018a614610422578063738d3e551461043757600080fd5b806339ead7201161020357806339ead720146103345780634b750334146103545780634d8d64dd1461036a578063543158171461038a578063553602ea146103aa57600080fd5b806301ffc9a71461024b5780630f6dbbcb14610280578063150b7a02146102b8578063335bf2bd146102f157806336cb4d961461031f57600080fd5b3661024657005b600080fd5b34801561025757600080fd5b5061026b610266366004613728565b61073e565b60405190151581526020015b60405180910390f35b34801561028c57600080fd5b50600d546102a0906001600160a01b031681565b6040516001600160a01b039091168152602001610277565b3480156102c457600080fd5b506102d86102d33660046137b0565b6107cd565b6040516001600160e01b03199091168152602001610277565b3480156102fd57600080fd5b5061031161030c366004613823565b6108f3565b604051908152602001610277565b61033261032d36600461392e565b610ab7565b005b34801561034057600080fd5b5061033261034f366004613823565b610ff3565b34801561036057600080fd5b5061031160055481565b34801561037657600080fd5b50610332610385366004613992565b6110ad565b34801561039657600080fd5b506103326103a5366004613a41565b61133d565b3480156103b657600080fd5b506103326103c5366004613b4c565b6118da565b3480156103d657600080fd5b5061026b6103e5366004613b4c565b6118ee565b3480156103f657600080fd5b5060025460ff1661026b565b34801561040e57600080fd5b5061033261041d366004613b4c565b6119a1565b34801561042e57600080fd5b506103326119b2565b34801561044357600080fd5b50610332610452366004613b65565b6119c6565b34801561046357600080fd5b50610311600a5481565b34801561047957600080fd5b50610332610488366004613b4c565b611a20565b34801561049957600080fd5b506103326104a8366004613b4c565b611a31565b3480156104b957600080fd5b50610311600b5481565b3480156104cf57600080fd5b5061031160045481565b3480156104e557600080fd5b506000546001600160a01b03166102a0565b34801561050357600080fd5b5061031160085481565b34801561051957600080fd5b50610332610528366004613bba565b611a42565b34801561053957600080fd5b50610332610548366004613b4c565b611b17565b34801561055957600080fd5b50600c546102a0906001600160a01b031681565b34801561057957600080fd5b5061031160095481565b34801561058f57600080fd5b5061033261059e366004613b4c565b611b28565b3480156105af57600080fd5b506103326105be366004613b4c565b611b39565b3480156105cf57600080fd5b506102d86105de366004613c2b565b611b4a565b3480156105ef57600080fd5b5061031160065481565b34801561060557600080fd5b50610332611e0c565b34801561061a57600080fd5b5061062e610629366004613b4c565b611e2e565b604080516001600160a01b0390951685526020850193909352901515918301919091526060820152608001610277565b34801561066a57600080fd5b5061031160075481565b34801561068057600080fd5b50610332611e75565b34801561069557600080fd5b50600354610311565b3480156106aa57600080fd5b506103326106b9366004613b4c565b611ebd565b3480156106ca57600080fd5b506102d86106d9366004613cea565b611ece565b3480156106ea57600080fd5b506103326106f9366004613d66565b612070565b34801561070a57600080fd5b50610332610719366004613bba565b61216d565b34801561072a57600080fd5b50610332610739366004613d83565b612222565b60006001600160e01b03198216630704183b60e11b148061076f57506001600160e01b03198216635c975abb60e01b145b8061078a57506001600160e01b03198216630a85bd0160e11b145b806107a557506001600160e01b03198216630271189760e51b145b806107b857506001600160e01b03198216155b156107c557506001919050565b506000919050565b6040516331a9108f60e11b815260048101849052600090339030908290636352211e90602401602060405180830381865afa158015610810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108349190613da5565b6001600160a01b0316146108635760405162461bcd60e51b815260040161085a90613dc2565b60405180910390fd5b61086d8186612751565b6005546040516000916001600160a01b038916918381818185875af1925050503d80600081146108b9576040519150601f19603f3d011682016040523d82523d6000602084013e6108be565b606091505b50509050806108df5760405162461bcd60e51b815260040161085a90613e08565b50630a85bd0160e11b979650505050505050565b60035460009082106109575760405162461bcd60e51b815260206004820152602760248201527f547261736842696e3a207374617274696e6720696e646578206f7574206f66206044820152663137bab732399760c91b606482015260840161085a565b815b600354811080156109745750610971836103e8613e61565b81105b156109fe57846001600160a01b03166003828154811061099657610996613e74565b60009182526020909120600490910201546001600160a01b03161480156109e0575083600382815481106109cc576109cc613e74565b906000526020600020906004020160010154145b156109ec579050610ab0565b806109f681613e8a565b915050610959565b60405162461bcd60e51b815260206004820152607560248201527f4e465420696e646578206e6f74206c6f63617465642e20436865636b2074686160448201527f742074686520636f6c6c656374696f6e20616e642069642076616c756573206160648201527f726520636f72726563742c20616e642f6f722063686f6f73652061206469666660848201527432b932b73a1039ba30b93a34b7339034b73232bc1760591b60a482015260c40161085a565b9392505050565b610abf6128c2565b600260015403610ae15760405162461bcd60e51b815260040161085a90613ea3565b60026001558151610af23383612908565b610afc9190613eda565b341015610b575760405162461bcd60e51b815260206004820152602360248201527f547261736842696e3a20696e73756666696369656e7420455448207061796d65604482015262373a1760e91b606482015260840161085a565b606482511115610bc75760405162461bcd60e51b815260206004820152603560248201527f547261736842696e3a2061206d6178696d756d206f662031303020707572636860448201527430b9b2b9903832b9103a3930b739b0b1ba34b7b71760591b606482015260840161085a565b60005b8251811015610e50576003548351849083908110610bea57610bea613e74565b602002602001015110610c0f5760405162461bcd60e51b815260040161085a90613ef1565b60006003848381518110610c2557610c25613e74565b602002602001015181548110610c3d57610c3d613e74565b600091825260209182902060408051608081018252600490930290910180546001600160a01b03168352600181015493830193909352600283015460ff1615159082015260039091015460608201819052600854919250610c9e9190613e61565b4311610d125760405162461bcd60e51b815260206004820152603e60248201527f547261736842696e3a20696e73756666696369656e742074696d65206861732060448201527f7061737365642073696e63652073616c65206f662074686973204e46542e0000606482015260840161085a565b806040015115610d8a5780516020820151604051632142170760e11b81526001600160a01b038316916342842e0e91610d52913091339190600401613f28565b600060405180830381600087803b158015610d6c57600080fd5b505af1158015610d80573d6000803e3d6000fd5b5050505050610df7565b80516020820151604051637921219560e11b81526001600160a01b0383169163f242432a91610dc3913091339190600190600401613f4c565b600060405180830381600087803b158015610ddd57600080fd5b505af1158015610df1573d6000803e3d6000fd5b50505050505b80604001511515816020015182600001516001600160a01b03167f1d61142c2c6c7bca70470912f4bb5e385638b745dd1da048b6f9bb4c3ee3500560405160405180910390a45080610e4881613e8a565b915050610bca565b5060005b8251811015610fd8578015610ec057828181518110610e7557610e75613e74565b602002602001015183600183610e8b9190613f8f565b81518110610e9b57610e9b613e74565b602002602001015111610ec05760405162461bcd60e51b815260040161085a90613fa2565b60038054610ed090600190613f8f565b81548110610ee057610ee0613e74565b90600052602060002090600402016003848381518110610f0257610f02613e74565b602002602001015181548110610f1a57610f1a613e74565b60009182526020909120825460049092020180546001600160a01b0319166001600160a01b0390921691909117815560018083015490820155600280830154908201805460ff909216151560ff1990921691909117905560039182015490820155805480610f8a57610f8a614009565b60008281526020812060046000199093019283020180546001600160a01b03191681556001810182905560028101805460ff1916905560030155905580610fd081613e8a565b915050610e54565b50600a54471115610feb57610feb612c18565b505060018055565b610ffb612e8d565b826001600160a01b031663f242432a3061101d6000546001600160a01b031690565b85856040518563ffffffff1660e01b815260040161103e9493929190613f4c565b600060405180830381600087803b15801561105857600080fd5b505af115801561106c573d6000803e3d6000fd5b505050508082846001600160a01b03167f833b472e001ec96e313d7cdf1971af11d9432698050462ed2f2df7e3370cd81b60405160405180910390a4505050565b6110b5612e8d565b60005b81518110156113395760035482518390839081106110d8576110d8613e74565b6020026020010151106110fd5760405162461bcd60e51b815260040161085a90613ef1565b80156111605781818151811061111557611115613e74565b60200260200101518260018361112b9190613f8f565b8151811061113b5761113b613e74565b6020026020010151116111605760405162461bcd60e51b815260040161085a90613fa2565b6000600383838151811061117657611176613e74565b60200260200101518154811061118e5761118e613e74565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018082015494840194909452600281015460ff1615159183019190915260039081015460608301528054919350916111f091613f8f565b8154811061120057611200613e74565b9060005260206000209060040201600384848151811061122257611222613e74565b60200260200101518154811061123a5761123a613e74565b60009182526020909120825460049092020180546001600160a01b0319166001600160a01b0390921691909117815560018083015490820155600280830154908201805460ff909216151560ff19909216919091179055600391820154908201558054806112aa576112aa614009565b6000828152602080822060046000199094019384020180546001600160a01b03191681556001810183905560028101805460ff1916905560030182905591909255820151825160405191926001600160a01b0391909116917fa704554c0202efdac33f094a98f655ebc38e3294c9c90d1213750210c79bd0ba9190a3508061133181613e8a565b9150506110b8565b5050565b8251845114801561134f575081518351145b801561135c575080518251145b6113be5760405162461bcd60e51b815260206004820152602d60248201527f547261736842696e3a20416c6c20617272617973206d7573742062652074686560448201526c1039b0b6b2903632b733ba341760991b606482015260840161085a565b6064845111156114365760405162461bcd60e51b815260206004820152603760248201527f547261736842696e3a2061206d6178696d756d206f662031303020636f6c6c6560448201527f6374696f6e7320706572207472616e73616374696f6e2e000000000000000000606482015260840161085a565b60005b83518110156118d35781818151811061145457611454613e74565b60200260200101511561169257600085828151811061147557611475613e74565b60200260200101519050306001600160a01b0316816001600160a01b031663081812fc8785815181106114aa576114aa613e74565b60200260200101516040518263ffffffff1660e01b81526004016114d091815260200190565b602060405180830381865afa1580156114ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115119190613da5565b6001600160a01b0316148061159f57506001600160a01b03811663e985e9c5336040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa15801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f919061401f565b6116115760405162461bcd60e51b815260206004820152603a60248201527f547261736842696e3a20547261736842696e206973206e6f7420617070726f7660448201527f656420746f207472616e7366657220455243373231204e46542e000000000000606482015260840161085a565b6001600160a01b0381166342842e0e333088868151811061163457611634613e74565b60200260200101516040518463ffffffff1660e01b815260040161165a93929190613f28565b600060405180830381600087803b15801561167457600080fd5b505af1158015611688573d6000803e3d6000fd5b50505050506118c1565b60648382815181106116a6576116a6613e74565b602002602001015111156117155760405162461bcd60e51b815260206004820152603060248201527f547261736842696e3a2061206d6178696d756d206f66203130302073616c657360448201526f103832b91031b7b63632b1ba34b7b71760811b606482015260840161085a565b600085828151811061172957611729613e74565b60200260200101519050806001600160a01b031663e985e9c56117493390565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152306024820152604401602060405180830381865afa158015611793573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b7919061401f565b6118295760405162461bcd60e51b815260206004820152603c60248201527f547261736842696e3a20547261736842696e206973206e6f7420617070726f7660448201527f656420746f207472616e736665722045524331313535204e4654732e00000000606482015260840161085a565b6001600160a01b03811663f242432a333088868151811061184c5761184c613e74565b602002602001015188878151811061186657611866613e74565b60200260200101516040518563ffffffff1660e01b815260040161188d9493929190613f4c565b600060405180830381600087803b1580156118a757600080fd5b505af11580156118bb573d6000803e3d6000fd5b50505050505b806118cb81613e8a565b915050611439565b5050505050565b6118e2612e8d565b6118eb81612ee7565b50565b60035460009082106119125760405162461bcd60e51b815260040161085a90613ef1565b60025460ff16156119595760405162461bcd60e51b81526020600482015260116024820152702a3930b9b42134b71d103830bab9b2b21760791b604482015260640161085a565b6008546003838154811061196f5761196f613e74565b90600052602060002090600402016003015461198b9190613e61565b431161199857600061199b565b60015b92915050565b6119a9612e8d565b6118eb81612fb8565b6119ba612e8d565b6119c4600061305c565b565b6119ce612e8d565b6119d7886130ac565b6119e087613169565b6119e98661321f565b6119f285612fb8565b6119fb846132c8565b611a0483613379565b611a0d8261341e565b611a1681612ee7565b5050505050505050565b611a28612e8d565b6118eb81613169565b611a39612e8d565b6118eb816130ac565b611a4a612e8d565b816001600160a01b031663a9059cbb611a6b6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044016020604051808303816000875af1158015611ab8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611adc919061401f565b5060405181906001600160a01b038416907fbe7426aee8a34d0263892b55ce65ce81d8f4c806eb4719e59015ea49feb92d2290600090a35050565b611b1f612e8d565b6118eb816132c8565b611b30612e8d565b6118eb8161341e565b611b41612e8d565b6118eb81613379565b6000336064871115611bba5760405162461bcd60e51b815260206004820152603360248201527f547261736842696e3a2061206d6178696d756d206f6620313030204e465420696044820152723239903832b9103a3930b739b0b1ba34b7b71760691b606482015260840161085a565b60005b87811015611d7657868682818110611bd757611bd7613e74565b90506020020135826001600160a01b031662fdd58e308c8c86818110611bff57611bff613e74565b6040516001600160e01b031960e087901b1681526001600160a01b0390941660048501526020029190910135602483015250604401602060405180830381865afa158015611c51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c75919061403c565b1015611c935760405162461bcd60e51b815260040161085a90613dc2565b6064878783818110611ca757611ca7613e74565b905060200201351115611d0c5760405162461bcd60e51b815260206004820152602760248201527f547261736842696e3a2061206d6178696d756d206f6620313030204e465473206044820152663832b91034b21760c91b606482015260840161085a565b60005b878783818110611d2157611d21613e74565b90506020020135811015611d6357611d51838b8b85818110611d4557611d45613e74565b905060200201356134ea565b80611d5b81613e8a565b915050611d0f565b5080611d6e81613e8a565b915050611bbd565b506005546000906001600160a01b038b1690611d93908a90613eda565b604051600081818185875af1925050503d8060008114611dcf576040519150601f19603f3d011682016040523d82523d6000602084013e611dd4565b606091505b5050905080611df55760405162461bcd60e51b815260040161085a90613e08565b5063bc197c8160e01b9a9950505050505050505050565b611e14612e8d565b60025460ff16611e26576119c461364c565b6119c46136a6565b60038181548110611e3e57600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b0390921693509160ff169084565b60025460ff1615611e8857611e88612e8d565b600260015403611eaa5760405162461bcd60e51b815260040161085a90613ea3565b6002600155611eb7612c18565b60018055565b611ec5612e8d565b6118eb8161321f565b604051627eeac760e11b81523060048201526024810185905260009033908590829062fdd58e90604401602060405180830381865afa158015611f15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f39919061403c565b1015611f575760405162461bcd60e51b815260040161085a90613dc2565b6064851115611fc15760405162461bcd60e51b815260206004820152603060248201527f547261736842696e3a2061206d6178696d756d206f6620313030204e4654732060448201526f3832b9103a3930b739b0b1ba34b7b71760811b606482015260840161085a565b60005b85811015611fe857611fd682886134ea565b80611fe081613e8a565b915050611fc4565b506005546040516000916001600160a01b038a16918381818185875af1925050503d8060008114612035576040519150601f19603f3d011682016040523d82523d6000602084013e61203a565b606091505b505090508061205b5760405162461bcd60e51b815260040161085a90613e08565b5063f23a6e6160e01b98975050505050505050565b6000546001600160a01b031633148061209c5750600d546001600160a01b0316336001600160a01b0316145b6120ff5760405162461bcd60e51b815260206004820152602e60248201527f547261736842696e3a206d75737420626520636f6e7472616374206f776e657260448201526d206f72204861736865732044414f60901b606482015260840161085a565b6001600160a01b0381166121645760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161085a565b6118eb8161305c565b612175612e8d565b816001600160a01b03166342842e0e306121976000546001600160a01b031690565b846040518463ffffffff1660e01b81526004016121b693929190613f28565b600060405180830381600087803b1580156121d057600080fd5b505af11580156121e4573d6000803e3d6000fd5b50506040518392506001600160a01b03851691507fcc7d0949892410da9ebd78d838ca9ba1601b557ad34c4a6cb4b492c5996bd8df90600090a35050565b61222a6128c2565b60026001540361224c5760405162461bcd60e51b815260040161085a90613ea3565b600260015560035482106122725760405162461bcd60e51b815260040161085a90613ef1565b600c546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa1580156122bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122df9190613da5565b6001600160a01b03161461235b5760405162461bcd60e51b815260206004820152603e60248201527f547261736842696e3a206d6573736167652073656e64657220646f6573206e6f60448201527f74206f776e2074686520486173686573204e46542070726f76696465642e0000606482015260840161085a565b600c60009054906101000a90046001600160a01b03166001600160a01b031663b233b3896040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d2919061403c565b8110801561244a5750600c54604051632a266cdb60e21b8152600481018390526001600160a01b039091169063a899b36c90602401602060405180830381865afa158015612424573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612448919061401f565b155b6124b15760405162461bcd60e51b815260206004820152603260248201527f547261736842696e3a20486173686573204e46542049642070726f76696465646044820152711034b9903737ba1030902220a79027232a1760711b606482015260840161085a565b6000600383815481106124c6576124c6613e74565b600091825260209182902060408051608081018252600490930290910180546001600160a01b0316835260018082015494840194909452600281015460ff16151591830191909152600390810154606083015280549193509161252891613f8f565b8154811061253857612538613e74565b90600052602060002090600402016003848154811061255957612559613e74565b60009182526020909120825460049092020180546001600160a01b0319166001600160a01b0390921691909117815560018083015490820155600280830154908201805460ff909216151560ff19909216919091179055600391820154908201558054806125c9576125c9614009565b60008281526020812060046000199093019283020180546001600160a01b03191681556001810182905560028101805460ff1916905560030155905560408101511561268e5780516001600160a01b0381166342842e0e306126336000546001600160a01b031690565b85602001516040518463ffffffff1660e01b815260040161265693929190613f28565b600060405180830381600087803b15801561267057600080fd5b505af1158015612684573d6000803e3d6000fd5b505050505061270c565b80516001600160a01b03811663f242432a306126b26000546001600160a01b031690565b856020015160016040518563ffffffff1660e01b81526004016126d89493929190613f4c565b600060405180830381600087803b1580156126f257600080fd5b505af1158015612706573d6000803e3d6000fd5b50505050505b602081015181516040516001600160a01b03909116907f5bed1be92baa67097fd78998bb163fa34dea76f33585504a916fcf3732692ef990600090a350506001805550565b6127596128c2565b60026001540361277b5760405162461bcd60e51b815260040161085a90613ea3565b60026001908155604080516080810182526001600160a01b038581168083526020808401878152848601878152436060870181815260038054808c01825560009190915288517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b600490920291820180546001600160a01b031916919099161790975592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c87015590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d8601805460ff191691151591909117905590517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e9094019390935593519182529193928592917f6a36df4d550e5a2835c70bc386a1c388ee4f827ea50b4d356640c9c5c2e226df91015b60405180910390a450506001805550565b60025460ff16156119c45760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161085a565b6000815160000361291c575060045461199b565b81516001146129825760405162461bcd60e51b815260206004820152602c60248201527f547261736842696e3a206d6f7265207468616e206f6e6520486173686573204e60448201526b232a10383937bb34b232b21760a11b606482015260840161085a565b600c5482516001600160a01b03808616921690636352211e9085906000906129ac576129ac613e74565b60200260200101516040518263ffffffff1660e01b81526004016129d291815260200190565b602060405180830381865afa1580156129ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a139190613da5565b6001600160a01b031614612a835760405162461bcd60e51b815260206004820152603160248201527f547261736842696e3a20627579657220646f6573206e6f74206f776e206861736044820152703432b99027232a10383937bb34b232b21760791b606482015260840161085a565b600c60009054906101000a90046001600160a01b03166001600160a01b031663b233b3896040518163ffffffff1660e01b8152600401602060405180830381865afa158015612ad6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612afa919061403c565b82600081518110612b0d57612b0d613e74565b6020026020010151108015612bae5750600c5482516001600160a01b039091169063a899b36c908490600090612b4557612b45613e74565b60200260200101516040518263ffffffff1660e01b8152600401612b6b91815260200190565b602060405180830381865afa158015612b88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612bac919061401f565b155b15612be957600754600003612bc55750600061199b565b612710600754600454612bd89190613eda565b612be29190614055565b905061199b565b600654600003612bfb5750600061199b565b612710600654600454612c0e9190613eda565b610ab09190614055565b60095447908111612c915760405162461bcd60e51b815260206004820152603f60248201527f547261736842696e3a20636f6e74726163742062616c616e6365206973206c6560448201527f7373207468616e206d696e696d756d2062616c616e636520616d6f756e742e00606482015260840161085a565b600060095482612ca19190613f8f565b9050600080600b541115612d9457612710600b5483612cc09190613eda565b612cca9190614055565b90506000612ce06000546001600160a01b031690565b6001600160a01b0316612cf4836001613eda565b604051600081818185875af1925050503d8060008114612d30576040519150601f19603f3d011682016040523d82523d6000602084013e612d35565b606091505b5050905080612d925760405162461bcd60e51b815260206004820152602360248201527f547261736842696e3a207472616e7366657220746f206f776e6572206661696c60448201526232b21760e91b606482015260840161085a565b505b6000612da08284613f8f565b600d549091506000906001600160a01b0316612dbd836001613eda565b604051600081818185875af1925050503d8060008114612df9576040519150601f19603f3d011682016040523d82523d6000602084013e612dfe565b606091505b5050905080612e5b5760405162461bcd60e51b8152602060048201526024808201527f547261736842696e3a207472616e7366657220746f20486173686573206661696044820152633632b21760e11b606482015260840161085a565b60405184907f94effa14ea3a1ef396fa2fd829336d1597f1d76b548c26bfa2332869706638af90600090a25050505050565b6000546001600160a01b031633146119c45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161085a565b612710811115612f575760405162461bcd60e51b815260206004820152603560248201527f547261736842696e3a2075706461746564204554482070657263656e746167656044820152741036b0bc903737ba1032bc31b2b2b210189818129760591b606482015260840161085a565b600b8054908290556040517332ba342832b931b2b73a30b3b2aa37a7bbb732b960611b8152829082906014015b604051908190038120907fbbdfcfc2a308379bae84c163587636c8b19321c21ea453bb3284a2f6f4c1d53290600090a45050565b6127108111156130305760405162461bcd60e51b815260206004820152603860248201527f547261736842696e3a20757064617465642044414f204861736820446973636f60448201527f756e74206d6179206e6f742065786365656420313030252e0000000000000000606482015260840161085a565b60078054908290556040516e19185bd2185cda111a5cd8dbdd5b9d608a1b815282908290600f01612f84565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b64e8d4a5100081101580156130c95750670de0b6b3a76400008111155b61313b5760405162461bcd60e51b815260206004820152603c60248201527f547261736842696e3a206e65774275795072696365206e6f742077697468696e60448201527f20746865206c6f77657220616e6420757070657220626f756e64732e00000000606482015260840161085a565b600454613149826001613eda565b60045560405167627579507269636560c01b815282908290600801612f84565b6001811015801561317e5750633b9aca008111155b6131f05760405162461bcd60e51b815260206004820152603d60248201527f547261736842696e3a206e657753656c6c5072696365206e6f7420776974686960448201527f6e20746865206c6f77657220616e6420757070657220626f756e64732e000000606482015260840161085a565b6005546131fe826001613eda565b6005556040516873656c6c507269636560b81b815282908290600901612f84565b6127108111156132975760405162461bcd60e51b815260206004820152603d60248201527f547261736842696e3a2075706461746564205374616e6461726420486173682060448201527f446973636f756e74206d6179206e6f742065786365656420313030252e000000606482015260840161085a565b6006805490829055604051731cdd185b99185c9912185cda111a5cd8dbdd5b9d60621b815282908290601401612f84565b600a81101580156132dc5750620186a08111155b613350576040805162461bcd60e51b81526020600482015260248101919091527f547261736842696e3a206e657742757961626c6544656c6179206e6f7420776960448201527f7468696e20746865206c6f77657220616e6420757070657220626f756e64732e606482015260840161085a565b60088054908290556040516b62757961626c6544656c617960a01b815282908290600c01612f84565b67016345785d8a00008111156133eb5760405162461bcd60e51b815260206004820152603160248201527f547261736842696e3a206e65774d696e45746842616c616e6365206d6179206e60448201527037ba1032bc31b2b2b210181718a2aa241760791b606482015260840161085a565b6009546133f9826001613eda565b6009556040516c6d696e45746842616c616e636560981b815282908290600d01612f84565b64e8d4a51000811015801561343b5750670de0b6b3a76400008111155b6134b75760405162461bcd60e51b815260206004820152604160248201527f547261736842696e3a206e65774d617845746842616c616e6365206e6f74207760448201527f697468696e20746865206c6f77657220616e6420757070657220626f756e64736064820152601760f91b608482015260a40161085a565b600a546134c5826001613eda565b600a556040516c6d617845746842616c616e636560981b815282908290600d01612f84565b6134f26128c2565b6002600154036135145760405162461bcd60e51b815260040161085a90613ea3565b60026001908155604080516080810182526001600160a01b03858116808352602080840187815260008587018181524360608801818152600380549b8c018155845288517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b6004909c029b8c0180546001600160a01b031916919099161790975592517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85c8a0155517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85d8901805460ff191691151591909117905593517fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85e909701969096559351948552919390928592917f6a36df4d550e5a2835c70bc386a1c388ee4f827ea50b4d356640c9c5c2e226df91016128b1565b6136546128c2565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586136893390565b6040516001600160a01b03909116815260200160405180910390a1565b6136ae6136df565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33613689565b60025460ff166119c45760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161085a565b60006020828403121561373a57600080fd5b81356001600160e01b031981168114610ab057600080fd5b6001600160a01b03811681146118eb57600080fd5b60008083601f84011261377957600080fd5b50813567ffffffffffffffff81111561379157600080fd5b6020830191508360208285010111156137a957600080fd5b9250929050565b6000806000806000608086880312156137c857600080fd5b85356137d381613752565b945060208601356137e381613752565b935060408601359250606086013567ffffffffffffffff81111561380657600080fd5b61381288828901613767565b969995985093965092949392505050565b60008060006060848603121561383857600080fd5b833561384381613752565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561389757613897613858565b604052919050565b600067ffffffffffffffff8211156138b9576138b9613858565b5060051b60200190565b600082601f8301126138d457600080fd5b813560206138e96138e48361389f565b61386e565b82815260059290921b8401810191818101908684111561390857600080fd5b8286015b84811015613923578035835291830191830161390c565b509695505050505050565b6000806040838503121561394157600080fd5b823567ffffffffffffffff8082111561395957600080fd5b613965868387016138c3565b9350602085013591508082111561397b57600080fd5b50613988858286016138c3565b9150509250929050565b6000602082840312156139a457600080fd5b813567ffffffffffffffff8111156139bb57600080fd5b6139c7848285016138c3565b949350505050565b80151581146118eb57600080fd5b600082601f8301126139ee57600080fd5b813560206139fe6138e48361389f565b82815260059290921b84018101918181019086841115613a1d57600080fd5b8286015b84811015613923578035613a34816139cf565b8352918301918301613a21565b60008060008060808587031215613a5757600080fd5b843567ffffffffffffffff80821115613a6f57600080fd5b818701915087601f830112613a8357600080fd5b81356020613a936138e48361389f565b82815260059290921b8401810191818101908b841115613ab257600080fd5b948201945b83861015613ad9578535613aca81613752565b82529482019490820190613ab7565b98505088013592505080821115613aef57600080fd5b613afb888389016138c3565b94506040870135915080821115613b1157600080fd5b613b1d888389016138c3565b93506060870135915080821115613b3357600080fd5b50613b40878288016139dd565b91505092959194509250565b600060208284031215613b5e57600080fd5b5035919050565b600080600080600080600080610100898b031215613b8257600080fd5b505086359860208801359850604088013597606081013597506080810135965060a0810135955060c0810135945060e0013592509050565b60008060408385031215613bcd57600080fd5b8235613bd881613752565b946020939093013593505050565b60008083601f840112613bf857600080fd5b50813567ffffffffffffffff811115613c1057600080fd5b6020830191508360208260051b85010111156137a957600080fd5b60008060008060008060008060a0898b031215613c4757600080fd5b8835613c5281613752565b97506020890135613c6281613752565b9650604089013567ffffffffffffffff80821115613c7f57600080fd5b613c8b8c838d01613be6565b909850965060608b0135915080821115613ca457600080fd5b613cb08c838d01613be6565b909650945060808b0135915080821115613cc957600080fd5b50613cd68b828c01613767565b999c989b5096995094979396929594505050565b60008060008060008060a08789031215613d0357600080fd5b8635613d0e81613752565b95506020870135613d1e81613752565b94506040870135935060608701359250608087013567ffffffffffffffff811115613d4857600080fd5b613d5489828a01613767565b979a9699509497509295939492505050565b600060208284031215613d7857600080fd5b8135610ab081613752565b60008060408385031215613d9657600080fd5b50508035926020909101359150565b600060208284031215613db757600080fd5b8151610ab081613752565b60208082526026908201527f547261736842696e3a207472616e7366657220746f20547261736842696e206660408201526530b4b632b21760d11b606082015260800190565b60208082526023908201527f547261736842696e3a2073616c6520746f206465706f7369746f72206661696c60408201526232b21760e91b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561199b5761199b613e4b565b634e487b7160e01b600052603260045260246000fd5b600060018201613e9c57613e9c613e4b565b5060010190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b808202811582820484141761199b5761199b613e4b565b6020808252601e908201527f547261736842696e3a20696e646578206f7574206f6620626f756e64732e0000604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b0394851681529290931660208301526040820152606081019190915260a06080820181905260029082015261060f60f31b60c082015260e00190565b8181038181111561199b5761199b613e4b565b60208082526041908201527f547261736862696e3a20696e64657865732061727261792070726f766964656460408201527f206973206e6f74206d6f6e6f746f6e6963616c6c792064656372656173696e676060820152601760f91b608082015260a00190565b634e487b7160e01b600052603160045260246000fd5b60006020828403121561403157600080fd5b8151610ab0816139cf565b60006020828403121561404e57600080fd5b5051919050565b60008261407257634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220a87c868b13ec549f4d3c6eca8cc8dd627c82e9d5f18b754c4215ff7f614d1d4c64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d07e72b00431af84ad438ca995fd9a7f0207542d000000000000000000000000bd3af18e0b7ebb30d49b253ab00788b92604552c000000000000000000000000da6d27fdf14547405319ba3c691876e283ae062f
-----Decoded View---------------
Arg [0] : _hashes (address): 0xD07e72b00431af84AD438CA995Fd9a7F0207542d
Arg [1] : _hashesDAO (address): 0xbD3Af18e0b7ebB30d49B253Ab00788b92604552C
Arg [2] : _owner (address): 0xda6d27fdf14547405319bA3c691876E283Ae062f
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d07e72b00431af84ad438ca995fd9a7f0207542d
Arg [1] : 000000000000000000000000bd3af18e0b7ebb30d49b253ab00788b92604552c
Arg [2] : 000000000000000000000000da6d27fdf14547405319ba3c691876e283ae062f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,127.39 | 0.076 | $237.68 |
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.