Contract Overview
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
Marketplace
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "./Token.sol"; import "./IERC2981.sol"; contract Marketplace is Ownable, ReentrancyGuard { struct Artwork { uint256 id; address artist; string name; string metadata; uint256 totalSupply; uint256 price; uint256 royalty; bool onsale; uint256[] tokenIds; } struct SellOffer { address seller; uint256 price; } using Counters for Counters.Counter; using SafeMath for uint256; event MadeSellOffer( uint256 indexed tokenId, address indexed seller, uint256 value ); event CancelledSellOffer(uint256 indexed tokenId, address indexed seller); event Sold( uint256 indexed tokenId, address seller, address indexed buyer, uint256 value ); event ArtworkCreated(uint256 artworkId, address indexed artist); event ArtworkMinted( uint256 artworkId, uint256 indexed tokenId, address indexed buyer ); bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; Token private token; address public tokenAddress = address(0); address private developer = address(0); uint256 public platformFee = 300; uint256 private MIN_PRICE = 1 ether; uint256 private MAX_PRICE = 10000 ether; Counters.Counter private _artworkIdCounter; mapping(uint256 => Artwork) private artworks; mapping(uint256 => SellOffer) private sellOffers; constructor() {} function setToken(address _tokenAddress) external onlyOwner { tokenAddress = _tokenAddress; token = Token(tokenAddress); } function setPlatformFee(uint256 fee) public onlyOwner { platformFee = fee; } function setDeveloper(address developerAddress) external onlyOwner { developer = developerAddress; } function getDeveloper() external view onlyOwner returns (address) { return developer; } function setPriceLimits(uint256 minPrice, uint256 maxPrice) external onlyOwner { MIN_PRICE = minPrice; MAX_PRICE = maxPrice; } function withdraw() external onlyOwner nonReentrant { uint256 royalty = address(this).balance; Address.sendValue(payable(developer), royalty); } function _getStrLen(string memory _str) private pure returns (uint256) { uint256 len = bytes(_str).length; return len; } function createArtwork( string memory name, string memory metadata, uint256 totalSupply, uint256 price, uint256 royalty, bool onsale ) external { require( totalSupply > 0 && totalSupply <= 10000, "The total supply must be between 1 and 10000" ); require(price >= MIN_PRICE && price <= MAX_PRICE, "invalid price"); require( royalty >= 0 && royalty <= 2500, "The royalty must be between 0% and 25%" ); require(_getStrLen(name) > 0 && _getStrLen(name) < 60); require(_getStrLen(metadata) > 0); require(msg.sender != address(0)); uint256 id = _artworkIdCounter.current(); uint256[] memory tokenIds = new uint256[](0); Artwork memory artwork = Artwork( id, msg.sender, name, metadata, totalSupply, price, royalty, onsale, tokenIds ); artworks[id] = artwork; _artworkIdCounter.increment(); emit ArtworkCreated(id, msg.sender); } function getArtworkCounts() public view returns (uint256) { return _artworkIdCounter.current(); } function setSaleStatus( uint256 id, uint256 price, uint256 royalty, bool onsale ) external hasArtwork(id) { require(price >= MIN_PRICE && price <= MAX_PRICE, "Invalid price"); require(royalty >= 0 && royalty <= 2500); Artwork memory artwork = artworks[id]; require(msg.sender == artwork.artist, "Invalid operation."); artwork.price = price; artwork.royalty = royalty; artwork.onsale = onsale; artworks[id] = artwork; } function getArtwork(uint256 id) external view hasArtwork(id) returns (Artwork memory artwork) { return artworks[id]; } function mintToken(uint256 id, string memory url) external payable canMint(id) nonReentrant { Artwork storage artwork = artworks[id]; uint256 price = artwork.price; uint256 platformCharge = price.mul(platformFee).div(10000); uint256 transferred = price.sub(platformCharge); require(msg.value >= artwork.price, "Invalid price given"); token.mint(id, artwork.artist, msg.sender, artwork.royalty, url); Address.sendValue(payable(artwork.artist), transferred); uint256 tokenId = token.getLatestTokenId(); artwork.tokenIds.push(tokenId); emit ArtworkMinted(id, tokenId, msg.sender); } function acceptOffer(uint256 tokenId) external payable hasSellOffer(tokenId) isMarketable(tokenId) nonReentrant { SellOffer memory offer = sellOffers[tokenId]; // If the artwork is sold or transffered on different platform. if (offer.seller != token.ownerOf(tokenId)) { delete (sellOffers[tokenId]); emit CancelledSellOffer(tokenId, offer.seller); revert("Invalid sell offer"); } require(msg.value >= offer.price, "Amount sent too low"); uint256 platformCharge = offer.price.mul(platformFee).div(10000); uint256 restAmount = offer.price.sub(platformCharge); uint256[] memory royalties = token.getFeeBps(tokenId); address payable[] memory recipents = token.getFeeRecipients(tokenId); for (uint256 i = 0; i < royalties.length; i++) { uint256 royalty = royalties[i]; address payable recipent = recipents[i]; uint256 amount = offer.price.mul(royalty).div(10000); if (amount > 0) { Address.sendValue(recipent, amount); restAmount = restAmount.sub(amount); } } if (restAmount > 0) { Address.sendValue(payable(offer.seller), restAmount); } token.safeTransferFrom(offer.seller, msg.sender, tokenId); delete (sellOffers[tokenId]); emit Sold(tokenId, offer.seller, msg.sender, msg.value); } function makeSellOffer(uint256 tokenId, uint256 price) external tokenOwnerOnly(tokenId) { if (price > 0) { require(price >= MIN_PRICE && price <= MAX_PRICE, "Invalid price"); sellOffers[tokenId] = SellOffer({seller: msg.sender, price: price}); token.approve(address(this), tokenId); } else { emit CancelledSellOffer(tokenId, msg.sender); delete sellOffers[tokenId]; } emit MadeSellOffer(tokenId, msg.sender, price); } function getSellOffer(uint256 tokenId) external view returns (uint256) { return sellOffers[tokenId].price; } modifier isMarketable(uint256 tokenId) { require(token.getApproved(tokenId) == address(this), "Not approved"); _; } modifier tokenOwnerOnly(uint256 tokenId) { require(token.ownerOf(tokenId) == msg.sender, "Not token owner"); _; } modifier hasSellOffer(uint256 tokenId) { SellOffer memory sellOffer = sellOffers[tokenId]; bool isAvailable = sellOffer.price != 0 && sellOffer.seller != address(0); require(isAvailable, "Invalid sell offer"); _; } modifier canMint(uint256 id) { Artwork memory artwork = artworks[id]; require(artwork.artist != address(0) && artwork.totalSupply > 0); require(artwork.onsale); require(artwork.tokenIds.length < artwork.totalSupply); _; } modifier hasArtwork(uint256 id) { Artwork memory artwork = artworks[id]; require(artwork.artist != address(0) && artwork.totalSupply > 0); _; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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 v4.4.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 Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./HasSecondarySaleFees.sol"; import "./ContextMixin.sol"; import "./IERC2981.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; contract Token is ERC721, Ownable, HasSecondarySaleFees, ContextMixin, ReentrancyGuard { using Counters for Counters.Counter; using SafeMath for uint256; event Minted(uint256 artworkId, uint256 tokenId, address minter); constructor() ERC721("polyblocks", "PB") HasSecondarySaleFees(new address payable[](0), new uint256[](0)) {} /** * This is used instead of msg.sender as transactions won't be sent by the original token owner, but by OpenSea. **/ function _msgSender() internal view override returns (address sender) { return ContextMixin.msgSender(); } Counters.Counter private _tokenIdCounter; mapping(uint256 => string) private idToURLs; address private developer = address(0); address private marketplace = address(0); function mint( uint256 artworkId, address artist, address collector, uint256 royalty, string memory url ) external senderIsMarketplace { uint256 id = _tokenIdCounter.current(); idToURLs[id] = url; _safeMint(artist, id); if (artist != collector) { safeTransferFrom(artist, collector, id); } address payable[] memory royaltyAddresses = new address payable[](1); royaltyAddresses[0] = payable(artist); uint256[] memory royaltiesWithTwoDecimals = new uint256[](1); royaltiesWithTwoDecimals[0] = royalty; _setRoyaltiesOf(id, royaltyAddresses, royaltiesWithTwoDecimals); _tokenIdCounter.increment(); emit Minted(artworkId, id, collector); } function getLatestTokenId() external view senderIsMarketplace returns (uint256) { return _tokenIdCounter.current().sub(1); } function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) { require( _exists(tokenId), "ERC721Metadata: URI query for nonexistent token" ); return idToURLs[tokenId]; } function setTokenURIs(uint256[] memory ids, string[] memory uris) external onlyOwner { for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; idToURLs[id] = uris[i]; } } function setMarket(address contractAddress) external onlyOwner { marketplace = contractAddress; } function setDeveloper(address developerAddress) external onlyOwner { developer = developerAddress; } function withdraw() external onlyOwner nonReentrant { Address.sendValue(payable(developer), address(this).balance); } // The following functions are overrides required by Solidity. function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721) { super._beforeTokenTransfer(from, to, tokenId); } /** * Override isApprovedForAll to auto-approve OS's proxy contract */ function isApprovedForAll(address _owner, address _operator) public view override returns (bool isOperator) { // if OpenSea's ERC721 Proxy Address is detected, auto-return true if (_operator == address(0x58807baD0B376efc12F5AD86aAc70E78ed67deaE)) { return true; } // otherwise, use the default ERC721.isApprovedForAll() return ERC721.isApprovedForAll(_owner, _operator); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, HasSecondarySaleFees) returns (bool) { return interfaceId == type(IERC2981).interfaceId || ERC721.supportsInterface(interfaceId) || HasSecondarySaleFees.supportsInterface(interfaceId); } modifier senderIsMarketplace() { require( msg.sender == marketplace, "Needs to be called from our marketplace" ); _; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /// /// @dev Interface for the NFT Royalty Standard /// interface IERC2981 is IERC165 { /// ERC165 bytes to add to interface array - set in parent contract /// implementing this standard /// /// bytes4(keccak256("royaltyInfo(uint256,uint256)")) == 0x2a55205a /// bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a; /// _registerInterface(_INTERFACE_ID_ERC2981); /// @notice Called with the sale price to determine how much royalty // is owed and to whom. /// @param _tokenId - the NFT asset queried for royalty information /// @param _salePrice - the sale price of the NFT asset specified by _tokenId /// @return receiver - address of who should be sent the royalty payment /// @return royaltyAmount - the royalty payment amount for _salePrice function royaltyInfo( uint256 _tokenId, uint256 _salePrice ) external view returns ( address receiver, uint256 royaltyAmount ); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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 // this is copied from chocomintapp/chocofactory // https://github.com/chocomintapp/chocofactory/blob/main/packages/contracts/contracts/extentions/HasSecondarySaleFees.sol pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; interface IHasSecondarySaleFees { function getFeeBps(uint256 id) external view returns (uint256[] memory); function getFeeRecipients(uint256 id) external view returns (address payable[] memory); } contract HasSecondarySaleFees is IERC165, IHasSecondarySaleFees { event ChangeCommonRoyalty( address payable[] royaltyAddresses, uint256[] royaltiesWithTwoDecimals ); event ChangeRoyalty( uint256 id, address payable[] royaltyAddresses, uint256[] royaltiesWithTwoDecimals ); struct RoyaltyInfo { bool isPresent; address payable[] royaltyAddresses; uint256[] royaltiesWithTwoDecimals; } mapping(bytes32 => RoyaltyInfo) royaltyInfoMap; mapping(uint256 => bytes32) tokenRoyaltyMap; address payable[] public commonRoyaltyAddresses; uint256[] public commonRoyaltiesWithTwoDecimals; constructor( address payable[] memory _commonRoyaltyAddresses, uint256[] memory _commonRoyaltiesWithTwoDecimals ) { _setCommonRoyalties(_commonRoyaltyAddresses, _commonRoyaltiesWithTwoDecimals); } function _setRoyaltiesOf( uint256 _tokenId, address payable[] memory _royaltyAddresses, uint256[] memory _royaltiesWithTwoDecimals ) internal { require(_royaltyAddresses.length == _royaltiesWithTwoDecimals.length, "input length must be same"); bytes32 key = 0x0; for (uint256 i = 0; i < _royaltyAddresses.length; i++) { require(_royaltyAddresses[i] != address(0), "Must not be zero-address"); key = keccak256(abi.encodePacked(key, _royaltyAddresses[i], _royaltiesWithTwoDecimals[i])); } tokenRoyaltyMap[_tokenId] = key; emit ChangeRoyalty(_tokenId, _royaltyAddresses, _royaltiesWithTwoDecimals); if (royaltyInfoMap[key].isPresent) { return; } royaltyInfoMap[key] = RoyaltyInfo( true, _royaltyAddresses, _royaltiesWithTwoDecimals ); } function _setCommonRoyalties( address payable[] memory _commonRoyaltyAddresses, uint256[] memory _commonRoyaltiesWithTwoDecimals ) internal { require(_commonRoyaltyAddresses.length == _commonRoyaltiesWithTwoDecimals.length, "input length must be same"); for (uint256 i = 0; i < _commonRoyaltyAddresses.length; i++) { require(_commonRoyaltyAddresses[i] != address(0), "Must not be zero-address"); } commonRoyaltyAddresses = _commonRoyaltyAddresses; commonRoyaltiesWithTwoDecimals = _commonRoyaltiesWithTwoDecimals; emit ChangeCommonRoyalty(_commonRoyaltyAddresses, _commonRoyaltiesWithTwoDecimals); } function getFeeRecipients(uint256 _tokenId) public view override returns (address payable[] memory) { RoyaltyInfo memory royaltyInfo = royaltyInfoMap[tokenRoyaltyMap[_tokenId]]; if (!royaltyInfo.isPresent) { return commonRoyaltyAddresses; } uint256 length = commonRoyaltyAddresses.length + royaltyInfo.royaltyAddresses.length; address payable[] memory recipients = new address payable[](length); for (uint256 i = 0; i < commonRoyaltyAddresses.length; i++) { recipients[i] = commonRoyaltyAddresses[i]; } for (uint256 i = 0; i < royaltyInfo.royaltyAddresses.length; i++) { recipients[i + commonRoyaltyAddresses.length] = royaltyInfo.royaltyAddresses[i]; } return recipients; } function getFeeBps(uint256 _tokenId) public view override returns (uint256[] memory) { RoyaltyInfo memory royaltyInfo = royaltyInfoMap[tokenRoyaltyMap[_tokenId]]; if (!royaltyInfo.isPresent) { return commonRoyaltiesWithTwoDecimals; } uint256 length = commonRoyaltiesWithTwoDecimals.length + royaltyInfo.royaltiesWithTwoDecimals.length; uint256[] memory fees = new uint256[](length); for (uint256 i = 0; i < commonRoyaltiesWithTwoDecimals.length; i++) { fees[i] = commonRoyaltiesWithTwoDecimals[i]; } for (uint256 i = 0; i < royaltyInfo.royaltiesWithTwoDecimals.length; i++) { fees[i + commonRoyaltyAddresses.length] = royaltyInfo.royaltiesWithTwoDecimals[i]; } return fees; } function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165) returns (bool) { return interfaceId == type(IHasSecondarySaleFees).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * https://github.com/maticnetwork/pos-portal/blob/master/contracts/common/ContextMixin.sol * https://docs.opensea.io/docs/polygon-basic-integration */ abstract contract ContextMixin { function msgSender() internal view returns (address payable sender) { if (msg.sender == address(this)) { bytes memory array = msg.data; uint256 index = msg.data.length; assembly { // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those. sender := and( mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff ) } } else { sender = payable(msg.sender); } return sender; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.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: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _owners[tokenId] != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint( address to, uint256 tokenId, bytes memory _data ) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.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 substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (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.0 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.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`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.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 `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.0 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"artworkId","type":"uint256"},{"indexed":true,"internalType":"address","name":"artist","type":"address"}],"name":"ArtworkCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"artworkId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"}],"name":"ArtworkMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"}],"name":"CancelledSellOffer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"seller","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"MadeSellOffer","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":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"seller","type":"address"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Sold","type":"event"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"acceptOffer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"metadata","type":"string"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"royalty","type":"uint256"},{"internalType":"bool","name":"onsale","type":"bool"}],"name":"createArtwork","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getArtwork","outputs":[{"components":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"artist","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"metadata","type":"string"},{"internalType":"uint256","name":"totalSupply","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"royalty","type":"uint256"},{"internalType":"bool","name":"onsale","type":"bool"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"internalType":"struct Marketplace.Artwork","name":"artwork","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getArtworkCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDeveloper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSellOffer","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"makeSellOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"string","name":"url","type":"string"}],"name":"mintToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"developerAddress","type":"address"}],"name":"setDeveloper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minPrice","type":"uint256"},{"internalType":"uint256","name":"maxPrice","type":"uint256"}],"name":"setPriceLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"},{"internalType":"uint256","name":"royalty","type":"uint256"},{"internalType":"bool","name":"onsale","type":"bool"}],"name":"setSaleStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040526000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061012c600555670de0b6b3a764000060065569021e19e0c9bab2400000600755348015620000b557600080fd5b50620000d6620000ca620000e360201b60201c565b620000eb60201b60201c565b60018081905550620001af565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61436580620001bf6000396000f3fe6080604052600436106101145760003560e01c80637a444072116100a0578063c728c75e11610064578063c728c75e14610344578063c815729d1461036d578063c9fa5d2d14610389578063f2fde38b146103c6578063ff70fa49146103ef57610114565b80637a444072146102715780638ccfb3d51461029c5780638da5cb5b146102c55780639d76ea58146102f05780639da8081b1461031b57610114565b8063370faeb0116100e7578063370faeb0146101d35780633ccfd60b146101fc5780636ecc297f14610213578063715018a61461023e578063752312a91461025557610114565b806312e8e2c314610119578063144fa6d714610142578063167ddf6e1461016b57806326232a2e146101a8575b600080fd5b34801561012557600080fd5b50610140600480360381019061013b919061335c565b610418565b005b34801561014e57600080fd5b50610169600480360381019061016491906131cf565b61049e565b005b34801561017757600080fd5b50610192600480360381019061018d919061335c565b6105c1565b60405161019f9190613b47565b60405180910390f35b3480156101b457600080fd5b506101bd610a8d565b6040516101ca9190613b69565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190613402565b610a93565b005b34801561020857600080fd5b50610211610b21565b005b34801561021f57600080fd5b50610228610c26565b6040516102359190613b69565b60405180910390f35b34801561024a57600080fd5b50610253610c37565b005b61026f600480360381019061026a91906133ae565b610cbf565b005b34801561027d57600080fd5b5061028661127e565b60405161029391906138ec565b60405180910390f35b3480156102a857600080fd5b506102c360048036038101906102be91906132a3565b611324565b005b3480156102d157600080fd5b506102da6116d0565b6040516102e791906138ec565b60405180910390f35b3480156102fc57600080fd5b506103056116f9565b60405161031291906138ec565b60405180910390f35b34801561032757600080fd5b50610342600480360381019061033d919061343e565b61171f565b005b34801561035057600080fd5b5061036b60048036038101906103669190613402565b611dea565b005b6103876004803603810190610382919061335c565b612163565b005b34801561039557600080fd5b506103b060048036038101906103ab919061335c565b612a5b565b6040516103bd9190613b69565b60405180910390f35b3480156103d257600080fd5b506103ed60048036038101906103e891906131cf565b612a7b565b005b3480156103fb57600080fd5b50610416600480360381019061041191906131cf565b612b73565b005b610420612c33565b73ffffffffffffffffffffffffffffffffffffffff1661043e6116d0565b73ffffffffffffffffffffffffffffffffffffffff1614610494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048b90613aa7565b60405180910390fd5b8060058190555050565b6104a6612c33565b73ffffffffffffffffffffffffffffffffffffffff166104c46116d0565b73ffffffffffffffffffffffffffffffffffffffff161461051a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051190613aa7565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6105c9612e69565b8160006009600083815260200190815260200160002060405180610120016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201805461065b90613e58565b80601f016020809104026020016040519081016040528092919081815260200182805461068790613e58565b80156106d45780601f106106a9576101008083540402835291602001916106d4565b820191906000526020600020905b8154815290600101906020018083116106b757829003601f168201915b505050505081526020016003820180546106ed90613e58565b80601f016020809104026020016040519081016040528092919081815260200182805461071990613e58565b80156107665780601f1061073b57610100808354040283529160200191610766565b820191906000526020600020905b81548152906001019060200180831161074957829003601f168201915b505050505081526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff16151515158152602001600882018054806020026020016040519081016040528092919081815260200182805480156107f757602002820191906000526020600020905b8154815260200190600101908083116107e3575b5050505050815250509050600073ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1614158015610847575060008160800151115b61085057600080fd5b6009600085815260200190815260200160002060405180610120016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820180546108df90613e58565b80601f016020809104026020016040519081016040528092919081815260200182805461090b90613e58565b80156109585780601f1061092d57610100808354040283529160200191610958565b820191906000526020600020905b81548152906001019060200180831161093b57829003601f168201915b5050505050815260200160038201805461097190613e58565b80601f016020809104026020016040519081016040528092919081815260200182805461099d90613e58565b80156109ea5780601f106109bf576101008083540402835291602001916109ea565b820191906000526020600020905b8154815290600101906020018083116109cd57829003601f168201915b505050505081526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815260200160088201805480602002602001604051908101604052809291908181526020018280548015610a7b57602002820191906000526020600020905b815481526020019060010190808311610a67575b50505050508152505092505050919050565b60055481565b610a9b612c33565b73ffffffffffffffffffffffffffffffffffffffff16610ab96116d0565b73ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0690613aa7565b60405180910390fd5b81600681905550806007819055505050565b610b29612c33565b73ffffffffffffffffffffffffffffffffffffffff16610b476116d0565b73ffffffffffffffffffffffffffffffffffffffff1614610b9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9490613aa7565b60405180910390fd5b60026001541415610be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bda90613b27565b60405180910390fd5b60026001819055506000479050610c1c600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682612c3b565b5060018081905550565b6000610c326008612d2f565b905090565b610c3f612c33565b73ffffffffffffffffffffffffffffffffffffffff16610c5d6116d0565b73ffffffffffffffffffffffffffffffffffffffff1614610cb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caa90613aa7565b60405180910390fd5b610cbd6000612d3d565b565b8160006009600083815260200190815260200160002060405180610120016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282018054610d5190613e58565b80601f0160208091040260200160405190810160405280929190818152602001828054610d7d90613e58565b8015610dca5780601f10610d9f57610100808354040283529160200191610dca565b820191906000526020600020905b815481529060010190602001808311610dad57829003601f168201915b50505050508152602001600382018054610de390613e58565b80601f0160208091040260200160405190810160405280929190818152602001828054610e0f90613e58565b8015610e5c5780601f10610e3157610100808354040283529160200191610e5c565b820191906000526020600020905b815481529060010190602001808311610e3f57829003601f168201915b505050505081526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815260200160088201805480602002602001604051908101604052809291908181526020018280548015610eed57602002820191906000526020600020905b815481526020019060010190808311610ed9575b5050505050815250509050600073ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1614158015610f3d575060008160800151115b610f4657600080fd5b8060e00151610f5457600080fd5b80608001518161010001515110610f6a57600080fd5b60026001541415610fb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa790613b27565b60405180910390fd5b600260018190555060006009600086815260200190815260200160002090506000816005015490506000611003612710610ff560055485612e0190919063ffffffff16565b612e1790919063ffffffff16565b9050600061101a8284612e2d90919063ffffffff16565b90508360050154341015611063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105a90613967565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ea65ee05898660010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff163388600601548c6040518663ffffffff1660e01b81526004016110ee959493929190613b84565b600060405180830381600087803b15801561110857600080fd5b505af115801561111c573d6000803e3d6000fd5b5050505061114e8460010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682612c3b565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166325d112a96040518163ffffffff1660e01b815260040160206040518083038186803b1580156111b857600080fd5b505afa1580156111cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f09190613385565b9050846008018190806001815401808255809150506001900390600052602060002001600090919091909150553373ffffffffffffffffffffffffffffffffffffffff16817f0c66714ac82c6b49d1baf73a23208093f244fc265e1ce7e1412598a9ff1da1648b6040516112649190613b69565b60405180910390a350505050506001808190555050505050565b6000611288612c33565b73ffffffffffffffffffffffffffffffffffffffff166112a66116d0565b73ffffffffffffffffffffffffffffffffffffffff16146112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390613aa7565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008411801561133657506127108411155b611375576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136c90613a27565b60405180910390fd5b600654831015801561138957506007548311155b6113c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113bf906139e7565b60405180910390fd5b600082101580156113db57506109c48211155b61141a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141190613ac7565b60405180910390fd5b600061142587612e43565b11801561143a5750603c61143887612e43565b105b61144357600080fd5b600061144e86612e43565b1161145857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561149257600080fd5b600061149e6008612d2f565b905060008067ffffffffffffffff8111156114e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156115105781602001602082028036833780820191505090505b50905060006040518061012001604052808481526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018a8152602001898152602001888152602001878152602001868152602001851515815260200183815250905080600960008581526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020190805190602001906115f0929190612ecd565b50606082015181600301908051906020019061160d929190612ecd565b506080820151816004015560a0820151816005015560c0820151816006015560e08201518160070160006101000a81548160ff021916908315150217905550610100820151816008019080519060200190611669929190612f53565b509050506116776008612e53565b3373ffffffffffffffffffffffffffffffffffffffff167f5ff4663d5496965b8dd6f9073898984de68e01ea2508cf1f66ef86c755feeb83846040516116bd9190613b69565b60405180910390a2505050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b8360006009600083815260200190815260200160002060405180610120016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820180546117b190613e58565b80601f01602080910402602001604051908101604052809291908181526020018280546117dd90613e58565b801561182a5780601f106117ff5761010080835404028352916020019161182a565b820191906000526020600020905b81548152906001019060200180831161180d57829003601f168201915b5050505050815260200160038201805461184390613e58565b80601f016020809104026020016040519081016040528092919081815260200182805461186f90613e58565b80156118bc5780601f10611891576101008083540402835291602001916118bc565b820191906000526020600020905b81548152906001019060200180831161189f57829003601f168201915b505050505081526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff161515151581526020016008820180548060200260200160405190810160405280929190818152602001828054801561194d57602002820191906000526020600020905b815481526020019060010190808311611939575b5050505050815250509050600073ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff161415801561199d575060008160800151115b6119a657600080fd5b60065485101580156119ba57506007548511155b6119f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f090613b07565b60405180910390fd5b60008410158015611a0c57506109c48411155b611a1557600080fd5b60006009600088815260200190815260200160002060405180610120016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600282018054611aa690613e58565b80601f0160208091040260200160405190810160405280929190818152602001828054611ad290613e58565b8015611b1f5780601f10611af457610100808354040283529160200191611b1f565b820191906000526020600020905b815481529060010190602001808311611b0257829003601f168201915b50505050508152602001600382018054611b3890613e58565b80601f0160208091040260200160405190810160405280929190818152602001828054611b6490613e58565b8015611bb15780601f10611b8657610100808354040283529160200191611bb1565b820191906000526020600020905b815481529060010190602001808311611b9457829003601f168201915b505050505081526020016004820154815260200160058201548152602001600682015481526020016007820160009054906101000a900460ff1615151515815260200160088201805480602002602001604051908101604052809291908181526020018280548015611c4257602002820191906000526020600020905b815481526020019060010190808311611c2e575b5050505050815250509050806020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb690613a47565b60405180910390fd5b858160a0018181525050848160c0018181525050838160e001901515908115158152505080600960008981526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002019080519060200190611d64929190612ecd565b506060820151816003019080519060200190611d81929190612ecd565b506080820151816004015560a0820151816005015560c0820151816006015560e08201518160070160006101000a81548160ff021916908315150217905550610100820151816008019080519060200190611ddd929190612f53565b5090505050505050505050565b813373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e836040518263ffffffff1660e01b8152600401611e5d9190613b69565b60206040518083038186803b158015611e7557600080fd5b505afa158015611e89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ead91906131f8565b73ffffffffffffffffffffffffffffffffffffffff1614611f03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efa90613ae7565b60405180910390fd5b6000821115612085576006548210158015611f2057506007548211155b611f5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5690613b07565b60405180910390fd5b60405180604001604052803373ffffffffffffffffffffffffffffffffffffffff16815260200183815250600a600085815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155905050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b330856040518363ffffffff1660e01b815260040161204e92919061393e565b600060405180830381600087803b15801561206857600080fd5b505af115801561207c573d6000803e3d6000fd5b5050505061210f565b3373ffffffffffffffffffffffffffffffffffffffff16837f4f67a52ae91ae05dad414ad8320a559180b527abaed5330867ea8b343733639d60405160405180910390a3600a6000848152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550505b3373ffffffffffffffffffffffffffffffffffffffff16837faeb106cb69d7fe11d37cfe48c9216dc0233d59acf1304b5f8a4366f8f2f08787846040516121569190613b69565b60405180910390a3505050565b806000600a60008381526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481525050905060008082602001511415801561222d5750600073ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff1614155b90508061226f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226690613a87565b60405180910390fd5b833073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663081812fc836040518263ffffffff1660e01b81526004016122e29190613b69565b60206040518083038186803b1580156122fa57600080fd5b505afa15801561230e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061233291906131f8565b73ffffffffffffffffffffffffffffffffffffffff1614612388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161237f90613a07565b60405180910390fd5b600260015414156123ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123c590613b27565b60405180910390fd5b60026001819055506000600a60008781526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e876040518263ffffffff1660e01b81526004016124b39190613b69565b60206040518083038186803b1580156124cb57600080fd5b505afa1580156124df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250391906131f8565b73ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff161461260157600a6000878152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600090555050806000015173ffffffffffffffffffffffffffffffffffffffff16867f4f67a52ae91ae05dad414ad8320a559180b527abaed5330867ea8b343733639d60405160405180910390a36040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f890613a87565b60405180910390fd5b8060200151341015612648576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161263f90613a67565b60405180910390fd5b60006126776127106126696005548560200151612e0190919063ffffffff16565b612e1790919063ffffffff16565b90506000612692828460200151612e2d90919063ffffffff16565b90506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630ebd4c7f8a6040518263ffffffff1660e01b81526004016126f19190613b69565b60006040518083038186803b15801561270957600080fd5b505afa15801561271d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906127469190613262565b90506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b9c4d9fb8b6040518263ffffffff1660e01b81526004016127a59190613b69565b60006040518083038186803b1580156127bd57600080fd5b505afa1580156127d1573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906127fa9190613221565b905060005b8251811015612900576000838281518110612843577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015190506000838381518110612888577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905060006128bf6127106128b1858c60200151612e0190919063ffffffff16565b612e1790919063ffffffff16565b905060008111156128ea576128d48282612c3b565b6128e78188612e2d90919063ffffffff16565b96505b50505080806128f890613ebb565b9150506127ff565b50600083111561291957612918856000015184612c3b565b5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342842e0e8660000151338d6040518463ffffffff1660e01b815260040161297c93929190613907565b600060405180830381600087803b15801561299657600080fd5b505af11580156129aa573d6000803e3d6000fd5b50505050600a60008b8152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600182016000905550503373ffffffffffffffffffffffffffffffffffffffff168a7f23f50d55776d8003622a982ade45a6c7f083116c8dbbcd980f59942f440badb1876000015134604051612a4092919061393e565b60405180910390a35050505050600180819055505050505050565b6000600a6000838152602001908152602001600020600101549050919050565b612a83612c33565b73ffffffffffffffffffffffffffffffffffffffff16612aa16116d0565b73ffffffffffffffffffffffffffffffffffffffff1614612af7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aee90613aa7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b5e90613987565b60405180910390fd5b612b7081612d3d565b50565b612b7b612c33565b73ffffffffffffffffffffffffffffffffffffffff16612b996116d0565b73ffffffffffffffffffffffffffffffffffffffff1614612bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612be690613aa7565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b80471015612c7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c75906139c7565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1682604051612ca4906138d7565b60006040518083038185875af1925050503d8060008114612ce1576040519150601f19603f3d011682016040523d82523d6000602084013e612ce6565b606091505b5050905080612d2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d21906139a7565b60405180910390fd5b505050565b600081600001549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008183612e0f9190613d2e565b905092915050565b60008183612e259190613cfd565b905092915050565b60008183612e3b9190613d88565b905092915050565b6000808251905080915050919050565b6001816000016000828254019250508190555050565b60405180610120016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001600081526020016000815260200160008152602001600015158152602001606081525090565b828054612ed990613e58565b90600052602060002090601f016020900481019282612efb5760008555612f42565b82601f10612f1457805160ff1916838001178555612f42565b82800160010185558215612f42579182015b82811115612f41578251825591602001919060010190612f26565b5b509050612f4f9190612fa0565b5090565b828054828255906000526020600020908101928215612f8f579160200282015b82811115612f8e578251825591602001919060010190612f73565b5b509050612f9c9190612fa0565b5090565b5b80821115612fb9576000816000905550600101612fa1565b5090565b6000612fd0612fcb84613c03565b613bde565b90508083825260208201905082856020860282011115612fef57600080fd5b60005b8581101561301f578161300588826130fd565b845260208401935060208301925050600181019050612ff2565b5050509392505050565b600061303c61303784613c2f565b613bde565b9050808382526020820190508285602086028201111561305b57600080fd5b60005b8581101561308b578161307188826131ba565b84526020840193506020830192505060018101905061305e565b5050509392505050565b60006130a86130a384613c5b565b613bde565b9050828152602081018484840111156130c057600080fd5b6130cb848285613e16565b509392505050565b6000813590506130e2816142d3565b92915050565b6000815190506130f7816142d3565b92915050565b60008151905061310c816142ea565b92915050565b600082601f83011261312357600080fd5b8151613133848260208601612fbd565b91505092915050565b600082601f83011261314d57600080fd5b815161315d848260208601613029565b91505092915050565b60008135905061317581614301565b92915050565b600082601f83011261318c57600080fd5b813561319c848260208601613095565b91505092915050565b6000813590506131b481614318565b92915050565b6000815190506131c981614318565b92915050565b6000602082840312156131e157600080fd5b60006131ef848285016130d3565b91505092915050565b60006020828403121561320a57600080fd5b6000613218848285016130e8565b91505092915050565b60006020828403121561323357600080fd5b600082015167ffffffffffffffff81111561324d57600080fd5b61325984828501613112565b91505092915050565b60006020828403121561327457600080fd5b600082015167ffffffffffffffff81111561328e57600080fd5b61329a8482850161313c565b91505092915050565b60008060008060008060c087890312156132bc57600080fd5b600087013567ffffffffffffffff8111156132d657600080fd5b6132e289828a0161317b565b965050602087013567ffffffffffffffff8111156132ff57600080fd5b61330b89828a0161317b565b955050604061331c89828a016131a5565b945050606061332d89828a016131a5565b935050608061333e89828a016131a5565b92505060a061334f89828a01613166565b9150509295509295509295565b60006020828403121561336e57600080fd5b600061337c848285016131a5565b91505092915050565b60006020828403121561339757600080fd5b60006133a5848285016131ba565b91505092915050565b600080604083850312156133c157600080fd5b60006133cf858286016131a5565b925050602083013567ffffffffffffffff8111156133ec57600080fd5b6133f88582860161317b565b9150509250929050565b6000806040838503121561341557600080fd5b6000613423858286016131a5565b9250506020613434858286016131a5565b9150509250929050565b6000806000806080858703121561345457600080fd5b6000613462878288016131a5565b9450506020613473878288016131a5565b9350506040613484878288016131a5565b925050606061349587828801613166565b91505092959194509250565b60006134ad83836138b9565b60208301905092915050565b6134c281613dbc565b82525050565b6134d181613dbc565b82525050565b60006134e282613c9c565b6134ec8185613cbf565b93506134f783613c8c565b8060005b8381101561352857815161350f88826134a1565b975061351a83613cb2565b9250506001810190506134fb565b5085935050505092915050565b61353e81613de0565b82525050565b600061354f82613ca7565b6135598185613cdb565b9350613569818560208601613e25565b61357281613fc0565b840191505092915050565b600061358882613ca7565b6135928185613cec565b93506135a2818560208601613e25565b6135ab81613fc0565b840191505092915050565b60006135c3601383613cec565b91506135ce82613fd1565b602082019050919050565b60006135e6602683613cec565b91506135f182613ffa565b604082019050919050565b6000613609603a83613cec565b915061361482614049565b604082019050919050565b600061362c601d83613cec565b915061363782614098565b602082019050919050565b600061364f600d83613cec565b915061365a826140c1565b602082019050919050565b6000613672600c83613cec565b915061367d826140ea565b602082019050919050565b6000613695602c83613cec565b91506136a082614113565b604082019050919050565b60006136b8601283613cec565b91506136c382614162565b602082019050919050565b60006136db601383613cec565b91506136e68261418b565b602082019050919050565b60006136fe601283613cec565b9150613709826141b4565b602082019050919050565b6000613721602083613cec565b915061372c826141dd565b602082019050919050565b6000613744600083613cd0565b915061374f82614206565b600082019050919050565b6000613767602683613cec565b915061377282614209565b604082019050919050565b600061378a600f83613cec565b915061379582614258565b602082019050919050565b60006137ad600d83613cec565b91506137b882614281565b602082019050919050565b60006137d0601f83613cec565b91506137db826142aa565b602082019050919050565b6000610120830160008301516137ff60008601826138b9565b50602083015161381260208601826134b9565b506040830151848203604086015261382a8282613544565b915050606083015184820360608601526138448282613544565b915050608083015161385960808601826138b9565b5060a083015161386c60a08601826138b9565b5060c083015161387f60c08601826138b9565b5060e083015161389260e0860182613535565b506101008301518482036101008601526138ac82826134d7565b9150508091505092915050565b6138c281613e0c565b82525050565b6138d181613e0c565b82525050565b60006138e282613737565b9150819050919050565b600060208201905061390160008301846134c8565b92915050565b600060608201905061391c60008301866134c8565b61392960208301856134c8565b61393660408301846138c8565b949350505050565b600060408201905061395360008301856134c8565b61396060208301846138c8565b9392505050565b60006020820190508181036000830152613980816135b6565b9050919050565b600060208201905081810360008301526139a0816135d9565b9050919050565b600060208201905081810360008301526139c0816135fc565b9050919050565b600060208201905081810360008301526139e08161361f565b9050919050565b60006020820190508181036000830152613a0081613642565b9050919050565b60006020820190508181036000830152613a2081613665565b9050919050565b60006020820190508181036000830152613a4081613688565b9050919050565b60006020820190508181036000830152613a60816136ab565b9050919050565b60006020820190508181036000830152613a80816136ce565b9050919050565b60006020820190508181036000830152613aa0816136f1565b9050919050565b60006020820190508181036000830152613ac081613714565b9050919050565b60006020820190508181036000830152613ae08161375a565b9050919050565b60006020820190508181036000830152613b008161377d565b9050919050565b60006020820190508181036000830152613b20816137a0565b9050919050565b60006020820190508181036000830152613b40816137c3565b9050919050565b60006020820190508181036000830152613b6181846137e6565b905092915050565b6000602082019050613b7e60008301846138c8565b92915050565b600060a082019050613b9960008301886138c8565b613ba660208301876134c8565b613bb360408301866134c8565b613bc060608301856138c8565b8181036080830152613bd2818461357d565b90509695505050505050565b6000613be8613bf9565b9050613bf48282613e8a565b919050565b6000604051905090565b600067ffffffffffffffff821115613c1e57613c1d613f91565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613c4a57613c49613f91565b5b602082029050602081019050919050565b600067ffffffffffffffff821115613c7657613c75613f91565b5b613c7f82613fc0565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613d0882613e0c565b9150613d1383613e0c565b925082613d2357613d22613f33565b5b828204905092915050565b6000613d3982613e0c565b9150613d4483613e0c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613d7d57613d7c613f04565b5b828202905092915050565b6000613d9382613e0c565b9150613d9e83613e0c565b925082821015613db157613db0613f04565b5b828203905092915050565b6000613dc782613dec565b9050919050565b6000613dd982613dec565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b83811015613e43578082015181840152602081019050613e28565b83811115613e52576000848401525b50505050565b60006002820490506001821680613e7057607f821691505b60208210811415613e8457613e83613f62565b5b50919050565b613e9382613fc0565b810181811067ffffffffffffffff82111715613eb257613eb1613f91565b5b80604052505050565b6000613ec682613e0c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613ef957613ef8613f04565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f496e76616c696420707269636520676976656e00000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260008201527f6563697069656e74206d61792068617665207265766572746564000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e6365000000600082015250565b7f696e76616c696420707269636500000000000000000000000000000000000000600082015250565b7f4e6f7420617070726f7665640000000000000000000000000000000000000000600082015250565b7f54686520746f74616c20737570706c79206d757374206265206265747765656e60008201527f203120616e642031303030300000000000000000000000000000000000000000602082015250565b7f496e76616c6964206f7065726174696f6e2e0000000000000000000000000000600082015250565b7f416d6f756e742073656e7420746f6f206c6f7700000000000000000000000000600082015250565b7f496e76616c69642073656c6c206f666665720000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b50565b7f54686520726f79616c7479206d757374206265206265747765656e203025206160008201527f6e64203235250000000000000000000000000000000000000000000000000000602082015250565b7f4e6f7420746f6b656e206f776e65720000000000000000000000000000000000600082015250565b7f496e76616c696420707269636500000000000000000000000000000000000000600082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b6142dc81613dbc565b81146142e757600080fd5b50565b6142f381613dce565b81146142fe57600080fd5b50565b61430a81613de0565b811461431557600080fd5b50565b61432181613e0c565b811461432c57600080fd5b5056fea26469706673582212208830a9da874e1268879f3b8cd28f94ccf74d1f63af9704198b184952b40c513b64736f6c63430008040033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.