Contract 0x827750C857EB63B4143BE8A141d22700904D0396

 
 
Txn Hash
Method
Block
From
To
Value
0x4eca8b5e9424674bac12a58c0b40aab26e6861d15846ab4a95146939352853e0Update Multiple ...131651382021-09-05 10:20:09460 days 1 hr agoENS Name trayvox.eth IN  0x827750c857eb63b4143be8a141d22700904d03960.01 Ether0.00425472 70.99379808
0xb34e0946ac128e06ace76267ec6972b14b289dff2ae29f2858bd855407995010Transfer131651182021-09-05 10:15:28460 days 1 hr agoENS Name trayvox.eth IN  0x827750c857eb63b4143be8a141d22700904d03960.1 Ether0.01213956 76.0048152
0xf1f0416a2c3503836bd222550d894a64671a8ccf8c0f0d432fcb0b1b13f979c4Transfer131650252021-09-05 9:53:08460 days 2 hrs agoENS Name trayvox.eth IN  0x827750c857eb63b4143be8a141d22700904d03960.1 Ether0.01593401 72.78433003
0x6c26191eb5078ab600e08598dd526e6115408f6f36c384003d136cb5ea59f1120x60a06040131650192021-09-05 9:52:07460 days 2 hrs ago0x000000007579a47b71037ab18b0cf7b63ad36928 IN  Create: CryptoPiggies0 Ether0.17979526 65.45516633
[ Download CSV Export 
Latest 3 internal transactions
Parent Txn Hash Block From To Value
0x4eca8b5e9424674bac12a58c0b40aab26e6861d15846ab4a95146939352853e0131651382021-09-05 10:20:09460 days 1 hr ago 0x827750c857eb63b4143be8a141d22700904d03960x374221d148c6e6d9ea381c1257dce567830db9450.005 Ether
0xb34e0946ac128e06ace76267ec6972b14b289dff2ae29f2858bd855407995010131651182021-09-05 10:15:28460 days 1 hr ago 0x827750c857eb63b4143be8a141d22700904d03960x374221d148c6e6d9ea381c1257dce567830db9450.05 Ether
0xf1f0416a2c3503836bd222550d894a64671a8ccf8c0f0d432fcb0b1b13f979c4131650252021-09-05 9:53:08460 days 2 hrs ago 0x827750c857eb63b4143be8a141d22700904d03960x374221d148c6e6d9ea381c1257dce567830db9450.05 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CryptoPiggies

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 2000 runs

Other Settings:
default evmVersion, Unlicense license
File 1 of 12 : ERC721.sol
// SPDX-License-Identifier: MIT

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 {
        require(operator != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_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 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 {}
}

File 2 of 12 : IERC721.sol
// SPDX-License-Identifier: MIT

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;
}

File 3 of 12 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT

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);
}

File 4 of 12 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

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);
}

File 5 of 12 : Address.sol
// SPDX-License-Identifier: MIT

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);
            }
        }
    }
}

File 6 of 12 : Context.sol
// SPDX-License-Identifier: MIT

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;
    }
}

File 7 of 12 : Strings.sol
// SPDX-License-Identifier: MIT

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);
    }
}

File 8 of 12 : ERC165.sol
// SPDX-License-Identifier: MIT

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;
    }
}

File 9 of 12 : IERC165.sol
// SPDX-License-Identifier: MIT

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);
}

File 10 of 12 : CryptoPiggies.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.6;

