Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Rotatoor
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "./RotatoorERC5192.sol"; contract Rotatoor is RotatoorERC5192, Ownable, ReentrancyGuard { using Counters for Counters.Counter; using SafeMath for uint256; Counters.Counter private _tokenIds; Counters.Counter private _styleIds; uint256 public constant FEE_DENOMINATOR = 10000; uint256 public BASE_PRICE; uint256 public STAKE_REQUIRED; uint256 public REWARD_BASE; uint256 public PROTOCOL_FEE; address private ROYALTY_RECEIVER; uint256 internal constant SLASH_GAS_COST = 48100; struct RotatoorToken { address[] contractAddresses; uint256[] tokenIds; uint256 style; } mapping(uint256 => string) public styleNames; // styleId : styleName mapping(uint256 => string) public styleUris; // styleId : styleUri mapping(uint256 => address) public stylePremiumReceivers; // styleId : style payment address mapping(uint256 => uint256) public stylePremiums; // styleId : style price mapping(uint256 => RotatoorToken) public rotatoors; // tokenId : Rotatoor object mapping(uint256 => uint256) public stakedBalances; // tokenId : corresponding stake mapping(address => mapping(uint256 => bool)) public ownedStyles; // customer : styles they've paid for mapping(address => bool) public paidMembers; // customer : has purchased rotatoor constructor( uint256 basePrice, uint256 stakeRequired, uint256 rewardBase, uint256 protocolFee, address royaltyReceiver ) RotatoorERC5192("rotatoor", "ROTATOOR") { BASE_PRICE = basePrice; STAKE_REQUIRED = stakeRequired; REWARD_BASE = rewardBase; PROTOCOL_FEE = protocolFee; ROYALTY_RECEIVER = royaltyReceiver; } // EVENTS event Mint( address indexed to, uint256 indexed tokenId, address[] nftContracts, uint256[] nftIds, uint256 indexed styleId ); event StyleCreated( uint256 styleId, string styleName, address creator, uint256 premium ); event RoyaltiesPaid(address receiver, uint256 amount); event Slashed(address victim, uint256 tokenId); event BasePriceDecreased(uint256 amount); event StylePremiumDecreased(uint256 styleId, uint256 amount); // READ FUNCTIONS function calculateMintPrice(address buyer, uint256 styleId) public view returns (uint256) { bytes storage styleUri = bytes(styleUris[styleId]); require(styleId < _styleIds.current(), "Style does not exist"); uint256 price = 0; if (!paidMembers[buyer]) { price += BASE_PRICE; } if (!unlockedStyle(buyer, styleId)) { price += stylePremiums[styleId]; } price += STAKE_REQUIRED; return price; } function tokenURI(uint256 tokenId) public view override returns (string memory) { require(stakedBalances[tokenId] > 0, "Rotatoor doesn't exist"); string storage styleUri = styleUris[rotatoors[tokenId].style]; return string.concat(styleUri, Strings.toString(tokenId)); } function tokenStyle(uint256 tokenId) external view returns (uint256) { require(stakedBalances[tokenId] > 0, "Rotatoor doesn't exist"); RotatoorToken storage rotatoor = rotatoors[tokenId]; return rotatoor.style; } function tokenNFTContracts(uint256 tokenId) external view returns (address[] memory) { require(stakedBalances[tokenId] > 0, "Rotatoor doesn't exist"); RotatoorToken storage rotatoor = rotatoors[tokenId]; return rotatoor.contractAddresses; } function tokenNFTIds(uint256 tokenId) external view returns (uint256[] memory) { require(stakedBalances[tokenId] > 0, "Rotatoor doesn't exist"); RotatoorToken storage rotatoor = rotatoors[tokenId]; return rotatoor.tokenIds; } function isSlashable(uint256 tokenId, uint256 nftIndex) public view returns (bool) { require(stakedBalances[tokenId] > 0, "Rotatoor doesn't exist"); RotatoorToken storage rotatoor = rotatoors[tokenId]; return IERC721(rotatoor.contractAddresses[nftIndex]).ownerOf(rotatoor.tokenIds[nftIndex]) != ownerOf(tokenId); } function isValidRotatoor(uint256 tokenId) public view returns (bool) { // Check that the NFT isn't 100% backed RotatoorToken storage rotatoor = rotatoors[tokenId]; for ( uint256 i = 0; i < rotatoor.contractAddresses.length; ) { if ( IERC721(rotatoor.contractAddresses[i]).ownerOf( rotatoor.tokenIds[i] ) != ownerOf(tokenId) ) { unchecked {i++;} return false; } unchecked {i++;} } return true; } function unlockedStyle(address owner, uint256 styleId) public view returns (bool) { if (stylePremiums[styleId] == 0) { return true; } return ownedStyles[owner][styleId]; } // PUBLIC FUNCTIONS function purchase(address recipient) external payable { require(paidMembers[recipient] == false, "Already purchased :)"); require(msg.value == BASE_PRICE, "Not enough funds"); paidMembers[recipient] = true; _payPlatform(BASE_PRICE); } function purchaseStyle(address recipient, uint256 styleId) external payable { require( unlockedStyle(recipient, styleId) == false, "Already purchased :)" ); require(msg.value == stylePremiums[styleId], "Not enough funds"); ownedStyles[recipient][styleId] = true; _payStylePremiumReceiver(stylePremiums[styleId], stylePremiumReceivers[styleId]); } function giftStyle(address recipient, uint256 styleId) external { require( unlockedStyle(recipient, styleId) == false, "Already purchased :)" ); require(msg.sender == stylePremiumReceivers[styleId], "Not the style creator"); ownedStyles[recipient][styleId] = true; } function mint( address[] calldata nftContracts, uint256[] calldata nftIds, uint256 styleId ) public payable { require( msg.value == calculateMintPrice(msg.sender, styleId), "Not enough funds" ); uint256 tokenId = _tokenIds.current(); _safeMint(msg.sender, tokenId); stakedBalances[tokenId] = STAKE_REQUIRED; emit Mint( msg.sender, tokenId, nftContracts, nftIds, styleId ); emit Locked(tokenId); rotatoors[tokenId] = RotatoorToken( nftContracts, nftIds, styleId ); require(isValidRotatoor(tokenId), "Invalid ownership"); _tokenIds.increment(); if (!paidMembers[msg.sender]) { paidMembers[msg.sender] = true; _payPlatform(BASE_PRICE); } if (!unlockedStyle(msg.sender, styleId)) { ownedStyles[msg.sender][styleId] = true; _payStylePremiumReceiver(stylePremiums[styleId], stylePremiumReceivers[styleId]); } } function burn(uint256 tokenId) external { uint256 amountStaked = stakedBalances[tokenId]; require(msg.sender == ownerOf(tokenId), "Only owner can burn!"); payable(msg.sender).transfer(amountStaked); stakedBalances[tokenId] = 0; _burn(tokenId); } /* * Code used for paying the slasher is based off: * https://github.com/code-423n4/2022-08-nounsdao/blob/452695d4764ba9d5e1d3eef0d5ecca3d004f215a/contracts/governance/NounsDAOLogicV2.sol#L974-L986 * //https://github.com/z0r0z/zolidity/blob/main/src/utils/Refunded.sol */ function slash(uint256 tokenId, uint256 nftIndex) external nonReentrant { uint256 startGas = gasleft(); uint256 amountStaked = stakedBalances[tokenId]; require(isSlashable(tokenId, nftIndex), "Owner has NFT"); uint256 gasPrice = block.basefee + REWARD_BASE; uint256 gasUsed = startGas - gasleft() + SLASH_GAS_COST; uint256 slashReward = gasPrice * gasUsed; require(amountStaked > slashReward, "Gas price too high"); payable(msg.sender).transfer(slashReward); payable(ownerOf(tokenId)).transfer(amountStaked - slashReward); stakedBalances[tokenId] = 0; emit Slashed(ownerOf(tokenId), tokenId); _burn(tokenId); } // CREATOR FUNCTIONS function addStyle( string calldata name, string calldata uri, uint256 premium, address royaltyPayee ) external { styleNames[_styleIds.current()] = name; styleUris[_styleIds.current()] = uri; stylePremiums[_styleIds.current()] = premium; stylePremiumReceivers[_styleIds.current()] = royaltyPayee; ownedStyles[msg.sender][_styleIds.current()] = true; _styleIds.increment(); } function reduceStylePremium(uint256 styleId, uint256 newStylePremium) external { require(msg.sender == stylePremiumReceivers[styleId], "You're not the style creator"); require(newStylePremium < stylePremiums[styleId], "No increasing the price >.<"); stylePremiums[styleId] = newStylePremium; emit StylePremiumDecreased(styleId, newStylePremium); } function changeStylePremiumReceiver(uint256 styleId, address newStylePremiumReceiver) external { require(msg.sender == stylePremiumReceivers[styleId],"You're not the style creator"); stylePremiumReceivers[styleId] = newStylePremiumReceiver; } // OWNER FUNCTIONS function reduceBasePrice(uint256 newBasePrice) external onlyOwner { require( newBasePrice <= BASE_PRICE, "No increasing the price >.<" ); BASE_PRICE = newBasePrice; emit BasePriceDecreased(newBasePrice); } function changeStakeAmount(uint256 newStakeRequired) external onlyOwner { STAKE_REQUIRED = newStakeRequired; } function changeRewardBase(uint256 newRewardBase) external onlyOwner { REWARD_BASE = newRewardBase; } function changeProtocolFee(uint256 newProtocolFee) external onlyOwner { require( newProtocolFee <= PROTOCOL_FEE, "No increasing the price >.<" ); PROTOCOL_FEE = newProtocolFee; } function changeRoyaltyReceiver(address newRoyaltyReceiver) external onlyOwner { ROYALTY_RECEIVER = newRoyaltyReceiver; } // PRIVATE FUNCTIONS function _payPlatform(uint256 amount) private { payable(ROYALTY_RECEIVER).transfer(amount); emit RoyaltiesPaid(ROYALTY_RECEIVER, amount); } function _payStylePremiumReceiver(uint256 amount, address receiver) private { uint256 receiverAmount = (amount * (FEE_DENOMINATOR - PROTOCOL_FEE)) / FEE_DENOMINATOR; uint256 royaltyReceiverAmount = amount - receiverAmount; payable(receiver).transfer(receiverAmount); payable(ROYALTY_RECEIVER).transfer(royaltyReceiverAmount); emit RoyaltiesPaid(receiver, receiverAmount); emit RoyaltiesPaid(ROYALTY_RECEIVER, royaltyReceiverAmount); } // OVERRIDES function approve(address to, uint256 tokenId) public override { revert(); } function getApproved(uint256 tokenId) public view override returns (address) { revert(); } function setApprovalForAll(address operator, bool approved) public override { revert(); } function isApprovedForAll(address owner, address operator) public view override returns (bool) { revert(); } function transferFrom( address from, address to, uint256 tokenId ) public override { revert(); } function _burn(uint256 tokenId) internal override { super._burn(tokenId); } }
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.12; interface IERC5192 { /// @notice Emitted when the locking status is changed to locked. /// @dev If a token is minted and the status is locked, this event should be emitted. /// @param tokenId The identifier for a token. event Locked(uint256 tokenId); /// @notice Emitted when the locking status is changed to unlocked. /// @dev If a token is minted and the status is unlocked, this event should be emitted. /// @param tokenId The identifier for a token. event Unlocked(uint256 tokenId); /// @notice Returns the locking status of an Soulbound Token /// @dev SBTs assigned to zero address are considered invalid, and queries /// about them do throw. /// @param tokenId The identifier for an SBT. function locked(uint256 tokenId) external view returns (bool); }
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "./IERC5192.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract RotatoorERC5192 is ERC721, IERC5192 { // ERC5192 Implementation for Rotatoor function locked(uint256 tokenId) external view returns (bool) { return true; } constructor(string memory name_, string memory symbol_) ERC721(name_, symbol_) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) { // function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC5192).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (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: address zero is not a valid owner"); 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: invalid token ID"); 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) { _requireMinted(tokenId); 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 overridden 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 token owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); 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: caller is not token 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: caller is not token 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) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == 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); _afterTokenTransfer(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); _afterTokenTransfer(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 from incorrect owner"); 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); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {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 an {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 Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @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 { /// @solidity memory-safe-assembly 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 {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 (last updated v4.7.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/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/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // 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); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // 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 (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "remappings": [ "@ensdomains/=node_modules/@ensdomains/", "@openzeppelin/=node_modules/@openzeppelin/", "ds-test/=lib/forge-std/lib/ds-test/src/", "eth-gas-reporter/=node_modules/eth-gas-reporter/", "forge-std/=lib/forge-std/src/", "hardhat/=node_modules/hardhat/" ], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"stakeRequired","type":"uint256"},{"internalType":"uint256","name":"rewardBase","type":"uint256"},{"internalType":"uint256","name":"protocolFee","type":"uint256"},{"internalType":"address","name":"royaltyReceiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"uint256","name":"amount","type":"uint256"}],"name":"BasePriceDecreased","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Locked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address[]","name":"nftContracts","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"indexed":true,"internalType":"uint256","name":"styleId","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RoyaltiesPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"victim","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Slashed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"styleId","type":"uint256"},{"indexed":false,"internalType":"string","name":"styleName","type":"string"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint256","name":"premium","type":"uint256"}],"name":"StyleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"styleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StylePremiumDecreased","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":"uint256","name":"tokenId","type":"uint256"}],"name":"Unlocked","type":"event"},{"inputs":[],"name":"BASE_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROTOCOL_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARD_BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STAKE_REQUIRED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"premium","type":"uint256"},{"internalType":"address","name":"royaltyPayee","type":"address"}],"name":"addStyle","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"buyer","type":"address"},{"internalType":"uint256","name":"styleId","type":"uint256"}],"name":"calculateMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProtocolFee","type":"uint256"}],"name":"changeProtocolFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newRewardBase","type":"uint256"}],"name":"changeRewardBase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRoyaltyReceiver","type":"address"}],"name":"changeRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStakeRequired","type":"uint256"}],"name":"changeStakeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"styleId","type":"uint256"},{"internalType":"address","name":"newStylePremiumReceiver","type":"address"}],"name":"changeStylePremiumReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"styleId","type":"uint256"}],"name":"giftStyle","outputs":[],"stateMutability":"nonpayable","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":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"nftIndex","type":"uint256"}],"name":"isSlashable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"isValidRotatoor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"nftContracts","type":"address[]"},{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"},{"internalType":"uint256","name":"styleId","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"ownedStyles","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"","type":"address"}],"name":"paidMembers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"styleId","type":"uint256"}],"name":"purchaseStyle","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newBasePrice","type":"uint256"}],"name":"reduceBasePrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"styleId","type":"uint256"},{"internalType":"uint256","name":"newStylePremium","type":"uint256"}],"name":"reduceStylePremium","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"rotatoors","outputs":[{"internalType":"uint256","name":"style","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":"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":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"nftIndex","type":"uint256"}],"name":"slash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakedBalances","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"styleNames","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stylePremiumReceivers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stylePremiums","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"styleUris","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"tokenNFTContracts","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenNFTIds","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenStyle","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"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":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"styleId","type":"uint256"}],"name":"unlockedStyle","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620033dd380380620033dd833981016040819052620000349162000149565b604051806040016040528060088152602001673937ba30ba37b7b960c11b815250604051806040016040528060088152602001672927aa20aa27a7a960c11b815250818181600090816200008991906200024d565b5060016200009882826200024d565b5050505050620000b7620000b1620000f360201b60201c565b620000f7565b6001600755600a94909455600b92909255600c55600d55600e80546001600160a01b0319166001600160a01b0390921691909117905562000319565b3390565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080600080600060a086880312156200016257600080fd5b855160208701516040880151606089015160808a0151939850919650945092506001600160a01b03811681146200019857600080fd5b809150509295509295909350565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001d157607f821691505b602082108103620001f257634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000248576000816000526020600020601f850160051c81016020861015620002235750805b601f850160051c820191505b8181101562000244578281556001016200022f565b5050505b505050565b81516001600160401b03811115620002695762000269620001a6565b62000281816200027a8454620001bc565b84620001f8565b602080601f831160018114620002b95760008415620002a05750858301515b600019600386901b1c1916600185901b17855562000244565b600085815260208120601f198616915b82811015620002ea57888601518255948401946001909101908401620002c9565b5085821015620003095787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6130b480620003296000396000f3fe6080604052600436106102e45760003560e01c80638bd2740511610190578063bce70463116100dc578063e985e9c511610095578063f6254e5d1161006f578063f6254e5d1461090e578063f86325ed1461092e578063f89e86b114610944578063fe6874751461096457600080fd5b8063e985e9c5146108a6578063f2fde38b146108c1578063f37d3172146108e157600080fd5b8063bce70463146107e7578063c87b56dd146107fa578063ca79b5a91461081a578063d73792a91461083a578063e6d6ee2b14610850578063e834d1f51461087057600080fd5b806398317f0511610149578063a22cb46511610123578063a22cb4651461076b578063b25a8dbf14610786578063b45a3c0e146107a6578063b88d4fde146107c757600080fd5b806398317f05146106fe5780639a0f01821461071e578063a22a64281461074b57600080fd5b80638bd274051461063b5780638da5cb5b1461065b578063910bdaeb1461067957806392754a261461069957806392ef91f7146106b957806395d89b41146106e957600080fd5b80632b1002641161024f57806355b4da1d116102085780636352211e116101e25780636352211e146105b957806370a08231146105d9578063715018a6146105f957806384514c921461060e57600080fd5b806355b4da1d1461056657806359af2ba1146105865780635e2a0023146105a657600080fd5b80632b1002641461049557806330794fe9146104b55780633beb7070146104f057806342842e0e1461050657806342966c681461052657806351848dac1461054657600080fd5b80630ca7d97c116102a15780630ca7d97c146103d45780631bd926ef146104015780631e009f311461043157806323b872dd1461044757806325b31a97146104625780632606fd5f1461047557600080fd5b806301ffc9a7146102e957806306fdde031461031e57806307541f2114610340578063081812fc14610362578063095ea7b3146103955780630b4501fd146103b0575b600080fd5b3480156102f557600080fd5b506103096103043660046126f3565b610984565b60405190151581526020015b60405180910390f35b34801561032a57600080fd5b506103336109af565b6040516103159190612767565b34801561034c57600080fd5b5061036061035b36600461277a565b610a41565b005b34801561036e57600080fd5b5061037d6102e436600461277a565b6040516001600160a01b039091168152602001610315565b3480156103a157600080fd5b506103606102e43660046127a8565b3480156103bc57600080fd5b506103c6600d5481565b604051908152602001610315565b3480156103e057600080fd5b506103c66103ef36600461277a565b60146020526000908152604090205481565b34801561040d57600080fd5b506103c661041c36600461277a565b60136020526000908152604090206002015481565b34801561043d57600080fd5b506103c6600c5481565b34801561045357600080fd5b506103606102e43660046127d4565b610360610470366004612815565b610a4e565b34801561048157600080fd5b5061030961049036600461277a565b610ae3565b3480156104a157600080fd5b506103096104b0366004612832565b610bec565b3480156104c157600080fd5b506103096104d03660046127a8565b601560209081526000928352604080842090915290825290205460ff1681565b3480156104fc57600080fd5b506103c6600b5481565b34801561051257600080fd5b506103606105213660046127d4565b610cfe565b34801561053257600080fd5b5061036061054136600461277a565b610d1e565b34801561055257600080fd5b506103096105613660046127a8565b610dd7565b34801561057257600080fd5b506103606105813660046127a8565b610e20565b34801561059257600080fd5b506103c66105a136600461277a565b610ed5565b6103606105b43660046128a0565b610f16565b3480156105c557600080fd5b5061037d6105d436600461277a565b61119b565b3480156105e557600080fd5b506103c66105f4366004612815565b611200565b34801561060557600080fd5b50610360611286565b34801561061a57600080fd5b506103c661062936600461277a565b60126020526000908152604090205481565b34801561064757600080fd5b50610360610656366004612832565b61129a565b34801561066757600080fd5b506006546001600160a01b031661037d565b34801561068557600080fd5b5061036061069436600461277a565b61137c565b3480156106a557600080fd5b506103606106b4366004612815565b6113e2565b3480156106c557600080fd5b506103096106d4366004612815565b60166020526000908152604090205460ff1681565b3480156106f557600080fd5b5061033361140c565b34801561070a57600080fd5b506103c66107193660046127a8565b61141b565b34801561072a57600080fd5b5061073e61073936600461277a565b6114e1565b6040516103159190612914565b34801561075757600080fd5b50610360610766366004612832565b61157e565b34801561077757600080fd5b506103606102e4366004612961565b34801561079257600080fd5b506103336107a136600461277a565b611797565b3480156107b257600080fd5b506103096107c136600461277a565b50600190565b3480156107d357600080fd5b506103606107e23660046129b5565b611831565b6103606107f53660046127a8565b6118b0565b34801561080657600080fd5b5061033361081536600461277a565b61194e565b34801561082657600080fd5b5061036061083536600461277a565b6119cc565b34801561084657600080fd5b506103c661271081565b34801561085c57600080fd5b5061036061086b366004612a95565b6119d9565b34801561087c57600080fd5b5061037d61088b36600461277a565b6011602052600090815260409020546001600160a01b031681565b3480156108b257600080fd5b506103096102e4366004612aba565b3480156108cd57600080fd5b506103606108dc366004612815565b611a6d565b3480156108ed57600080fd5b506109016108fc36600461277a565b611ae3565b6040516103159190612ae8565b34801561091a57600080fd5b50610360610929366004612b62565b611b79565b34801561093a57600080fd5b506103c6600a5481565b34801561095057600080fd5b5061033361095f36600461277a565b611c5e565b34801561097057600080fd5b5061036061097f36600461277a565b611c77565b60006001600160e01b03198216635a2d1e0760e11b14806109a957506109a982611ca6565b92915050565b6060600080546109be90612bee565b80601f01602080910402602001604051908101604052809291908181526020018280546109ea90612bee565b8015610a375780601f10610a0c57610100808354040283529160200191610a37565b820191906000526020600020905b815481529060010190602001808311610a1a57829003601f168201915b5050505050905090565b610a49611cf6565b600c55565b6001600160a01b03811660009081526016602052604090205460ff1615610a905760405162461bcd60e51b8152600401610a8790612c28565b60405180910390fd5b600a543414610ab15760405162461bcd60e51b8152600401610a8790612c56565b6001600160a01b0381166000908152601660205260409020805460ff19166001179055600a54610ae090611d50565b50565b6000818152601360205260408120815b8154811015610be257610b058461119b565b6001600160a01b0316826000018281548110610b2357610b23612c80565b6000918252602090912001546001840180546001600160a01b0390921691636352211e919085908110610b5857610b58612c80565b90600052602060002001546040518263ffffffff1660e01b8152600401610b8191815260200190565b602060405180830381865afa158015610b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc29190612c96565b6001600160a01b031614610bda575060009392505050565b600101610af3565b5060019392505050565b600082815260146020526040812054610c175760405162461bcd60e51b8152600401610a8790612cb3565b6000838152601360205260409020610c2e8461119b565b6001600160a01b0316816000018481548110610c4c57610c4c612c80565b6000918252602090912001546001830180546001600160a01b0390921691636352211e919087908110610c8157610c81612c80565b90600052602060002001546040518263ffffffff1660e01b8152600401610caa91815260200190565b602060405180830381865afa158015610cc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ceb9190612c96565b6001600160a01b03161415949350505050565b610d1983838360405180602001604052806000815250611831565b505050565b600081815260146020526040902054610d368261119b565b6001600160a01b0316336001600160a01b031614610d8d5760405162461bcd60e51b81526020600482015260146024820152734f6e6c79206f776e65722063616e206275726e2160601b6044820152606401610a87565b604051339082156108fc029083906000818181858888f19350505050158015610dba573d6000803e3d6000fd5b50600082815260146020526040812055610dd382611dce565b5050565b6000818152601260205260408120548103610df4575060016109a9565b506001600160a01b03919091166000908152601560209081526040808320938352929052205460ff1690565b610e2a8282610dd7565b15610e475760405162461bcd60e51b8152600401610a8790612c28565b6000818152601160205260409020546001600160a01b03163314610ea55760405162461bcd60e51b81526020600482015260156024820152742737ba103a34329039ba3cb6329031b932b0ba37b960591b6044820152606401610a87565b6001600160a01b03909116600090815260156020908152604080832093835292905220805460ff19166001179055565b600081815260146020526040812054610f005760405162461bcd60e51b8152600401610a8790612cb3565b5060009081526013602052604090206002015490565b610f20338261141b565b3414610f3e5760405162461bcd60e51b8152600401610a8790612c56565b6000610f4960085490565b9050610f553382611dd7565b600b546000828152601460205260409081902091909155518290829033907f7a4615b9d64349efbe1d57cb37222d0cf5878f632cdb3946a1adcbe498de2e7b90610fa6908b908b908b908b90612ce3565b60405180910390a46040518181527f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16119060200160405180910390a16040518060600160405280878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020878102828101820190935287825292830192909188918891829185019084908082843760009201829052509385525050506020918201859052838152601382526040902082518051919261108192849290910190612628565b50602082810151805161109a926001850192019061268d565b50604082015181600201559050506110b181610ae3565b6110f15760405162461bcd60e51b81526020600482015260116024820152700496e76616c6964206f776e65727368697607c1b6044820152606401610a87565b6110ff600880546001019055565b3360009081526016602052604090205460ff1661113c57336000908152601660205260409020805460ff19166001179055600a5461113c90611d50565b6111463383610dd7565b611193573360009081526015602090815260408083208584528252808320805460ff19166001179055601282528083205460119092529091205461119391906001600160a01b0316611df1565b505050505050565b6000818152600260205260408120546001600160a01b0316806109a95760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a87565b60006001600160a01b03821661126a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610a87565b506001600160a01b031660009081526003602052604090205490565b61128e611cf6565b6112986000611f2b565b565b6000828152601160205260409020546001600160a01b031633146113005760405162461bcd60e51b815260206004820152601c60248201527f596f75277265206e6f7420746865207374796c652063726561746f72000000006044820152606401610a87565b600082815260126020526040902054811061132d5760405162461bcd60e51b8152600401610a8790612d61565b60008281526012602090815260409182902083905581518481529081018390527f48069ef3559f4c79ed76a23a4c9d1c9c8385601d3c6f00f0c8c0daf79c1c0fb0910160405180910390a15050565b611384611cf6565b600a548111156113a65760405162461bcd60e51b8152600401610a8790612d61565b600a8190556040518181527f77d50960548aa72149bc447bb9c47a08cce44caca44808256cb594c6ee241b4b906020015b60405180910390a150565b6113ea611cf6565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600180546109be90612bee565b600081815260106020526040812060095483106114715760405162461bcd60e51b815260206004820152601460248201527314dd1e5b1948191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610a87565b6001600160a01b03841660009081526016602052604081205460ff166114a157600a5461149e9082612dae565b90505b6114ab8585610dd7565b6114cb576000848152601260205260409020546114c89082612dae565b90505b600b546114d89082612dae565b95945050505050565b60008181526014602052604090205460609061150f5760405162461bcd60e51b8152600401610a8790612cb3565b600082815260136020908152604091829020805483518184028101840190945280845290929183919083018282801561157157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611553575b5050505050915050919050565b6002600754036115d05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a87565b600260075560005a6000848152601460205260409020549091506115f48484610bec565b6116305760405162461bcd60e51b815260206004820152600d60248201526c13dddb995c881a185cc8139195609a1b6044820152606401610a87565b6000600c54486116409190612dae565b9050600061bbe45a6116529086612dc1565b61165c9190612dae565b9050600061166a8284612dd4565b90508084116116b05760405162461bcd60e51b815260206004820152601260248201527108ec2e640e0e4d2c6ca40e8dede40d0d2ced60731b6044820152606401610a87565b604051339082156108fc029083906000818181858888f193505050501580156116dd573d6000803e3d6000fd5b506116e78761119b565b6001600160a01b03166108fc6116fd8387612dc1565b6040518115909202916000818181858888f19350505050158015611725573d6000803e3d6000fd5b506000878152601460205260408120557f4ed05e9673c26d2ed44f7ef6a7f2942df0ee3b5e1e17db4b99f9dcd261a339cd61175f8861119b565b604080516001600160a01b039092168252602082018a90520160405180910390a161178987611dce565b505060016007555050505050565b601060205260009081526040902080546117b090612bee565b80601f01602080910402602001604051908101604052809291908181526020018280546117dc90612bee565b80156118295780601f106117fe57610100808354040283529160200191611829565b820191906000526020600020905b81548152906001019060200180831161180c57829003601f168201915b505050505081565b61183b3383611f7d565b61189e5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610a87565b6118aa84848484611fd9565b50505050565b6118ba8282610dd7565b156118d75760405162461bcd60e51b8152600401610a8790612c28565b60008181526012602052604090205434146119045760405162461bcd60e51b8152600401610a8790612c56565b6001600160a01b0380831660009081526015602090815260408083208584528252808320805460ff191660011790556012825280832054601190925290912054610dd39216611df1565b60008181526014602052604090205460609061197c5760405162461bcd60e51b8152600401610a8790612cb3565b600082815260136020908152604080832060020154835260109091529020806119a48461200c565b6040516020016119b5929190612deb565b604051602081830303815290604052915050919050565b6119d4611cf6565b600b55565b6000828152601160205260409020546001600160a01b03163314611a3f5760405162461bcd60e51b815260206004820152601c60248201527f596f75277265206e6f7420746865207374796c652063726561746f72000000006044820152606401610a87565b60009182526011602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b611a75611cf6565b6001600160a01b038116611ada5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a87565b610ae081611f2b565b600081815260146020526040902054606090611b115760405162461bcd60e51b8152600401610a8790612cb3565b60008281526013602090815260409182902060018101805484518185028101850190955280855291939290919083018282801561157157602002820191906000526020600020905b815481526020019060010190808311611b59575050505050915050919050565b8585600f6000611b8860095490565b81526020019081526020016000209182611ba3929190612eba565b50838360106000611bb360095490565b81526020019081526020016000209182611bce929190612eba565b508160126000611bdd60095490565b8152602001908152602001600020819055508060116000611bfd60095490565b81526020808201929092526040908101600090812080546001600160a01b0319166001600160a01b039590951694909417909355338352601582528083206009805485529252909120805460ff191660019081179091558154019055611193565b600f60205260009081526040902080546117b090612bee565b611c7f611cf6565b600d54811115611ca15760405162461bcd60e51b8152600401610a8790612d61565b600d55565b60006001600160e01b031982166380ac58cd60e01b1480611cd757506001600160e01b03198216635b5e139f60e01b145b806109a957506301ffc9a760e01b6001600160e01b03198316146109a9565b6006546001600160a01b031633146112985760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a87565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611d8a573d6000803e3d6000fd5b50600e54604080516001600160a01b039092168252602082018390527f06a845867525bb4bb2d46ad712cd6873d92d77452827c1cdf8e75a8ab7f2172491016113d7565b610ae08161210d565b610dd38282604051806020016040528060008152506121a8565b6000612710600d54612710611e069190612dc1565b611e109085612dd4565b611e1a9190612f91565b90506000611e288285612dc1565b6040519091506001600160a01b0384169083156108fc029084906000818181858888f19350505050158015611e61573d6000803e3d6000fd5b50600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611e9c573d6000803e3d6000fd5b50604080516001600160a01b0385168152602081018490527f06a845867525bb4bb2d46ad712cd6873d92d77452827c1cdf8e75a8ab7f21724910160405180910390a1600e54604080516001600160a01b039092168252602082018390527f06a845867525bb4bb2d46ad712cd6873d92d77452827c1cdf8e75a8ab7f21724910160405180910390a150505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080611f898361119b565b9050806001600160a01b0316846001600160a01b03161480611fae5750611fae600080fd5b80611fd15750836001600160a01b0316611fc6600080fd5b6001600160a01b0316145b949350505050565b611fe48484846121db565b611ff084848484612377565b6118aa5760405162461bcd60e51b8152600401610a8790612fa5565b6060816000036120335750506040805180820190915260018152600360fc1b602082015290565b8160005b811561205d578061204781612ff7565b91506120569050600a83612f91565b9150612037565b60008167ffffffffffffffff8111156120785761207861299f565b6040519080825280601f01601f1916602001820160405280156120a2576020820181803683370190505b5090505b8415611fd1576120b7600183612dc1565b91506120c4600a86613010565b6120cf906030612dae565b60f81b8183815181106120e4576120e4612c80565b60200101906001600160f81b031916908160001a905350612106600a86612f91565b94506120a6565b60006121188261119b565b9050612125600083612478565b6001600160a01b038116600090815260036020526040812080546001929061214e908490612dc1565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6121b283836124e6565b6121bf6000848484612377565b610d195760405162461bcd60e51b8152600401610a8790612fa5565b826001600160a01b03166121ee8261119b565b6001600160a01b0316146122525760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610a87565b6001600160a01b0382166122b45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a87565b6122bf600082612478565b6001600160a01b03831660009081526003602052604081208054600192906122e8908490612dc1565b90915550506001600160a01b0382166000908152600360205260408120805460019290612316908490612dae565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160a01b0384163b1561246d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906123bb903390899088908890600401613024565b6020604051808303816000875af19250505080156123f6575060408051601f3d908101601f191682019092526123f391810190613061565b60015b612453573d808015612424576040519150601f19603f3d011682016040523d82523d6000602084013e612429565b606091505b50805160000361244b5760405162461bcd60e51b8152600401610a8790612fa5565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611fd1565b506001949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906124ad8261119b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160a01b03821661253c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a87565b6000818152600260205260409020546001600160a01b0316156125a15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a87565b6001600160a01b03821660009081526003602052604081208054600192906125ca908490612dae565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805482825590600052602060002090810192821561267d579160200282015b8281111561267d57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612648565b506126899291506126c8565b5090565b82805482825590600052602060002090810192821561267d579160200282015b8281111561267d5782518255916020019190600101906126ad565b5b8082111561268957600081556001016126c9565b6001600160e01b031981168114610ae057600080fd5b60006020828403121561270557600080fd5b8135612710816126dd565b9392505050565b60005b8381101561273257818101518382015260200161271a565b50506000910152565b60008151808452612753816020860160208601612717565b601f01601f19169290920160200192915050565b602081526000612710602083018461273b565b60006020828403121561278c57600080fd5b5035919050565b6001600160a01b0381168114610ae057600080fd5b600080604083850312156127bb57600080fd5b82356127c681612793565b946020939093013593505050565b6000806000606084860312156127e957600080fd5b83356127f481612793565b9250602084013561280481612793565b929592945050506040919091013590565b60006020828403121561282757600080fd5b813561271081612793565b6000806040838503121561284557600080fd5b50508035926020909101359150565b60008083601f84011261286657600080fd5b50813567ffffffffffffffff81111561287e57600080fd5b6020830191508360208260051b850101111561289957600080fd5b9250929050565b6000806000806000606086880312156128b857600080fd5b853567ffffffffffffffff808211156128d057600080fd5b6128dc89838a01612854565b909750955060208801359150808211156128f557600080fd5b5061290288828901612854565b96999598509660400135949350505050565b6020808252825182820181905260009190848201906040850190845b818110156129555783516001600160a01b031683529284019291840191600101612930565b50909695505050505050565b6000806040838503121561297457600080fd5b823561297f81612793565b91506020830135801515811461299457600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156129cb57600080fd5b84356129d681612793565b935060208501356129e681612793565b925060408501359150606085013567ffffffffffffffff80821115612a0a57600080fd5b818701915087601f830112612a1e57600080fd5b813581811115612a3057612a3061299f565b604051601f8201601f19908116603f01168101908382118183101715612a5857612a5861299f565b816040528281528a6020848701011115612a7157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215612aa857600080fd5b82359150602083013561299481612793565b60008060408385031215612acd57600080fd5b8235612ad881612793565b9150602083013561299481612793565b6020808252825182820181905260009190848201906040850190845b8181101561295557835183529284019291840191600101612b04565b60008083601f840112612b3257600080fd5b50813567ffffffffffffffff811115612b4a57600080fd5b60208301915083602082850101111561289957600080fd5b60008060008060008060808789031215612b7b57600080fd5b863567ffffffffffffffff80821115612b9357600080fd5b612b9f8a838b01612b20565b90985096506020890135915080821115612bb857600080fd5b50612bc589828a01612b20565b909550935050604087013591506060870135612be081612793565b809150509295509295509295565b600181811c90821680612c0257607f821691505b602082108103612c2257634e487b7160e01b600052602260045260246000fd5b50919050565b602080825260149082015273416c726561647920707572636861736564203a2960601b604082015260600190565b60208082526010908201526f4e6f7420656e6f7567682066756e647360801b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612ca857600080fd5b815161271081612793565b602080825260169082015275149bdd185d1bdbdc88191bd95cdb89dd08195e1a5cdd60521b604082015260600190565b6040808252810184905260008560608301825b87811015612d26578235612d0981612793565b6001600160a01b0316825260209283019290910190600101612cf6565b5083810360208501528481526001600160fb1b03851115612d4657600080fd5b8460051b915081866020830137016020019695505050505050565b6020808252601b908201527f4e6f20696e6372656173696e6720746865207072696365203e2e3c0000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156109a9576109a9612d98565b818103818111156109a9576109a9612d98565b80820281158282048414176109a9576109a9612d98565b6000808454612df981612bee565b60018281168015612e115760018114612e2657612e55565b60ff1984168752821515830287019450612e55565b8860005260208060002060005b85811015612e4c5781548a820152908401908201612e33565b50505082870194505b505050508351612e69818360208801612717565b01949350505050565b601f821115610d19576000816000526020600020601f850160051c81016020861015612e9b5750805b601f850160051c820191505b8181101561119357828155600101612ea7565b67ffffffffffffffff831115612ed257612ed261299f565b612ee683612ee08354612bee565b83612e72565b6000601f841160018114612f1a5760008515612f025750838201355b600019600387901b1c1916600186901b178355612f74565b600083815260209020601f19861690835b82811015612f4b5786850135825560209485019460019092019101612f2b565b5086821015612f685760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b634e487b7160e01b600052601260045260246000fd5b600082612fa057612fa0612f7b565b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60006001820161300957613009612d98565b5060010190565b60008261301f5761301f612f7b565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130579083018461273b565b9695505050505050565b60006020828403121561307357600080fd5b8151612710816126dd56fea2646970667358221220d10f2505016223310c4aec69935f67cb852d8bf4ecc4228c18689e546d4f242c64736f6c6343000817003300000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000012a05f200000000000000000000000000000000000000000000000000000000000000138800000000000000000000000046e210371707d0292e5163906f18bc4447c06bad
Deployed Bytecode
0x6080604052600436106102e45760003560e01c80638bd2740511610190578063bce70463116100dc578063e985e9c511610095578063f6254e5d1161006f578063f6254e5d1461090e578063f86325ed1461092e578063f89e86b114610944578063fe6874751461096457600080fd5b8063e985e9c5146108a6578063f2fde38b146108c1578063f37d3172146108e157600080fd5b8063bce70463146107e7578063c87b56dd146107fa578063ca79b5a91461081a578063d73792a91461083a578063e6d6ee2b14610850578063e834d1f51461087057600080fd5b806398317f0511610149578063a22cb46511610123578063a22cb4651461076b578063b25a8dbf14610786578063b45a3c0e146107a6578063b88d4fde146107c757600080fd5b806398317f05146106fe5780639a0f01821461071e578063a22a64281461074b57600080fd5b80638bd274051461063b5780638da5cb5b1461065b578063910bdaeb1461067957806392754a261461069957806392ef91f7146106b957806395d89b41146106e957600080fd5b80632b1002641161024f57806355b4da1d116102085780636352211e116101e25780636352211e146105b957806370a08231146105d9578063715018a6146105f957806384514c921461060e57600080fd5b806355b4da1d1461056657806359af2ba1146105865780635e2a0023146105a657600080fd5b80632b1002641461049557806330794fe9146104b55780633beb7070146104f057806342842e0e1461050657806342966c681461052657806351848dac1461054657600080fd5b80630ca7d97c116102a15780630ca7d97c146103d45780631bd926ef146104015780631e009f311461043157806323b872dd1461044757806325b31a97146104625780632606fd5f1461047557600080fd5b806301ffc9a7146102e957806306fdde031461031e57806307541f2114610340578063081812fc14610362578063095ea7b3146103955780630b4501fd146103b0575b600080fd5b3480156102f557600080fd5b506103096103043660046126f3565b610984565b60405190151581526020015b60405180910390f35b34801561032a57600080fd5b506103336109af565b6040516103159190612767565b34801561034c57600080fd5b5061036061035b36600461277a565b610a41565b005b34801561036e57600080fd5b5061037d6102e436600461277a565b6040516001600160a01b039091168152602001610315565b3480156103a157600080fd5b506103606102e43660046127a8565b3480156103bc57600080fd5b506103c6600d5481565b604051908152602001610315565b3480156103e057600080fd5b506103c66103ef36600461277a565b60146020526000908152604090205481565b34801561040d57600080fd5b506103c661041c36600461277a565b60136020526000908152604090206002015481565b34801561043d57600080fd5b506103c6600c5481565b34801561045357600080fd5b506103606102e43660046127d4565b610360610470366004612815565b610a4e565b34801561048157600080fd5b5061030961049036600461277a565b610ae3565b3480156104a157600080fd5b506103096104b0366004612832565b610bec565b3480156104c157600080fd5b506103096104d03660046127a8565b601560209081526000928352604080842090915290825290205460ff1681565b3480156104fc57600080fd5b506103c6600b5481565b34801561051257600080fd5b506103606105213660046127d4565b610cfe565b34801561053257600080fd5b5061036061054136600461277a565b610d1e565b34801561055257600080fd5b506103096105613660046127a8565b610dd7565b34801561057257600080fd5b506103606105813660046127a8565b610e20565b34801561059257600080fd5b506103c66105a136600461277a565b610ed5565b6103606105b43660046128a0565b610f16565b3480156105c557600080fd5b5061037d6105d436600461277a565b61119b565b3480156105e557600080fd5b506103c66105f4366004612815565b611200565b34801561060557600080fd5b50610360611286565b34801561061a57600080fd5b506103c661062936600461277a565b60126020526000908152604090205481565b34801561064757600080fd5b50610360610656366004612832565b61129a565b34801561066757600080fd5b506006546001600160a01b031661037d565b34801561068557600080fd5b5061036061069436600461277a565b61137c565b3480156106a557600080fd5b506103606106b4366004612815565b6113e2565b3480156106c557600080fd5b506103096106d4366004612815565b60166020526000908152604090205460ff1681565b3480156106f557600080fd5b5061033361140c565b34801561070a57600080fd5b506103c66107193660046127a8565b61141b565b34801561072a57600080fd5b5061073e61073936600461277a565b6114e1565b6040516103159190612914565b34801561075757600080fd5b50610360610766366004612832565b61157e565b34801561077757600080fd5b506103606102e4366004612961565b34801561079257600080fd5b506103336107a136600461277a565b611797565b3480156107b257600080fd5b506103096107c136600461277a565b50600190565b3480156107d357600080fd5b506103606107e23660046129b5565b611831565b6103606107f53660046127a8565b6118b0565b34801561080657600080fd5b5061033361081536600461277a565b61194e565b34801561082657600080fd5b5061036061083536600461277a565b6119cc565b34801561084657600080fd5b506103c661271081565b34801561085c57600080fd5b5061036061086b366004612a95565b6119d9565b34801561087c57600080fd5b5061037d61088b36600461277a565b6011602052600090815260409020546001600160a01b031681565b3480156108b257600080fd5b506103096102e4366004612aba565b3480156108cd57600080fd5b506103606108dc366004612815565b611a6d565b3480156108ed57600080fd5b506109016108fc36600461277a565b611ae3565b6040516103159190612ae8565b34801561091a57600080fd5b50610360610929366004612b62565b611b79565b34801561093a57600080fd5b506103c6600a5481565b34801561095057600080fd5b5061033361095f36600461277a565b611c5e565b34801561097057600080fd5b5061036061097f36600461277a565b611c77565b60006001600160e01b03198216635a2d1e0760e11b14806109a957506109a982611ca6565b92915050565b6060600080546109be90612bee565b80601f01602080910402602001604051908101604052809291908181526020018280546109ea90612bee565b8015610a375780601f10610a0c57610100808354040283529160200191610a37565b820191906000526020600020905b815481529060010190602001808311610a1a57829003601f168201915b5050505050905090565b610a49611cf6565b600c55565b6001600160a01b03811660009081526016602052604090205460ff1615610a905760405162461bcd60e51b8152600401610a8790612c28565b60405180910390fd5b600a543414610ab15760405162461bcd60e51b8152600401610a8790612c56565b6001600160a01b0381166000908152601660205260409020805460ff19166001179055600a54610ae090611d50565b50565b6000818152601360205260408120815b8154811015610be257610b058461119b565b6001600160a01b0316826000018281548110610b2357610b23612c80565b6000918252602090912001546001840180546001600160a01b0390921691636352211e919085908110610b5857610b58612c80565b90600052602060002001546040518263ffffffff1660e01b8152600401610b8191815260200190565b602060405180830381865afa158015610b9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc29190612c96565b6001600160a01b031614610bda575060009392505050565b600101610af3565b5060019392505050565b600082815260146020526040812054610c175760405162461bcd60e51b8152600401610a8790612cb3565b6000838152601360205260409020610c2e8461119b565b6001600160a01b0316816000018481548110610c4c57610c4c612c80565b6000918252602090912001546001830180546001600160a01b0390921691636352211e919087908110610c8157610c81612c80565b90600052602060002001546040518263ffffffff1660e01b8152600401610caa91815260200190565b602060405180830381865afa158015610cc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ceb9190612c96565b6001600160a01b03161415949350505050565b610d1983838360405180602001604052806000815250611831565b505050565b600081815260146020526040902054610d368261119b565b6001600160a01b0316336001600160a01b031614610d8d5760405162461bcd60e51b81526020600482015260146024820152734f6e6c79206f776e65722063616e206275726e2160601b6044820152606401610a87565b604051339082156108fc029083906000818181858888f19350505050158015610dba573d6000803e3d6000fd5b50600082815260146020526040812055610dd382611dce565b5050565b6000818152601260205260408120548103610df4575060016109a9565b506001600160a01b03919091166000908152601560209081526040808320938352929052205460ff1690565b610e2a8282610dd7565b15610e475760405162461bcd60e51b8152600401610a8790612c28565b6000818152601160205260409020546001600160a01b03163314610ea55760405162461bcd60e51b81526020600482015260156024820152742737ba103a34329039ba3cb6329031b932b0ba37b960591b6044820152606401610a87565b6001600160a01b03909116600090815260156020908152604080832093835292905220805460ff19166001179055565b600081815260146020526040812054610f005760405162461bcd60e51b8152600401610a8790612cb3565b5060009081526013602052604090206002015490565b610f20338261141b565b3414610f3e5760405162461bcd60e51b8152600401610a8790612c56565b6000610f4960085490565b9050610f553382611dd7565b600b546000828152601460205260409081902091909155518290829033907f7a4615b9d64349efbe1d57cb37222d0cf5878f632cdb3946a1adcbe498de2e7b90610fa6908b908b908b908b90612ce3565b60405180910390a46040518181527f032bc66be43dbccb7487781d168eb7bda224628a3b2c3388bdf69b532a3a16119060200160405180910390a16040518060600160405280878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250505090825250604080516020878102828101820190935287825292830192909188918891829185019084908082843760009201829052509385525050506020918201859052838152601382526040902082518051919261108192849290910190612628565b50602082810151805161109a926001850192019061268d565b50604082015181600201559050506110b181610ae3565b6110f15760405162461bcd60e51b81526020600482015260116024820152700496e76616c6964206f776e65727368697607c1b6044820152606401610a87565b6110ff600880546001019055565b3360009081526016602052604090205460ff1661113c57336000908152601660205260409020805460ff19166001179055600a5461113c90611d50565b6111463383610dd7565b611193573360009081526015602090815260408083208584528252808320805460ff19166001179055601282528083205460119092529091205461119391906001600160a01b0316611df1565b505050505050565b6000818152600260205260408120546001600160a01b0316806109a95760405162461bcd60e51b815260206004820152601860248201527f4552433732313a20696e76616c696420746f6b656e20494400000000000000006044820152606401610a87565b60006001600160a01b03821661126a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610a87565b506001600160a01b031660009081526003602052604090205490565b61128e611cf6565b6112986000611f2b565b565b6000828152601160205260409020546001600160a01b031633146113005760405162461bcd60e51b815260206004820152601c60248201527f596f75277265206e6f7420746865207374796c652063726561746f72000000006044820152606401610a87565b600082815260126020526040902054811061132d5760405162461bcd60e51b8152600401610a8790612d61565b60008281526012602090815260409182902083905581518481529081018390527f48069ef3559f4c79ed76a23a4c9d1c9c8385601d3c6f00f0c8c0daf79c1c0fb0910160405180910390a15050565b611384611cf6565b600a548111156113a65760405162461bcd60e51b8152600401610a8790612d61565b600a8190556040518181527f77d50960548aa72149bc447bb9c47a08cce44caca44808256cb594c6ee241b4b906020015b60405180910390a150565b6113ea611cf6565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600180546109be90612bee565b600081815260106020526040812060095483106114715760405162461bcd60e51b815260206004820152601460248201527314dd1e5b1948191bd95cc81b9bdd08195e1a5cdd60621b6044820152606401610a87565b6001600160a01b03841660009081526016602052604081205460ff166114a157600a5461149e9082612dae565b90505b6114ab8585610dd7565b6114cb576000848152601260205260409020546114c89082612dae565b90505b600b546114d89082612dae565b95945050505050565b60008181526014602052604090205460609061150f5760405162461bcd60e51b8152600401610a8790612cb3565b600082815260136020908152604091829020805483518184028101840190945280845290929183919083018282801561157157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611553575b5050505050915050919050565b6002600754036115d05760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a87565b600260075560005a6000848152601460205260409020549091506115f48484610bec565b6116305760405162461bcd60e51b815260206004820152600d60248201526c13dddb995c881a185cc8139195609a1b6044820152606401610a87565b6000600c54486116409190612dae565b9050600061bbe45a6116529086612dc1565b61165c9190612dae565b9050600061166a8284612dd4565b90508084116116b05760405162461bcd60e51b815260206004820152601260248201527108ec2e640e0e4d2c6ca40e8dede40d0d2ced60731b6044820152606401610a87565b604051339082156108fc029083906000818181858888f193505050501580156116dd573d6000803e3d6000fd5b506116e78761119b565b6001600160a01b03166108fc6116fd8387612dc1565b6040518115909202916000818181858888f19350505050158015611725573d6000803e3d6000fd5b506000878152601460205260408120557f4ed05e9673c26d2ed44f7ef6a7f2942df0ee3b5e1e17db4b99f9dcd261a339cd61175f8861119b565b604080516001600160a01b039092168252602082018a90520160405180910390a161178987611dce565b505060016007555050505050565b601060205260009081526040902080546117b090612bee565b80601f01602080910402602001604051908101604052809291908181526020018280546117dc90612bee565b80156118295780601f106117fe57610100808354040283529160200191611829565b820191906000526020600020905b81548152906001019060200180831161180c57829003601f168201915b505050505081565b61183b3383611f7d565b61189e5760405162461bcd60e51b815260206004820152602e60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526d1c881b9bdc88185c1c1c9bdd995960921b6064820152608401610a87565b6118aa84848484611fd9565b50505050565b6118ba8282610dd7565b156118d75760405162461bcd60e51b8152600401610a8790612c28565b60008181526012602052604090205434146119045760405162461bcd60e51b8152600401610a8790612c56565b6001600160a01b0380831660009081526015602090815260408083208584528252808320805460ff191660011790556012825280832054601190925290912054610dd39216611df1565b60008181526014602052604090205460609061197c5760405162461bcd60e51b8152600401610a8790612cb3565b600082815260136020908152604080832060020154835260109091529020806119a48461200c565b6040516020016119b5929190612deb565b604051602081830303815290604052915050919050565b6119d4611cf6565b600b55565b6000828152601160205260409020546001600160a01b03163314611a3f5760405162461bcd60e51b815260206004820152601c60248201527f596f75277265206e6f7420746865207374796c652063726561746f72000000006044820152606401610a87565b60009182526011602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b611a75611cf6565b6001600160a01b038116611ada5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a87565b610ae081611f2b565b600081815260146020526040902054606090611b115760405162461bcd60e51b8152600401610a8790612cb3565b60008281526013602090815260409182902060018101805484518185028101850190955280855291939290919083018282801561157157602002820191906000526020600020905b815481526020019060010190808311611b59575050505050915050919050565b8585600f6000611b8860095490565b81526020019081526020016000209182611ba3929190612eba565b50838360106000611bb360095490565b81526020019081526020016000209182611bce929190612eba565b508160126000611bdd60095490565b8152602001908152602001600020819055508060116000611bfd60095490565b81526020808201929092526040908101600090812080546001600160a01b0319166001600160a01b039590951694909417909355338352601582528083206009805485529252909120805460ff191660019081179091558154019055611193565b600f60205260009081526040902080546117b090612bee565b611c7f611cf6565b600d54811115611ca15760405162461bcd60e51b8152600401610a8790612d61565b600d55565b60006001600160e01b031982166380ac58cd60e01b1480611cd757506001600160e01b03198216635b5e139f60e01b145b806109a957506301ffc9a760e01b6001600160e01b03198316146109a9565b6006546001600160a01b031633146112985760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a87565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611d8a573d6000803e3d6000fd5b50600e54604080516001600160a01b039092168252602082018390527f06a845867525bb4bb2d46ad712cd6873d92d77452827c1cdf8e75a8ab7f2172491016113d7565b610ae08161210d565b610dd38282604051806020016040528060008152506121a8565b6000612710600d54612710611e069190612dc1565b611e109085612dd4565b611e1a9190612f91565b90506000611e288285612dc1565b6040519091506001600160a01b0384169083156108fc029084906000818181858888f19350505050158015611e61573d6000803e3d6000fd5b50600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611e9c573d6000803e3d6000fd5b50604080516001600160a01b0385168152602081018490527f06a845867525bb4bb2d46ad712cd6873d92d77452827c1cdf8e75a8ab7f21724910160405180910390a1600e54604080516001600160a01b039092168252602082018390527f06a845867525bb4bb2d46ad712cd6873d92d77452827c1cdf8e75a8ab7f21724910160405180910390a150505050565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600080611f898361119b565b9050806001600160a01b0316846001600160a01b03161480611fae5750611fae600080fd5b80611fd15750836001600160a01b0316611fc6600080fd5b6001600160a01b0316145b949350505050565b611fe48484846121db565b611ff084848484612377565b6118aa5760405162461bcd60e51b8152600401610a8790612fa5565b6060816000036120335750506040805180820190915260018152600360fc1b602082015290565b8160005b811561205d578061204781612ff7565b91506120569050600a83612f91565b9150612037565b60008167ffffffffffffffff8111156120785761207861299f565b6040519080825280601f01601f1916602001820160405280156120a2576020820181803683370190505b5090505b8415611fd1576120b7600183612dc1565b91506120c4600a86613010565b6120cf906030612dae565b60f81b8183815181106120e4576120e4612c80565b60200101906001600160f81b031916908160001a905350612106600a86612f91565b94506120a6565b60006121188261119b565b9050612125600083612478565b6001600160a01b038116600090815260036020526040812080546001929061214e908490612dc1565b909155505060008281526002602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6121b283836124e6565b6121bf6000848484612377565b610d195760405162461bcd60e51b8152600401610a8790612fa5565b826001600160a01b03166121ee8261119b565b6001600160a01b0316146122525760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610a87565b6001600160a01b0382166122b45760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a87565b6122bf600082612478565b6001600160a01b03831660009081526003602052604081208054600192906122e8908490612dc1565b90915550506001600160a01b0382166000908152600360205260408120805460019290612316908490612dae565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60006001600160a01b0384163b1561246d57604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906123bb903390899088908890600401613024565b6020604051808303816000875af19250505080156123f6575060408051601f3d908101601f191682019092526123f391810190613061565b60015b612453573d808015612424576040519150601f19603f3d011682016040523d82523d6000602084013e612429565b606091505b50805160000361244b5760405162461bcd60e51b8152600401610a8790612fa5565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611fd1565b506001949350505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b03841690811790915581906124ad8261119b565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6001600160a01b03821661253c5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a87565b6000818152600260205260409020546001600160a01b0316156125a15760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a87565b6001600160a01b03821660009081526003602052604081208054600192906125ca908490612dae565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b82805482825590600052602060002090810192821561267d579160200282015b8281111561267d57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190612648565b506126899291506126c8565b5090565b82805482825590600052602060002090810192821561267d579160200282015b8281111561267d5782518255916020019190600101906126ad565b5b8082111561268957600081556001016126c9565b6001600160e01b031981168114610ae057600080fd5b60006020828403121561270557600080fd5b8135612710816126dd565b9392505050565b60005b8381101561273257818101518382015260200161271a565b50506000910152565b60008151808452612753816020860160208601612717565b601f01601f19169290920160200192915050565b602081526000612710602083018461273b565b60006020828403121561278c57600080fd5b5035919050565b6001600160a01b0381168114610ae057600080fd5b600080604083850312156127bb57600080fd5b82356127c681612793565b946020939093013593505050565b6000806000606084860312156127e957600080fd5b83356127f481612793565b9250602084013561280481612793565b929592945050506040919091013590565b60006020828403121561282757600080fd5b813561271081612793565b6000806040838503121561284557600080fd5b50508035926020909101359150565b60008083601f84011261286657600080fd5b50813567ffffffffffffffff81111561287e57600080fd5b6020830191508360208260051b850101111561289957600080fd5b9250929050565b6000806000806000606086880312156128b857600080fd5b853567ffffffffffffffff808211156128d057600080fd5b6128dc89838a01612854565b909750955060208801359150808211156128f557600080fd5b5061290288828901612854565b96999598509660400135949350505050565b6020808252825182820181905260009190848201906040850190845b818110156129555783516001600160a01b031683529284019291840191600101612930565b50909695505050505050565b6000806040838503121561297457600080fd5b823561297f81612793565b91506020830135801515811461299457600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080600080608085870312156129cb57600080fd5b84356129d681612793565b935060208501356129e681612793565b925060408501359150606085013567ffffffffffffffff80821115612a0a57600080fd5b818701915087601f830112612a1e57600080fd5b813581811115612a3057612a3061299f565b604051601f8201601f19908116603f01168101908382118183101715612a5857612a5861299f565b816040528281528a6020848701011115612a7157600080fd5b82602086016020830137600060208483010152809550505050505092959194509250565b60008060408385031215612aa857600080fd5b82359150602083013561299481612793565b60008060408385031215612acd57600080fd5b8235612ad881612793565b9150602083013561299481612793565b6020808252825182820181905260009190848201906040850190845b8181101561295557835183529284019291840191600101612b04565b60008083601f840112612b3257600080fd5b50813567ffffffffffffffff811115612b4a57600080fd5b60208301915083602082850101111561289957600080fd5b60008060008060008060808789031215612b7b57600080fd5b863567ffffffffffffffff80821115612b9357600080fd5b612b9f8a838b01612b20565b90985096506020890135915080821115612bb857600080fd5b50612bc589828a01612b20565b909550935050604087013591506060870135612be081612793565b809150509295509295509295565b600181811c90821680612c0257607f821691505b602082108103612c2257634e487b7160e01b600052602260045260246000fd5b50919050565b602080825260149082015273416c726561647920707572636861736564203a2960601b604082015260600190565b60208082526010908201526f4e6f7420656e6f7567682066756e647360801b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215612ca857600080fd5b815161271081612793565b602080825260169082015275149bdd185d1bdbdc88191bd95cdb89dd08195e1a5cdd60521b604082015260600190565b6040808252810184905260008560608301825b87811015612d26578235612d0981612793565b6001600160a01b0316825260209283019290910190600101612cf6565b5083810360208501528481526001600160fb1b03851115612d4657600080fd5b8460051b915081866020830137016020019695505050505050565b6020808252601b908201527f4e6f20696e6372656173696e6720746865207072696365203e2e3c0000000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b808201808211156109a9576109a9612d98565b818103818111156109a9576109a9612d98565b80820281158282048414176109a9576109a9612d98565b6000808454612df981612bee565b60018281168015612e115760018114612e2657612e55565b60ff1984168752821515830287019450612e55565b8860005260208060002060005b85811015612e4c5781548a820152908401908201612e33565b50505082870194505b505050508351612e69818360208801612717565b01949350505050565b601f821115610d19576000816000526020600020601f850160051c81016020861015612e9b5750805b601f850160051c820191505b8181101561119357828155600101612ea7565b67ffffffffffffffff831115612ed257612ed261299f565b612ee683612ee08354612bee565b83612e72565b6000601f841160018114612f1a5760008515612f025750838201355b600019600387901b1c1916600186901b178355612f74565b600083815260209020601f19861690835b82811015612f4b5786850135825560209485019460019092019101612f2b565b5086821015612f685760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b634e487b7160e01b600052601260045260246000fd5b600082612fa057612fa0612f7b565b500490565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60006001820161300957613009612d98565b5060010190565b60008261301f5761301f612f7b565b500690565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130579083018461273b565b9695505050505050565b60006020828403121561307357600080fd5b8151612710816126dd56fea2646970667358221220d10f2505016223310c4aec69935f67cb852d8bf4ecc4228c18689e546d4f242c64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000b1a2bc2ec5000000000000000000000000000000000000000000000000000000b1a2bc2ec50000000000000000000000000000000000000000000000000000000000012a05f200000000000000000000000000000000000000000000000000000000000000138800000000000000000000000046e210371707d0292e5163906f18bc4447c06bad
-----Decoded View---------------
Arg [0] : basePrice (uint256): 50000000000000000
Arg [1] : stakeRequired (uint256): 50000000000000000
Arg [2] : rewardBase (uint256): 5000000000
Arg [3] : protocolFee (uint256): 5000
Arg [4] : royaltyReceiver (address): 0x46E210371707d0292E5163906F18BC4447C06BAd
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000b1a2bc2ec50000
Arg [1] : 00000000000000000000000000000000000000000000000000b1a2bc2ec50000
Arg [2] : 000000000000000000000000000000000000000000000000000000012a05f200
Arg [3] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [4] : 00000000000000000000000046e210371707d0292e5163906f18bc4447c06bad
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.