ETH Price: $3,365.03 (-1.51%)
Gas: 8 Gwei

Contract

0x58e80f54c86b6DF98814CC274893534C0F7785E8
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Set Approval For...200999202024-06-15 21:37:3510 days ago1718487455IN
CryptoToons: CryptoBulls Token
0 ETH0.000172153.68635762
Safe Transfer Fr...198290862024-05-09 1:03:2348 days ago1715216603IN
CryptoToons: CryptoBulls Token
0 ETH0.000415514.27776649
Set Approval For...190285032024-01-17 18:52:11160 days ago1705517531IN
CryptoToons: CryptoBulls Token
0 ETH0.0008294633.34816177
Set Approval For...188059552023-12-17 13:10:59192 days ago1702818659IN
CryptoToons: CryptoBulls Token
0 ETH0.0010521442.30062356
Set Approval For...188016972023-12-16 22:49:47192 days ago1702766987IN
CryptoToons: CryptoBulls Token
0 ETH0.0018969440.61889389
Safe Transfer Fr...188016272023-12-16 22:35:47192 days ago1702766147IN
CryptoToons: CryptoBulls Token
0 ETH0.0052583141.72136188
Set Approval For...182761642023-10-04 9:08:35266 days ago1696410515IN
CryptoToons: CryptoBulls Token
0 ETH0.000180537.25845962
Transfer From180686562023-09-05 7:01:23295 days ago1693897283IN
CryptoToons: CryptoBulls Token
0 ETH0.001061279.90810196
Set Approval For...178620942023-08-07 9:14:35324 days ago1691399675IN
CryptoToons: CryptoBulls Token
0 ETH0.0008330617.83834253
Set Approval For...178309532023-08-03 0:39:59328 days ago1691023199IN
CryptoToons: CryptoBulls Token
0 ETH0.0008828218.90370323
Set Approval For...178277792023-08-02 14:02:11329 days ago1690984931IN
CryptoToons: CryptoBulls Token
0 ETH0.0023556450.44098846
Set Approval For...174765392023-06-14 6:55:23378 days ago1686725723IN
CryptoToons: CryptoBulls Token
0 ETH0.0006819614.60280412
Set Approval For...169590952023-04-02 4:38:11451 days ago1680410291IN
CryptoToons: CryptoBulls Token
0 ETH0.0010444622.36495086
Set Approval For...167635672023-03-05 17:05:35479 days ago1678035935IN
CryptoToons: CryptoBulls Token
0 ETH0.0013920629.80811572
Set Approval For...165375102023-02-02 0:21:11510 days ago1675297271IN
CryptoToons: CryptoBulls Token
0 ETH0.0013986229.94857809
Set Approval For...163786562023-01-10 19:59:47532 days ago1673380787IN
CryptoToons: CryptoBulls Token
0 ETH0.0014516731.08448567
Set Approval For...163452262023-01-06 4:01:59537 days ago1672977719IN
CryptoToons: CryptoBulls Token
0 ETH0.0009206719.7143274
Set Approval For...158575962022-10-30 1:29:35605 days ago1667093375IN
CryptoToons: CryptoBulls Token
0 ETH0.000209058.40491232
Set Approval For...157740132022-10-18 9:10:59617 days ago1666084259IN
CryptoToons: CryptoBulls Token
0 ETH0.0009340220
Set Approval For...157720462022-10-18 2:36:35617 days ago1666060595IN
CryptoToons: CryptoBulls Token
0 ETH0.0007398915.84333062
Set Approval For...156756202022-10-04 15:19:59631 days ago1664896799IN
CryptoToons: CryptoBulls Token
0 ETH0.0007291515.61335745
Set Approval For...155635212022-09-18 22:52:35646 days ago1663541555IN
CryptoToons: CryptoBulls Token
0 ETH0.000295996.33811615
Set Approval For...154151972022-08-26 11:54:33670 days ago1661514873IN
CryptoToons: CryptoBulls Token
0 ETH0.000418788.96728005
Set Approval For...154114602022-08-25 21:29:10670 days ago1661462950IN
CryptoToons: CryptoBulls Token
0 ETH0.0004926910.55
Set Approval For...153746462022-08-20 1:09:35676 days ago1660957775IN
CryptoToons: CryptoBulls Token
0 ETH0.000408138.73937939
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x271a0b46...B2B76900E
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
CryptoToon

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-09-02
*/

pragma solidity ^0.4.24;

contract ERC721Basic {
    event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
    event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    function balanceOf(address _owner) public view returns (uint256 _balance);

    function ownerOf(uint256 _tokenId) public view returns (address _owner);

    function exists(uint256 _tokenId) public view returns (bool _exists);

    function approve(address _to, uint256 _tokenId) public;

    function getApproved(uint256 _tokenId) public view returns (address _operator);

    function setApprovalForAll(address _operator, bool _approved) public;

    function isApprovedForAll(address _owner, address _operator) public view returns (bool);

    function transferFrom(address _from, address _to, uint256 _tokenId) public;

    function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;

    //    function safeTransferFrom(
    //        address _from,
    //        address _to,
    //        uint256 _tokenId,
    //        bytes _data
    //    )
    //    public;
}

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Enumerable is ERC721Basic {
    function totalSupply() public view returns (uint256);

    function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256 _tokenId);

    function tokenByIndex(uint256 _index) public view returns (uint256);
}


/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Metadata is ERC721Basic {
    function name() public view returns (string _name);

    function symbol() public view returns (string _symbol);

    function tokenURI(uint256 _tokenId) public view returns (string);
}


/**
 * @title ERC-721 Non-Fungible Token Standard, full implementation interface
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721 is ERC721Basic, ERC721Enumerable, ERC721Metadata {
}

contract ToonInterface is ERC721 {

    function isToonInterface() external pure returns (bool);

    /**
    * @notice   Returns an address of the toon author. 0x0 if
    *           the toon has been created by us.
    */
    function authorAddress() external view returns (address);

    /**
    * @notice   Returns maximum supply. In other words there will
    *           be never more toons that that number. It has to
    *           be constant.
    *           If there is no limit function returns 0.
    */
    function maxSupply() external view returns (uint256);

    function getToonInfo(uint _id) external view returns (
        uint genes,
        uint birthTime,
        address owner
    );

}

contract Ownable {
    address public owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor() public {
        owner = msg.sender;
    }


    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }


    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

}

contract Pausable is Ownable {
    event Pause();
    event Unpause();

    bool public paused = false;


    /**
     * @dev modifier to allow actions only when the contract IS paused
     */
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /**
     * @dev modifier to allow actions only when the contract IS NOT paused
     */
    modifier whenPaused {
        require(paused);
        _;
    }

    /**
     * @dev called by the owner to pause, triggers stopped state
     */
    function pause() public onlyOwner whenNotPaused returns (bool) {
        paused = true;
        emit Pause();
        return true;
    }

    /**
     * @dev called by the owner to unpause, returns to normal state
     */
    function unpause() public onlyOwner whenPaused returns (bool) {
        paused = false;
        emit Unpause();
        return true;
    }
}

contract Withdrawable {

    mapping(address => uint) private pendingWithdrawals;

    event Withdrawal(address indexed receiver, uint amount);
    event BalanceChanged(address indexed _address, uint oldBalance, uint newBalance);

    /**
    * Returns amount of wei that given address is able to withdraw.
    */
    function getPendingWithdrawal(address _address) public view returns (uint) {
        return pendingWithdrawals[_address];
    }

    /**
    * Add pending withdrawal for an address.
    */
    function addPendingWithdrawal(address _address, uint _amount) internal {
        require(_address != 0x0);

        uint oldBalance = pendingWithdrawals[_address];
        pendingWithdrawals[_address] += _amount;

        emit BalanceChanged(_address, oldBalance, oldBalance + _amount);
    }

    /**
    * Withdraws all pending withdrawals.
    */
    function withdraw() external {
        uint amount = getPendingWithdrawal(msg.sender);
        require(amount > 0);

        pendingWithdrawals[msg.sender] = 0;
        msg.sender.transfer(amount);

        emit Withdrawal(msg.sender, amount);
        emit BalanceChanged(msg.sender, amount, 0);
    }

}