import {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import {IMetaDataGenerator} from './interfaces/IMetaDataGenerator.sol';
import {ICryptoPiggies} from './interfaces/ICryptoPiggies.sol';

/**
 * @dev Implementation of the Non-Fungible Token CryptoPiggies which uses a MetaDataGenerator to generate MetaData fully on-chain
 * Each piggy stores some eth, which can be redeemed by breaking the piggie, so there is a hard floor for sellers.
 */

contract CryptoPiggies is ERC721, ICryptoPiggies {
    address payable public override treasury;
    IMetaDataGenerator public immutable override METADATAGENERATOR;

    mapping(uint256 => Piggy) piggies;

    uint256 public constant MINT_MASK = 0xfffff;
    uint256 public constant MINT_PRICE = 0.1 ether;
    uint256 public constant MINT_VALUE = MINT_PRICE / 2;
    uint256 public constant FLIP_MIN_COST = 0.01 ether;
    uint256 public constant MAX_SUPPLY = 10000;
    uint256 public constant MAX_MINT = 20;

    uint256 internal _supply = 0;
    uint256 internal _broken = 0;

    constructor(address payable treasury_, IMetaDataGenerator generator)
        ERC721('CryptoPiggies', 'CPig')
    {
        treasury = treasury_;
        METADATAGENERATOR = generator;
    }

    function setTreasury(address payable treasury_) public {
        require(treasury == msg.sender, 'caller not treasury');
        treasury = treasury_;
    }

    /**
     * @dev Mints CryptoPiggies to the msg.sender when receiving ETH directly.
     *      Computes the number of CryptoPiggies from the msg.value
     */
    receive() external payable override {
        uint256 piggiesToMint = msg.value / MINT_PRICE;
        giftPiggies(piggiesToMint > MAX_MINT ? MAX_MINT : piggiesToMint, msg.sender);
    }

    /**
     * @dev Mints CryptoPiggies to the msg.sender
     * @param piggiesToMint the amount of CryptoPiggies to mint
     */
    function mintPiggies(uint256 piggiesToMint) public payable override {
        giftPiggies(piggiesToMint, msg.sender);
    }

    /**
     * @dev Minting CryptoPiggies to another account than msg.sender
     * @param piggiesToMint the amount of CryptoPiggies to mint
     * @param to the address to receive those CryptoPiggies
     */
    function giftPiggies(uint256 piggiesToMint, address to) public payable override {
        uint256 supply = _supply;
        require(piggiesToMint > 0, 'cannot mint 0 piggies');
        require(piggiesToMint <= MAX_MINT, 'exceeds max mint');
        require(supply + piggiesToMint <= MAX_SUPPLY, 'exceeds max supply');
        require(msg.value >= MINT_PRICE * piggiesToMint, 'insufficient eth');
        _supply = _supply + piggiesToMint;
        for (uint256 i = 0; i < piggiesToMint; i++) {
            _mintPiggie(to, supply + i);
        }
        treasury.transfer(MINT_VALUE * piggiesToMint);
        uint256 refundAmount = msg.value - piggiesToMint * MINT_PRICE;
        payable(msg.sender).transfer(refundAmount);
    }

    /**
     * @dev Destroy CryptoPiggies to redeem the ETH they hold
     * @param tokenIds the CryptoPiggies to destroy
     * @param to the receiver of the funds
     */
    function breakPiggies(uint256[] memory tokenIds, address payable to) external override {
        uint256 fundsInBroken = 0;
        for (uint256 i = 0; i < tokenIds.length; i++) {
            uint256 tokenId = tokenIds[i];
            fundsInBroken += _breakPiggie(tokenId);
        }
        _broken += tokenIds.length;
        to.transfer(fundsInBroken);

        emit Break(tokenIds.length, fundsInBroken, to);
    }

    /**
     * @dev Resets the trait mask to the initial mask
     * @param tokenId the CryptoPiggy to reset
     */
    function resetTraitMask(uint256 tokenId) public override {
        require(_isApprovedOrOwner(msg.sender, tokenId), 'caller is not approved nor owner');
        piggies[tokenId].traitMask = MINT_MASK;
        piggies[tokenId].flipCost = FLIP_MIN_COST;
        emit ResetMask(tokenId);
    }

    /**
     * @dev Update multiple traits at once
     * @param tokenId the CryptoPiggy to update traits on
     * @param positions the traits to flip
     * @param onOffs whether to turn the trait on or off
     */
    function updateMultipleTraits(
        uint256 tokenId,
        uint256[] memory positions,
        bool[] memory onOffs
    ) public payable override {
        require(_isApprovedOrOwner(msg.sender, tokenId), 'caller is not approved nor owner');
        require(positions.length == onOffs.length, 'length mismatch');
        uint256 costOfFlipping = 0;
        for (uint256 i = 0; i < positions.length; i++) {
            costOfFlipping += piggies[tokenId].flipCost * (2**i);
        }
        require(msg.value >= costOfFlipping, 'insufficient eth');

        Piggy memory piggie = piggies[tokenId];
        for (uint256 i = 0; i < positions.length; i++) {
            require(positions[i] > 4, 'cannot flip piggy or colors');
            if (onOffs[i]) {
                piggie.traitMask = newMask(piggie.traitMask, 15, positions[i]);
                emit TurnTraitOn(tokenId, positions[i]);
            } else {
                piggie.traitMask = newMask(piggie.traitMask, 0, positions[i]);
                emit TurnTraitOff(tokenId, positions[i]);
            }
        }

        piggie.flipCost = piggie.flipCost * (2 * (positions.length));
        piggie.balance += msg.value / 2;
        piggies[tokenId] = piggie;

        treasury.transfer(msg.value / 2);
    }

    /**
     * @dev Turn on a nibble (4 bits) in the trait mask.
     * @param tokenId the CryptoPiggy to update mask for
     * @param position nibble index from the right to flip
     */
    function turnTraitOn(uint256 tokenId, uint256 position) public payable override {
        require(_isApprovedOrOwner(msg.sender, tokenId), 'caller is not approved nor owner');
        _updateTraitMask(tokenId, 15, position);
        emit TurnTraitOn(tokenId, position);
    }

    /**
     * @dev Turn off a nibble (4 bits) in the trait mask.
     * @param tokenId the CryptoPiggy to update mask for
     * @param position nibble index from the right to flip
     */
    function turnTraitOff(uint256 tokenId, uint256 position) public payable override {
        require(_isApprovedOrOwner(msg.sender, tokenId), 'caller is not approved nor owner');
        _updateTraitMask(tokenId, 0, position);
        emit TurnTraitOff(tokenId, position);
    }

    /**
     * @dev Donates ETH from msg.value directly to a CryptoPiggy
     * @param tokenId the CryptoPiggy to donate to
     */

    function deposit(uint256 tokenId) public payable override {
        require(_exists(tokenId), 'cannot deposit to non-existing piggy');
        piggies[tokenId].balance += msg.value;
        emit Deposit(tokenId, msg.value);
    }

    /**
     * @dev Generates SVG image for CryptoPiggy with the activeGene and balance
     * @param tokenId the CryptoPiggy to generate image for
     * @return SVG contents
     */
    function getSVG(uint256 tokenId) public view override returns (string memory) {
        return METADATAGENERATOR.getSVG(activeGeneOf(tokenId), piggyBalance(tokenId));
    }

    /**
     * @dev Generates MetaData for a specific CryptoPiggy using its activeGene and balance
     * @param tokenId the CryptoPiggy to generate metadata for
     * @return Base64 encoded MetaData for the CryptoPiggy
     */
    function tokenURI(uint256 tokenId) public view override returns (string memory) {
        IMetaDataGenerator.MetaDataParams memory params = IMetaDataGenerator.MetaDataParams(
            tokenId,
            activeGeneOf(tokenId),
            piggyBalance(tokenId),
            ownerOf(tokenId)
        );
        return METADATAGENERATOR.tokenURI(params);
    }

    function totalSupply() external view returns (uint256) {
        return _supply;
    }

    function broken() external view override returns (uint256) {
        return _broken;
    }

    function geneOf(uint256 tokenId) external view override returns (uint256) {
        return piggies[tokenId].gene;
    }

    function traitMaskOf(uint256 tokenId) external view override returns (uint256) {
        return piggies[tokenId].traitMask;
    }

    function activeGeneOf(uint256 tokenId) public view override returns (uint256) {
        return piggies[tokenId].gene & piggies[tokenId].traitMask;
    }

    function piggyBalance(uint256 tokenId) public view override returns (uint256) {
        return piggies[tokenId].balance;
    }

    function flipCost(uint256 tokenId) external view override returns (uint256) {
        return piggies[tokenId].flipCost;
    }

    function getPiggy(uint256 tokenId) external view override returns (Piggy memory) {
        return piggies[tokenId];
    }

    // Internal functions

    function _mintPiggie(address to, uint256 tokenId) internal {
        // Semi gameable gene
        uint256 gene = uint256(
            keccak256(
                abi.encode(
                    blockhash(block.number),
                    // blockhash(block.number - 50), // This is why coverage is fuckeds
                    gasleft(),
                    msg.sender,
                    to,
                    tokenId,
                    _supply,
                    _broken
                )
            )
        );
        piggies[tokenId] = Piggy(gene, MINT_MASK, MINT_VALUE, FLIP_MIN_COST);
        _mint(to, tokenId);
    }

    function _breakPiggie(uint256 tokenId) internal returns (uint256 balance) {
        require(_isApprovedOrOwner(_msgSender(), tokenId), 'caller is not approved nor owner');
        balance = piggies[tokenId].balance;
        delete piggies[tokenId];
        _burn(tokenId);
    }

    function _updateTraitMask(
        uint256 tokenId,
        uint256 replaceValue,
        uint256 position
    ) internal {
        require(position > 4, 'cannot flip piggy or colors');
        Piggy memory piggie = piggies[tokenId];
        require(msg.value >= piggie.flipCost, 'insufficient eth');
        piggie.traitMask = newMask(piggie.traitMask, replaceValue, position);
        piggie.flipCost += piggie.flipCost;
        piggie.balance += msg.value / 2;
        piggies[tokenId] = piggie;

        treasury.transfer(msg.value / 2);
    }

    function newMask(
        uint256 mask,
        uint256 replacement,
        uint256 position
    ) internal pure virtual returns (uint256) {
        uint256 rhs = position > 0 ? mask % 16**position : 0;
        uint256 lhs = (mask / (16**(position + 1))) * (16**(position + 1));
        uint256 insert = replacement * 16**position;
        return lhs + insert + rhs;
    }
}

File 11 of 12 : ICryptoPiggies.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.6;

import {IERC721} from '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import {IMetaDataGenerator} from './IMetaDataGenerator.sol';

interface ICryptoPiggies is IERC721 {
    struct Piggy {
        uint256 gene;
        uint256 traitMask;
        uint256 balance;
        uint256 flipCost;
    }

    // Events

    event ResetMask(uint256 tokenId);
    event TurnTraitOn(uint256 tokenId, uint256 position);
    event TurnTraitOff(uint256 tokenId, uint256 position);
    event Deposit(uint256 tokenId, uint256 amount);
    event Break(uint256 piggiesBroken, uint256 amount, address to);

    // Functions for minting

    receive() external payable;

    function mintPiggies(uint256 piggiesToMint) external payable;

    function giftPiggies(uint256 piggiesToMint, address to) external payable;

    // Breaking

    function breakPiggies(uint256[] memory tokenIds, address payable to) external;

    // Manipulating mask

    function resetTraitMask(uint256 tokenId) external;

    function turnTraitOn(uint256 tokenId, uint256 position) external payable;

    function turnTraitOff(uint256 tokenId, uint256 position) external payable;

    function updateMultipleTraits(
        uint256 tokenId,
        uint256[] memory position,
        bool[] memory onOff
    ) external payable;

    // Depositing eth into a piggy

    function deposit(uint256 tokenId) external payable;

    // Views

    function getSVG(uint256 tokenId) external view returns (string memory);

    function piggyBalance(uint256 tokenId) external view returns (uint256);

    function geneOf(uint256 tokenId) external view returns (uint256);

    function traitMaskOf(uint256 tokenId) external view returns (uint256);

    function activeGeneOf(uint256 tokenId) external view returns (uint256);

    function getPiggy(uint256 tokenId) external view returns (Piggy memory);

    function flipCost(uint256 tokenId) external view returns (uint256);

    function broken() external view returns (uint256);

    function treasury() external view returns (address payable);

    function METADATAGENERATOR() external view returns (IMetaDataGenerator);
}

File 12 of 12 : IMetaDataGenerator.sol
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.6;

interface IMetaDataGenerator {
    struct MetaDataParams {
        uint256 tokenId;
        uint256 activeGene;
        uint256 balance;
        address owner;
    }

    struct Attribute {
        uint256 layer;
        uint256 scene;
    }

    struct EncodedData {
        uint8[576] composite;
        uint256[] colorPalette;
        string[] attributes;
    }

    function getSVG(uint256 activeGene, uint256 balance) external view returns (string memory);

    function tokenURI(MetaDataParams memory params) external view returns (string memory);

    function getEncodedData(uint256 activeGene) external view returns (EncodedData memory);

    function ossified() external view returns (bool);
}

Settings
{
  "evmVersion": "berlin",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 2000
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address payable","name":"treasury_","type":"address"},{"internalType":"contract IMetaDataGenerator","name":"generator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"piggiesBroken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Break","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ResetMask","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"position","type":"uint256"}],"name":"TurnTraitOff","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"position","type":"uint256"}],"name":"TurnTraitOn","type":"event"},{"inputs":[],"name":"FLIP_MIN_COST","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_MINT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"METADATAGENERATOR","outputs":[{"internalType":"contract IMetaDataGenerator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_MASK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_VALUE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"activeGeneOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address payable","name":"to","type":"address"}],"name":"breakPiggies","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"broken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"flipCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"geneOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPiggy","outputs":[{"components":[{"internalType":"uint256","name":"gene","type":"uint256"},{"internalType":"uint256","name":"traitMask","type":"uint256"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"flipCost","type":"uint256"}],"internalType":"struct ICryptoPiggies.Piggy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getSVG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"piggiesToMint","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"giftPiggies","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"piggiesToMint","type":"uint256"}],"name":"mintPiggies","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"piggyBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetTraitMask","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"treasury_","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"traitMaskOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"position","type":"uint256"}],"name":"turnTraitOff","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"position","type":"uint256"}],"name":"turnTraitOn","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"positions","type":"uint256[]"},{"internalType":"bool[]","name":"onOffs","type":"bool[]"}],"name":"updateMultipleTraits","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a0604052600060085560006009553480156200001b57600080fd5b50604051620031b6380380620031b68339810160408190526200003e9162000185565b604080518082018252600d81526c43727970746f5069676769657360981b6020808301918252835180850190945260048452634350696760e01b9084015281519192916200008f91600091620000df565b508051620000a5906001906020840190620000df565b5050600680546001600160a01b0319166001600160a01b03949094169390931790925560601b6001600160601b031916608052506200021a565b828054620000ed90620001c4565b90600052602060002090601f0160209004810192826200011157600085556200015c565b82601f106200012c57805160ff19168380011785556200015c565b828001600101855582156200015c579182015b828111156200015c5782518255916020019190600101906200013f565b506200016a9291506200016e565b5090565b5b808211156200016a57600081556001016200016f565b600080604083850312156200019957600080fd5b8251620001a68162000201565b6020840151909250620001b98162000201565b809150509250929050565b600181811c90821680620001d957607f821691505b60208210811415620001fb57634e487b7160e01b600052602260045260246000fd5b50919050565b6001600160a01b03811681146200021757600080fd5b50565b60805160601c612f6f62000247600039600081816104cc0152818161181401526119be0152612f6f6000f3fe6080604052600436106102a45760003560e01c8063900052d01161016e578063c002d23d116100cb578063dc5609391161007f578063f0292a0311610064578063f0292a03146107c7578063f0f44260146107dc578063f2fe3805146107fc57600080fd5b8063dc5609391461074e578063e985e9c51461077e57600080fd5b8063cbf792ec116100b0578063cbf792ec146106d1578063d4d23609146106e4578063da75ce34146106fb57600080fd5b8063c002d23d14610695578063c87b56dd146106b157600080fd5b8063a22cb46511610122578063b6b55f2511610107578063b6b55f2514610642578063b88d4fde14610655578063be985ac91461067557600080fd5b8063a22cb465146105f2578063a6caa87a1461061257600080fd5b80639405deb6116101535780639405deb61461058957806395cf2912146105a957806395d89b41146105dd57600080fd5b8063900052d01461056357806392a84eeb1461057657600080fd5b806342842e0e1161021c57806364043e84116101d05780636b28e79a116101b55780636b28e79a1461051b57806370a082311461052e5780637fb1ad621461054e57600080fd5b806364043e84146104ba5780636a5be686146104ee57600080fd5b806355f9b2501161020157806355f9b2501461044a57806361d027b31461047a5780636352211e1461049a57600080fd5b806342842e0e1461040f57806347370dbd1461042f57600080fd5b806318160ddd1161027357806323d23d461161025857806323d23d46146103d157806332cb6b0c146103e457806339b11696146103fa57600080fd5b806318160ddd1461039257806323b872dd146103b157600080fd5b806301ffc9a7146102e157806306fdde0314610316578063081812fc14610338578063095ea7b31461037057600080fd5b366102dc5760006102bd67016345785d8a000034612cd3565b90506102d9601482116102d057816102d3565b60145b3361081c565b50005b600080fd5b3480156102ed57600080fd5b506103016102fc3660046129e1565b610a6b565b60405190151581526020015b60405180910390f35b34801561032257600080fd5b5061032b610b50565b60405161030d9190612c2b565b34801561034457600080fd5b50610358610353366004612a92565b610be2565b6040516001600160a01b03909116815260200161030d565b34801561037c57600080fd5b5061039061038b36600461296e565b610c88565b005b34801561039e57600080fd5b506008545b60405190815260200161030d565b3480156103bd57600080fd5b506103906103cc36600461284e565b610dd8565b6103906103df366004612aab565b61081c565b3480156103f057600080fd5b506103a361271081565b34801561040657600080fd5b506103a3610e5f565b34801561041b57600080fd5b5061039061042a36600461284e565b610e75565b34801561043b57600080fd5b506103a3662386f26fc1000081565b34801561045657600080fd5b506103a3610465366004612a92565b60009081526007602052604090206001015490565b34801561048657600080fd5b50600654610358906001600160a01b031681565b3480156104a657600080fd5b506103586104b5366004612a92565b610e90565b3480156104c657600080fd5b506103587f000000000000000000000000000000000000000000000000000000000000000081565b3480156104fa57600080fd5b506103a3610509366004612a92565b60009081526007602052604090205490565b610390610529366004612ba1565b610f1b565b34801561053a57600080fd5b506103a36105493660046127f8565b610fbb565b34801561055a57600080fd5b506009546103a3565b610390610571366004612ba1565b611055565b610390610584366004612ad0565b6110ed565b34801561059557600080fd5b506103906105a4366004612a92565b6114f3565b3480156105b557600080fd5b506103a36105c4366004612a92565b6000908152600760205260409020600181015490541690565b3480156105e957600080fd5b5061032b6115ab565b3480156105fe57600080fd5b5061039061060d366004612939565b6115ba565b34801561061e57600080fd5b506103a361062d366004612a92565b60009081526007602052604090206002015490565b610390610650366004612a92565b61169d565b34801561066157600080fd5b5061039061067036600461288f565b611781565b34801561068157600080fd5b5061032b610690366004612a92565b611810565b3480156106a157600080fd5b506103a367016345785d8a000081565b3480156106bd57600080fd5b5061032b6106cc366004612a92565b611900565b6103906106df366004612a92565b611a43565b3480156106f057600080fd5b506103a3620fffff81565b34801561070757600080fd5b5061071b610716366004612a92565b611a50565b60405161030d91908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b34801561075a57600080fd5b506103a3610769366004612a92565b60009081526007602052604090206003015490565b34801561078a57600080fd5b50610301610799366004612815565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156107d357600080fd5b506103a3601481565b3480156107e857600080fd5b506103906107f73660046127f8565b611ac0565b34801561080857600080fd5b5061039061081736600461299a565b611b49565b600854826108715760405162461bcd60e51b815260206004820152601560248201527f63616e6e6f74206d696e7420302070696767696573000000000000000000000060448201526064015b60405180910390fd5b60148311156108c25760405162461bcd60e51b815260206004820152601060248201527f65786365656473206d6178206d696e74000000000000000000000000000000006044820152606401610868565b6127106108cf8483612cbb565b111561091d5760405162461bcd60e51b815260206004820152601260248201527f65786365656473206d617820737570706c7900000000000000000000000000006044820152606401610868565b61092f8367016345785d8a0000612dd2565b34101561097e5760405162461bcd60e51b815260206004820152601060248201527f696e73756666696369656e7420657468000000000000000000000000000000006044820152606401610868565b8260085461098c9190612cbb565b60085560005b838110156109bf576109ad836109a88385612cbb565b611c3b565b806109b781612e6f565b915050610992565b506006546001600160a01b03166108fc846109e3600267016345785d8a0000612cd3565b6109ed9190612dd2565b6040518115909202916000818181858888f19350505050158015610a15573d6000803e3d6000fd5b506000610a2a67016345785d8a000085612dd2565b610a349034612df1565b604051909150339082156108fc029083906000818181858888f19350505050158015610a64573d6000803e3d6000fd5b5050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480610afe57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610b4a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b606060008054610b5f90612e34565b80601f0160208091040260200160405190810160405280929190818152602001828054610b8b90612e34565b8015610bd85780601f10610bad57610100808354040283529160200191610bd8565b820191906000526020600020905b815481529060010190602001808311610bbb57829003601f168201915b5050505050905090565b6000818152600260205260408120546001600160a01b0316610c6c5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610868565b506000908152600460205260409020546001600160a01b031690565b6000610c9382610e90565b9050806001600160a01b0316836001600160a01b03161415610d1d5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610868565b336001600160a01b0382161480610d5757506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b610dc95760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610868565b610dd38383611d0f565b505050565b610de23382611d8a565b610e545760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610868565b610dd3838383611e92565b610e72600267016345785d8a0000612cd3565b81565b610dd383838360405180602001604052806000815250611781565b6000818152600260205260408120546001600160a01b031680610b4a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610868565b610f253383611d8a565b610f715760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f7420617070726f766564206e6f72206f776e65726044820152606401610868565b610f7d8260008361206c565b60408051838152602081018390527f906e9acfe458d7ab8d8abd68ead84d1c313a9e326b0b76d11f078e4ce7b2b61991015b60405180910390a15050565b60006001600160a01b0382166110395760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610868565b506001600160a01b031660009081526003602052604090205490565b61105f3383611d8a565b6110ab5760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f7420617070726f766564206e6f72206f776e65726044820152606401610868565b6110b782600f8361206c565b60408051838152602081018390527fb773bd5c1433d0e808e6d5296bdc89c53bbc0e046b6ed0aa63402332c5e6da669101610faf565b6110f73384611d8a565b6111435760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f7420617070726f766564206e6f72206f776e65726044820152606401610868565b80518251146111945760405162461bcd60e51b815260206004820152600f60248201527f6c656e677468206d69736d6174636800000000000000000000000000000000006044820152606401610868565b6000805b83518110156111e6576111ac816002612d2a565b6000868152600760205260409020600301546111c89190612dd2565b6111d29083612cbb565b9150806111de81612e6f565b915050611198565b50803410156112375760405162461bcd60e51b815260206004820152601060248201527f696e73756666696369656e7420657468000000000000000000000000000000006044820152606401610868565b6000848152600760209081526040808320815160808101835281548152600182015493810193909352600281015491830191909152600301546060820152905b845181101561142d57600485828151811061129457611294612eca565b6020026020010151116112e95760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f7420666c6970207069676779206f7220636f6c6f727300000000006044820152606401610868565b8381815181106112fb576112fb612eca565b60200260200101511561139a576113318260200151600f87848151811061132457611324612eca565b6020026020010151612212565b8260200181815250507fb773bd5c1433d0e808e6d5296bdc89c53bbc0e046b6ed0aa63402332c5e6da668686838151811061136e5761136e612eca565b602002602001015160405161138d929190918252602082015260400190565b60405180910390a161141b565b6113b68260200151600087848151811061132457611324612eca565b8260200181815250507f906e9acfe458d7ab8d8abd68ead84d1c313a9e326b0b76d11f078e4ce7b2b619868683815181106113f3576113f3612eca565b6020026020010151604051611412929190918252602082015260400190565b60405180910390a15b8061142581612e6f565b915050611277565b50835161143b906002612dd2565b816060015161144a9190612dd2565b606082015261145a600234612cd3565b8160400181815161146b9190612cbb565b905250600085815260076020908152604091829020835181559083015160018201559082015160028083019190915560608301516003909201919091556006546001600160a01b0316906108fc906114c39034612cd3565b6040518115909202916000818181858888f193505050501580156114eb573d6000803e3d6000fd5b505050505050565b6114fd3382611d8a565b6115495760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f7420617070726f766564206e6f72206f776e65726044820152606401610868565b60008181526007602052604090819020620fffff6001820155662386f26fc10000600390910155517f08cc781ae5aa698908590f22393ca25838db1c8d7a98c8bb51e07aaffaf79f11906115a09083815260200190565b60405180910390a150565b606060018054610b5f90612e34565b6001600160a01b0382163314156116135760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610868565b3360008181526005602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000818152600260205260409020546001600160a01b03166117265760405162461bcd60e51b8152602060048201526024808201527f63616e6e6f74206465706f73697420746f206e6f6e2d6578697374696e67207060448201527f69676779000000000000000000000000000000000000000000000000000000006064820152608401610868565b60008181526007602052604081206002018054349290611747908490612cbb565b9091555050604080518281523460208201527fa3af609bf46297028ce551832669030f9effef2b02606d02cbbcc40fe6b47c5591016115a0565b61178c335b83611d8a565b6117fe5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610868565b61180a848484846122b8565b50505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632ede0bda61185e846000908152600760205260409020600181015490541690565b6000858152600760205260409020600201546040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526004810192909252602482015260440160006040518083038186803b1580156118c457600080fd5b505afa1580156118d8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b4a9190810190612a1b565b606060006040518060800160405280848152602001611932856000908152600760205260409020600181015490541690565b81526020016119508560009081526007602052604090206002015490565b815260200161195e85610e90565b6001600160a01b03908116909152604080517f59b848a000000000000000000000000000000000000000000000000000000000815283516004820152602084015160248201529083015160448201526060830151821660648201529192507f000000000000000000000000000000000000000000000000000000000000000016906359b848a09060840160006040518083038186803b158015611a0057600080fd5b505afa158015611a14573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611a3c9190810190612a1b565b9392505050565b611a4d813361081c565b50565b611a7b6040518060800160405280600081526020016000815260200160008152602001600081525090565b50600090815260076020908152604091829020825160808101845281548152600182015492810192909252600281015492820192909252600390910154606082015290565b6006546001600160a01b03163314611b1a5760405162461bcd60e51b815260206004820152601360248201527f63616c6c6572206e6f74207472656173757279000000000000000000000000006044820152606401610868565b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000805b8351811015611b9d576000848281518110611b6a57611b6a612eca565b60200260200101519050611b7d81612341565b611b879084612cbb565b9250508080611b9590612e6f565b915050611b4d565b50825160096000828254611bb19190612cbb565b90915550506040516001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611bec573d6000803e3d6000fd5b50825160408051918252602082018390526001600160a01b03841682820152517f99d5080c1572a02cdf1bb94d0b98a4c28f7a8e1fe8e44e4007dc5ac3b7ed35fa9181900360600190a1505050565b600043405a6008546009546040805160208101959095528401929092523360608401526001600160a01b038616608084015260a0830185905260c083015260e08201526101000160408051601f198184030181528282528051602091820120608084018352808452620fffff9184019190915292508101611cc5600267016345785d8a0000612cd3565b8152662386f26fc10000602091820152600084815260078252604090819020835181559183015160018301558201516002820155606090910151600390910155610dd383836123d2565b6000818152600460205260409020805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0384169081179091558190611d5182610e90565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600260205260408120546001600160a01b0316611e145760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610868565b6000611e1f83610e90565b9050806001600160a01b0316846001600160a01b03161480611e5a5750836001600160a01b0316611e4f84610be2565b6001600160a01b0316145b80611e8a57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611ea582610e90565b6001600160a01b031614611f215760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610868565b6001600160a01b038216611f9c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610868565b611fa7600082611d0f565b6001600160a01b0383166000908152600360205260408120805460019290611fd0908490612df1565b90915550506001600160a01b0382166000908152600360205260408120805460019290611ffe908490612cbb565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600481116120bc5760405162461bcd60e51b815260206004820152601b60248201527f63616e6e6f7420666c6970207069676779206f7220636f6c6f727300000000006044820152606401610868565b6000838152600760209081526040918290208251608081018452815481526001820154928101929092526002810154928201929092526003909101546060820181905234101561214e5760405162461bcd60e51b815260206004820152601060248201527f696e73756666696369656e7420657468000000000000000000000000000000006044820152606401610868565b61215d81602001518484612212565b6020820152606081018051906121738280612cbb565b905250612181600234612cd3565b816040018181516121929190612cbb565b905250600084815260076020908152604091829020835181559083015160018201559082015160028083019190915560608301516003909201919091556006546001600160a01b0316906108fc906121ea9034612cd3565b6040518115909202916000818181858888f19350505050158015610a64573d6000803e3d6000fd5b60008060008311612224576000612239565b61222f836010612d2a565b6122399086612e8a565b90506000612248846001612cbb565b612253906010612d2a565b61225e856001612cbb565b612269906010612d2a565b6122739088612cd3565b61227d9190612dd2565b9050600061228c856010612d2a565b6122969087612dd2565b9050826122a38284612cbb565b6122ad9190612cbb565b979650505050505050565b6122c3848484611e92565b6122cf84848484612521565b61180a5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610868565b600061234c33611786565b6123985760405162461bcd60e51b815260206004820181905260248201527f63616c6c6572206973206e6f7420617070726f766564206e6f72206f776e65726044820152606401610868565b50600081815260076020526040812060028101805483835560018301849055908390556003909101919091556123cd826126ce565b919050565b6001600160a01b0382166124285760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610868565b6000818152600260205260409020546001600160a01b03161561248d5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610868565b6001600160a01b03821660009081526003602052604081208054600192906124b6908490612cbb565b9091555050600081815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001600160a01b0384163b156126c3576040517f150b7a020000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063150b7a029061257e903390899088908890600401612bef565b602060405180830381600087803b15801561259857600080fd5b505af19250505080156125c8575060408051601f3d908101601f191682019092526125c5918101906129fe565b60015b612678573d8080156125f6576040519150601f19603f3d011682016040523d82523d6000602084013e6125fb565b606091505b5080516126705760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610868565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050611e8a565b506001949350505050565b60006126d982610e90565b90506126e6600083611d0f565b6001600160a01b038116600090815260036020526040812080546001929061270f908490612df1565b9091555050600082815260026020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b600082601f83011261278757600080fd5b8135602061279c61279783612c6f565b612c3e565b80838252828201915082860187848660051b89010111156127bc57600080fd5b60005b858110156127db578135845292840192908401906001016127bf565b5090979650505050505050565b803580151581146123cd57600080fd5b60006020828403121561280a57600080fd5b8135611a3c81612ef6565b6000806040838503121561282857600080fd5b823561283381612ef6565b9150602083013561284381612ef6565b809150509250929050565b60008060006060848603121561286357600080fd5b833561286e81612ef6565b9250602084013561287e81612ef6565b929592945050506040919091013590565b600080600080608085870312156128a557600080fd5b84356128b081612ef6565b935060208501356128c081612ef6565b925060408501359150606085013567ffffffffffffffff8111156128e357600080fd5b8501601f810187136128f457600080fd5b803561290261279782612c93565b81815288602083850101111561291757600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b6000806040838503121561294c57600080fd5b823561295781612ef6565b9150612965602084016127e8565b90509250929050565b6000806040838503121561298157600080fd5b823561298c81612ef6565b946020939093013593505050565b600080604083850312156129ad57600080fd5b823567ffffffffffffffff8111156129c457600080fd5b6129d085828601612776565b925050602083013561284381612ef6565b6000602082840312156129f357600080fd5b8135611a3c81612f0b565b600060208284031215612a1057600080fd5b8151611a3c81612f0b565b600060208284031215612a2d57600080fd5b815167ffffffffffffffff811115612a4457600080fd5b8201601f81018413612a5557600080fd5b8051612a6361279782612c93565b818152856020838501011115612a7857600080fd5b612a89826020830160208601612e08565b95945050505050565b600060208284031215612aa457600080fd5b5035919050565b60008060408385031215612abe57600080fd5b82359150602083013561284381612ef6565b600080600060608486031215612ae557600080fd5b8335925060208085013567ffffffffffffffff80821115612b0557600080fd5b612b1188838901612776565b94506040870135915080821115612b2757600080fd5b508501601f81018713612b3957600080fd5b8035612b4761279782612c6f565b8082825284820191508484018a868560051b8701011115612b6757600080fd5b600094505b83851015612b9157612b7d816127e8565b835260019490940193918501918501612b6c565b5080955050505050509250925092565b60008060408385031215612bb457600080fd5b50508035926020909101359150565b60008151808452612bdb816020860160208601612e08565b601f01601f19169290920160200192915050565b60006001600160a01b03808716835280861660208401525083604083015260806060830152612c216080830184612bc3565b9695505050505050565b602081526000611a3c6020830184612bc3565b604051601f8201601f1916810167ffffffffffffffff81118282101715612c6757612c67612ee0565b604052919050565b600067ffffffffffffffff821115612c8957612c89612ee0565b5060051b60200190565b600067ffffffffffffffff821115612cad57612cad612ee0565b50601f01601f191660200190565b60008219821115612cce57612cce612e9e565b500190565b600082612ce257612ce2612eb4565b500490565b600181815b80851115612d22578160001904821115612d0857612d08612e9e565b80851615612d1557918102915b93841c9390800290612cec565b509250929050565b6000611a3c8383600082612d4057506001610b4a565b81612d4d57506000610b4a565b8160018114612d635760028114612d6d57612d89565b6001915050610b4a565b60ff841115612d7e57612d7e612e9e565b50506001821b610b4a565b5060208310610133831016604e8410600b8410161715612dac575081810a610b4a565b612db68383612ce7565b8060001904821115612dca57612dca612e9e565b029392505050565b6000816000190483118215151615612dec57612dec612e9e565b500290565b600082821015612e0357612e03612e9e565b500390565b60005b83811015612e23578181015183820152602001612e0b565b8381111561180a5750506000910152565b600181811c90821680612e4857607f821691505b60208210811415612e6957634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415612e8357612e83612e9e565b5060010190565b600082612e9957612e99612eb4565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611a4d57600080fd5b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611a4d57600080fdfea2646970667358221220501a522390e73b8b9134f3d84a2637a63c95ecf4276b60ee698608754125d2f264736f6c63430008060033000000000000000000000000374221d148c6e6d9ea381c1257dce567830db945000000000000000000000000a72aaee165ea0b5ca56c2fdc48772a0963629df0

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000374221d148c6e6d9ea381c1257dce567830db945000000000000000000000000a72aaee165ea0b5ca56c2fdc48772a0963629df0

-----Decoded View---------------
Arg [0] : treasury_ (address): 0x374221d148c6E6D9Ea381C1257DCe567830db945
Arg [1] : generator (address): 0xa72AaEe165Ea0B5Ca56c2FdC48772A0963629df0

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000374221d148c6e6d9ea381c1257dce567830db945
Arg [1] : 000000000000000000000000a72aaee165ea0b5ca56c2fdc48772a0963629df0


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.