ERC-721
Overview
Max Total Supply
9,666 BATZ
Holders
5,924
Market
Volume (24H)
0.0764 ETH
Min Price (24H)
$63.32 @ 0.018800 ETH
Max Price (24H)
$66.35 @ 0.019700 ETH
Other Info
Token Contract
Balance
2 BATZLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
CryptoBatz
Compiler Version
v0.8.8+commit.dddeac2f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: None pragma solidity 0.8.8; //.......................................;+++*%%%%%%%%%%?++++,............................................................ //..................................:????%%?**:,:,,,,,:,;**?S%+........................................................... //.............................::;%%%?*+;:,,,::;++++;:::::+?S@?........................................................... //.........................,++*%%?:::,,,;;;;+********;::+%%*,,,...................................................;+++;... //......................:?????+,,:;;++++*************+:;%@:.....................................................:??*?**?:. //...................,:?%?*;,::+++******************;::+S@:....................................................,;@;,,,;@+, //..................;*%+;:;;*+++;::::;+************+:::?%S,....................................................SS,::+++:%# //................:??+,;+*+++::::::;+***;+********;::;+@?......................................................S#,+?%%?:S@ //.............,:??+:;+;;;:::::::;+***+;:;;*******;::;*@?....................................................:S+;;*?***%#@ //............;*%;:;+;::::::::::+***+::::::*++***?+::;*@?....................................................;@;:S*+****#@ //..........;*?+,;++:::::::::::;**+;::::::;*;:***%*:;+*@?...................................................+*?;;*?%%?**#@ //.......,:%*+:;+;;:::::::::::;*+;:::::::;+;::***S*:*%#+:.,,,,,...................................,,,......,SS,*%*?%?***#@ //.....,:*%;::+;;::::::::::::+*+;:::::::;++:::***%+:+S@,.,S#SS?;................................:*S#?.....;@+:+*?*SS**?+#@ //.....,@?:;;+:::::::::::::::++::::::::;*;::::***%*:+S@,.,#S++*?*;............................:*%?+@%....+*?;+@?**S#*S#%#@ //....+%*+:*+::::::::::::::;+;;::::::::;*;::::***S*:+S@,.,#S;::,+*%:,.......................,%?*:;+@%.,;%*;,?%?*?S#S*S#?#@ //..,:?#:;+;:::::::::::::::;*;::::::::+*+;:::;*?S@?:+S@,.,#%:;;:::;??:,...................:*S?+::+*@%:%?:;*S@S**?##S*S#*#@ //..,@?:;;::::::::::::::::;;+;::::::::+*::::::*?%#?;+S@,.,@%,;;;::::;?*;....;*********+.:*S%*:::***@#?::*S##S%*?%##S*S@#@@ //.+%?;:;;::::::::::::::::*+::::::::::++::::::*?%#%**S@,..+?%:,;+;:::,+*%%%????*******??#@*+;:;+***@%,?S@###?**S###S*?%#@@ //:%#:+?+++?*+?+::::::::::*+::::::::;*;;:::::;*?S#%**%#;,..+#+:,:;*;:::+#%*+:,,,,,,,,,,;;+#?::;**?#@S;S@####*?#####S**?##S //@%**?%%%%%%%%?*::::::::;+;::::::::;*;:::::::*?%###***@?...,#%.,:+;;::;+;::,,,,,,,,,,,,,,***;+**%@@@####@S*?%#####S*S@@+, //@#S*:........:*%*:::::;*;:::::::::;*;::::::;*?%###S?*%%?,..+*?:,:++:;;:::::,,,,,,,,,,,,:;;;****%@####S?%%%########%##*:. //#*:............:*S+;::;+;::::::::++;::::::::+**?S#@S*+%@;,..;@+;:+*+**;***+;::::::::::+****+;;*S@####%*S#@######%?#@#... //,................,?%%%?*;;:::::::++::::::::::+*%S####***S%+,.,##*****?@@@SS%***+++++**S@@#S%*:S@@###??###S%%###@?*#@#... //...................:****S%+;:::::++::::::::::+*%S####S?**?S?+.##****++??*:::;;+%%%%SS+*??+:::;S@@###*?##S*S####%%S@%+... //........................:*@+:::::++::::::::::+*?%####@S****?%%@#**+;:::::::::::+S@@%+::::::::;S@@###?%#@S*S###S+S@@;.... //.........................:S*+::;*;:::::::::::+**?%S#####%***?S@#*;:::::::::::::::::::::::::::;#@##S?###S%?###S%+##,..... //...........................S#::;*;:::::::::::;+*?%%S#####S%*?%#S*;::::::;%%%%%%%%??%%%%%%+::::@@#######*?@###?*S?+...... //.........................,,SS::;*;::::::::::::;*?S%S#######SS?##S*++;:::;****************+:;*S#########??####?%@;....... //.........................;@+::+*+;:::::::::::;+**?%%%#############S?*+;;;;;;;;;;;;;;;;::+*?#@@#####S#S*S##%??##S;....... //.........................;@*;:++:::::::::::::;+;+*%%%#########SS####S%%***************?SS#@######%%%#S*S##@@@%+......... //.........................;@*;+*+::::::::::::++;++*?%S#########+;++?##@@SSSSSSSSSSSSSS*S@@@#######*?@%%S#@@*;;,.......... //........................:*#*+**+::::::::::::;++****?%S######%*+;::;*%SS#@#############%?@@#@####S?%#@%:,,,.............. //........................#@SSSS?+::::::::::;;+;+****?%%S###%+;::::::::;+?S############@%*@@@@@##%*#@@%+.................. //........................;+++++%%;:::::::::;;++*****?S###%*;::::::::::::+*?S##########@%*@@@@@@@S*#%+,................... //..............................,;%*+:::::::;+;+*****?%#S*;::::::::::::::+?S############%?@@S:::SSS;,..................... //................................,*??;:::::;;;+****%%%#%*::::::::::::::;+*%###########*S@%;.............................. //..................................,+?%%%%%*++**++*%%S#%*;:::::::::::;+*%%%S########S%S?+................................ //....................................,:::::*%SSS%S@#@@@S**+;::::::;;+*?S%%###SSSS%%%S%:,................................. //...........................................,,.,+%S#@@@S****;;;;+%**%%%%S#SS%%%%%%%%;,................................... //.............................................+%%%S@@@@S*%SSSS#S#@##@#S@@#SS%*++*:....................................... //..........................................,;SS%#@@;;+#S*?S@@@@%%%#@@+:::::::............................................ //..........................................+%@@#%%%+?S%S@@@@#S?#@@@#%:................................................... //...........................................,+*+...*?S@@@@S*%#@@@@?;..................................................... //...................................................,;::::,.:;::::........,.............................................. //.....................................................................,+?%#S*,........................................... //..................................................................,;%#@@@@@@#*,,.....................,++................ //...........................................................*%%%%%S@@@@#@@@@@@@@S%+................:?S@#*................ //...........................................................::+?@@@@@@S,*@@@@@@@S;,............:+?%@@@S,................. //.,;++++;..,;+++++;,.,;+;...,++:,;++++++:..;+++++++;..:+++++:...*@@@@@S..;#@@@@@+..............;S@@@@#:.................. //*S@@@@@@?:;@@@@@@@%+;@@@;.,?@@S:@@@@@@@@*;@@@@@@@@@:*#@@@@@@*:.+@@@@@S...%@@@@@+..,,......,,...,S@@@#.;;.,,......,,..... //@@@?::S#@+;@@@+:S@@@:%@@@*S@@S*:@@@+:;@@@*:;*@@@*;:;@@@+:;@@@*.+@@@@@S...%@@@@@+.,S#+....;S#;:;;S@@@#;##:S#:...;%@#;.... //@@@+..,,,.;@@@##@@S+..*#@@@#S:.:@@@%?%@@#+..:@@@:..;@@@:.,@@@+.+@@@@@S.:+#@@@@#+*S@@@%*+?#@@@@@@@@@@@@@@@@@@%*%@@@@#+:.. //@@@*::S#@+:@@@?+?@@S:..,#@@*...:@@@#SSS?,...:@@@:..;@@@;:;@@@*.+@@@@@@%@@@@@#*::%@@@@@%%@@@@@@%;S@@@#+#@@@@#%@@@@@@#%?,. //*S@@@@@@?:;@@@:.,@@@;..,#@@*...:@@@;........:@@@;..,?@@@@@@@?:.+@@@@@S:+%@@@@#%*+?S@?;,:#@@@@?..%@@@#.?%?@#,*@@@@@*,.... //.:+++++;..,+++,.,+++,...;++:...,+++,........,+++,....;+++++;...+@@@@@S..:#@@@@@@@++*%#SS@@@@@*..%@@@#,..;*:;@@@@@;*+.... //...............................................................+@@@@@S...%@@@@@++@@@@@:,#@@@@*..%@@@#.....;@@@@@*.#@:... //...............................................................+@@@@@S...%@@@@@+,S@@@@,.S@@@@*.,S@@@@;..:%@@@@@*.*@@?... //...............................................................+@@@@@#*;,%@@@@@?%@@@@@%%@@@@@#%#@@@@@@*%@@@@@@#%S@@@@%;. //..............................................................:*@@@@@@@@S#@@@@@%+S@@@S**%@@@@S+?S@@@#?++@@@@@?;?%@@@@%+. //...........................................................,*S@@@@@@@@S+,,,;+%@@+:%#*,...;##;...,+@?,...:S#?:....;#S:... //..........................................................+#@@##@@@@@+,.......,+:..,......,,......,,.....,,.......,,.... //..........................................................*@@+,,:*#S;................................................... //...........................................................?@?,...::.................................................... import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/math/SafeCast.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./SutterTreasury.sol"; import "./ERC2981.sol"; struct PresaleConfig { uint32 startTime; uint32 endTime; uint32 supplyLimit; uint256 mintPrice; } struct DutchAuctionConfig { uint32 txLimit; uint32 startTime; uint32 bottomTime; uint32 stepInterval; uint256 startPrice; uint256 bottomPrice; uint256 priceStep; } contract CryptoBatz is Ownable, ERC721, ERC2981, SutterTreasury { using Address for address; using SafeCast for uint256; using ECDSA for bytes32; // EVENTS ***************************************************** event StartingIndexSet(uint256 _value); event ProvenanceHashUpdated(uint256 _hash); event WhitelistSignerUpdated(address _signer); event BaseUriUpdated(string _uri); event AncientBatzMinterUpdated(address _address); event AncientBatzMinted(address indexed _to, uint256 indexed _id); event PresaleConfigUpdated(); event DutchAuctionConfigUpdated(); // MEMBERS **************************************************** uint256 public constant MAX_OWNER_RESERVE = 100; uint256 public constant ANCIENT_BATZ_SUPPLY = 99; uint256 public constant CRYPTO_BATZ_SUPPLY = 9666; uint256 public totalSupply = 0; // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; PresaleConfig public presaleConfig; DutchAuctionConfig public dutchAuctionConfig; string public baseURI; address public whitelistSigner; address public ancientBatzMinter; uint256 public PROVENANCE_HASH; uint256 public randomizedStartIndex; mapping(address => uint256) private presaleMinted; bytes32 private DOMAIN_SEPARATOR; bytes32 private constant TYPEHASH = keccak256("presale(address buyer,uint256 limit)"); address[] private mintPayees = [ 0xaDC6A7985036531c394B6dF054666C51dE29b9a9, //Ozzy 0x76bf7b1e22C773754EBC608d92f71cc0B5D99d4B, //Sutter 0x8b8AbE9CEC13CF5050517816B2E95722E711818e //Dev ]; uint256[] private mintShares = [50, 45, 5]; SutterTreasury public royaltyRecipient; // CONSTRUCTOR ************************************************** constructor(string memory initialBaseUri) ERC721("CryptoBatz by Ozzy Osbourne", "BATZ") SutterTreasury(mintPayees, mintShares) { baseURI = initialBaseUri; ancientBatzMinter = msg.sender; presaleConfig = PresaleConfig({ startTime: 1642633200, // Wed Jan 19 2022 23:00:00 GMT+0000 endTime: 1642719600, // Thu Jan 20 2022 23:00:00 GMT+0000 supplyLimit: 8000, mintPrice: 0.088 ether }); dutchAuctionConfig = DutchAuctionConfig({ txLimit: 3, startTime: 1642721400, // Thu Jan 20 2022 23:30:00 GMT+0000 bottomTime: 1642735800, // Fri Jan 21 2022 03:30:00 GMT+0000 stepInterval: 60, // 1 minute startPrice: 1.666 ether, bottomPrice: 0.1 ether, priceStep: 0.006525 ether }); address[] memory royaltyPayees = new address[](2); royaltyPayees[0] = 0xaDC6A7985036531c394B6dF054666C51dE29b9a9; //Ozzy royaltyPayees[1] = 0x76bf7b1e22C773754EBC608d92f71cc0B5D99d4B; //Sutter uint256[] memory royaltyShares = new uint256[](2); royaltyShares[0] = 70; royaltyShares[1] = 30; royaltyRecipient = new SutterTreasury(royaltyPayees, royaltyShares); _setRoyalties(address(royaltyRecipient), 750); // 7.5% royalties uint256 chainId; assembly { chainId := chainid() } DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ), keccak256(bytes("CryptoBatz")), keccak256(bytes("1")), chainId, address(this) ) ); } // PUBLIC METHODS **************************************************** /// @notice Allows users to buy during presale, only whitelisted addresses may call this function. /// Whitelisting is enforced by requiring a signature from the whitelistSigner address /// @dev Whitelist signing is performed off chain, via the cryptobatz website backend /// @param signature signed data authenticating the validity of this transaction /// @param numberOfTokens number of NFTs to buy /// @param approvedLimit the total number of NFTs this address is permitted to buy during presale, this number is also encoded in the signature function buyPresale( bytes calldata signature, uint256 numberOfTokens, uint256 approvedLimit ) external payable { PresaleConfig memory _config = presaleConfig; require( block.timestamp >= _config.startTime && block.timestamp < _config.endTime, "Presale is not active" ); require(whitelistSigner != address(0), "Whitelist signer has not been set"); require( msg.value == (_config.mintPrice * numberOfTokens), "Incorrect payment" ); require( (presaleMinted[msg.sender] + numberOfTokens) <= approvedLimit, "Mint limit exceeded" ); require( (totalSupply + numberOfTokens) <= _config.supplyLimit, "Not enough BATZ remaining" ); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR, keccak256(abi.encode(TYPEHASH, msg.sender, approvedLimit)) ) ); address signer = digest.recover(signature); require( signer != address(0) && signer == whitelistSigner, "Invalid signature" ); presaleMinted[msg.sender] = presaleMinted[msg.sender] + numberOfTokens; mint(msg.sender, numberOfTokens); } /// @notice Allows users to buy during public sale, pricing follows a dutch auction format /// @dev Preventing contract buys has some downsides, but it seems to be what the NFT market generally wants as a bot mitigation measure /// @param numberOfTokens the number of NFTs to buy function buyPublic(uint256 numberOfTokens) external payable { // disallow contracts from buying require( (!msg.sender.isContract() && msg.sender == tx.origin), "Contract buys not allowed" ); DutchAuctionConfig memory _config = dutchAuctionConfig; require( (totalSupply + numberOfTokens) <= CRYPTO_BATZ_SUPPLY, "Not enough BATZ remaining" ); require(block.timestamp >= _config.startTime, "Sale is not active"); require(numberOfTokens <= _config.txLimit, "Transaction limit exceeded"); uint256 mintPrice = getCurrentAuctionPrice() * numberOfTokens; require(msg.value >= mintPrice, "Insufficient payment"); // refund if customer paid more than the cost to mint if (msg.value > mintPrice) { Address.sendValue(payable(msg.sender), msg.value - mintPrice); } mint(msg.sender, numberOfTokens); } /// @notice Gets the current price for the duction auction, based on current block timestamp /// @dev Dutch auction parameters configured via dutchAuctionConfig /// @return currentPrice Current mint price per NFT function getCurrentAuctionPrice() public view returns (uint256 currentPrice) { DutchAuctionConfig memory _config = dutchAuctionConfig; uint256 timestamp = block.timestamp; if (timestamp < _config.startTime) { currentPrice = _config.startPrice; } else if (timestamp >= _config.bottomTime) { currentPrice = _config.bottomPrice; } else { uint256 elapsedIntervals = (timestamp - _config.startTime) / _config.stepInterval; currentPrice = _config.startPrice - (elapsedIntervals * _config.priceStep); } return currentPrice; } /// @notice Gets an array of tokenIds owned by a wallet /// @param wallet wallet address to query contents for /// @return an array of tokenIds owned by wallet function tokensOwnedBy(address wallet) external view returns (uint256[] memory) { uint256 tokenCount = balanceOf(wallet); uint256[] memory ownedTokenIds = new uint256[](tokenCount); for (uint256 i = 0; i < tokenCount; i++) { ownedTokenIds[i] = _ownedTokens[wallet][i]; } return ownedTokenIds; } /// @inheritdoc ERC165 function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC2981) returns (bool) { return super.supportsInterface(interfaceId); } // OWNER METHODS ******************************************************** /// @notice Allows the contract owner to reserve NFTs for team members or promotional purposes /// @dev This should be called before presale or public sales start, as only the first MAX_OWNER_RESERVE tokens can be reserved /// @param to address for the reserved NFTs to be minted to /// @param numberOfTokens number of NFTs to reserve function reserve(address to, uint256 numberOfTokens) external onlyOwner { require( (totalSupply + numberOfTokens) <= MAX_OWNER_RESERVE, "Exceeds owner reserve limit" ); mint(to, numberOfTokens); } /// @notice Allows the owner to roll a pseudo-random number once, which will be used as the starting index for the token metadata. /// This is used to prove randomness and fairness in the metadata distribution, in conjunction with the PROVENANCE_HASH /// @dev The starting index can only be set once, only after the start of the public sale, and only if the PROVENANCE_HASH has been set function rollStartIndex() external onlyOwner { require(PROVENANCE_HASH != 0, "Provenance hash not set"); require(randomizedStartIndex == 0, "Index already set"); require( block.timestamp >= dutchAuctionConfig.startTime, "Too early to roll start index" ); uint256 number = uint256( keccak256( abi.encodePacked( blockhash(block.number - 1), block.coinbase, block.difficulty, block.timestamp ) ) ); randomizedStartIndex = (number % CRYPTO_BATZ_SUPPLY) + 1; emit StartingIndexSet(randomizedStartIndex); } /// @notice Allows the ancientBatzMinter to mint an AncientBatz to the specified address /// The Hanging Judge /// @param to the address for the AncientBatz to be minted to /// @param ancientBatzId the AncientBatz id, from 1 to ANCIENT_BATZ_SUPPLY inclusive function mintAncientBatz(address to, uint256 ancientBatzId) external { require(ancientBatzMinter != address(0), "AncientBatz minter not set"); require( msg.sender == ancientBatzMinter, "Must be authorized AncientBatz minter" ); require( ancientBatzId > 0 && ancientBatzId <= ANCIENT_BATZ_SUPPLY, "Invalid AncientBatz Id" ); uint256 tokenId = CRYPTO_BATZ_SUPPLY + ancientBatzId; emit AncientBatzMinted(to, ancientBatzId); _safeMint(to, tokenId); totalSupply++; } function setBaseURI(string calldata newBaseUri) external onlyOwner { emit BaseUriUpdated(newBaseUri); baseURI = newBaseUri; } function setWhitelistSigner(address newWhitelistSigner) external onlyOwner { emit WhitelistSignerUpdated(newWhitelistSigner); whitelistSigner = newWhitelistSigner; } function setAncientBatzMinter(address newMinter) external onlyOwner { emit AncientBatzMinterUpdated(newMinter); ancientBatzMinter = newMinter; } function setProvenance(uint256 provenanceHash) external onlyOwner { require(randomizedStartIndex == 0, "Starting index already set"); emit ProvenanceHashUpdated(provenanceHash); PROVENANCE_HASH = provenanceHash; } /// @notice Allows the contract owner to update start and end time for the presale function configurePresale(uint256 startTime, uint256 endTime) external onlyOwner { uint32 _startTime = startTime.toUint32(); uint32 _endTime = endTime.toUint32(); require(0 < _startTime, "Invalid time"); require(_startTime < _endTime, "Invalid time"); require(_endTime <= dutchAuctionConfig.startTime, "Invalid time"); presaleConfig.startTime = _startTime; presaleConfig.endTime = _endTime; emit PresaleConfigUpdated(); } /// @notice Allows the contract owner to update config for the public dutch auction function configureDutchAuction( uint256 startTime, uint256 bottomTime, uint256 stepInterval, uint256 startPrice, uint256 bottomPrice, uint256 priceStep ) external onlyOwner { uint32 _startTime = startTime.toUint32(); uint32 _bottomTime = bottomTime.toUint32(); uint32 _stepInterval = stepInterval.toUint32(); require(presaleConfig.endTime <= _startTime, "Invalid time"); require(_startTime < _bottomTime, "Invalid time"); require(0 < stepInterval, "0 step interval"); require(bottomPrice < startPrice, "Invalid start price"); require(0 < bottomPrice, "Invalid bottom price"); require(0 < priceStep && priceStep < startPrice, "Invalid price step"); dutchAuctionConfig.startTime = _startTime; dutchAuctionConfig.bottomTime = _bottomTime; dutchAuctionConfig.stepInterval = _stepInterval; dutchAuctionConfig.startPrice = startPrice; dutchAuctionConfig.bottomPrice = bottomPrice; dutchAuctionConfig.priceStep = priceStep; emit DutchAuctionConfigUpdated(); } // PRIVATE/INTERNAL METHODS **************************************************** function _baseURI() internal view override returns (string memory) { return baseURI; } function mint(address to, uint256 numberOfTokens) private { uint256 newId = totalSupply; for (uint256 i = 0; i < numberOfTokens; i++) { newId += 1; _safeMint(to, newId); } totalSupply = newId; } // ************************************************************************************************************************ // The following methods are borrowed from OpenZeppelin's ERC721Enumerable contract, to make it easier to query a wallet's // contents without incurring the extra storage gas costs of the full ERC721Enumerable extension // ************************************************************************************************************************ /** * @dev Private function to add a token to ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from != address(0)) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to != address(0)) { _addTokenToOwnerEnumeration(to, tokenId); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeCast.sol) pragma solidity ^0.8.0; /** * @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow * checks. * * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can * easily result in undesired exploitation or bugs, since developers usually * assume that overflows raise errors. `SafeCast` restores this intuition by * reverting the transaction when such an operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. * * Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing * all math on `uint256` and `int256` and then downcasting. */ library SafeCast { /** * @dev Returns the downcasted uint224 from uint256, reverting on * overflow (when the input is greater than largest uint224). * * Counterpart to Solidity's `uint224` operator. * * Requirements: * * - input must fit into 224 bits */ function toUint224(uint256 value) internal pure returns (uint224) { require(value <= type(uint224).max, "SafeCast: value doesn't fit in 224 bits"); return uint224(value); } /** * @dev Returns the downcasted uint128 from uint256, reverting on * overflow (when the input is greater than largest uint128). * * Counterpart to Solidity's `uint128` operator. * * Requirements: * * - input must fit into 128 bits */ function toUint128(uint256 value) internal pure returns (uint128) { require(value <= type(uint128).max, "SafeCast: value doesn't fit in 128 bits"); return uint128(value); } /** * @dev Returns the downcasted uint96 from uint256, reverting on * overflow (when the input is greater than largest uint96). * * Counterpart to Solidity's `uint96` operator. * * Requirements: * * - input must fit into 96 bits */ function toUint96(uint256 value) internal pure returns (uint96) { require(value <= type(uint96).max, "SafeCast: value doesn't fit in 96 bits"); return uint96(value); } /** * @dev Returns the downcasted uint64 from uint256, reverting on * overflow (when the input is greater than largest uint64). * * Counterpart to Solidity's `uint64` operator. * * Requirements: * * - input must fit into 64 bits */ function toUint64(uint256 value) internal pure returns (uint64) { require(value <= type(uint64).max, "SafeCast: value doesn't fit in 64 bits"); return uint64(value); } /** * @dev Returns the downcasted uint32 from uint256, reverting on * overflow (when the input is greater than largest uint32). * * Counterpart to Solidity's `uint32` operator. * * Requirements: * * - input must fit into 32 bits */ function toUint32(uint256 value) internal pure returns (uint32) { require(value <= type(uint32).max, "SafeCast: value doesn't fit in 32 bits"); return uint32(value); } /** * @dev Returns the downcasted uint16 from uint256, reverting on * overflow (when the input is greater than largest uint16). * * Counterpart to Solidity's `uint16` operator. * * Requirements: * * - input must fit into 16 bits */ function toUint16(uint256 value) internal pure returns (uint16) { require(value <= type(uint16).max, "SafeCast: value doesn't fit in 16 bits"); return uint16(value); } /** * @dev Returns the downcasted uint8 from uint256, reverting on * overflow (when the input is greater than largest uint8). * * Counterpart to Solidity's `uint8` operator. * * Requirements: * * - input must fit into 8 bits. */ function toUint8(uint256 value) internal pure returns (uint8) { require(value <= type(uint8).max, "SafeCast: value doesn't fit in 8 bits"); return uint8(value); } /** * @dev Converts a signed int256 into an unsigned uint256. * * Requirements: * * - input must be greater than or equal to 0. */ function toUint256(int256 value) internal pure returns (uint256) { require(value >= 0, "SafeCast: value must be positive"); return uint256(value); } /** * @dev Returns the downcasted int128 from int256, reverting on * overflow (when the input is less than smallest int128 or * greater than largest int128). * * Counterpart to Solidity's `int128` operator. * * Requirements: * * - input must fit into 128 bits * * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128) { require(value >= type(int128).min && value <= type(int128).max, "SafeCast: value doesn't fit in 128 bits"); return int128(value); } /** * @dev Returns the downcasted int64 from int256, reverting on * overflow (when the input is less than smallest int64 or * greater than largest int64). * * Counterpart to Solidity's `int64` operator. * * Requirements: * * - input must fit into 64 bits * * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64) { require(value >= type(int64).min && value <= type(int64).max, "SafeCast: value doesn't fit in 64 bits"); return int64(value); } /** * @dev Returns the downcasted int32 from int256, reverting on * overflow (when the input is less than smallest int32 or * greater than largest int32). * * Counterpart to Solidity's `int32` operator. * * Requirements: * * - input must fit into 32 bits * * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32) { require(value >= type(int32).min && value <= type(int32).max, "SafeCast: value doesn't fit in 32 bits"); return int32(value); } /** * @dev Returns the downcasted int16 from int256, reverting on * overflow (when the input is less than smallest int16 or * greater than largest int16). * * Counterpart to Solidity's `int16` operator. * * Requirements: * * - input must fit into 16 bits * * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16) { require(value >= type(int16).min && value <= type(int16).max, "SafeCast: value doesn't fit in 16 bits"); return int16(value); } /** * @dev Returns the downcasted int8 from int256, reverting on * overflow (when the input is less than smallest int8 or * greater than largest int8). * * Counterpart to Solidity's `int8` operator. * * Requirements: * * - input must fit into 8 bits. * * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8) { require(value >= type(int8).min && value <= type(int8).max, "SafeCast: value doesn't fit in 8 bits"); return int8(value); } /** * @dev Converts an unsigned uint256 into a signed int256. * * Requirements: * * - input must be less than or equal to maxInt256. */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive require(value <= uint256(type(int256).max), "SafeCast: value doesn't fit in an int256"); return int256(value); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @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. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: None pragma solidity ^0.8.8; import "@openzeppelin/contracts/finance/PaymentSplitter.sol"; contract SutterTreasury is PaymentSplitter { uint256 private _numberOfPayees; constructor(address[] memory payees, uint256[] memory shares_) payable PaymentSplitter(payees, shares_) { _numberOfPayees = payees.length; } function withdrawAll() external { require(address(this).balance > 0, "No balance to withdraw"); for (uint256 i = 0; i < _numberOfPayees; i++) { release(payable(payee(i))); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "./IERC2981.sol"; /// @dev This is a contract used to add ERC2981 support to ERC721 and 1155 contract ERC2981 is ERC165, IERC2981 { struct RoyaltyInfo { address recipient; uint24 amount; } RoyaltyInfo private _royalties; /// @dev Sets token royalties /// @param recipient recipient of the royalties /// @param value percentage (using 2 decimals - 10000 = 100, 0 = 0) function _setRoyalties(address recipient, uint256 value) internal { require(value <= 10000, "ERC2981Royalties: Too high"); _royalties = RoyaltyInfo(recipient, uint24(value)); } /// @inheritdoc IERC2981 function royaltyInfo(uint256, uint256 value) external view override returns (address receiver, uint256 royaltyAmount) { RoyaltyInfo memory royalties = _royalties; receiver = royalties.recipient; royaltyAmount = (value * royalties.amount) / 10000; } /// @inheritdoc ERC165 function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (finance/PaymentSplitter.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @title PaymentSplitter * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. * * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you * to run tests before sending real value to this contract. */ contract PaymentSplitter is Context { event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount); event PaymentReceived(address from, uint256 amount); uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; mapping(IERC20 => uint256) private _erc20TotalReleased; mapping(IERC20 => mapping(address => uint256)) private _erc20Released; /** * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at * the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ constructor(address[] memory payees, uint256[] memory shares_) payable { require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitter: no payees"); for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { emit PaymentReceived(_msgSender(), msg.value); } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view returns (uint256) { return _totalShares; } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view returns (uint256) { return _totalReleased; } /** * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20 * contract. */ function totalReleased(IERC20 token) public view returns (uint256) { return _erc20TotalReleased[token]; } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view returns (uint256) { return _shares[account]; } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view returns (uint256) { return _released[account]; } /** * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an * IERC20 contract. */ function released(IERC20 token, address account) public view returns (uint256) { return _erc20Released[token][account]; } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view returns (address) { return _payees[index]; } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = address(this).balance + totalReleased(); uint256 payment = _pendingPayment(account, totalReceived, released(account)); require(payment != 0, "PaymentSplitter: account is not due payment"); _released[account] += payment; _totalReleased += payment; Address.sendValue(account, payment); emit PaymentReleased(account, payment); } /** * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20 * contract. */ function release(IERC20 token, address account) public virtual { require(_shares[account] > 0, "PaymentSplitter: account has no shares"); uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token); uint256 payment = _pendingPayment(account, totalReceived, released(token, account)); require(payment != 0, "PaymentSplitter: account is not due payment"); _erc20Released[token][account] += payment; _erc20TotalReleased[token] += payment; SafeERC20.safeTransfer(token, account, payment); emit ERC20PaymentReleased(token, account, payment); } /** * @dev internal logic for computing the pending payment of an `account` given the token historical balances and * already released amounts. */ function _pendingPayment( address account, uint256 totalReceived, uint256 alreadyReleased ) private view returns (uint256) { return (totalReceived * _shares[account]) / _totalShares - alreadyReleased; } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private { require(account != address(0), "PaymentSplitter: account is the zero address"); require(shares_ > 0, "PaymentSplitter: shares are 0"); require(_shares[account] == 0, "PaymentSplitter: account already has shares"); _payees.push(account); _shares[account] = shares_; _totalShares = _totalShares + shares_; emit PayeeAdded(account, shares_); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: None pragma solidity ^0.8.8; /// /// @dev Interface for the NFT Royalty Standard /// interface IERC2981 { /// @notice Called with the sale price to determine how much royalty // is owed and to whom. /// @param _tokenId - the NFT asset queried for royalty information /// @param _salePrice - the sale price of the NFT asset specified by _tokenId /// @return receiver - address of who should be sent the royalty payment /// @return royaltyAmount - the royalty payment amount for _salePrice function royaltyInfo(uint256 _tokenId, uint256 _salePrice) external view returns (address receiver, uint256 royaltyAmount); }
{ "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":"string","name":"initialBaseUri","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"AncientBatzMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_address","type":"address"}],"name":"AncientBatzMinterUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_uri","type":"string"}],"name":"BaseUriUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"DutchAuctionConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ERC20PaymentReleased","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"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"PayeeAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PaymentReleased","type":"event"},{"anonymous":false,"inputs":[],"name":"PresaleConfigUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_hash","type":"uint256"}],"name":"ProvenanceHashUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"StartingIndexSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_signer","type":"address"}],"name":"WhitelistSignerUpdated","type":"event"},{"inputs":[],"name":"ANCIENT_BATZ_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CRYPTO_BATZ_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_OWNER_RESERVE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROVENANCE_HASH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ancientBatzMinter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"numberOfTokens","type":"uint256"},{"internalType":"uint256","name":"approvedLimit","type":"uint256"}],"name":"buyPresale","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"numberOfTokens","type":"uint256"}],"name":"buyPublic","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"bottomTime","type":"uint256"},{"internalType":"uint256","name":"stepInterval","type":"uint256"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"bottomPrice","type":"uint256"},{"internalType":"uint256","name":"priceStep","type":"uint256"}],"name":"configureDutchAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"name":"configurePresale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dutchAuctionConfig","outputs":[{"internalType":"uint32","name":"txLimit","type":"uint32"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"bottomTime","type":"uint32"},{"internalType":"uint32","name":"stepInterval","type":"uint32"},{"internalType":"uint256","name":"startPrice","type":"uint256"},{"internalType":"uint256","name":"bottomPrice","type":"uint256"},{"internalType":"uint256","name":"priceStep","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentAuctionPrice","outputs":[{"internalType":"uint256","name":"currentPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"ancientBatzId","type":"uint256"}],"name":"mintAncientBatz","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"payee","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleConfig","outputs":[{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"endTime","type":"uint32"},{"internalType":"uint32","name":"supplyLimit","type":"uint32"},{"internalType":"uint256","name":"mintPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"randomizedStartIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"released","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"numberOfTokens","type":"uint256"}],"name":"reserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rollStartIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyRecipient","outputs":[{"internalType":"contract SutterTreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMinter","type":"address"}],"name":"setAncientBatzMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseUri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"provenanceHash","type":"uint256"}],"name":"setProvenance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newWhitelistSigner","type":"address"}],"name":"setWhitelistSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"shares","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":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"}],"name":"tokensOwnedBy","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalReleased","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whitelistSigner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
600060105560e060405273adc6a7985036531c394b6df054666c51de29b9a960809081527376bf7b1e22c773754ebc608d92f71cc0b5d99d4b60a052738b8abe9cec13cf5050517816b2e95722e711818e60c0526200006390602090600362000984565b506040805160608101825260328152602d602082015260059181019190915262000092906021906003620009ee565b50348015620000a057600080fd5b5060405162005f9338038062005f93833981016040819052620000c39162000ae9565b6020805460408051828402810184019091528181529190828201828280156200011657602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620000f7575b505050505060218054806020026020016040519081016040528092919081815260200182805480156200016957602002820191906000526020600020905b81548152602001906001019080831162000154575b505050505081816040518060400160405280601b81526020017f43727970746f4261747a206279204f7a7a79204f73626f75726e650000000000815250604051806040016040528060048152602001632120aa2d60e11b815250620001dd620001d7620006a460201b60201c565b620006a8565b8151620001f290600190602085019062000a31565b5080516200020890600290602084019062000a31565b50505080518251146200027d5760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620002d05760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f20706179656573000000000000604482015260640162000274565b60005b82518110156200033c5762000327838281518110620002f657620002f662000bc5565b602002602001015183838151811062000313576200031362000bc5565b6020026020010151620006f860201b60201c565b80620003338162000bf1565b915050620002d3565b50509151600f55505080516200035a90601990602084019062000a31565b50601b8054336001600160a01b031990911617905560408051608080820183526361e897f082526361e9e970602080840191909152611f4083850152670138a388a43c00006060938401819052601380546001600160601b031916691f4061e9e97061e897f0179055601455835160e081018552600381526361e9f078818301526361ea28b881860152603c8185015267171ed22c53cd000092810183905267016345785d8a000060a0820181905266172e73f328d00060c0909201829052601580546001600160801b0319166c3c61ea28b861e9f078000000031790556016939093556017929092556018919091558251600280825292810184526000939092918301908036833701905050905073adc6a7985036531c394b6df054666c51de29b9a98160008151811062000494576200049462000bc5565b60200260200101906001600160a01b031690816001600160a01b0316815250507376bf7b1e22c773754ebc608d92f71cc0b5d99d4b81600181518110620004df57620004df62000bc5565b6001600160a01b0392909216602092830291909101820152604080516002808252606082018352600093919290918301908036833701905050905060468160008151811062000532576200053262000bc5565b602002602001018181525050601e8160018151811062000556576200055662000bc5565b6020026020010181815250508181604051620005729062000aae565b6200057f92919062000c0f565b604051809103906000f0801580156200059c573d6000803e3d6000fd5b50602280546001600160a01b0319166001600160a01b03929092169182179055620005ca906102ee620008e6565b5050604080518082018252600a81526921b93cb83a37a130ba3d60b11b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f4cd623e634825d03c9e358bf0b908ce4eb74e3227158217072ec57b7fe69f654818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c09091019092528151910120601f555062000cef565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216620007655760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b606482015260840162000274565b60008111620007b75760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a20736861726573206172652030000000604482015260640162000274565b6001600160a01b0382166000908152600a602052604090205415620008335760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b606482015260840162000274565b600c8054600181019091557fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c70180546001600160a01b0319166001600160a01b0384169081179091556000908152600a602052604090208190556008546200089d90829062000c97565b600855604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b6127108111156200093a5760405162461bcd60e51b815260206004820152601a60248201527f45524332393831526f79616c746965733a20546f6f2068696768000000000000604482015260640162000274565b604080518082019091526001600160a01b0390921680835262ffffff909116602090920182905260078054600160a01b9093026001600160b81b0319909316909117919091179055565b828054828255906000526020600020908101928215620009dc579160200282015b82811115620009dc57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620009a5565b50620009ea92915062000abc565b5090565b828054828255906000526020600020908101928215620009dc579160200282015b82811115620009dc578251829060ff1690559160200191906001019062000a0f565b82805462000a3f9062000cb2565b90600052602060002090601f01602090048101928262000a635760008555620009dc565b82601f1062000a7e57805160ff1916838001178555620009dc565b82800160010185558215620009dc579182015b82811115620009dc57825182559160200191906001019062000a91565b61121a8062004d7983390190565b5b80821115620009ea576000815560010162000abd565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121562000afd57600080fd5b82516001600160401b038082111562000b1557600080fd5b818501915085601f83011262000b2a57600080fd5b81518181111562000b3f5762000b3f62000ad3565b604051601f8201601f19908116603f0116810190838211818310171562000b6a5762000b6a62000ad3565b81604052828152888684870101111562000b8357600080fd5b600093505b8284101562000ba7578484018601518185018701529285019262000b88565b8284111562000bb95760008684830101525b98975050505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141562000c085762000c0862000bdb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101562000c535781516001600160a01b03168452928401929084019060010162000c2c565b5050508381038285015284518082528583019183019060005b8181101562000c8a5783518352928401929184019160010162000c6c565b5090979650505050505050565b6000821982111562000cad5762000cad62000bdb565b500190565b600181811c9082168062000cc757607f821691505b6020821081141562000ce957634e487b7160e01b600052602260045260246000fd5b50919050565b61407a8062000cff6000396000f3fe6080604052600436106103035760003560e01c8063715018a611610190578063cc47a40b116100dc578063e985e9c511610095578063ef81b4d41161006f578063ef81b4d414610a17578063f2fde38b14610a37578063fd88fa6914610a57578063ff1b655614610ac157600080fd5b8063e985e9c514610981578063ea66aeb3146109ca578063ec5ed89b146109f757600080fd5b8063cc47a40b146108ab578063ce7c2ac2146108cb578063ce9124f514610901578063d338143814610916578063d79779b214610936578063e33b7de31461096c57600080fd5b806395d89b4111610149578063a6c5846711610123578063a6c5846714610842578063b88d4fde14610858578063c0c8dd0714610878578063c87b56dd1461088b57600080fd5b806395d89b41146107d75780639852595c146107ec578063a22cb4651461082257600080fd5b8063715018a6146106bd578063755486b2146106d25780637bd07f8b146106f2578063853828b6146107845780638b83209b146107995780638da5cb5b146107b957600080fd5b80632a55205a1161024f5780634c00de82116102085780635aca1982116101e25780635aca1982146106535780636352211e146106685780636c0360eb1461068857806370a082311461069d57600080fd5b80634c00de82146105fe57806351c7115b1461061e57806355f804b31461063357600080fd5b80632a55205a146105115780633266e957146105505780633a98ef3914610563578063406072a91461057857806342842e0e146105be57806348b75044146105de57600080fd5b8063097fedd3116102bc5780631bf9f509116102965780631bf9f5091461049b5780631d3e946c146104bb57806323b872dd146104db5780632a3dd109146104fb57600080fd5b8063097fedd31461044557806318160ddd14610465578063191655871461047b57600080fd5b806301ffc9a714610351578063040ba9ea1461038657806306968310146103a957806306fdde03146103cb578063081812fc146103ed578063095ea7b31461042557600080fd5b3661034c577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b34801561035d57600080fd5b5061037161036c36600461385e565b610ad7565b60405190151581526020015b60405180910390f35b34801561039257600080fd5b5061039b606381565b60405190815260200161037d565b3480156103b557600080fd5b506103c96103c436600461387b565b610ae8565b005b3480156103d757600080fd5b506103e0610ba3565b60405161037d91906138ec565b3480156103f957600080fd5b5061040d61040836600461387b565b610c35565b6040516001600160a01b03909116815260200161037d565b34801561043157600080fd5b506103c9610440366004613914565b610cca565b34801561045157600080fd5b506103c9610460366004613940565b610de0565b34801561047157600080fd5b5061039b60105481565b34801561048757600080fd5b506103c9610496366004613983565b61104a565b3480156104a757600080fd5b506103c96104b6366004613983565b611178565b3480156104c757600080fd5b50601b5461040d906001600160a01b031681565b3480156104e757600080fd5b506103c96104f63660046139a0565b611200565b34801561050757600080fd5b5061039b601d5481565b34801561051d57600080fd5b5061053161052c3660046139e1565b611231565b604080516001600160a01b03909316835260208301919091520161037d565b6103c961055e366004613a45565b611286565b34801561056f57600080fd5b5060085461039b565b34801561058457600080fd5b5061039b610593366004613a96565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506103c96105d93660046139a0565b61161d565b3480156105ea57600080fd5b506103c96105f9366004613a96565b611638565b34801561060a57600080fd5b5060225461040d906001600160a01b031681565b34801561062a57600080fd5b5061039b611820565b34801561063f57600080fd5b506103c961064e366004613acf565b611904565b34801561065f57600080fd5b506103c9611973565b34801561067457600080fd5b5061040d61068336600461387b565b611b39565b34801561069457600080fd5b506103e0611bb0565b3480156106a957600080fd5b5061039b6106b8366004613983565b611c3e565b3480156106c957600080fd5b506103c9611cc5565b3480156106de57600080fd5b506103c96106ed366004613914565b611cfb565b3480156106fe57600080fd5b5060155460165460175460185461073e9363ffffffff80821694600160201b8304821694600160401b8404831694600160601b9094049092169290919087565b6040805163ffffffff9889168152968816602088015294871694860194909452949091166060840152608083015260a082019290925260c081019190915260e00161037d565b34801561079057600080fd5b506103c9611e7c565b3480156107a557600080fd5b5061040d6107b436600461387b565b611ef3565b3480156107c557600080fd5b506000546001600160a01b031661040d565b3480156107e357600080fd5b506103e0611f23565b3480156107f857600080fd5b5061039b610807366004613983565b6001600160a01b03166000908152600b602052604090205490565b34801561082e57600080fd5b506103c961083d366004613b1f565b611f32565b34801561084e57600080fd5b5061039b6125c281565b34801561086457600080fd5b506103c9610873366004613b63565b611f41565b6103c961088636600461387b565b611f79565b34801561089757600080fd5b506103e06108a636600461387b565b6121b4565b3480156108b757600080fd5b506103c96108c6366004613914565b61228f565b3480156108d757600080fd5b5061039b6108e6366004613983565b6001600160a01b03166000908152600a602052604090205490565b34801561090d57600080fd5b5061039b606481565b34801561092257600080fd5b506103c9610931366004613983565b612321565b34801561094257600080fd5b5061039b610951366004613983565b6001600160a01b03166000908152600d602052604090205490565b34801561097857600080fd5b5060095461039b565b34801561098d57600080fd5b5061037161099c366004613a96565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b3480156109d657600080fd5b506109ea6109e5366004613983565b6123a9565b60405161037d9190613c43565b348015610a0357600080fd5b506103c9610a123660046139e1565b612467565b348015610a2357600080fd5b50601a5461040d906001600160a01b031681565b348015610a4357600080fd5b506103c9610a52366004613983565b612584565b348015610a6357600080fd5b50601354601454610a8f9163ffffffff80821692600160201b8304821692600160401b90049091169084565b60405161037d949392919063ffffffff9485168152928416602084015292166040820152606081019190915260800190565b348015610acd57600080fd5b5061039b601c5481565b6000610ae28261261c565b92915050565b6000546001600160a01b03163314610b1b5760405162461bcd60e51b8152600401610b1290613c87565b60405180910390fd5b601d5415610b6b5760405162461bcd60e51b815260206004820152601a60248201527f5374617274696e6720696e64657820616c7265616479207365740000000000006044820152606401610b12565b6040518181527f7a118106d7ec5624cae2261255cffcd06cc8e43e34e8b2506e4f25c7fd23cbb29060200160405180910390a1601c55565b606060018054610bb290613cbc565b80601f0160208091040260200160405190810160405280929190818152602001828054610bde90613cbc565b8015610c2b5780601f10610c0057610100808354040283529160200191610c2b565b820191906000526020600020905b815481529060010190602001808311610c0e57829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b0316610cae5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b12565b506000908152600560205260409020546001600160a01b031690565b6000610cd582611b39565b9050806001600160a01b0316836001600160a01b03161415610d435760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b12565b336001600160a01b0382161480610d5f5750610d5f813361099c565b610dd15760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b12565b610ddb8383612641565b505050565b6000546001600160a01b03163314610e0a5760405162461bcd60e51b8152600401610b1290613c87565b6000610e15876126af565b90506000610e22876126af565b90506000610e2f876126af565b60135490915063ffffffff808516600160201b909204161115610e645760405162461bcd60e51b8152600401610b1290613cf7565b8163ffffffff168363ffffffff1610610e8f5760405162461bcd60e51b8152600401610b1290613cf7565b86600010610ed15760405162461bcd60e51b815260206004820152600f60248201526e0c081cdd195c081a5b9d195c9d985b608a1b6044820152606401610b12565b858510610f165760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420737461727420707269636560681b6044820152606401610b12565b84600010610f5d5760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420626f74746f6d20707269636560601b6044820152606401610b12565b836000108015610f6c57508584105b610fad5760405162461bcd60e51b81526020600482015260126024820152710496e76616c696420707269636520737465760741b6044820152606401610b12565b601580546bffffffffffffffff000000001916600160201b63ffffffff868116919091026bffffffff0000000000000000191691909117600160401b858316021763ffffffff60601b1916600160601b918416919091021790556016869055601785905560188490556040517f585ef91acea44084cac26f5bbe4a675e850dd07762ebb27e9838544a38fa867190600090a1505050505050505050565b6001600160a01b0381166000908152600a602052604090205461107f5760405162461bcd60e51b8152600401610b1290613d1d565b600061108a60095490565b6110949047613d79565b905060006110c183836110bc866001600160a01b03166000908152600b602052604090205490565b612718565b9050806110e05760405162461bcd60e51b8152600401610b1290613d91565b6001600160a01b0383166000908152600b602052604081208054839290611108908490613d79565b9250508190555080600960008282546111219190613d79565b909155506111319050838261275e565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b6000546001600160a01b031633146111a25760405162461bcd60e51b8152600401610b1290613c87565b6040516001600160a01b03821681527ffa58eecf7016f069d53d57b14c0b2a98c90ffe8deaec7b465b8618f850d2d7b59060200160405180910390a1601b80546001600160a01b0319166001600160a01b0392909216919091179055565b61120a3382612877565b6112265760405162461bcd60e51b8152600401610b1290613ddc565b610ddb83838361296d565b604080518082019091526007546001600160a01b038116808352600160a01b90910462ffffff16602083018190529091600091612710906112729086613e2d565b61127c9190613e62565b9150509250929050565b6040805160808101825260135463ffffffff808216808452600160201b830482166020850152600160401b909204169282019290925260145460608201529042108015906112dd5750806020015163ffffffff1642105b6113215760405162461bcd60e51b815260206004820152601560248201527450726573616c65206973206e6f742061637469766560581b6044820152606401610b12565b601a546001600160a01b03166113835760405162461bcd60e51b815260206004820152602160248201527f57686974656c697374207369676e657220686173206e6f74206265656e2073656044820152601d60fa1b6064820152608401610b12565b8281606001516113939190613e2d565b34146113d55760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b6044820152606401610b12565b336000908152601e602052604090205482906113f2908590613d79565b11156114365760405162461bcd60e51b8152602060048201526013602482015272135a5b9d081b1a5b5a5d08195e18d959591959606a1b6044820152606401610b12565b806040015163ffffffff168360105461144f9190613d79565b11156114995760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f756768204241545a2072656d61696e696e6760381b6044820152606401610b12565b601f54604080517f62b1d609957efd7198a66f841063387013c1f07f57cbb6ae3cd625ddd9f9ebab6020820152339181019190915260608101849052600091906080016040516020818303038152906040528051906020012060405160200161151992919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600061157587878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050612b189050565b90506001600160a01b0381161580159061159c5750601a546001600160a01b038281169116145b6115dc5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610b12565b336000908152601e60205260409020546115f7908690613d79565b336000818152601e60205260409020919091556116149086612b34565b50505050505050565b610ddb83838360405180602001604052806000815250611f41565b6001600160a01b0381166000908152600a602052604090205461166d5760405162461bcd60e51b8152600401610b1290613d1d565b6001600160a01b0382166000908152600d60205260408120546040516370a0823160e01b81523060048201526001600160a01b038516906370a082319060240160206040518083038186803b1580156116c557600080fd5b505afa1580156116d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fd9190613e76565b6117079190613d79565b9050600061174083836110bc87876001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b90508061175f5760405162461bcd60e51b8152600401610b1290613d91565b6001600160a01b038085166000908152600e6020908152604080832093871683529290529081208054839290611796908490613d79565b90915550506001600160a01b0384166000908152600d6020526040812080548392906117c3908490613d79565b909155506117d49050848483612b73565b604080516001600160a01b038581168252602082018490528616917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a250505050565b6040805160e08101825260155463ffffffff8082168352600160201b8204811660208401819052600160401b8304821694840194909452600160601b909104166060820152601654608082015260175460a082015260185460c08201526000914290811015611893575060800151919050565b816040015163ffffffff1681106118ae575060a00151919050565b6000826060015163ffffffff16836020015163ffffffff16836118d19190613e8f565b6118db9190613e62565b90508260c00151816118ed9190613e2d565b83608001516118fc9190613e8f565b935050505090565b6000546001600160a01b0316331461192e5760405162461bcd60e51b8152600401610b1290613c87565b7f24a9152dc695ecc801ad580886331ee12d7aac0fa2ae341a5ae3c2ccae36cb4f828260405161195f929190613ea6565b60405180910390a1610ddb601983836137b8565b6000546001600160a01b0316331461199d5760405162461bcd60e51b8152600401610b1290613c87565b601c546119ec5760405162461bcd60e51b815260206004820152601760248201527f50726f76656e616e63652068617368206e6f74207365740000000000000000006044820152606401610b12565b601d5415611a305760405162461bcd60e51b8152602060048201526011602482015270125b99195e08185b1c9958591e481cd95d607a1b6044820152606401610b12565b601554600160201b900463ffffffff16421015611a8f5760405162461bcd60e51b815260206004820152601d60248201527f546f6f206561726c7920746f20726f6c6c20737461727420696e6465780000006044820152606401610b12565b6000611a9c600143613e8f565b60408051914060208301526bffffffffffffffffffffffff194160601b169082015244605482015242607482015260940160408051601f1981840301815291905280516020909101209050611af36125c282613ed5565b611afe906001613d79565b601d8190556040519081527fca6fb0afaccdd6d4e6bae677f2228557803ae36f831e27606d4f4ccffc4286599060200160405180910390a150565b6000818152600360205260408120546001600160a01b031680610ae25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b12565b60198054611bbd90613cbc565b80601f0160208091040260200160405190810160405280929190818152602001828054611be990613cbc565b8015611c365780601f10611c0b57610100808354040283529160200191611c36565b820191906000526020600020905b815481529060010190602001808311611c1957829003601f168201915b505050505081565b60006001600160a01b038216611ca95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b12565b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314611cef5760405162461bcd60e51b8152600401610b1290613c87565b611cf96000612bc5565b565b601b546001600160a01b0316611d535760405162461bcd60e51b815260206004820152601a60248201527f416e6369656e744261747a206d696e746572206e6f74207365740000000000006044820152606401610b12565b601b546001600160a01b03163314611dbb5760405162461bcd60e51b815260206004820152602560248201527f4d75737420626520617574686f72697a656420416e6369656e744261747a206d60448201526434b73a32b960d91b6064820152608401610b12565b600081118015611dcc575060638111155b611e115760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a5908105b98da595b9d10985d1e88125960521b6044820152606401610b12565b6000611e1f826125c2613d79565b905081836001600160a01b03167ffa1f2f7c8c968670bcb031f074110e4e82778c4a83fe1c872e4ccc2e5371f33a60405160405180910390a3611e628382612c15565b60108054906000611e7283613ee9565b9190505550505050565b60004711611ec55760405162461bcd60e51b81526020600482015260166024820152754e6f2062616c616e636520746f20776974686472617760501b6044820152606401610b12565b60005b600f54811015611ef057611ede61049682611ef3565b80611ee881613ee9565b915050611ec8565b50565b6000600c8281548110611f0857611f08613f04565b6000918252602090912001546001600160a01b031692915050565b606060028054610bb290613cbc565b611f3d338383612c2f565b5050565b611f4b3383612877565b611f675760405162461bcd60e51b8152600401610b1290613ddc565b611f7384848484612cfe565b50505050565b333b158015611f8757503332145b611fd35760405162461bcd60e51b815260206004820152601960248201527f436f6e74726163742062757973206e6f7420616c6c6f776564000000000000006044820152606401610b12565b6040805160e08101825260155463ffffffff8082168352600160201b820481166020840152600160401b8204811693830193909352600160601b90049091166060820152601654608082015260175460a082015260185460c08201526010546125c290612041908490613d79565b111561208b5760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f756768204241545a2072656d61696e696e6760381b6044820152606401610b12565b806020015163ffffffff164210156120da5760405162461bcd60e51b815260206004820152601260248201527153616c65206973206e6f742061637469766560701b6044820152606401610b12565b805163ffffffff168211156121315760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e206c696d69742065786365656465640000000000006044820152606401610b12565b60008261213c611820565b6121469190613e2d565b90508034101561218f5760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152606401610b12565b803411156121aa576121aa336121a58334613e8f565b61275e565b610ddb3384612b34565b6000818152600360205260409020546060906001600160a01b03166122335760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b12565b600061223d612d31565b9050600081511161225d5760405180602001604052806000815250612288565b8061226784612d40565b604051602001612278929190613f1a565b6040516020818303038152906040525b9392505050565b6000546001600160a01b031633146122b95760405162461bcd60e51b8152600401610b1290613c87565b6064816010546122c99190613d79565b11156123175760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206f776e65722072657365727665206c696d697400000000006044820152606401610b12565b611f3d8282612b34565b6000546001600160a01b0316331461234b5760405162461bcd60e51b8152600401610b1290613c87565b6040516001600160a01b03821681527f0411c872a35ac01013d258ad2fe1ffd003847123a878624b993c256fd75d1d789060200160405180910390a1601a80546001600160a01b0319166001600160a01b0392909216919091179055565b606060006123b683611c3e565b905060008167ffffffffffffffff8111156123d3576123d3613b4d565b6040519080825280602002602001820160405280156123fc578160200160208202803683370190505b50905060005b8281101561245f576001600160a01b0385166000908152601160209081526040808320848452909152902054825183908390811061244257612442613f04565b60209081029190910101528061245781613ee9565b915050612402565b509392505050565b6000546001600160a01b031633146124915760405162461bcd60e51b8152600401610b1290613c87565b600061249c836126af565b905060006124a9836126af565b90508163ffffffff166000106124d15760405162461bcd60e51b8152600401610b1290613cf7565b8063ffffffff168263ffffffff16106124fc5760405162461bcd60e51b8152600401610b1290613cf7565b60155463ffffffff600160201b9091048116908216111561252f5760405162461bcd60e51b8152600401610b1290613cf7565b6013805463ffffffff838116600160201b0267ffffffffffffffff19909216908516171790556040517f78416bc810005a62b38a156c2241d33b50a7d83e064ca20d330c528f926cfa2f90600090a150505050565b6000546001600160a01b031633146125ae5760405162461bcd60e51b8152600401610b1290613c87565b6001600160a01b0381166126135760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b12565b611ef081612bc5565b60006001600160e01b0319821663152a902d60e11b1480610ae25750610ae282612e3e565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061267682611b39565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600063ffffffff8211156127145760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610b12565b5090565b6008546001600160a01b0384166000908152600a6020526040812054909183916127429086613e2d565b61274c9190613e62565b6127569190613e8f565b949350505050565b804710156127ae5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b12565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146127fb576040519150601f19603f3d011682016040523d82523d6000602084013e612800565b606091505b5050905080610ddb5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b12565b6000818152600360205260408120546001600160a01b03166128f05760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b12565b60006128fb83611b39565b9050806001600160a01b0316846001600160a01b031614806129365750836001600160a01b031661292b84610c35565b6001600160a01b0316145b8061275657506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff16949350505050565b826001600160a01b031661298082611b39565b6001600160a01b0316146129e85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b12565b6001600160a01b038216612a4a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b12565b612a55838383612e8e565b612a60600082612641565b6001600160a01b0383166000908152600460205260408120805460019290612a89908490613e8f565b90915550506001600160a01b0382166000908152600460205260408120805460019290612ab7908490613d79565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000806000612b278585612ec0565b9150915061245f81612f30565b60105460005b82811015612b6b57612b4d600183613d79565b9150612b598483612c15565b80612b6381613ee9565b915050612b3a565b506010555050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ddb9084906130eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611f3d8282604051806020016040528060008152506131bd565b816001600160a01b0316836001600160a01b03161415612c915760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b12565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612d0984848461296d565b612d15848484846131f0565b611f735760405162461bcd60e51b8152600401610b1290613f49565b606060198054610bb290613cbc565b606081612d645750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612d8e5780612d7881613ee9565b9150612d879050600a83613e62565b9150612d68565b60008167ffffffffffffffff811115612da957612da9613b4d565b6040519080825280601f01601f191660200182016040528015612dd3576020820181803683370190505b5090505b841561275657612de8600183613e8f565b9150612df5600a86613ed5565b612e00906030613d79565b60f81b818381518110612e1557612e15613f04565b60200101906001600160f81b031916908160001a905350612e37600a86613e62565b9450612dd7565b60006001600160e01b031982166380ac58cd60e01b1480612e6f57506001600160e01b03198216635b5e139f60e01b145b80610ae257506301ffc9a760e01b6001600160e01b0319831614610ae2565b6001600160a01b03831615612ea757612ea783826132fd565b6001600160a01b03821615610ddb57610ddb828261339a565b600080825160411415612ef75760208301516040840151606085015160001a612eeb878285856133de565b94509450505050612f29565b825160401415612f215760208301516040840151612f168683836134cb565b935093505050612f29565b506000905060025b9250929050565b6000816004811115612f4457612f44613f9b565b1415612f4d5750565b6001816004811115612f6157612f61613f9b565b1415612faf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b12565b6002816004811115612fc357612fc3613f9b565b14156130115760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b12565b600381600481111561302557613025613f9b565b141561307e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b12565b600481600481111561309257613092613f9b565b1415611ef05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b12565b6000613140826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134fa9092919063ffffffff16565b805190915015610ddb578080602001905181019061315e9190613fb1565b610ddb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b12565b6131c78383613509565b6131d460008484846131f0565b610ddb5760405162461bcd60e51b8152600401610b1290613f49565b60006001600160a01b0384163b156132f257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613234903390899088908890600401613fce565b602060405180830381600087803b15801561324e57600080fd5b505af192505050801561327e575060408051601f3d908101601f1916820190925261327b9181019061400b565b60015b6132d8573d8080156132ac576040519150601f19603f3d011682016040523d82523d6000602084013e6132b1565b606091505b5080516132d05760405162461bcd60e51b8152600401610b1290613f49565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612756565b506001949350505050565b6000600161330a84611c3e565b6133149190613e8f565b600083815260126020526040902054909150808214613367576001600160a01b03841660009081526011602090815260408083208584528252808320548484528184208190558352601290915290208190555b5060009182526012602090815260408084208490556001600160a01b039094168352601181528383209183525290812055565b60006133a583611c3e565b6001600160a01b039093166000908152601160209081526040808320868452825280832085905593825260129052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561341557506000905060036134c2565b8460ff16601b1415801561342d57508460ff16601c14155b1561343e57506000905060046134c2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613492573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166134bb576000600192509250506134c2565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016134ec878288856133de565b935093505050935093915050565b60606127568484600085613657565b6001600160a01b03821661355f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b12565b6000818152600360205260409020546001600160a01b0316156135c45760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b12565b6135d060008383612e8e565b6001600160a01b03821660009081526004602052604081208054600192906135f9908490613d79565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060824710156136b85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610b12565b843b6137065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b12565b600080866001600160a01b031685876040516137229190614028565b60006040518083038185875af1925050503d806000811461375f576040519150601f19603f3d011682016040523d82523d6000602084013e613764565b606091505b509150915061377482828661377f565b979650505050505050565b6060831561378e575081612288565b82511561379e5782518084602001fd5b8160405162461bcd60e51b8152600401610b1291906138ec565b8280546137c490613cbc565b90600052602060002090601f0160209004810192826137e6576000855561382c565b82601f106137ff5782800160ff1982351617855561382c565b8280016001018555821561382c579182015b8281111561382c578235825591602001919060010190613811565b506127149291505b808211156127145760008155600101613834565b6001600160e01b031981168114611ef057600080fd5b60006020828403121561387057600080fd5b813561228881613848565b60006020828403121561388d57600080fd5b5035919050565b60005b838110156138af578181015183820152602001613897565b83811115611f735750506000910152565b600081518084526138d8816020860160208601613894565b601f01601f19169290920160200192915050565b60208152600061228860208301846138c0565b6001600160a01b0381168114611ef057600080fd5b6000806040838503121561392757600080fd5b8235613932816138ff565b946020939093013593505050565b60008060008060008060c0878903121561395957600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b60006020828403121561399557600080fd5b8135612288816138ff565b6000806000606084860312156139b557600080fd5b83356139c0816138ff565b925060208401356139d0816138ff565b929592945050506040919091013590565b600080604083850312156139f457600080fd5b50508035926020909101359150565b60008083601f840112613a1557600080fd5b50813567ffffffffffffffff811115613a2d57600080fd5b602083019150836020828501011115612f2957600080fd5b60008060008060608587031215613a5b57600080fd5b843567ffffffffffffffff811115613a7257600080fd5b613a7e87828801613a03565b90989097506020870135966040013595509350505050565b60008060408385031215613aa957600080fd5b8235613ab4816138ff565b91506020830135613ac4816138ff565b809150509250929050565b60008060208385031215613ae257600080fd5b823567ffffffffffffffff811115613af957600080fd5b613b0585828601613a03565b90969095509350505050565b8015158114611ef057600080fd5b60008060408385031215613b3257600080fd5b8235613b3d816138ff565b91506020830135613ac481613b11565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215613b7957600080fd5b8435613b84816138ff565b93506020850135613b94816138ff565b925060408501359150606085013567ffffffffffffffff80821115613bb857600080fd5b818701915087601f830112613bcc57600080fd5b813581811115613bde57613bde613b4d565b604051601f8201601f19908116603f01168101908382118183101715613c0657613c06613b4d565b816040528281528a6020848701011115613c1f57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6020808252825182820181905260009190848201906040850190845b81811015613c7b57835183529284019291840191600101613c5f565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613cd057607f821691505b60208210811415613cf157634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252600c908201526b496e76616c69642074696d6560a01b604082015260600190565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115613d8c57613d8c613d63565b500190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000816000190483118215151615613e4757613e47613d63565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613e7157613e71613e4c565b500490565b600060208284031215613e8857600080fd5b5051919050565b600082821015613ea157613ea1613d63565b500390565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600082613ee457613ee4613e4c565b500690565b6000600019821415613efd57613efd613d63565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60008351613f2c818460208801613894565b835190830190613f40818360208801613894565b01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215613fc357600080fd5b815161228881613b11565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614001908301846138c0565b9695505050505050565b60006020828403121561401d57600080fd5b815161228881613848565b6000825161403a818460208701613894565b919091019291505056fea264697066735822122062594b07b861bee9c1214a90fc9ccb4dd6f9d8fb4fcc6255f32624e9a5a46c2764736f6c6343000808003360806040526040516200121a3803806200121a833981016040819052620000269162000437565b818180518251146200009a5760405162461bcd60e51b815260206004820152603260248201527f5061796d656e7453706c69747465723a2070617965657320616e6420736861726044820152710cae640d8cadccee8d040dad2e6dac2e8c6d60731b60648201526084015b60405180910390fd5b6000825111620000ed5760405162461bcd60e51b815260206004820152601a60248201527f5061796d656e7453706c69747465723a206e6f20706179656573000000000000604482015260640162000091565b60005b825181101562000159576200014483828151811062000113576200011362000515565b602002602001015183838151811062000130576200013062000515565b60200260200101516200016960201b60201c565b80620001508162000541565b915050620000f0565b50509151600755506200057a9050565b6001600160a01b038216620001d65760405162461bcd60e51b815260206004820152602c60248201527f5061796d656e7453706c69747465723a206163636f756e74206973207468652060448201526b7a65726f206164647265737360a01b606482015260840162000091565b60008111620002285760405162461bcd60e51b815260206004820152601d60248201527f5061796d656e7453706c69747465723a20736861726573206172652030000000604482015260640162000091565b6001600160a01b03821660009081526002602052604090205415620002a45760405162461bcd60e51b815260206004820152602b60248201527f5061796d656e7453706c69747465723a206163636f756e7420616c726561647960448201526a206861732073686172657360a81b606482015260840162000091565b60048054600181019091557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0384169081179091556000908152600260205260408120829055546200030c9082906200055f565b600055604080516001600160a01b0384168152602081018390527f40c340f65e17194d14ddddb073d3c9f888e3cb52b5aae0c6c7706b4fbc905fac910160405180910390a15050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562000396576200039662000355565b604052919050565b60006001600160401b03821115620003ba57620003ba62000355565b5060051b60200190565b600082601f830112620003d657600080fd5b81516020620003ef620003e9836200039e565b6200036b565b82815260059290921b840181019181810190868411156200040f57600080fd5b8286015b848110156200042c578051835291830191830162000413565b509695505050505050565b600080604083850312156200044b57600080fd5b82516001600160401b03808211156200046357600080fd5b818501915085601f8301126200047857600080fd5b815160206200048b620003e9836200039e565b82815260059290921b84018101918181019089841115620004ab57600080fd5b948201945b83861015620004e25785516001600160a01b0381168114620004d25760008081fd5b82529482019490820190620004b0565b91880151919650909350505080821115620004fc57600080fd5b506200050b85828601620003c4565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156200055857620005586200052b565b5060010190565b600082198211156200057557620005756200052b565b500190565b610c90806200058a6000396000f3fe6080604052600436106100955760003560e01c80638b83209b116100595780638b83209b146101a45780639852595c146101dc578063ce7c2ac214610212578063d79779b214610248578063e33b7de31461027e57600080fd5b806319165587146100e35780633a98ef3914610105578063406072a91461012957806348b750441461016f578063853828b61461018f57600080fd5b366100de577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b3480156100ef57600080fd5b506101036100fe3660046109e9565b610293565b005b34801561011157600080fd5b506000545b6040519081526020015b60405180910390f35b34801561013557600080fd5b50610116610144366004610a06565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b34801561017b57600080fd5b5061010361018a366004610a06565b6103ca565b34801561019b57600080fd5b506101036105b2565b3480156101b057600080fd5b506101c46101bf366004610a3f565b610629565b6040516001600160a01b039091168152602001610120565b3480156101e857600080fd5b506101166101f73660046109e9565b6001600160a01b031660009081526003602052604090205490565b34801561021e57600080fd5b5061011661022d3660046109e9565b6001600160a01b031660009081526002602052604090205490565b34801561025457600080fd5b506101166102633660046109e9565b6001600160a01b031660009081526005602052604090205490565b34801561028a57600080fd5b50600154610116565b6001600160a01b0381166000908152600260205260409020546102d15760405162461bcd60e51b81526004016102c890610a58565b60405180910390fd5b60006102dc60015490565b6102e69047610ab4565b90506000610313838361030e866001600160a01b031660009081526003602052604090205490565b610659565b9050806103325760405162461bcd60e51b81526004016102c890610acc565b6001600160a01b0383166000908152600360205260408120805483929061035a908490610ab4565b9250508190555080600160008282546103739190610ab4565b909155506103839050838261069e565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b6001600160a01b0381166000908152600260205260409020546103ff5760405162461bcd60e51b81526004016102c890610a58565b6001600160a01b0382166000908152600560205260408120546040516370a0823160e01b81523060048201526001600160a01b038516906370a082319060240160206040518083038186803b15801561045757600080fd5b505afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190610b17565b6104999190610ab4565b905060006104d2838361030e87876001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b9050806104f15760405162461bcd60e51b81526004016102c890610acc565b6001600160a01b03808516600090815260066020908152604080832093871683529290529081208054839290610528908490610ab4565b90915550506001600160a01b03841660009081526005602052604081208054839290610555908490610ab4565b9091555061056690508484836107bc565b604080516001600160a01b038581168252602082018490528616917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a250505050565b600047116105fb5760405162461bcd60e51b81526020600482015260166024820152754e6f2062616c616e636520746f20776974686472617760501b60448201526064016102c8565b60005b600754811015610626576106146100fe82610629565b8061061e81610b30565b9150506105fe565b50565b60006004828154811061063e5761063e610b4b565b6000918252602090912001546001600160a01b031692915050565b600080546001600160a01b0385168252600260205260408220548391906106809086610b61565b61068a9190610b80565b6106949190610ba2565b90505b9392505050565b804710156106ee5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016102c8565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461073b576040519150601f19603f3d011682016040523d82523d6000602084013e610740565b606091505b50509050806107b75760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016102c8565b505050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526107b79286929160009161084c9185169084906108c9565b8051909150156107b7578080602001905181019061086a9190610bb9565b6107b75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016102c8565b6060610694848460008585843b6109225760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102c8565b600080866001600160a01b0316858760405161093e9190610c0b565b60006040518083038185875af1925050503d806000811461097b576040519150601f19603f3d011682016040523d82523d6000602084013e610980565b606091505b509150915061099082828661099b565b979650505050505050565b606083156109aa575081610697565b8251156109ba5782518084602001fd5b8160405162461bcd60e51b81526004016102c89190610c27565b6001600160a01b038116811461062657600080fd5b6000602082840312156109fb57600080fd5b8135610697816109d4565b60008060408385031215610a1957600080fd5b8235610a24816109d4565b91506020830135610a34816109d4565b809150509250929050565b600060208284031215610a5157600080fd5b5035919050565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115610ac757610ac7610a9e565b500190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b600060208284031215610b2957600080fd5b5051919050565b6000600019821415610b4457610b44610a9e565b5060010190565b634e487b7160e01b600052603260045260246000fd5b6000816000190483118215151615610b7b57610b7b610a9e565b500290565b600082610b9d57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015610bb457610bb4610a9e565b500390565b600060208284031215610bcb57600080fd5b8151801515811461069757600080fd5b60005b83811015610bf6578181015183820152602001610bde565b83811115610c05576000848401525b50505050565b60008251610c1d818460208701610bdb565b9190910192915050565b6020815260008251806020840152610c46816040850160208701610bdb565b601f01601f1916919091016040019291505056fea2646970667358221220a23fb147ac17f34b3c7360306f47743a24bd861fa76ff87a2af44b204a6bc62f64736f6c6343000808003300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d4e53517959725a3836524373686d4667794a4d356a766766753544686856596275487531734c4d524d4650572f00000000000000000000
Deployed Bytecode
0x6080604052600436106103035760003560e01c8063715018a611610190578063cc47a40b116100dc578063e985e9c511610095578063ef81b4d41161006f578063ef81b4d414610a17578063f2fde38b14610a37578063fd88fa6914610a57578063ff1b655614610ac157600080fd5b8063e985e9c514610981578063ea66aeb3146109ca578063ec5ed89b146109f757600080fd5b8063cc47a40b146108ab578063ce7c2ac2146108cb578063ce9124f514610901578063d338143814610916578063d79779b214610936578063e33b7de31461096c57600080fd5b806395d89b4111610149578063a6c5846711610123578063a6c5846714610842578063b88d4fde14610858578063c0c8dd0714610878578063c87b56dd1461088b57600080fd5b806395d89b41146107d75780639852595c146107ec578063a22cb4651461082257600080fd5b8063715018a6146106bd578063755486b2146106d25780637bd07f8b146106f2578063853828b6146107845780638b83209b146107995780638da5cb5b146107b957600080fd5b80632a55205a1161024f5780634c00de82116102085780635aca1982116101e25780635aca1982146106535780636352211e146106685780636c0360eb1461068857806370a082311461069d57600080fd5b80634c00de82146105fe57806351c7115b1461061e57806355f804b31461063357600080fd5b80632a55205a146105115780633266e957146105505780633a98ef3914610563578063406072a91461057857806342842e0e146105be57806348b75044146105de57600080fd5b8063097fedd3116102bc5780631bf9f509116102965780631bf9f5091461049b5780631d3e946c146104bb57806323b872dd146104db5780632a3dd109146104fb57600080fd5b8063097fedd31461044557806318160ddd14610465578063191655871461047b57600080fd5b806301ffc9a714610351578063040ba9ea1461038657806306968310146103a957806306fdde03146103cb578063081812fc146103ed578063095ea7b31461042557600080fd5b3661034c577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77033604080516001600160a01b0390921682523460208301520160405180910390a1005b600080fd5b34801561035d57600080fd5b5061037161036c36600461385e565b610ad7565b60405190151581526020015b60405180910390f35b34801561039257600080fd5b5061039b606381565b60405190815260200161037d565b3480156103b557600080fd5b506103c96103c436600461387b565b610ae8565b005b3480156103d757600080fd5b506103e0610ba3565b60405161037d91906138ec565b3480156103f957600080fd5b5061040d61040836600461387b565b610c35565b6040516001600160a01b03909116815260200161037d565b34801561043157600080fd5b506103c9610440366004613914565b610cca565b34801561045157600080fd5b506103c9610460366004613940565b610de0565b34801561047157600080fd5b5061039b60105481565b34801561048757600080fd5b506103c9610496366004613983565b61104a565b3480156104a757600080fd5b506103c96104b6366004613983565b611178565b3480156104c757600080fd5b50601b5461040d906001600160a01b031681565b3480156104e757600080fd5b506103c96104f63660046139a0565b611200565b34801561050757600080fd5b5061039b601d5481565b34801561051d57600080fd5b5061053161052c3660046139e1565b611231565b604080516001600160a01b03909316835260208301919091520161037d565b6103c961055e366004613a45565b611286565b34801561056f57600080fd5b5060085461039b565b34801561058457600080fd5b5061039b610593366004613a96565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506103c96105d93660046139a0565b61161d565b3480156105ea57600080fd5b506103c96105f9366004613a96565b611638565b34801561060a57600080fd5b5060225461040d906001600160a01b031681565b34801561062a57600080fd5b5061039b611820565b34801561063f57600080fd5b506103c961064e366004613acf565b611904565b34801561065f57600080fd5b506103c9611973565b34801561067457600080fd5b5061040d61068336600461387b565b611b39565b34801561069457600080fd5b506103e0611bb0565b3480156106a957600080fd5b5061039b6106b8366004613983565b611c3e565b3480156106c957600080fd5b506103c9611cc5565b3480156106de57600080fd5b506103c96106ed366004613914565b611cfb565b3480156106fe57600080fd5b5060155460165460175460185461073e9363ffffffff80821694600160201b8304821694600160401b8404831694600160601b9094049092169290919087565b6040805163ffffffff9889168152968816602088015294871694860194909452949091166060840152608083015260a082019290925260c081019190915260e00161037d565b34801561079057600080fd5b506103c9611e7c565b3480156107a557600080fd5b5061040d6107b436600461387b565b611ef3565b3480156107c557600080fd5b506000546001600160a01b031661040d565b3480156107e357600080fd5b506103e0611f23565b3480156107f857600080fd5b5061039b610807366004613983565b6001600160a01b03166000908152600b602052604090205490565b34801561082e57600080fd5b506103c961083d366004613b1f565b611f32565b34801561084e57600080fd5b5061039b6125c281565b34801561086457600080fd5b506103c9610873366004613b63565b611f41565b6103c961088636600461387b565b611f79565b34801561089757600080fd5b506103e06108a636600461387b565b6121b4565b3480156108b757600080fd5b506103c96108c6366004613914565b61228f565b3480156108d757600080fd5b5061039b6108e6366004613983565b6001600160a01b03166000908152600a602052604090205490565b34801561090d57600080fd5b5061039b606481565b34801561092257600080fd5b506103c9610931366004613983565b612321565b34801561094257600080fd5b5061039b610951366004613983565b6001600160a01b03166000908152600d602052604090205490565b34801561097857600080fd5b5060095461039b565b34801561098d57600080fd5b5061037161099c366004613a96565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b3480156109d657600080fd5b506109ea6109e5366004613983565b6123a9565b60405161037d9190613c43565b348015610a0357600080fd5b506103c9610a123660046139e1565b612467565b348015610a2357600080fd5b50601a5461040d906001600160a01b031681565b348015610a4357600080fd5b506103c9610a52366004613983565b612584565b348015610a6357600080fd5b50601354601454610a8f9163ffffffff80821692600160201b8304821692600160401b90049091169084565b60405161037d949392919063ffffffff9485168152928416602084015292166040820152606081019190915260800190565b348015610acd57600080fd5b5061039b601c5481565b6000610ae28261261c565b92915050565b6000546001600160a01b03163314610b1b5760405162461bcd60e51b8152600401610b1290613c87565b60405180910390fd5b601d5415610b6b5760405162461bcd60e51b815260206004820152601a60248201527f5374617274696e6720696e64657820616c7265616479207365740000000000006044820152606401610b12565b6040518181527f7a118106d7ec5624cae2261255cffcd06cc8e43e34e8b2506e4f25c7fd23cbb29060200160405180910390a1601c55565b606060018054610bb290613cbc565b80601f0160208091040260200160405190810160405280929190818152602001828054610bde90613cbc565b8015610c2b5780601f10610c0057610100808354040283529160200191610c2b565b820191906000526020600020905b815481529060010190602001808311610c0e57829003601f168201915b5050505050905090565b6000818152600360205260408120546001600160a01b0316610cae5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b12565b506000908152600560205260409020546001600160a01b031690565b6000610cd582611b39565b9050806001600160a01b0316836001600160a01b03161415610d435760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b12565b336001600160a01b0382161480610d5f5750610d5f813361099c565b610dd15760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610b12565b610ddb8383612641565b505050565b6000546001600160a01b03163314610e0a5760405162461bcd60e51b8152600401610b1290613c87565b6000610e15876126af565b90506000610e22876126af565b90506000610e2f876126af565b60135490915063ffffffff808516600160201b909204161115610e645760405162461bcd60e51b8152600401610b1290613cf7565b8163ffffffff168363ffffffff1610610e8f5760405162461bcd60e51b8152600401610b1290613cf7565b86600010610ed15760405162461bcd60e51b815260206004820152600f60248201526e0c081cdd195c081a5b9d195c9d985b608a1b6044820152606401610b12565b858510610f165760405162461bcd60e51b8152602060048201526013602482015272496e76616c696420737461727420707269636560681b6044820152606401610b12565b84600010610f5d5760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420626f74746f6d20707269636560601b6044820152606401610b12565b836000108015610f6c57508584105b610fad5760405162461bcd60e51b81526020600482015260126024820152710496e76616c696420707269636520737465760741b6044820152606401610b12565b601580546bffffffffffffffff000000001916600160201b63ffffffff868116919091026bffffffff0000000000000000191691909117600160401b858316021763ffffffff60601b1916600160601b918416919091021790556016869055601785905560188490556040517f585ef91acea44084cac26f5bbe4a675e850dd07762ebb27e9838544a38fa867190600090a1505050505050505050565b6001600160a01b0381166000908152600a602052604090205461107f5760405162461bcd60e51b8152600401610b1290613d1d565b600061108a60095490565b6110949047613d79565b905060006110c183836110bc866001600160a01b03166000908152600b602052604090205490565b612718565b9050806110e05760405162461bcd60e51b8152600401610b1290613d91565b6001600160a01b0383166000908152600b602052604081208054839290611108908490613d79565b9250508190555080600960008282546111219190613d79565b909155506111319050838261275e565b604080516001600160a01b0385168152602081018390527fdf20fd1e76bc69d672e4814fafb2c449bba3a5369d8359adf9e05e6fde87b056910160405180910390a1505050565b6000546001600160a01b031633146111a25760405162461bcd60e51b8152600401610b1290613c87565b6040516001600160a01b03821681527ffa58eecf7016f069d53d57b14c0b2a98c90ffe8deaec7b465b8618f850d2d7b59060200160405180910390a1601b80546001600160a01b0319166001600160a01b0392909216919091179055565b61120a3382612877565b6112265760405162461bcd60e51b8152600401610b1290613ddc565b610ddb83838361296d565b604080518082019091526007546001600160a01b038116808352600160a01b90910462ffffff16602083018190529091600091612710906112729086613e2d565b61127c9190613e62565b9150509250929050565b6040805160808101825260135463ffffffff808216808452600160201b830482166020850152600160401b909204169282019290925260145460608201529042108015906112dd5750806020015163ffffffff1642105b6113215760405162461bcd60e51b815260206004820152601560248201527450726573616c65206973206e6f742061637469766560581b6044820152606401610b12565b601a546001600160a01b03166113835760405162461bcd60e51b815260206004820152602160248201527f57686974656c697374207369676e657220686173206e6f74206265656e2073656044820152601d60fa1b6064820152608401610b12565b8281606001516113939190613e2d565b34146113d55760405162461bcd60e51b8152602060048201526011602482015270125b98dbdc9c9958dd081c185e5b595b9d607a1b6044820152606401610b12565b336000908152601e602052604090205482906113f2908590613d79565b11156114365760405162461bcd60e51b8152602060048201526013602482015272135a5b9d081b1a5b5a5d08195e18d959591959606a1b6044820152606401610b12565b806040015163ffffffff168360105461144f9190613d79565b11156114995760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f756768204241545a2072656d61696e696e6760381b6044820152606401610b12565b601f54604080517f62b1d609957efd7198a66f841063387013c1f07f57cbb6ae3cd625ddd9f9ebab6020820152339181019190915260608101849052600091906080016040516020818303038152906040528051906020012060405160200161151992919061190160f01b81526002810192909252602282015260420190565b604051602081830303815290604052805190602001209050600061157587878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508693925050612b189050565b90506001600160a01b0381161580159061159c5750601a546001600160a01b038281169116145b6115dc5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606401610b12565b336000908152601e60205260409020546115f7908690613d79565b336000818152601e60205260409020919091556116149086612b34565b50505050505050565b610ddb83838360405180602001604052806000815250611f41565b6001600160a01b0381166000908152600a602052604090205461166d5760405162461bcd60e51b8152600401610b1290613d1d565b6001600160a01b0382166000908152600d60205260408120546040516370a0823160e01b81523060048201526001600160a01b038516906370a082319060240160206040518083038186803b1580156116c557600080fd5b505afa1580156116d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fd9190613e76565b6117079190613d79565b9050600061174083836110bc87876001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b90508061175f5760405162461bcd60e51b8152600401610b1290613d91565b6001600160a01b038085166000908152600e6020908152604080832093871683529290529081208054839290611796908490613d79565b90915550506001600160a01b0384166000908152600d6020526040812080548392906117c3908490613d79565b909155506117d49050848483612b73565b604080516001600160a01b038581168252602082018490528616917f3be5b7a71e84ed12875d241991c70855ac5817d847039e17a9d895c1ceb0f18a910160405180910390a250505050565b6040805160e08101825260155463ffffffff8082168352600160201b8204811660208401819052600160401b8304821694840194909452600160601b909104166060820152601654608082015260175460a082015260185460c08201526000914290811015611893575060800151919050565b816040015163ffffffff1681106118ae575060a00151919050565b6000826060015163ffffffff16836020015163ffffffff16836118d19190613e8f565b6118db9190613e62565b90508260c00151816118ed9190613e2d565b83608001516118fc9190613e8f565b935050505090565b6000546001600160a01b0316331461192e5760405162461bcd60e51b8152600401610b1290613c87565b7f24a9152dc695ecc801ad580886331ee12d7aac0fa2ae341a5ae3c2ccae36cb4f828260405161195f929190613ea6565b60405180910390a1610ddb601983836137b8565b6000546001600160a01b0316331461199d5760405162461bcd60e51b8152600401610b1290613c87565b601c546119ec5760405162461bcd60e51b815260206004820152601760248201527f50726f76656e616e63652068617368206e6f74207365740000000000000000006044820152606401610b12565b601d5415611a305760405162461bcd60e51b8152602060048201526011602482015270125b99195e08185b1c9958591e481cd95d607a1b6044820152606401610b12565b601554600160201b900463ffffffff16421015611a8f5760405162461bcd60e51b815260206004820152601d60248201527f546f6f206561726c7920746f20726f6c6c20737461727420696e6465780000006044820152606401610b12565b6000611a9c600143613e8f565b60408051914060208301526bffffffffffffffffffffffff194160601b169082015244605482015242607482015260940160408051601f1981840301815291905280516020909101209050611af36125c282613ed5565b611afe906001613d79565b601d8190556040519081527fca6fb0afaccdd6d4e6bae677f2228557803ae36f831e27606d4f4ccffc4286599060200160405180910390a150565b6000818152600360205260408120546001600160a01b031680610ae25760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610b12565b60198054611bbd90613cbc565b80601f0160208091040260200160405190810160405280929190818152602001828054611be990613cbc565b8015611c365780601f10611c0b57610100808354040283529160200191611c36565b820191906000526020600020905b815481529060010190602001808311611c1957829003601f168201915b505050505081565b60006001600160a01b038216611ca95760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610b12565b506001600160a01b031660009081526004602052604090205490565b6000546001600160a01b03163314611cef5760405162461bcd60e51b8152600401610b1290613c87565b611cf96000612bc5565b565b601b546001600160a01b0316611d535760405162461bcd60e51b815260206004820152601a60248201527f416e6369656e744261747a206d696e746572206e6f74207365740000000000006044820152606401610b12565b601b546001600160a01b03163314611dbb5760405162461bcd60e51b815260206004820152602560248201527f4d75737420626520617574686f72697a656420416e6369656e744261747a206d60448201526434b73a32b960d91b6064820152608401610b12565b600081118015611dcc575060638111155b611e115760405162461bcd60e51b8152602060048201526016602482015275125b9d985b1a5908105b98da595b9d10985d1e88125960521b6044820152606401610b12565b6000611e1f826125c2613d79565b905081836001600160a01b03167ffa1f2f7c8c968670bcb031f074110e4e82778c4a83fe1c872e4ccc2e5371f33a60405160405180910390a3611e628382612c15565b60108054906000611e7283613ee9565b9190505550505050565b60004711611ec55760405162461bcd60e51b81526020600482015260166024820152754e6f2062616c616e636520746f20776974686472617760501b6044820152606401610b12565b60005b600f54811015611ef057611ede61049682611ef3565b80611ee881613ee9565b915050611ec8565b50565b6000600c8281548110611f0857611f08613f04565b6000918252602090912001546001600160a01b031692915050565b606060028054610bb290613cbc565b611f3d338383612c2f565b5050565b611f4b3383612877565b611f675760405162461bcd60e51b8152600401610b1290613ddc565b611f7384848484612cfe565b50505050565b333b158015611f8757503332145b611fd35760405162461bcd60e51b815260206004820152601960248201527f436f6e74726163742062757973206e6f7420616c6c6f776564000000000000006044820152606401610b12565b6040805160e08101825260155463ffffffff8082168352600160201b820481166020840152600160401b8204811693830193909352600160601b90049091166060820152601654608082015260175460a082015260185460c08201526010546125c290612041908490613d79565b111561208b5760405162461bcd60e51b81526020600482015260196024820152784e6f7420656e6f756768204241545a2072656d61696e696e6760381b6044820152606401610b12565b806020015163ffffffff164210156120da5760405162461bcd60e51b815260206004820152601260248201527153616c65206973206e6f742061637469766560701b6044820152606401610b12565b805163ffffffff168211156121315760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e206c696d69742065786365656465640000000000006044820152606401610b12565b60008261213c611820565b6121469190613e2d565b90508034101561218f5760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d081c185e5b595b9d60621b6044820152606401610b12565b803411156121aa576121aa336121a58334613e8f565b61275e565b610ddb3384612b34565b6000818152600360205260409020546060906001600160a01b03166122335760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b12565b600061223d612d31565b9050600081511161225d5760405180602001604052806000815250612288565b8061226784612d40565b604051602001612278929190613f1a565b6040516020818303038152906040525b9392505050565b6000546001600160a01b031633146122b95760405162461bcd60e51b8152600401610b1290613c87565b6064816010546122c99190613d79565b11156123175760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206f776e65722072657365727665206c696d697400000000006044820152606401610b12565b611f3d8282612b34565b6000546001600160a01b0316331461234b5760405162461bcd60e51b8152600401610b1290613c87565b6040516001600160a01b03821681527f0411c872a35ac01013d258ad2fe1ffd003847123a878624b993c256fd75d1d789060200160405180910390a1601a80546001600160a01b0319166001600160a01b0392909216919091179055565b606060006123b683611c3e565b905060008167ffffffffffffffff8111156123d3576123d3613b4d565b6040519080825280602002602001820160405280156123fc578160200160208202803683370190505b50905060005b8281101561245f576001600160a01b0385166000908152601160209081526040808320848452909152902054825183908390811061244257612442613f04565b60209081029190910101528061245781613ee9565b915050612402565b509392505050565b6000546001600160a01b031633146124915760405162461bcd60e51b8152600401610b1290613c87565b600061249c836126af565b905060006124a9836126af565b90508163ffffffff166000106124d15760405162461bcd60e51b8152600401610b1290613cf7565b8063ffffffff168263ffffffff16106124fc5760405162461bcd60e51b8152600401610b1290613cf7565b60155463ffffffff600160201b9091048116908216111561252f5760405162461bcd60e51b8152600401610b1290613cf7565b6013805463ffffffff838116600160201b0267ffffffffffffffff19909216908516171790556040517f78416bc810005a62b38a156c2241d33b50a7d83e064ca20d330c528f926cfa2f90600090a150505050565b6000546001600160a01b031633146125ae5760405162461bcd60e51b8152600401610b1290613c87565b6001600160a01b0381166126135760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610b12565b611ef081612bc5565b60006001600160e01b0319821663152a902d60e11b1480610ae25750610ae282612e3e565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061267682611b39565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600063ffffffff8211156127145760405162461bcd60e51b815260206004820152602660248201527f53616665436173743a2076616c756520646f65736e27742066697420696e203360448201526532206269747360d01b6064820152608401610b12565b5090565b6008546001600160a01b0384166000908152600a6020526040812054909183916127429086613e2d565b61274c9190613e62565b6127569190613e8f565b949350505050565b804710156127ae5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610b12565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146127fb576040519150601f19603f3d011682016040523d82523d6000602084013e612800565b606091505b5050905080610ddb5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610b12565b6000818152600360205260408120546001600160a01b03166128f05760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b12565b60006128fb83611b39565b9050806001600160a01b0316846001600160a01b031614806129365750836001600160a01b031661292b84610c35565b6001600160a01b0316145b8061275657506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff16949350505050565b826001600160a01b031661298082611b39565b6001600160a01b0316146129e85760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610b12565b6001600160a01b038216612a4a5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b12565b612a55838383612e8e565b612a60600082612641565b6001600160a01b0383166000908152600460205260408120805460019290612a89908490613e8f565b90915550506001600160a01b0382166000908152600460205260408120805460019290612ab7908490613d79565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6000806000612b278585612ec0565b9150915061245f81612f30565b60105460005b82811015612b6b57612b4d600183613d79565b9150612b598483612c15565b80612b6381613ee9565b915050612b3a565b506010555050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ddb9084906130eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611f3d8282604051806020016040528060008152506131bd565b816001600160a01b0316836001600160a01b03161415612c915760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b12565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b612d0984848461296d565b612d15848484846131f0565b611f735760405162461bcd60e51b8152600401610b1290613f49565b606060198054610bb290613cbc565b606081612d645750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612d8e5780612d7881613ee9565b9150612d879050600a83613e62565b9150612d68565b60008167ffffffffffffffff811115612da957612da9613b4d565b6040519080825280601f01601f191660200182016040528015612dd3576020820181803683370190505b5090505b841561275657612de8600183613e8f565b9150612df5600a86613ed5565b612e00906030613d79565b60f81b818381518110612e1557612e15613f04565b60200101906001600160f81b031916908160001a905350612e37600a86613e62565b9450612dd7565b60006001600160e01b031982166380ac58cd60e01b1480612e6f57506001600160e01b03198216635b5e139f60e01b145b80610ae257506301ffc9a760e01b6001600160e01b0319831614610ae2565b6001600160a01b03831615612ea757612ea783826132fd565b6001600160a01b03821615610ddb57610ddb828261339a565b600080825160411415612ef75760208301516040840151606085015160001a612eeb878285856133de565b94509450505050612f29565b825160401415612f215760208301516040840151612f168683836134cb565b935093505050612f29565b506000905060025b9250929050565b6000816004811115612f4457612f44613f9b565b1415612f4d5750565b6001816004811115612f6157612f61613f9b565b1415612faf5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b12565b6002816004811115612fc357612fc3613f9b565b14156130115760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b12565b600381600481111561302557613025613f9b565b141561307e5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b12565b600481600481111561309257613092613f9b565b1415611ef05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610b12565b6000613140826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166134fa9092919063ffffffff16565b805190915015610ddb578080602001905181019061315e9190613fb1565b610ddb5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610b12565b6131c78383613509565b6131d460008484846131f0565b610ddb5760405162461bcd60e51b8152600401610b1290613f49565b60006001600160a01b0384163b156132f257604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613234903390899088908890600401613fce565b602060405180830381600087803b15801561324e57600080fd5b505af192505050801561327e575060408051601f3d908101601f1916820190925261327b9181019061400b565b60015b6132d8573d8080156132ac576040519150601f19603f3d011682016040523d82523d6000602084013e6132b1565b606091505b5080516132d05760405162461bcd60e51b8152600401610b1290613f49565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050612756565b506001949350505050565b6000600161330a84611c3e565b6133149190613e8f565b600083815260126020526040902054909150808214613367576001600160a01b03841660009081526011602090815260408083208584528252808320548484528184208190558352601290915290208190555b5060009182526012602090815260408084208490556001600160a01b039094168352601181528383209183525290812055565b60006133a583611c3e565b6001600160a01b039093166000908152601160209081526040808320868452825280832085905593825260129052919091209190915550565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561341557506000905060036134c2565b8460ff16601b1415801561342d57508460ff16601c14155b1561343e57506000905060046134c2565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613492573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166134bb576000600192509250506134c2565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b016134ec878288856133de565b935093505050935093915050565b60606127568484600085613657565b6001600160a01b03821661355f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b12565b6000818152600360205260409020546001600160a01b0316156135c45760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b12565b6135d060008383612e8e565b6001600160a01b03821660009081526004602052604081208054600192906135f9908490613d79565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6060824710156136b85760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610b12565b843b6137065760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610b12565b600080866001600160a01b031685876040516137229190614028565b60006040518083038185875af1925050503d806000811461375f576040519150601f19603f3d011682016040523d82523d6000602084013e613764565b606091505b509150915061377482828661377f565b979650505050505050565b6060831561378e575081612288565b82511561379e5782518084602001fd5b8160405162461bcd60e51b8152600401610b1291906138ec565b8280546137c490613cbc565b90600052602060002090601f0160209004810192826137e6576000855561382c565b82601f106137ff5782800160ff1982351617855561382c565b8280016001018555821561382c579182015b8281111561382c578235825591602001919060010190613811565b506127149291505b808211156127145760008155600101613834565b6001600160e01b031981168114611ef057600080fd5b60006020828403121561387057600080fd5b813561228881613848565b60006020828403121561388d57600080fd5b5035919050565b60005b838110156138af578181015183820152602001613897565b83811115611f735750506000910152565b600081518084526138d8816020860160208601613894565b601f01601f19169290920160200192915050565b60208152600061228860208301846138c0565b6001600160a01b0381168114611ef057600080fd5b6000806040838503121561392757600080fd5b8235613932816138ff565b946020939093013593505050565b60008060008060008060c0878903121561395957600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b60006020828403121561399557600080fd5b8135612288816138ff565b6000806000606084860312156139b557600080fd5b83356139c0816138ff565b925060208401356139d0816138ff565b929592945050506040919091013590565b600080604083850312156139f457600080fd5b50508035926020909101359150565b60008083601f840112613a1557600080fd5b50813567ffffffffffffffff811115613a2d57600080fd5b602083019150836020828501011115612f2957600080fd5b60008060008060608587031215613a5b57600080fd5b843567ffffffffffffffff811115613a7257600080fd5b613a7e87828801613a03565b90989097506020870135966040013595509350505050565b60008060408385031215613aa957600080fd5b8235613ab4816138ff565b91506020830135613ac4816138ff565b809150509250929050565b60008060208385031215613ae257600080fd5b823567ffffffffffffffff811115613af957600080fd5b613b0585828601613a03565b90969095509350505050565b8015158114611ef057600080fd5b60008060408385031215613b3257600080fd5b8235613b3d816138ff565b91506020830135613ac481613b11565b634e487b7160e01b600052604160045260246000fd5b60008060008060808587031215613b7957600080fd5b8435613b84816138ff565b93506020850135613b94816138ff565b925060408501359150606085013567ffffffffffffffff80821115613bb857600080fd5b818701915087601f830112613bcc57600080fd5b813581811115613bde57613bde613b4d565b604051601f8201601f19908116603f01168101908382118183101715613c0657613c06613b4d565b816040528281528a6020848701011115613c1f57600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b6020808252825182820181905260009190848201906040850190845b81811015613c7b57835183529284019291840191600101613c5f565b50909695505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c90821680613cd057607f821691505b60208210811415613cf157634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252600c908201526b496e76616c69642074696d6560a01b604082015260600190565b60208082526026908201527f5061796d656e7453706c69747465723a206163636f756e7420686173206e6f2060408201526573686172657360d01b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008219821115613d8c57613d8c613d63565b500190565b6020808252602b908201527f5061796d656e7453706c69747465723a206163636f756e74206973206e6f742060408201526a191d59481c185e5b595b9d60aa1b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6000816000190483118215151615613e4757613e47613d63565b500290565b634e487b7160e01b600052601260045260246000fd5b600082613e7157613e71613e4c565b500490565b600060208284031215613e8857600080fd5b5051919050565b600082821015613ea157613ea1613d63565b500390565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b600082613ee457613ee4613e4c565b500690565b6000600019821415613efd57613efd613d63565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60008351613f2c818460208801613894565b835190830190613f40818360208801613894565b01949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b600060208284031215613fc357600080fd5b815161228881613b11565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614001908301846138c0565b9695505050505050565b60006020828403121561401d57600080fd5b815161228881613848565b6000825161403a818460208701613894565b919091019291505056fea264697066735822122062594b07b861bee9c1214a90fc9ccb4dd6f9d8fb4fcc6255f32624e9a5a46c2764736f6c63430008080033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000036697066733a2f2f516d4e53517959725a3836524373686d4667794a4d356a766766753544686856596275487531734c4d524d4650572f00000000000000000000
-----Decoded View---------------
Arg [0] : initialBaseUri (string): ipfs://QmNSQyYrZ86RCshmFgyJM5jvgfu5DhhVYbuHu1sLMRMFPW/
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000036
Arg [2] : 697066733a2f2f516d4e53517959725a3836524373686d4667794a4d356a7667
Arg [3] : 66753544686856596275487531734c4d524d4650572f00000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.