contract ClockAuctionBase is Withdrawable, Pausable {

    // Represents an auction on an NFT
    struct Auction {
        // Address of a contract
        address _contract;
        // Current owner of NFT
        address seller;
        // Price (in wei) at beginning of auction
        uint128 startingPrice;
        // Price (in wei) at end of auction
        uint128 endingPrice;
        // Duration (in seconds) of auction
        uint64 duration;
        // Time when auction started
        // NOTE: 0 if this auction has been concluded
        uint64 startedAt;
    }

    // Reference to contract tracking NFT ownership
    ToonInterface[] public toonContracts;
    mapping(address => uint256) addressToIndex;

    // Cut owner takes on each auction, measured in basis points (1/100 of a percent).
    // Values 0-10,000 map to 0%-100%
    uint256 public ownerCut;

    // Values 0-10,000 map to 0%-100%
    // Author's share from the owner cut.
    uint256 public authorShare;

    // Map from token ID to their corresponding auction.
    //    mapping(uint256 => Auction) tokenIdToAuction;
    mapping(address => mapping(uint256 => Auction)) tokenToAuction;

    event AuctionCreated(address indexed _contract, uint256 indexed tokenId,
        uint256 startingPrice, uint256 endingPrice, uint256 duration);
    event AuctionSuccessful(address indexed _contract, uint256 indexed tokenId,
        uint256 totalPrice, address indexed winner);
    event AuctionCancelled(address indexed _contract, uint256 indexed tokenId);

    /**
    * @notice   Adds a new toon contract.
    */
    function addToonContract(address _toonContractAddress) external onlyOwner {
        ToonInterface _interface = ToonInterface(_toonContractAddress);
        require(_interface.isToonInterface());

        uint _index = toonContracts.push(_interface) - 1;
        addressToIndex[_toonContractAddress] = _index;
    }

    /// @dev Returns true if the claimant owns the token.
    /// @param _contract - address of a toon contract
    /// @param _claimant - Address claiming to own the token.
    /// @param _tokenId - ID of token whose ownership to verify.
    function _owns(address _contract, address _claimant, uint256 _tokenId)
    internal
    view
    returns (bool) {
        ToonInterface _interface = _interfaceByAddress(_contract);
        address _owner = _interface.ownerOf(_tokenId);

        return (_owner == _claimant);
    }

    /// @dev Escrows the NFT, assigning ownership to this contract.
    /// Throws if the escrow fails.
    /// @param _owner - Current owner address of token to escrow.
    /// @param _tokenId - ID of token whose approval to verify.
    function _escrow(address _contract, address _owner, uint256 _tokenId) internal {
        ToonInterface _interface = _interfaceByAddress(_contract);
        // it will throw if transfer fails
        _interface.transferFrom(_owner, this, _tokenId);
    }

    /// @dev Transfers an NFT owned by this contract to another address.
    /// Returns true if the transfer succeeds.
    /// @param _receiver - Address to transfer NFT to.
    /// @param _tokenId - ID of token to transfer.
    function _transfer(address _contract, address _receiver, uint256 _tokenId) internal {
        ToonInterface _interface = _interfaceByAddress(_contract);
        // it will throw if transfer fails
        _interface.transferFrom(this, _receiver, _tokenId);
    }

    /// @dev Adds an auction to the list of open auctions. Also fires the
    ///  AuctionCreated event.
    /// @param _tokenId The ID of the token to be put on auction.
    /// @param _auction Auction to add.
    function _addAuction(address _contract, uint256 _tokenId, Auction _auction) internal {
        // Require that all auctions have a duration of
        // at least one minute. (Keeps our math from getting hairy!)
        require(_auction.duration >= 1 minutes);

        _isAddressSupportedContract(_contract);
        tokenToAuction[_contract][_tokenId] = _auction;

        emit AuctionCreated(
            _contract,
            uint256(_tokenId),
            uint256(_auction.startingPrice),
            uint256(_auction.endingPrice),
            uint256(_auction.duration)
        );
    }

    /// @dev Cancels an auction unconditionally.
    function _cancelAuction(address _contract, uint256 _tokenId, address _seller) internal {
        _removeAuction(_contract, _tokenId);
        _transfer(_contract, _seller, _tokenId);
        emit AuctionCancelled(_contract, _tokenId);
    }

    /// @dev Computes the price and transfers winnings.
    /// Does NOT transfer ownership of token.
    function _bid(address _contract, uint256 _tokenId, uint256 _bidAmount)
    internal
    returns (uint256)
    {
        // Get a reference to the auction struct
        Auction storage auction = tokenToAuction[_contract][_tokenId];
        ToonInterface _interface = _interfaceByAddress(auction._contract);

        // Explicitly check that this auction is currently live.
        // (Because of how Ethereum mappings work, we can't just count
        // on the lookup above failing. An invalid _tokenId will just
        // return an auction object that is all zeros.)
        require(_isOnAuction(auction));

        // Check that the bid is greater than or equal to the current price
        uint256 price = _currentPrice(auction);
        require(_bidAmount >= price);

        // Grab a reference to the seller before the auction struct
        // gets deleted.
        address seller = auction.seller;

        // The bid is good! Remove the auction before sending the fees
        // to the sender so we can't have a reentrancy attack.
        _removeAuction(_contract, _tokenId);

        // Transfer proceeds to seller (if there are any!)
        if (price > 0) {
            // Calculate the auctioneer's cut.
            // (NOTE: _computeCut() is guaranteed to return a
            // value <= price, so this subtraction can't go negative.)
            uint256 auctioneerCut;
            uint256 authorCut;
            uint256 sellerProceeds;
            (auctioneerCut, authorCut, sellerProceeds) = _computeCut(_interface, price);

            if (authorCut > 0) {
                address authorAddress = _interface.authorAddress();
                addPendingWithdrawal(authorAddress, authorCut);
            }

            addPendingWithdrawal(owner, auctioneerCut);

            // NOTE: Doing a transfer() in the middle of a complex
            // method like this is generally discouraged because of
            // reentrancy attacks and DoS attacks if the seller is
            // a contract with an invalid fallback function. We explicitly
            // guard against reentrancy attacks by removing the auction
            // before calling transfer(), and the only thing the seller
            // can DoS is the sale of their own asset! (And if it's an
            // accident, they can call cancelAuction(). )
            seller.transfer(sellerProceeds);
        }

        // Calculate any excess funds included with the bid. If the excess
        // is anything worth worrying about, transfer it back to bidder.
        // NOTE: We checked above that the bid amount is greater than or
        // equal to the price so this cannot underflow.
        uint256 bidExcess = _bidAmount - price;

        // Return the funds. Similar to the previous transfer, this is
        // not susceptible to a re-entry attack because the auction is
        // removed before any transfers occur.
        msg.sender.transfer(bidExcess);

        // Tell the world!
        emit AuctionSuccessful(_contract, _tokenId, price, msg.sender);

        return price;
    }

    /// @dev Removes an auction from the list of open auctions.
    /// @param _tokenId - ID of NFT on auction.
    function _removeAuction(address _contract, uint256 _tokenId) internal {
        delete tokenToAuction[_contract][_tokenId];
    }

    /// @dev Returns true if the NFT is on auction.
    /// @param _auction - Auction to check.
    function _isOnAuction(Auction storage _auction) internal view returns (bool) {
        return (_auction.startedAt > 0);
    }

    /// @dev Returns current price of an NFT on auction. Broken into two
    ///  functions (this one, that computes the duration from the auction
    ///  structure, and the other that does the price computation) so we
    ///  can easily test that the price computation works correctly.
    function _currentPrice(Auction storage _auction)
    internal
    view
    returns (uint256)
    {
        uint256 secondsPassed = 0;

        // A bit of insurance against negative values (or wraparound).
        // Probably not necessary (since Ethereum guarnatees that the
        // now variable doesn't ever go backwards).
        if (now > _auction.startedAt) {
            secondsPassed = now - _auction.startedAt;
        }

        return _computeCurrentPrice(
            _auction.startingPrice,
            _auction.endingPrice,
            _auction.duration,
            secondsPassed
        );
    }

    /// @dev Computes the current price of an auction. Factored out
    ///  from _currentPrice so we can run extensive unit tests.
    ///  When testing, make this function public and turn on
    ///  `Current price computation` test suite.
    function _computeCurrentPrice(
        uint256 _startingPrice,
        uint256 _endingPrice,
        uint256 _duration,
        uint256 _secondsPassed
    )
    internal
    pure
    returns (uint256)
    {
        // NOTE: We don't use SafeMath (or similar) in this function because
        //  all of our public functions carefully cap the maximum values for
        //  time (at 64-bits) and currency (at 128-bits). _duration is
        //  also known to be non-zero (see the require() statement in
        //  _addAuction())
        if (_secondsPassed >= _duration) {
            // We've reached the end of the dynamic pricing portion
            // of the auction, just return the end price.
            return _endingPrice;
        } else {
            // Starting price can be higher than ending price (and often is!), so
            // this delta can be negative.
            int256 totalPriceChange = int256(_endingPrice) - int256(_startingPrice);

            // This multiplication can't overflow, _secondsPassed will easily fit within
            // 64-bits, and totalPriceChange will easily fit within 128-bits, their product
            // will always fit within 256-bits.
            int256 currentPriceChange = totalPriceChange * int256(_secondsPassed) / int256(_duration);

            // currentPriceChange can be negative, but if so, will have a magnitude
            // less that _startingPrice. Thus, this result will always end up positive.
            int256 currentPrice = int256(_startingPrice) + currentPriceChange;

            return uint256(currentPrice);
        }
    }

    /// @dev Computes owner's cut of a sale.
    /// @param _price - Sale price of NFT.
    function _computeCut(ToonInterface _interface, uint256 _price) internal view returns (
        uint256 ownerCutValue,
        uint256 authorCutValue,
        uint256 sellerProceeds
    ) {
        // NOTE: We don't use SafeMath (or similar) in this function because
        //  all of our entry functions carefully cap the maximum values for
        //  currency (at 128-bits), and ownerCut <= 10000 (see the require()
        //  statement in the ClockAuction constructor). The result of this
        //  function is always guaranteed to be <= _price.

        uint256 _totalCut = _price * ownerCut / 10000;
        uint256 _authorCut = 0;
        uint256 _ownerCut = 0;
        if (_interface.authorAddress() != 0x0) {
            _authorCut = _totalCut * authorShare / 10000;
        }

        _ownerCut = _totalCut - _authorCut;
        uint256 _sellerProfit = _price - _ownerCut - _authorCut;
        require(_sellerProfit + _ownerCut + _authorCut == _price);

        return (_ownerCut, _authorCut, _sellerProfit);
    }

    function _interfaceByAddress(address _address) internal view returns (ToonInterface) {
        uint _index = addressToIndex[_address];
        ToonInterface _interface = toonContracts[_index];
        require(_address == address(_interface));

        return _interface;
    }

    function _isAddressSupportedContract(address _address) internal view returns (bool) {
        uint _index = addressToIndex[_address];
        ToonInterface _interface = toonContracts[_index];
        return _address == address(_interface);
    }
}

contract ClockAuction is ClockAuctionBase {

    /// @dev The ERC-165 interface signature for ERC-721.
    ///  Ref: https://github.com/ethereum/EIPs/issues/165
    ///  Ref: https://github.com/ethereum/EIPs/issues/721
    bytes4 constant InterfaceSignature_ERC721 = bytes4(0x9a20483d);

    bool public isSaleClockAuction = true;

    /// @dev Constructor creates a reference to the NFT ownership contract
    ///  and verifies the owner cut is in the valid range.
    /// @param _ownerCut - percent cut the owner takes on each auction, must be
    ///  between 0-10,000.
    /// @param _authorShare - percent share of the author of the toon.
    ///  Calculated from the ownerCut
    constructor(uint256 _ownerCut, uint256 _authorShare) public {
        require(_ownerCut <= 10000);
        require(_authorShare <= 10000);

        ownerCut = _ownerCut;
        authorShare = _authorShare;
    }

    /// @dev Creates and begins a new auction.
    /// @param _tokenId - ID of token to auction, sender must be owner.
    /// @param _startingPrice - Price of item (in wei) at beginning of auction.
    /// @param _endingPrice - Price of item (in wei) at end of auction.
    /// @param _duration - Length of time to move between starting
    ///  price and ending price (in seconds).
    /// @param _seller - Seller, if not the message sender
    function createAuction(
        address _contract,
        uint256 _tokenId,
        uint256 _startingPrice,
        uint256 _endingPrice,
        uint256 _duration,
        address _seller
    )
    external
    whenNotPaused
    {
        require(_isAddressSupportedContract(_contract));
        // Sanity check that no inputs overflow how many bits we've allocated
        // to store them in the auction struct.
        require(_startingPrice == uint256(uint128(_startingPrice)));
        require(_endingPrice == uint256(uint128(_endingPrice)));
        require(_duration == uint256(uint64(_duration)));

        _escrow(_contract, _seller, _tokenId);

        Auction memory auction = Auction(
            _contract,
            _seller,
            uint128(_startingPrice),
            uint128(_endingPrice),
            uint64(_duration),
            uint64(now)
        );
        _addAuction(_contract, _tokenId, auction);
    }

    /// @dev Bids on an open auction, completing the auction and transferring
    ///  ownership of the NFT if enough Ether is supplied.
    /// @param _tokenId - ID of token to bid on.
    function bid(address _contract, uint256 _tokenId)
    external
    payable
    whenNotPaused
    {
        // _bid will throw if the bid or funds transfer fails
        _bid(_contract, _tokenId, msg.value);
        _transfer(_contract, msg.sender, _tokenId);
    }

    /// @dev Cancels an auction that hasn't been won yet.
    ///  Returns the NFT to original owner.
    /// @notice This is a state-modifying function that can
    ///  be called while the contract is paused.
    /// @param _tokenId - ID of token on auction
    function cancelAuction(address _contract, uint256 _tokenId)
    external
    {
        Auction storage auction = tokenToAuction[_contract][_tokenId];
        require(_isOnAuction(auction));
        address seller = auction.seller;
        require(msg.sender == seller);
        _cancelAuction(_contract, _tokenId, seller);
    }

    /// @dev Cancels an auction when the contract is paused.
    ///  Only the owner may do this, and NFTs are returned to
    ///  the seller. This should only be used in emergencies.
    /// @param _tokenId - ID of the NFT on auction to cancel.
    function cancelAuctionWhenPaused(address _contract, uint256 _tokenId)
    whenPaused
    onlyOwner
    external
    {
        Auction storage auction = tokenToAuction[_contract][_tokenId];
        require(_isOnAuction(auction));
        _cancelAuction(_contract, _tokenId, auction.seller);
    }

    /// @dev Returns auction info for an NFT on auction.
    /// @param _tokenId - ID of NFT on auction.
    function getAuction(address _contract, uint256 _tokenId)
    external
    view
    returns
    (
        address seller,
        uint256 startingPrice,
        uint256 endingPrice,
        uint256 duration,
        uint256 startedAt,
        uint256 currentPrice
    ) {
        Auction storage auction = tokenToAuction[_contract][_tokenId];

        if (!_isOnAuction(auction)) {
            return (0x0, 0, 0, 0, 0, 0);
        }

        return (
        auction.seller,
        auction.startingPrice,
        auction.endingPrice,
        auction.duration,
        auction.startedAt,
        getCurrentPrice(_contract, _tokenId)
        );
    }

    /// @dev Returns the current price of an auction.
    /// @param _tokenId - ID of the token price we are checking.
    function getCurrentPrice(address _contract, uint256 _tokenId)
    public
    view
    returns (uint256)
    {
        Auction storage auction = tokenToAuction[_contract][_tokenId];
        require(_isOnAuction(auction));
        return _currentPrice(auction);
    }

}



contract AccessControl is Ownable {
    // This facet controls access control for CryptoKitties. There are four roles managed here:
    //
    //     - The CEO: The CEO can reassign other roles and change the addresses of our dependent smart
    //         contracts. It is also the only role that can unpause the smart contract. It is initially
    //         set to the address that created the smart contract in the KittyCore constructor.
    //
    //     - The CFO: The CFO can withdraw funds from KittyCore and its auction contracts.
    //
    //     - The COO: The COO can release gen0 kitties to auction, and mint promo cats.
    //
    // It should be noted that these roles are distinct without overlap in their access abilities, the
    // abilities listed for each role above are exhaustive. In particular, while the CEO can assign any
    // address to any role, the CEO address itself doesn't have the ability to act in those roles. This
    // restriction is intentional so that we aren't tempted to use the CEO address frequently out of
    // convenience. The less we use an address, the less likely it is that we somehow compromise the
    // account.

    // The addresses of the accounts (or contracts) that can execute actions within each roles.
    address public ceoAddress;
    address public cfoAddress;
    address public cooAddress;

    // @dev Keeps track whether the contract is paused. When that is true, most actions are blocked
    bool public paused = false;

    /// @dev Access modifier for CEO-only functionality
    modifier onlyCEO() {
        require(msg.sender == ceoAddress);
        _;
    }

    /// @dev Access modifier for CFO-only functionality
    modifier onlyCFO() {
        require(msg.sender == cfoAddress);
        _;
    }

    /// @dev Access modifier for COO-only functionality
    modifier onlyCOO() {
        require(msg.sender == cooAddress);
        _;
    }

    modifier onlyCLevel() {
        require(
            msg.sender == cooAddress ||
            msg.sender == ceoAddress ||
            msg.sender == cfoAddress
        );
        _;
    }

    constructor() public {
        ceoAddress = owner;
        cfoAddress = owner;
        cooAddress = owner;
    }

    /// @dev Assigns a new address to act as the CEO. Only available to the current CEO.
    /// @param _newCEO The address of the new CEO
    function setCEO(address _newCEO) external onlyCEO {
        require(_newCEO != address(0));

        ceoAddress = _newCEO;
    }

    /// @dev Assigns a new address to act as the CFO. Only available to the current CEO.
    /// @param _newCFO The address of the new CFO
    function setCFO(address _newCFO) external onlyCEO {
        require(_newCFO != address(0));

        cfoAddress = _newCFO;
    }

    /// @dev Assigns a new address to act as the COO. Only available to the current CEO.
    /// @param _newCOO The address of the new COO
    function setCOO(address _newCOO) external onlyCEO {
        require(_newCOO != address(0));

        cooAddress = _newCOO;
    }

    /*** Pausable functionality adapted from OpenZeppelin ***/

    /// @dev Modifier to allow actions only when the contract IS NOT paused
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /// @dev Modifier to allow actions only when the contract IS paused
    modifier whenPaused {
        require(paused);
        _;
    }

    /// @dev Called by any "C-level" role to pause the contract. Used only when
    ///  a bug or exploit is detected and we need to limit damage.
    function pause() external onlyCLevel whenNotPaused {
        paused = true;
    }

    /// @dev Unpauses the smart contract. Can only be called by the CEO, since
    ///  one reason we may pause the contract is when CFO or COO accounts are
    ///  compromised.
    /// @notice This is public rather than external so it can be called by
    ///  derived contracts.
    function unpause() public onlyCEO whenPaused {
        // can't unpause if contract was upgraded
        paused = false;
    }
}

interface ERC165 {
    /// @notice Query if a contract implements an interface
    /// @param interfaceID The interface identifier, as specified in ERC-165
    /// @dev Interface identification is specified in ERC-165. This function
    ///  uses less than 30,000 gas.
    /// @return `true` if the contract implements `interfaceID` and
    ///  `interfaceID` is not 0xffffffff, `false` otherwise
    function supportsInterface(bytes4 interfaceID) external view returns (bool);
}

contract ERC165MappingImplementation is ERC165 {
    /// @dev You must not set element 0xffffffff to true
    mapping(bytes4 => bool) internal supportedInterfaces;

    constructor() internal {
        supportedInterfaces[this.supportsInterface.selector] = true;
    }

    function supportsInterface(bytes4 interfaceID) external view returns (bool) {
        return supportedInterfaces[interfaceID];
    }
}

library SafeMath {

    /**
    * @dev Multiplies two numbers, throws on overflow.
    */
    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        if (a == 0) {
            return 0;
        }
        c = a * b;
        assert(c / a == b);
        return c;
    }

    /**
    * @dev Integer division of two numbers, truncating the quotient.
    */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        // uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return a / b;
    }

    /**
    * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }

    /**
    * @dev Adds two numbers, throws on overflow.
    */
    function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a + b;
        assert(c >= a);
        return c;
    }

    function toString(uint i) internal pure returns (string){
        if (i == 0) return "0";
        uint j = i;
        uint length;
        while (j != 0){
            length++;
            j /= 10;
        }
        bytes memory bstr = new bytes(length);
        uint k = length - 1;
        while (i != 0){
            bstr[k--] = byte(48 + i % 10);
            i /= 10;
        }
        return string(bstr);
    }

}

library AddressUtils {

    /**
     * Returns whether the target address is a contract
     * @dev This function will return false if invoked during the constructor of a contract,
     *  as the code is not actually created until after the constructor finishes.
     * @param addr address to check
     * @return whether the target address is a contract
     */
    function isContract(address addr) internal view returns (bool) {
        uint256 size;
        // XXX Currently there is no better way to check if there is a contract in an address
        // than to check the size of the code at that address.
        // See https://ethereum.stackexchange.com/a/14016/36603
        // for more details about how this works.
        // TODO Check this again before the Serenity release, because all addresses will be
        // contracts then.
        assembly { size := extcodesize(addr) }  // solium-disable-line security/no-inline-assembly
        return size > 0;
    }

}

contract ERC721Receiver {
    /**
     * @dev Magic value to be returned upon successful reception of an NFT
     *  Equals to `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`,
     *  which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
     */
    bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;

    /**
     * @notice Handle the receipt of an NFT
     * @dev The ERC721 smart contract calls this function on the recipient
     *  after a `safetransfer`. This function MAY throw to revert and reject the
     *  transfer. This function MUST use 50,000 gas or less. Return of other
     *  than the magic value MUST result in the transaction being reverted.
     *  Note: the contract address is always the message sender.
     * @param _from The sending address
     * @param _tokenId The NFT identifier which is being transfered
     * @param _data Additional data with no specified format
     * @return `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`
     */
    function onERC721Received(address _from, uint256 _tokenId, bytes _data) public returns(bytes4);
}

contract ERC721BasicToken is ERC721Basic, ERC165MappingImplementation {
    using SafeMath for uint256;
    using AddressUtils for address;

    // Equals to `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`
    // which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
    bytes4 constant ERC721_RECEIVED = 0xf0b9e5ba;

    // Mapping from token ID to owner
    mapping(uint256 => address) internal tokenOwner;

    // Mapping from token ID to approved address
    mapping(uint256 => address) internal tokenApprovals;

    // Mapping from owner to number of owned token
    mapping(address => uint256) internal ownedTokensCount;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) internal operatorApprovals;

    /**
     * @dev Guarantees msg.sender is owner of the given token
     * @param _tokenId uint256 ID of the token to validate its ownership belongs to msg.sender
     */
    modifier onlyOwnerOf(uint256 _tokenId) {
        require(ownerOf(_tokenId) == msg.sender);
        _;
    }

    constructor() public {
        supportedInterfaces[0x80ac58cd] = true;
    }

    /**
     * @dev Checks msg.sender can transfer a token, by being owner, approved, or operator
     * @param _tokenId uint256 ID of the token to validate
     */
    modifier canTransfer(uint256 _tokenId) {
        require(isApprovedOrOwner(msg.sender, _tokenId));
        _;
    }

    /**
     * @dev Gets the balance of the specified address
     * @param _owner address to query the balance of
     * @return uint256 representing the amount owned by the passed address
     */
    function balanceOf(address _owner) public view returns (uint256) {
        require(_owner != address(0));
        return ownedTokensCount[_owner];
    }

    /**
     * @dev Gets the owner of the specified token ID
     * @param _tokenId uint256 ID of the token to query the owner of
     * @return owner address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 _tokenId) public view returns (address) {
        address owner = tokenOwner[_tokenId];
        require(owner != address(0));
        return owner;
    }

    /**
     * @dev Returns whether the specified token exists
     * @param _tokenId uint256 ID of the token to query the existence of
     * @return whether the token exists
     */
    function exists(uint256 _tokenId) public view returns (bool) {
        address owner = tokenOwner[_tokenId];
        return owner != address(0);
    }

    /**
     * @dev Approves another address to transfer the given token ID
     * @dev The zero address indicates there is no approved address.
     * @dev There can only be one approved address per token at a given time.
     * @dev Can only be called by the token owner or an approved operator.
     * @param _to address to be approved for the given token ID
     * @param _tokenId uint256 ID of the token to be approved
     */
    function approve(address _to, uint256 _tokenId) public {
        address owner = ownerOf(_tokenId);
        require(_to != owner);
        require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

        if (getApproved(_tokenId) != address(0) || _to != address(0)) {
            tokenApprovals[_tokenId] = _to;
            emit Approval(owner, _to, _tokenId);
        }
    }

    /**
     * @dev Gets the approved address for a token ID, or zero if no address set
     * @param _tokenId uint256 ID of the token to query the approval of
     * @return address currently approved for the given token ID
     */
    function getApproved(uint256 _tokenId) public view returns (address) {
        return tokenApprovals[_tokenId];
    }

    /**
     * @dev Sets or unsets the approval of a given operator
     * @dev An operator is allowed to transfer all tokens of the sender on their behalf
     * @param _to operator address to set the approval
     * @param _approved representing the status of the approval to be set
     */
    function setApprovalForAll(address _to, bool _approved) public {
        require(_to != msg.sender);
        operatorApprovals[msg.sender][_to] = _approved;
        emit ApprovalForAll(msg.sender, _to, _approved);
    }

    /**
     * @dev Tells whether an operator is approved by a given owner
     * @param _owner owner address which you want to query the approval of
     * @param _operator operator address which you want to query the approval of
     * @return bool whether the given operator is approved by the given owner
     */
    function isApprovedForAll(address _owner, address _operator) public view returns (bool) {
        return operatorApprovals[_owner][_operator];
    }

    /**
     * @dev Transfers the ownership of a given token ID to another address
     * @dev Usage of this method is discouraged, use `safeTransferFrom` whenever possible
     * @dev Requires the msg sender to be the owner, approved, or operator
     * @param _from current owner of the token
     * @param _to address to receive the ownership of the given token ID
     * @param _tokenId uint256 ID of the token to be transferred
    */
    function transferFrom(address _from, address _to, uint256 _tokenId) public canTransfer(_tokenId) {
        require(_from != address(0));
        require(_to != address(0));

        clearApproval(_from, _tokenId);
        removeTokenFrom(_from, _tokenId);
        addTokenTo(_to, _tokenId);

        emit Transfer(_from, _to, _tokenId);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * @dev If the target address is a contract, it must implement `onERC721Received`,
     *  which is called upon a safe transfer, and return the magic value
     *  `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`; otherwise,
     *  the transfer is reverted.
     * @dev Requires the msg sender to be the owner, approved, or operator
     * @param _from current owner of the token
     * @param _to address to receive the ownership of the given token ID
     * @param _tokenId uint256 ID of the token to be transferred
    */
    function safeTransferFrom(
        address _from,
        address _to,
        uint256 _tokenId
    )
    public
    canTransfer(_tokenId)
    {
        // solium-disable-next-line arg-overflow
        safeTransferFrom(_from, _to, _tokenId, "");
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * @dev If the target address is a contract, it must implement `onERC721Received`,
     *  which is called upon a safe transfer, and return the magic value
     *  `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`; otherwise,
     *  the transfer is reverted.
     * @dev Requires the msg sender to be the owner, approved, or operator
     * @param _from current owner of the token
     * @param _to address to receive the ownership of the given token ID
     * @param _tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function safeTransferFrom(
        address _from,
        address _to,
        uint256 _tokenId,
        bytes _data
    )
    public
    canTransfer(_tokenId)
    {
        transferFrom(_from, _to, _tokenId);
        // solium-disable-next-line arg-overflow
        require(checkAndCallSafeTransfer(_from, _to, _tokenId, _data));
    }

    /**
     * @dev Returns whether the given spender can transfer a given token ID
     * @param _spender address of the spender to query
     * @param _tokenId uint256 ID of the token to be transferred
     * @return bool whether the msg.sender is approved for the given token ID,
     *  is an operator of the owner, or is the owner of the token
     */
    function isApprovedOrOwner(address _spender, uint256 _tokenId) internal view returns (bool) {
        address owner = ownerOf(_tokenId);
        return _spender == owner || getApproved(_tokenId) == _spender || isApprovedForAll(owner, _spender);
    }

    /**
     * @dev Internal function to mint a new token
     * @dev Reverts if the given token ID already exists
     * @param _to The address that will own the minted token
     * @param _tokenId uint256 ID of the token to be minted by the msg.sender
     */
    function _mint(address _to, uint256 _tokenId) internal {
        require(_to != address(0));
        addTokenTo(_to, _tokenId);
        emit Transfer(address(0), _to, _tokenId);
    }

    /**
     * @dev Internal function to clear current approval of a given token ID
     * @dev Reverts if the given address is not indeed the owner of the token
     * @param _owner owner of the token
     * @param _tokenId uint256 ID of the token to be transferred
     */
    function clearApproval(address _owner, uint256 _tokenId) internal {
        require(ownerOf(_tokenId) == _owner);
        if (tokenApprovals[_tokenId] != address(0)) {
            tokenApprovals[_tokenId] = address(0);
            emit Approval(_owner, address(0), _tokenId);
        }
    }

    /**
     * @dev Internal function to add a token ID to the list of a given address
     * @param _to address representing the new owner of the given token ID
     * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function addTokenTo(address _to, uint256 _tokenId) internal {
        require(tokenOwner[_tokenId] == address(0));
        tokenOwner[_tokenId] = _to;
        ownedTokensCount[_to] = ownedTokensCount[_to].add(1);
    }

    /**
     * @dev Internal function to remove a token ID from the list of a given address
     * @param _from address representing the previous owner of the given token ID
     * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function removeTokenFrom(address _from, uint256 _tokenId) internal {
        require(ownerOf(_tokenId) == _from);
        ownedTokensCount[_from] = ownedTokensCount[_from].sub(1);
        tokenOwner[_tokenId] = address(0);
    }

    /**
     * @dev Internal function to invoke `onERC721Received` on a target address
     * @dev 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 whether the call correctly returned the expected magic value
     */
    function checkAndCallSafeTransfer(
        address _from,
        address _to,
        uint256 _tokenId,
        bytes _data
    )
    internal
    returns (bool)
    {
        if (!_to.isContract()) {
            return true;
        }
        bytes4 retval = ERC721Receiver(_to).onERC721Received(_from, _tokenId, _data);
        return (retval == ERC721_RECEIVED);
    }
}

contract ERC721Token is ERC721, ERC721BasicToken {

    // Token name
    string internal name_;

    // Token symbol
    string internal symbol_;

    // Mapping from owner to list of owned token IDs
    mapping(address => uint256[]) internal ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) internal ownedTokensIndex;

    /**
     * @dev Constructor function
     */
    constructor(string _name, string _symbol) public {
        supportedInterfaces[0x5b5e139f] = true; // ERC721Metadata
        supportedInterfaces[0x780e9d63] = true; // ERC721Enumerable

        name_ = _name;
        symbol_ = _symbol;
    }

    /**
     * @dev Gets the token name
     * @return string representing the token name
     */
    function name() public view returns (string) {
        return name_;
    }

    /**
     * @dev Gets the token symbol
     * @return string representing the token symbol
     */
    function symbol() public view returns (string) {
        return symbol_;
    }

    /**
     * @dev Returns an URI for a given token ID
     * @dev Throws if the token ID does not exist. May return an empty string.
     * @param _tokenId uint256 ID of the token to query
     */
    function tokenURI(uint256 _tokenId) public view returns (string);

    /**
     * @dev Gets the token ID at a given index of the tokens list of the requested owner
     * @param _owner address owning the tokens list to be accessed
     * @param _index uint256 representing the index to be accessed of the requested tokens list
     * @return uint256 token ID at the given index of the tokens list owned by the requested address
     */
    function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) {
        require(_index < balanceOf(_owner));
        return ownedTokens[_owner][_index];
    }

    /**
     * @dev Gets the total amount of tokens stored by the contract
     * @return uint256 representing the total amount of tokens
     */
    function totalSupply() public view returns (uint256);

    /**
     * @dev Gets the token ID at a given index of all the tokens in this contract
     * @dev Reverts if the index is greater or equal to the total number of tokens
     * @param _index uint256 representing the index to be accessed of the tokens list
     * @return uint256 token ID at the given index of the tokens list
     */
    function tokenByIndex(uint256 _index) public view returns (uint256) {
        require(_index < totalSupply());

        //In our case id is an index and vice versa.
        return _index;
    }

    /**
     * @dev Internal function to add a token ID to the list of a given address
     * @param _to address representing the new owner of the given token ID
     * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function addTokenTo(address _to, uint256 _tokenId) internal {
        super.addTokenTo(_to, _tokenId);
        uint256 length = ownedTokens[_to].length;
        ownedTokens[_to].push(_tokenId);
        ownedTokensIndex[_tokenId] = length;
    }

    /**
     * @dev Internal function to remove a token ID from the list of a given address
     * @param _from address representing the previous owner of the given token ID
     * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function removeTokenFrom(address _from, uint256 _tokenId) internal {
        super.removeTokenFrom(_from, _tokenId);

        uint256 tokenIndex = ownedTokensIndex[_tokenId];
        uint256 lastTokenIndex = ownedTokens[_from].length.sub(1);
        uint256 lastToken = ownedTokens[_from][lastTokenIndex];

        ownedTokens[_from][tokenIndex] = lastToken;
        ownedTokens[_from][lastTokenIndex] = 0;
        // Note that this will handle single-element arrays. In that case, both tokenIndex and lastTokenIndex are going to
        // be zero. Then we can make sure that we will remove _tokenId from the ownedTokens list since we are first swapping
        // the lastToken to the first position, and then dropping the element placed in the last position of the list

        ownedTokens[_from].length--;
        ownedTokensIndex[_tokenId] = 0;
        ownedTokensIndex[lastToken] = tokenIndex;
    }

}

library StringUtils {

    struct slice {
        uint _len;
        uint _ptr;
    }

    /*
     * @dev Returns a slice containing the entire string.
     * @param self The string to make a slice from.
     * @return A newly allocated slice containing the entire string.
     */
    function toSlice(string memory self) internal pure returns (slice memory) {
        uint ptr;
        assembly {
            ptr := add(self, 0x20)
        }
        return slice(bytes(self).length, ptr);
    }

    /*
     * @dev Returns a newly allocated string containing the concatenation of
     *      `self` and `other`.
     * @param self The first slice to concatenate.
     * @param other The second slice to concatenate.
     * @return The concatenation of the two strings.
     */
    function concat(slice memory self, slice memory other) internal pure returns (string memory) {
        string memory ret = new string(self._len + other._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }
        memcpy(retptr, self._ptr, self._len);
        memcpy(retptr + self._len, other._ptr, other._len);
        return ret;
    }

    function memcpy(uint dest, uint src, uint len) private pure {
        // Copy word-length chunks while possible
        for(; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        uint mask = 256 ** (32 - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

}

contract ToonBase is ERC721Token, AccessControl, ToonInterface {

    using StringUtils for *;
    using SafeMath for uint;

    Toon[] private toons;
    uint public maxSupply;
    uint32 public maxPromoToons;
    address public authorAddress;

    string public endpoint = "https://mindhouse.io:3100/metadata/";

    constructor(string _name, string _symbol, uint _maxSupply, uint32 _maxPromoToons, address _author)
    public
    ERC721Token(_name, _symbol) {
        require(_maxPromoToons <= _maxSupply);

        maxSupply = _maxSupply;
        maxPromoToons = _maxPromoToons;
        authorAddress = _author;
    }

    function maxSupply() external view returns (uint) {
        return maxSupply;
    }

    /**
     * @dev Gets the total amount of tokens stored by the contract
     * @return uint256 representing the total amount of tokens
     */
    function totalSupply() public view returns (uint256) {
        return toons.length;
    }

    /**
     * @dev Returns an URI for a given token ID
     * @dev Throws if the token ID does not exist. May return an empty string.
     * @param _tokenId uint256 ID of the token to query
     */
    function tokenURI(uint256 _tokenId) public view returns (string) {
        require(exists(_tokenId));
        string memory slash = "/";
        return endpoint.toSlice().concat(name_.toSlice()).toSlice().concat(slash.toSlice()).toSlice().concat(_tokenId.toString().toSlice());
    }

    function authorAddress() external view returns (address) {
        return authorAddress;
    }

    function changeEndpoint(string newEndpoint) external onlyOwner {
        endpoint = newEndpoint;
    }

    function isToonInterface() external pure returns (bool) {
        return true;
    }

    function _getToon(uint _id) internal view returns (Toon){
        require(_id <= totalSupply());
        return toons[_id];
    }

    function _createToon(uint _genes, address _owner) internal {
        require(totalSupply() < maxSupply);

        Toon memory _toon = Toon(_genes, now);
        uint id = toons.push(_toon) - 1;

        _mint(_owner, id);
    }

    struct Toon {
        uint256 genes;

        uint256 birthTime;
    }
}

library SafeMath32 {


    /**
    * @dev Multiplies two numbers, throws on overflow.
    */
    function mul(uint32 a, uint32 b) internal pure returns (uint32 c) {
        if (a == 0) {
            return 0;
        }
        c = a * b;
        assert(c / a == b);
        return c;
    }

    /**
    * @dev Integer division of two numbers, truncating the quotient.
    */
    function div(uint32 a, uint32 b) internal pure returns (uint32) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        // uint32 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return a / b;
    }

    /**
    * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
    */
    function sub(uint32 a, uint32 b) internal pure returns (uint32) {
        assert(b <= a);
        return a - b;
    }

    /**
    * @dev Adds two numbers, throws on overflow.
    */
    function add(uint32 a, uint32 b) internal pure returns (uint32 c) {
        c = a + b;
        assert(c >= a);
        return c;
    }

}

contract ToonMinting is ToonBase {
    using SafeMath32 for uint32;

    uint32 public promoToonsMinted = 0;

    constructor(string _name, string _symbol, uint _maxSupply, uint32 _maxPromoToons, address _author)
    public
    ToonBase(_name, _symbol, _maxSupply, _maxPromoToons, _author) {
    }

    function createPromoToon(uint _genes, address _owner) external onlyCOO {
        require(promoToonsMinted < maxPromoToons);
        address _toonOwner = _owner;
        if (_toonOwner == 0x0) {
            _toonOwner = cooAddress;
        }

        _createToon(_genes, _toonOwner);
        promoToonsMinted = promoToonsMinted.add(1);
    }

}

contract ToonAuction is ToonMinting {

    ClockAuction public saleAuction;

    constructor(string _name, string _symbol, uint _maxSupply, uint32 _maxPromoToons, address _author)
    public
    ToonMinting(_name, _symbol, _maxSupply, _maxPromoToons, _author) {
    }

    function setSaleAuctionAddress(address _address) external onlyCEO {
        ClockAuction candidateContract = ClockAuction(_address);
        require(candidateContract.isSaleClockAuction());

        // Set the new contract address
        saleAuction = candidateContract;
    }

    function createSaleAuction(
        uint256 _toonId,
        uint256 _startingPrice,
        uint256 _endingPrice,
        uint256 _duration
    )
    external
    whenNotPaused
    {
        // Auction contract checks input sizes
        // If toon is already on any auction, this will throw
        // because it will be owned by the auction contract.
        require(ownerOf(_toonId) == msg.sender);
        approve(saleAuction, _toonId);

        // Sale auction throws if inputs are invalid and clears
        // transfer approval after escrowing the toon.
        saleAuction.createAuction(
            this,
            _toonId,
            _startingPrice,
            _endingPrice,
            _duration,
            msg.sender
        );
    }

}

contract CryptoToon is ToonAuction {

    constructor(string _name, string _symbol, uint _maxSupply, uint32 _maxPromoToons, address _author)
    public
    ToonAuction(_name, _symbol, _maxSupply, _maxPromoToons, _author) {
    }

    function getToonInfo(uint _id) external view returns (
        uint genes,
        uint birthTime,
        address owner
    ) {
        Toon memory _toon = _getToon(_id);
        return (_toon.genes, _toon.birthTime, ownerOf(_id));
    }

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[{"name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"authorAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cfoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ceoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getToonInfo","outputs":[{"name":"genes","type":"uint256"},{"name":"birthTime","type":"uint256"},{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCEO","type":"address"}],"name":"setCEO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCOO","type":"address"}],"name":"setCOO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isToonInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_toonId","type":"uint256"},{"name":"_startingPrice","type":"uint256"},{"name":"_endingPrice","type":"uint256"},{"name":"_duration","type":"uint256"}],"name":"createSaleAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCFO","type":"address"}],"name":"setCFO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"exists","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"endpoint","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setSaleAuctionAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newEndpoint","type":"string"}],"name":"changeEndpoint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_genes","type":"uint256"},{"name":"_owner","type":"address"}],"name":"createPromoToon","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"maxPromoToons","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cooAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"saleAuction","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"promoToonsMinted","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_maxSupply","type":"uint256"},{"name":"_maxPromoToons","type":"uint32"},{"name":"_author","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_approved","type":"address"},{"indexed":false,"name":"_tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_operator","type":"address"},{"indexed":false,"name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"}]

Deployed Bytecode

0x6080604052600436106101d45763ffffffff60e060020a60003504166301ffc9a781146101d957806302a86781146102245780630519ce791461025557806306fdde031461026a578063081812fc146102f4578063095ea7b31461030c5780630a0f81681461033257806318160ddd146103475780631d9070751461036e57806323b872dd146103ad57806327d7874c146103d75780632ba73c15146103f85780632f745c591461041957806335bb5fd21461043d5780633d7d3f5a146104525780633f4ba83a1461047357806342842e0e146104885780634e0a3379146104b25780634f558e79146104d35780634f6ccce7146104eb5780635c975abb146105035780635e280f11146105185780636352211e1461052d5780636fbde40d1461054557806370a08231146105665780637d01a517146105875780638456cb59146105a75780638da5cb5b146105bc57806395d89b41146105d1578063a22cb465146105e6578063a27771a61461060c578063ab90f85514610630578063b047fb501461065e578063b88d4fde14610673578063c87b56dd146106e2578063d5abeb01146106fa578063e6cbe3511461070f578063e985e9c514610724578063f2fde38b1461074b578063f42541be1461076c575b600080fd5b3480156101e557600080fd5b506102107bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1960043516610781565b604080519115158252519081900360200190f35b34801561023057600080fd5b506102396107b5565b60408051600160a060020a039092168252519081900360200190f35b34801561026157600080fd5b506102396107cd565b34801561027657600080fd5b5061027f6107dc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102b95781810151838201526020016102a1565b50505050905090810190601f1680156102e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561030057600080fd5b50610239600435610872565b34801561031857600080fd5b50610330600160a060020a036004351660243561088d565b005b34801561033e57600080fd5b50610239610972565b34801561035357600080fd5b5061035c610981565b60408051918252519081900360200190f35b34801561037a57600080fd5b50610386600435610987565b604080519384526020840192909252600160a060020a031682820152519081900360600190f35b3480156103b957600080fd5b50610330600160a060020a03600435811690602435166044356109c0565b3480156103e357600080fd5b50610330600160a060020a0360043516610a6f565b34801561040457600080fd5b50610330600160a060020a0360043516610abd565b34801561042557600080fd5b5061035c600160a060020a0360043516602435610b0b565b34801561044957600080fd5b50610210610b58565b34801561045e57600080fd5b50610330600435602435604435606435610b5d565b34801561047f57600080fd5b50610330610c5b565b34801561049457600080fd5b50610330600160a060020a0360043581169060243516604435610caa565b3480156104be57600080fd5b50610330600160a060020a0360043516610ce2565b3480156104df57600080fd5b50610210600435610d30565b3480156104f757600080fd5b5061035c600435610d4d565b34801561050f57600080fd5b50610210610d66565b34801561052457600080fd5b5061027f610d76565b34801561053957600080fd5b50610239600435610e04565b34801561055157600080fd5b50610330600160a060020a0360043516610e2e565b34801561057257600080fd5b5061035c600160a060020a0360043516610efc565b34801561059357600080fd5b506103306004803560248101910135610f2f565b3480156105b357600080fd5b50610330610f52565b3480156105c857600080fd5b50610239610fd2565b3480156105dd57600080fd5b5061027f610fe1565b3480156105f257600080fd5b50610330600160a060020a03600435166024351515611042565b34801561061857600080fd5b50610330600435600160a060020a03602435166110c6565b34801561063c57600080fd5b5061064561115c565b6040805163ffffffff9092168252519081900360200190f35b34801561066a57600080fd5b50610239611168565b34801561067f57600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261033094600160a060020a0381358116956024803590921695604435953695608494019181908401838280828437509497506111779650505050505050565b3480156106ee57600080fd5b5061027f6004356111b6565b34801561070657600080fd5b5061035c611335565b34801561071b57600080fd5b5061023961133b565b34801561073057600080fd5b50610210600160a060020a0360043581169060243516611352565b34801561075757600080fd5b50610330600160a060020a0360043516611380565b34801561077857600080fd5b50610645611408565b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191660009081526020819052604090205460ff1690565b600f546401000000009004600160a060020a03165b90565b600b54600160a060020a031681565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108685780601f1061083d57610100808354040283529160200191610868565b820191906000526020600020905b81548152906001019060200180831161084b57829003601f168201915b5050505050905090565b600090815260026020526040902054600160a060020a031690565b600061089882610e04565b9050600160a060020a0383811690821614156108b357600080fd5b33600160a060020a03821614806108cf57506108cf8133611352565b15156108da57600080fd5b60006108e583610872565b600160a060020a03161415806109035750600160a060020a03831615155b1561096d576000828152600260209081526040918290208054600160a060020a031916600160a060020a03878116918217909255835186815293519093918516927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35b505050565b600a54600160a060020a031681565b600d5490565b6000806000610994611cbd565b61099d85611414565b9050806000015181602001516109b287610e04565b935093509350509193909250565b806109cb3382611472565b15156109d657600080fd5b600160a060020a03841615156109eb57600080fd5b600160a060020a0383161515610a0057600080fd5b610a0a84836114d1565b610a148483611572565b610a1e83836116ab565b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600a54600160a060020a03163314610a8657600080fd5b600160a060020a0381161515610a9b57600080fd5b600a8054600160a060020a031916600160a060020a0392909216919091179055565b600a54600160a060020a03163314610ad457600080fd5b600160a060020a0381161515610ae957600080fd5b600c8054600160a060020a031916600160a060020a0392909216919091179055565b6000610b1683610efc565b8210610b2157600080fd5b600160a060020a0383166000908152600760205260409020805483908110610b4557fe5b9060005260206000200154905092915050565b600190565b600c5460a060020a900460ff1615610b7457600080fd5b33610b7e85610e04565b600160a060020a031614610b9157600080fd5b601154610baf906401000000009004600160a060020a03168561088d565b601154604080517fe6effbe9000000000000000000000000000000000000000000000000000000008152306004820152602481018790526044810186905260648101859052608481018490523360a48201529051640100000000909204600160a060020a03169163e6effbe99160c48082019260009290919082900301818387803b158015610c3d57600080fd5b505af1158015610c51573d6000803e3d6000fd5b5050505050505050565b600a54600160a060020a03163314610c7257600080fd5b600c5460a060020a900460ff161515610c8a57600080fd5b600c805474ff000000000000000000000000000000000000000019169055565b80610cb53382611472565b1515610cc057600080fd5b610cdc8484846020604051908101604052806000815250611177565b50505050565b600a54600160a060020a03163314610cf957600080fd5b600160a060020a0381161515610d0e57600080fd5b600b8054600160a060020a031916600160a060020a0392909216919091179055565b600090815260016020526040902054600160a060020a0316151590565b6000610d57610981565b8210610d6257600080fd5b5090565b600c5460a060020a900460ff1681565b6010805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610dfc5780601f10610dd157610100808354040283529160200191610dfc565b820191906000526020600020905b815481529060010190602001808311610ddf57829003601f168201915b505050505081565b600081815260016020526040812054600160a060020a0316801515610e2857600080fd5b92915050565b600a54600090600160a060020a03163314610e4857600080fd5b81905080600160a060020a03166385b861886040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015610e8957600080fd5b505af1158015610e9d573d6000803e3d6000fd5b505050506040513d6020811015610eb357600080fd5b50511515610ec057600080fd5b60118054600160a060020a039092166401000000000277ffffffffffffffffffffffffffffffffffffffff000000001990921691909117905550565b6000600160a060020a0382161515610f1357600080fd5b50600160a060020a031660009081526003602052604090205490565b600954600160a060020a03163314610f4657600080fd5b61096d60108383611cd4565b600c54600160a060020a0316331480610f755750600a54600160a060020a031633145b80610f8a5750600b54600160a060020a031633145b1515610f9557600080fd5b600c5460a060020a900460ff1615610fac57600080fd5b600c805474ff0000000000000000000000000000000000000000191660a060020a179055565b600954600160a060020a031681565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156108685780601f1061083d57610100808354040283529160200191610868565b600160a060020a03821633141561105857600080fd5b336000818152600460209081526040808320600160a060020a03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b600c54600090600160a060020a031633146110e057600080fd5b600f5460115463ffffffff9182169116106110fa57600080fd5b5080600160a060020a038116151561111a5750600c54600160a060020a03165b61112483826116f4565b60115461113d9063ffffffff9081169060019061179b16565b6011805463ffffffff191663ffffffff92909216919091179055505050565b600f5463ffffffff1681565b600c54600160a060020a031681565b816111823382611472565b151561118d57600080fd5b6111988585856109c0565b6111a4858585856117b1565b15156111af57600080fd5b5050505050565b6060806111c283610d30565b15156111cd57600080fd5b5060408051808201909152600181527f2f00000000000000000000000000000000000000000000000000000000000000602082015261132e6112166112118561191e565b611a45565b61132261121161122585611a45565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815261132293611211936112c0938301828280156112b65780601f1061128b576101008083540402835291602001916112b6565b820191906000526020600020905b81548152906001019060200180831161129957829003601f168201915b5050505050611a45565b60108054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815261132293909290918301828280156112b65780601f1061128b576101008083540402835291602001916112b6565b9063ffffffff611a6b16565b9392505050565b600e5490565b6011546401000000009004600160a060020a031681565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205460ff1690565b600954600160a060020a0316331461139757600080fd5b600160a060020a03811615156113ac57600080fd5b600954604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360098054600160a060020a031916600160a060020a0392909216919091179055565b60115463ffffffff1681565b61141c611cbd565b611424610981565b82111561143057600080fd5b600d80548390811061143e57fe5b9060005260206000209060020201604080519081016040529081600082015481526020016001820154815250509050919050565b60008061147e83610e04565b905080600160a060020a031684600160a060020a031614806114b9575083600160a060020a03166114ae84610872565b600160a060020a0316145b806114c957506114c98185611352565b949350505050565b81600160a060020a03166114e482610e04565b600160a060020a0316146114f757600080fd5b600081815260026020526040902054600160a060020a03161561156e5760008181526002602090815260408083208054600160a060020a031916905580518481529051600160a060020a038616927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35b5050565b60008060006115818585611ae2565b600084815260086020908152604080832054600160a060020a03891684526007909252909120549093506115bc90600163ffffffff611b6b16565b600160a060020a0386166000908152600760205260409020805491935090839081106115e457fe5b90600052602060002001549050806007600087600160a060020a0316600160a060020a031681526020019081526020016000208481548110151561162457fe5b6000918252602080832090910192909255600160a060020a038716815260079091526040812080548490811061165657fe5b6000918252602080832090910192909255600160a060020a038716815260079091526040902080549061168d906000198301611d4e565b50600093845260086020526040808520859055908452909220555050565b60006116b78383611b7d565b50600160a060020a039091166000908152600760209081526040808320805460018101825590845282842081018590559383526008909152902055565b6116fc611cbd565b6000600e54611709610981565b1061171357600080fd5b5050604080518082019091528281524260208201908152600d80546001810182556000919091528251600282027fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb581019190915591517fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb690920191909155610cdc8382611c00565b81810163ffffffff8084169082161015610e2857fe5b6000806117c685600160a060020a0316611c64565b15156117d55760019150611915565b84600160a060020a031663f0b9e5ba8786866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561185457818101518382015260200161183c565b50505050905090810190601f1680156118815780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1580156118a257600080fd5b505af11580156118b6573d6000803e3d6000fd5b505050506040513d60208110156118cc57600080fd5b50517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1981167ff0b9e5ba0000000000000000000000000000000000000000000000000000000014925090505b50949350505050565b606060008082818515156119675760408051808201909152600181527f300000000000000000000000000000000000000000000000000000000000000060208201529450611a3c565b8593505b831561198257600190920191600a8404935061196b565b826040519080825280601f01601f1916602001820160405280156119b0578160200160208202803883390190505b5091505060001982015b8515611a385781516000198201917f01000000000000000000000000000000000000000000000000000000000000006030600a8a0601029184919081106119fd57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a860495506119ba565b8194505b50505050919050565b611a4d611cbd565b50604080518082019091528151815260209182019181019190915290565b606080600083600001518560000151016040519080825280601f01601f191660200182016040528015611aa8578160200160208202803883390190505b509150602082019050611ac48186602001518760000151611c6c565b845160208501518551611ada9284019190611c6c565b509392505050565b81600160a060020a0316611af582610e04565b600160a060020a031614611b0857600080fd5b600160a060020a038216600090815260036020526040902054611b3290600163ffffffff611b6b16565b600160a060020a039092166000908152600360209081526040808320949094559181526001909152208054600160a060020a0319169055565b600082821115611b7757fe5b50900390565b600081815260016020526040902054600160a060020a031615611b9f57600080fd5b60008181526001602081815260408084208054600160a060020a031916600160a060020a0388169081179091558452600390915290912054611be091611cb0565b600160a060020a0390921660009081526003602052604090209190915550565b600160a060020a0382161515611c1557600080fd5b611c1f82826116ab565b604080518281529051600160a060020a038416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000903b1190565b60005b60208210611c91578251845260209384019390920191601f1990910190611c6f565b50905182516020929092036101000a6000190180199091169116179052565b81810182811015610e2857fe5b604080518082019091526000808252602082015290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611d155782800160ff19823516178555611d42565b82800160010185558215611d42579182015b82811115611d42578235825591602001919060010190611d27565b50610d62929150611d6e565b81548183558181111561096d5760008381526020902061096d9181019083015b6107ca91905b80821115610d625760008155600101611d745600a165627a7a723058208246bb84ec0d1a749ed819ca32d1477785a69128e574de50a5ded6b34daf257d0029

Swarm Source

bzzr://8246bb84ec0d1a749ed819ca32d1477785a69128e574de50a5ded6b34daf257d

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

OVERVIEW

The characters of CryptoToons are designed by combining different shapes, colors, and layers to create a toon. Through combining different layers with each other there are billions of possible toons combinations and they all have their own DNA.

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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