Contract 0x20c81Ae5A7cF1C5a3F8293313692474f8d6b808b

 

Contract Overview

BC: Breeding Market
Balance:
0.085011350213029245 Ether

EtherValue:
$170.18 (@ $2,001.90/ETH)

Token:
Txn Hash Method
Block
From
To
Value
0x977236aac9148fdb26fb74e97687ba28fc60cf0b1ef5c2bf0c434e7a91bff4b4Cancel Active Au...123048372021-04-24 19:31:3059 days 15 hrs ago0xe5d972785481b0bbd66ecc7037be632fbf052d22 IN  BC: Breeding Market0 Ether0.00189240651
0x5cdf77f610713c9da7a75d8dcccf3f91028e6e3d96f006e7389966a60845cbffCancel Active Au...121971382021-04-08 4:54:5176 days 5 hrs ago0xe424b6d9cc3f6a8c3c7c191d886cca932d3f9b02 IN  BC: Breeding Market0 Ether0.00334024691
0x708dd37fa0cf1363c26519f86dd8fcf051045c644f234db141f9996e0ec28999Cancel Active Au...121130712021-03-26 6:41:5489 days 3 hrs ago0xe5d972785481b0bbd66ecc7037be632fbf052d22 IN  BC: Breeding Market0 Ether0.004551544124
0xb273623acfceae4fbc9532e869354de148f99d8f16dd7a07576895181179feacCancel Active Au...120498192021-03-16 13:12:2698 days 21 hrs ago0xe424b6d9cc3f6a8c3c7c191d886cca932d3f9b02 IN  BC: Breeding Market0 Ether0.00306045135
0xfeda767155cfd53bf12e06e10dd69b4546d5b5638bf9a8e79491cae1cdf5b727Cancel Active Au...120498132021-03-16 13:11:1498 days 21 hrs ago0xe424b6d9cc3f6a8c3c7c191d886cca932d3f9b02 IN  BC: Breeding Market0 Ether0.00306045135
0x32d44f3686d2c76217fd3d48f55d3a96b78b06a6d5c257e77d043a45f6ee6b49Cancel Active Au...120498132021-03-16 13:11:1498 days 21 hrs ago0xe424b6d9cc3f6a8c3c7c191d886cca932d3f9b02 IN  BC: Breeding Market0 Ether0.00495531135
0xd342b96b5deb20be3aa04819e80d0c22f39ab0b060ac6ff591f8cff20a081f73Cancel Active Au...120034182021-03-09 9:09:12106 days 1 hr ago0xd699d40ebce34768f8ce35d9d60c68d7cb431ee2 IN  BC: Breeding Market0 Ether0.00458825125
0x01a4ff43fb79be4a7510958801a5cd61c3165c9da0d04cfd0955643073e45b60Cancel Active Au...119929742021-03-07 18:34:48107 days 16 hrs ago0xd699d40ebce34768f8ce35d9d60c68d7cb431ee2 IN  BC: Breeding Market0 Ether0.0073412200
0x2cab5ed7c0d52aeeae9acdc478038858c17df64c381242f8834d19d8434583afCancel Active Au...119915642021-03-07 13:10:31107 days 21 hrs ago0xe4c1e7713f6169999aa869bc6695c2dbc1a928c1 IN  BC: Breeding Market0 Ether0.0025694270
0xb575a66d7423fe48ab8ec0a6da241afbee55f93d97a746c98c88bd833254c32dCancel Active Au...119833252021-03-06 6:56:11109 days 3 hrs ago0xe4c1e7713f6169999aa869bc6695c2dbc1a928c1 IN  BC: Breeding Market0 Ether0.00271624474
0xe21ad7d22149ffa9f700259bf3260aee3f9f499dc756f6e20ae3971165f0eac5Transfer118616702021-02-15 13:45:21127 days 20 hrs ago0x28f02c5d47616362bcce2b7629ad0ccb26582be4 IN  BC: Breeding Market0.0001 Ether0.00229543103109.000001459
0x374ed70e2549435f2b4d1b1e0fddb08f15a8f71bab7a940853386d8adffb7688Cancel Active Au...117064952021-01-22 16:55:30151 days 17 hrs ago0xa76d210f87868d552d9a10bd068cc8995aa7d3e1 IN  BC: Breeding Market0 Ether0.005248958143
0xc4a90f70e7d4302f1f631aa445c4954fd1284a46d25c486b00d2a516cb1a1f20Cancel Active Au...116614112021-01-15 18:36:14158 days 16 hrs ago0x3e0590bf02762888431eb19767333029d0f240d2 IN  BC: Breeding Market0 Ether0.0025694270
0x8bea7abdfe0d08e01a61ae957d9ff3237e019f615cace4364450d84d32951655Cancel Active Au...116586662021-01-15 8:41:54159 days 1 hr ago0x3e0590bf02762888431eb19767333029d0f240d2 IN  BC: Breeding Market0 Ether0.0009521442
0x804cee83bf6dacef0c95bf51e2037b66a2d934adeb0bc3f19234560680f81293Cancel Active Au...116586662021-01-15 8:41:54159 days 1 hr ago0x3e0590bf02762888431eb19767333029d0f240d2 IN  BC: Breeding Market0 Ether0.00154165242
0x990f99875c8a2c0c260af54ae627b21eee703f6ba1986ebbe4f5bfdd2f49e82bCancel Active Au...116586662021-01-15 8:41:54159 days 1 hr ago0x3e0590bf02762888431eb19767333029d0f240d2 IN  BC: Breeding Market0 Ether0.00154165242
0x581c1c45b64446b7f87645604bbcac83bf1133cfe61998896b555763f8eea9b0Cancel Active Au...113423142020-11-27 19:07:44207 days 15 hrs ago0xe70914f960510035bcf173b03463c7b012d30684 IN  BC: Breeding Market0 Ether0.00095435626
0xae29b8f5fb9f67ad6f53b1d29e310576ee016c16025549493fa92af38f86bd46Cancel Active Au...112619922020-11-15 10:53:07219 days 23 hrs ago0x8d1a767dbafbd423b400bd0e7c05722ec47406c7 IN  BC: Breeding Market0 Ether0.00051371614
0x006f94403b3c93a20987cc0edb5a77fe8656941978bb3f4541d59fd1c78fbeb5Cancel Active Au...111876412020-11-04 1:11:58231 days 9 hrs ago0x1bc1181842f188e1dda52e2477ca040522bcb49b IN  BC: Breeding Market0 Ether0.0009176525
0x9539cf6fe31bf6639a3b18763771440927fa7ed2d66d549d393aeabebdf90a4bCancel Active Au...111709262020-11-01 11:31:30233 days 23 hrs ago0x8edac8633cd4f1cf4d8c92523229202a6d9c383e IN  BC: Breeding Market0 Ether0.00069741419
0x6770d3b78e47e14527e1c60cf263bcc7013bdbeb4d8e6b63636a85f5dc8aa1a2Cancel Active Au...109723672020-10-01 20:33:20264 days 14 hrs ago0x2fbd6fa44c51a5af5a557fe9ba32e4763dd8a7bd IN  BC: Breeding Market0 Ether0.00223833461
0xda9362f836079edb6e6275850467359ef50987539f112f51210d874ae01ba267Cancel Active Au...108156732020-09-07 16:42:19288 days 17 hrs ago0x816dce6ec0bbcb84eeb73fe8931e39594265775d IN  BC: Breeding Market0 Ether0.0029471130
0x0f22b89e200105c269886ce8e6cfc190383f996330aa64ccbb4b40ac027164d6Cancel Active Au...108156732020-09-07 16:42:19288 days 17 hrs ago0x816dce6ec0bbcb84eeb73fe8931e39594265775d IN  BC: Breeding Market0 Ether0.004000954109
0x7d68a42e821af14b1e1b2763089b3448828ac88dbb81be205d2fe90f366db38bCancel Active Au...106529882020-08-13 17:35:21313 days 17 hrs ago0x20363ff31b40467b4b246e22027d2f8bb28d428c IN  BC: Breeding Market0 Ether0.004845192132
0x88d454d9a873c5d510c24e47de3975dc60aa910ce44147edee4326226a54aaafCancel Active Au...105952832020-08-04 19:50:22322 days 14 hrs ago0xa7b7bf2c3ab430363d15af83075e873dd4345569 IN  BC: Breeding Market0 Ether0.0012842935
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x602bcefb4ee69c347ea93dd38f21d8d6cb145a658fee207018be3dd86091591f111882662020-11-04 3:32:04231 days 7 hrs ago BC: Breeding Market0x6452abb82c78b59e89c41882e3815ec02a093bb30.00288 Ether
0x602bcefb4ee69c347ea93dd38f21d8d6cb145a658fee207018be3dd86091591f111882662020-11-04 3:32:04231 days 7 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.003 Ether
0xa73cc7d66bea951a5d8539a44a77b5af126acb0b3a34e0f11ca8c3cfc424eaa3111881432020-11-04 3:04:42231 days 7 hrs ago BC: Breeding Market0xdefa8427d56478ac5328710db468e21bd12a68bc0.0096 Ether
0xa73cc7d66bea951a5d8539a44a77b5af126acb0b3a34e0f11ca8c3cfc424eaa3111881432020-11-04 3:04:42231 days 7 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.01 Ether
0xf3a63c423fa98a93ec84644b70619caee551c2ea49e1c1576def556d3e320c0d111822232020-11-03 5:10:10232 days 5 hrs ago BC: Breeding Market0x2e0ce5513f4b3a48a8a4e30ff69e24714f5cd5fa0.0048 Ether
0xf3a63c423fa98a93ec84644b70619caee551c2ea49e1c1576def556d3e320c0d111822232020-11-03 5:10:10232 days 5 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.005 Ether
0x837f6f1e81a37436918aee2816231a3256df6df143ce12d7729674d6462f7b3d111754542020-11-02 4:26:06233 days 6 hrs ago BC: Breeding Market0x6452abb82c78b59e89c41882e3815ec02a093bb30.00576 Ether
0x837f6f1e81a37436918aee2816231a3256df6df143ce12d7729674d6462f7b3d111754542020-11-02 4:26:06233 days 6 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.006 Ether
0x5ca422ffbe31ed4e036e6c70ef6474755011fb3475f0626d5e72898f6872e8df111737322020-11-01 21:55:00233 days 12 hrs ago BC: Breeding Market0x12af7409b63c2f5734abae5a0d76347fab05c0630.00096 Ether
0x5ca422ffbe31ed4e036e6c70ef6474755011fb3475f0626d5e72898f6872e8df111737322020-11-01 21:55:00233 days 12 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.001 Ether
0xe757d390faefa293bc157f421da13c0104e8b830f0ae00fab6e7f9f51f163af2111731912020-11-01 19:53:16233 days 14 hrs ago BC: Breeding Market0xe92ea2efa6179a0256f00305e6527724cb2c2ed70.00624 Ether
0xe757d390faefa293bc157f421da13c0104e8b830f0ae00fab6e7f9f51f163af2111731912020-11-01 19:53:16233 days 14 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.0065 Ether
0x3551dc504e9cc094a004bbd2f836c60b379cff9c37d950aee38169b21187836b111664012020-10-31 18:51:23234 days 15 hrs ago BC: Breeding Market0x8514301b1dc3099e8d83f10b96b0a317d22f55470.00192 Ether
0x3551dc504e9cc094a004bbd2f836c60b379cff9c37d950aee38169b21187836b111664012020-10-31 18:51:23234 days 15 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.002 Ether
0x1d3dfcae2adfbc58f222ef5d7e73f6a057a1a62ed916528c8711dc78c0f37d23111173282020-10-24 5:59:45242 days 4 hrs ago BC: Breeding Market0x2a1f935f8175f990ccbcdf2b8cd842145425ec570.00192 Ether
0x1d3dfcae2adfbc58f222ef5d7e73f6a057a1a62ed916528c8711dc78c0f37d23111173282020-10-24 5:59:45242 days 4 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.002 Ether
0xd97845ba3e00fd140506934b4e626ef18cacb80c06e166d01d13fb9cd0a19587110561392020-10-14 21:03:40251 days 13 hrs ago BC: Breeding Market0x35a3e6f5d0fce697c3e820bf6011c6187c332fd20.00096 Ether
0xd97845ba3e00fd140506934b4e626ef18cacb80c06e166d01d13fb9cd0a19587110561392020-10-14 21:03:40251 days 13 hrs ago Blockchain Cuties: Old BC Token BC: Breeding Market0.001 Ether
0xd9f24263e31dbbbb39461d1a4ea56de71319b1506fad061ff9aebb0640e5eea9105409672020-07-27 10:13:18331 days 28 mins ago BC: Breeding Market0x12edf4564f54514b3f6b068066ddd4ebce0a9a680.0024 Ether
0xd9f24263e31dbbbb39461d1a4ea56de71319b1506fad061ff9aebb0640e5eea9105409672020-07-27 10:13:18331 days 28 mins ago Blockchain Cuties: Old BC Token BC: Breeding Market0.0025 Ether
0x2c04ce6f0d833f48a9dc56508af92492f24ac2622986ef6cb258d50d02851345105408102020-07-27 9:42:29331 days 59 mins ago BC: Breeding Market0x12edf4564f54514b3f6b068066ddd4ebce0a9a680.00432 Ether
0x2c04ce6f0d833f48a9dc56508af92492f24ac2622986ef6cb258d50d02851345105408102020-07-27 9:42:29331 days 59 mins ago Blockchain Cuties: Old BC Token BC: Breeding Market0.0045 Ether
0xcd962ed9d0d8a8db676ff06cb939ab833110416b3f56d3e9951135d62eeeae04105407742020-07-27 9:35:37331 days 1 hr ago BC: Breeding Market0x17a113bb84b69b29d003c40bec4ab6fcae2989f60.00096 Ether
0xcd962ed9d0d8a8db676ff06cb939ab833110416b3f56d3e9951135d62eeeae04105407742020-07-27 9:35:37331 days 1 hr ago Blockchain Cuties: Old BC Token BC: Breeding Market0.001 Ether
0xdbefb24f7689dc4ca2aeb645a65218f13ede88c4c68624629a80c5aa3ad6ce4f105407152020-07-27 9:22:58331 days 1 hr ago BC: Breeding Market0x2e0ce5513f4b3a48a8a4e30ff69e24714f5cd5fa0.0096 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BreedingMarket

Compiler Version
v0.4.21+commit.dfe3193c

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-04-25
*/

pragma solidity ^0.4.20;

contract CutieCoreInterface
{
    function isCutieCore() pure public returns (bool);

    function transferFrom(address _from, address _to, uint256 _cutieId) external;
    function transfer(address _to, uint256 _cutieId) external;

    function ownerOf(uint256 _cutieId)
        external
        view
        returns (address owner);

    function getCutie(uint40 _id)
        external
        view
        returns (
        uint256 genes,
        uint40 birthTime,
        uint40 cooldownEndTime,
        uint40 momId,
        uint40 dadId,
        uint16 cooldownIndex,
        uint16 generation
    );

    function getGenes(uint40 _id)
        public
        view
        returns (
        uint256 genes
    );


    function getCooldownEndTime(uint40 _id)
        public
        view
        returns (
        uint40 cooldownEndTime
    );

    function getCooldownIndex(uint40 _id)
        public
        view
        returns (
        uint16 cooldownIndex
    );


    function getGeneration(uint40 _id)
        public
        view
        returns (
        uint16 generation
    );

    function getOptional(uint40 _id)
        public
        view
        returns (
        uint64 optional
    );


    function changeGenes(
        uint40 _cutieId,
        uint256 _genes)
        public;

    function changeCooldownEndTime(
        uint40 _cutieId,
        uint40 _cooldownEndTime)
        public;

    function changeCooldownIndex(
        uint40 _cutieId,
        uint16 _cooldownIndex)
        public;

    function changeOptional(
        uint40 _cutieId,
        uint64 _optional)
        public;

    function changeGeneration(
        uint40 _cutieId,
        uint16 _generation)
        public;
}







/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
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.
   */
  function Ownable() 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;
  }

}



/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;


  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    require(paused);
    _;
  }

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

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



/// @title Auction Market for Blockchain Cuties.
/// @author https://BlockChainArchitect.io
contract MarketInterface 
{
    function withdrawEthFromBalance() external;    

    function createAuction(uint40 _cutieId, uint128 _startPrice, uint128 _endPrice, uint40 _duration, address _seller) public payable;

    function bid(uint40 _cutieId) public payable;

    function cancelActiveAuctionWhenPaused(uint40 _cutieId) public;

	function getAuctionInfo(uint40 _cutieId)
        public
        view
        returns
    (
        address seller,
        uint128 startPrice,
        uint128 endPrice,
        uint40 duration,
        uint40 startedAt,
        uint128 featuringFee
    );
}


/// @title Auction Market for Blockchain Cuties.
/// @author https://BlockChainArchitect.io
contract Market is MarketInterface, Pausable
{
    // Shows the auction on an Cutie Token
    struct Auction {
        // Price (in wei) at the beginning of auction
        uint128 startPrice;
        // Price (in wei) at the end of auction
        uint128 endPrice;
        // Current owner of Token
        address seller;
        // Auction duration in seconds
        uint40 duration;
        // Time when auction started
        // NOTE: 0 if this auction has been concluded
        uint40 startedAt;
        // Featuring fee (in wei, optional)
        uint128 featuringFee;
    }

    // Reference to contract that tracks ownership
    CutieCoreInterface public coreContract;

    // Cut owner takes on each auction, in basis points - 1/100 of a per cent.
    // Values 0-10,000 map to 0%-100%
    uint16 public ownerFee;

    // Map from token ID to their corresponding auction.
    mapping (uint40 => Auction) public cutieIdToAuction;

    event AuctionCreated(uint40 cutieId, uint128 startPrice, uint128 endPrice, uint40 duration, uint128 fee);
    event AuctionSuccessful(uint40 cutieId, uint128 totalPrice, address winner);
    event AuctionCancelled(uint40 cutieId);

    /// @dev disables sending fund to this contract
    function() external {}

    modifier canBeStoredIn128Bits(uint256 _value) 
    {
        require(_value <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
        _;
    }

    // @dev Adds to the list of open auctions and fires the
    //  AuctionCreated event.
    // @param _cutieId The token ID is to be put on auction.
    // @param _auction To add an auction.
    // @param _fee Amount of money to feature auction
    function _addAuction(uint40 _cutieId, 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);

        cutieIdToAuction[_cutieId] = _auction;
        
        emit AuctionCreated(
            _cutieId,
            _auction.startPrice,
            _auction.endPrice,
            _auction.duration,
            _auction.featuringFee
        );
    }

    // @dev Returns true if the token is claimed by the claimant.
    // @param _claimant - Address claiming to own the token.
    function _isOwner(address _claimant, uint256 _cutieId) internal view returns (bool)
    {
        return (coreContract.ownerOf(_cutieId) == _claimant);
    }

    // @dev Transfers the token owned by this contract to another address.
    // Returns true when the transfer succeeds.
    // @param _receiver - Address to transfer token to.
    // @param _cutieId - Token ID to transfer.
    function _transfer(address _receiver, uint40 _cutieId) internal
    {
        // it will throw if transfer fails
        coreContract.transfer(_receiver, _cutieId);
    }

    // @dev Escrows the token and assigns ownership to this contract.
    // Throws if the escrow fails.
    // @param _owner - Current owner address of token to escrow.
    // @param _cutieId - Token ID the approval of which is to be verified.
    function _escrow(address _owner, uint40 _cutieId) internal
    {
        // it will throw if transfer fails
        coreContract.transferFrom(_owner, this, _cutieId);
    }

    // @dev just cancel auction.
    function _cancelActiveAuction(uint40 _cutieId, address _seller) internal
    {
        _removeAuction(_cutieId);
        _transfer(_seller, _cutieId);
        emit AuctionCancelled(_cutieId);
    }

    // @dev Calculates the price and transfers winnings.
    // Does not transfer token ownership.
    function _bid(uint40 _cutieId, uint128 _bidAmount)
        internal
        returns (uint128)
    {
        // Get a reference to the auction struct
        Auction storage auction = cutieIdToAuction[_cutieId];

        require(_isOnAuction(auction));

        // Check that bid > current price
        uint128 price = _currentPrice(auction);
        require(_bidAmount >= price);

        // Provide a reference to the seller before the auction struct is deleted.
        address seller = auction.seller;

        _removeAuction(_cutieId);

        // Transfer proceeds to seller (if there are any!)
        if (price > 0) {
            uint128 fee = _computeFee(price);
            uint128 sellerValue = price - fee;

            seller.transfer(sellerValue);
        }

        emit AuctionSuccessful(_cutieId, price, msg.sender);

        return price;
    }

    // @dev Removes from the list of open auctions.
    // @param _cutieId - ID of token on auction.
    function _removeAuction(uint40 _cutieId) internal
    {
        delete cutieIdToAuction[_cutieId];
    }

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

    // @dev calculate current price of auction. 
    //  When testing, make this function public and turn on
    //  `Current price calculation` test suite.
    function _computeCurrentPrice(
        uint128 _startPrice,
        uint128 _endPrice,
        uint40 _duration,
        uint40 _secondsPassed
    )
        internal
        pure
        returns (uint128)
    {
        if (_secondsPassed >= _duration) {
            return _endPrice;
        } else {
            int256 totalPriceChange = int256(_endPrice) - int256(_startPrice);
            int256 currentPriceChange = totalPriceChange * int256(_secondsPassed) / int256(_duration);
            uint128 currentPrice = _startPrice + uint128(currentPriceChange);
            
            return currentPrice;
        }
    }
    // @dev return current price of token.
    function _currentPrice(Auction storage _auction)
        internal
        view
        returns (uint128)
    {
        uint40 secondsPassed = 0;

        uint40 timeNow = uint40(now);
        if (timeNow > _auction.startedAt) {
            secondsPassed = timeNow - _auction.startedAt;
        }

        return _computeCurrentPrice(
            _auction.startPrice,
            _auction.endPrice,
            _auction.duration,
            secondsPassed
        );
    }

    // @dev Calculates owner's cut of a sale.
    // @param _price - Sale price of cutie.
    function _computeFee(uint128 _price) internal view returns (uint128)
    {
        return _price * ownerFee / 10000;
    }

    // @dev Remove all Ether from the contract with the owner's cuts. Also, remove any Ether sent directly to the contract address.
    //  Transfers to the token contract, but can be called by
    //  the owner or the token contract.
    function withdrawEthFromBalance() external
    {
        address coreAddress = address(coreContract);

        require(
            msg.sender == owner ||
            msg.sender == coreAddress
        );
        coreAddress.transfer(address(this).balance);
    }

    // @dev create and begin new auction.
    function createAuction(uint40 _cutieId, uint128 _startPrice, uint128 _endPrice, uint40 _duration, address _seller)
        public whenNotPaused payable
    {
        require(_isOwner(msg.sender, _cutieId));
        _escrow(msg.sender, _cutieId);
        Auction memory auction = Auction(
            _startPrice,
            _endPrice,
            _seller,
            _duration,
            uint40(now),
            uint128(msg.value)
        );
        _addAuction(_cutieId, auction);
    }

    // @dev Set the reference to cutie ownership contract. Verify the owner's fee.
    //  @param fee should be between 0-10,000.
    function setup(address _coreContractAddress, uint16 _fee) public onlyOwner
    {
        require(_fee <= 10000);

        ownerFee = _fee;
        
        CutieCoreInterface candidateContract = CutieCoreInterface(_coreContractAddress);
        require(candidateContract.isCutieCore());
        coreContract = candidateContract;
    }

    // @dev Set the owner's fee.
    //  @param fee should be between 0-10,000.
    function setFee(uint16 _fee) public onlyOwner
    {
        require(_fee <= 10000);

        ownerFee = _fee;
    }

    // @dev bid on auction. Complete it and transfer ownership of cutie if enough ether was given.
    function bid(uint40 _cutieId) public payable whenNotPaused canBeStoredIn128Bits(msg.value)
    {
        // _bid throws if something failed.
        _bid(_cutieId, uint128(msg.value));
        _transfer(msg.sender, _cutieId);
    }

    // @dev Returns auction info for a token on auction.
    // @param _cutieId - ID of token on auction.
    function getAuctionInfo(uint40 _cutieId)
        public
        view
        returns
    (
        address seller,
        uint128 startPrice,
        uint128 endPrice,
        uint40 duration,
        uint40 startedAt,
        uint128 featuringFee
    ) {
        Auction storage auction = cutieIdToAuction[_cutieId];
        require(_isOnAuction(auction));
        return (
            auction.seller,
            auction.startPrice,
            auction.endPrice,
            auction.duration,
            auction.startedAt,
            auction.featuringFee
        );
    }

    // @dev Returns auction info for a token on auction.
    // @param _cutieId - ID of token on auction.
    function isOnAuction(uint40 _cutieId)
        public
        view
        returns (bool) 
    {
        return cutieIdToAuction[_cutieId].startedAt > 0;
    }

/*
    /// @dev Import cuties from previous version of Core contract.
    /// @param _oldAddress Old core contract address
    /// @param _fromIndex (inclusive)
    /// @param _toIndex (inclusive)
    function migrate(address _oldAddress, uint40 _fromIndex, uint40 _toIndex) public onlyOwner whenPaused
    {
        Market old = Market(_oldAddress);

        for (uint40 i = _fromIndex; i <= _toIndex; i++)
        {
            if (coreContract.ownerOf(i) == _oldAddress)
            {
                address seller;
                uint128 startPrice;
                uint128 endPrice;
                uint40 duration;
                uint40 startedAt;
                uint128 featuringFee;   
                (seller, startPrice, endPrice, duration, startedAt, featuringFee) = old.getAuctionInfo(i);

                Auction memory auction = Auction({
                    seller: seller, 
                    startPrice: startPrice, 
                    endPrice: endPrice, 
                    duration: duration, 
                    startedAt: startedAt, 
                    featuringFee: featuringFee
                });
                _addAuction(i, auction);
            }
        }
    }*/

    // @dev Returns the current price of an auction.
    function getCurrentPrice(uint40 _cutieId)
        public
        view
        returns (uint128)
    {
        Auction storage auction = cutieIdToAuction[_cutieId];
        require(_isOnAuction(auction));
        return _currentPrice(auction);
    }

    // @dev Cancels unfinished auction and returns token to owner. 
    // Can be called when contract is paused.
    function cancelActiveAuction(uint40 _cutieId) public
    {
        Auction storage auction = cutieIdToAuction[_cutieId];
        require(_isOnAuction(auction));
        address seller = auction.seller;
        require(msg.sender == seller);
        _cancelActiveAuction(_cutieId, seller);
    }

    // @dev Cancels auction when contract is on pause. Option is available only to owners in urgent situations. Tokens returned to seller.
    //  Used on Core contract upgrade.
    function cancelActiveAuctionWhenPaused(uint40 _cutieId) whenPaused onlyOwner public
    {
        Auction storage auction = cutieIdToAuction[_cutieId];
        require(_isOnAuction(auction));
        _cancelActiveAuction(_cutieId, auction.seller);
    }
}


/// @title Auction market for breeding
/// @author https://BlockChainArchitect.io
contract BreedingMarket is Market
{
    bool public isBreedingMarket = true;

    // @dev Launches and starts a new auction.
    function createAuction(
        uint40 _cutieId,
        uint128 _startPrice,
        uint128 _endPrice,
        uint40 _duration,
        address _seller)
        public payable
    {
        require(msg.sender == address(coreContract));
        _escrow(_seller, _cutieId);
        Auction memory auction = Auction(
            _startPrice,
            _endPrice,
            _seller,
            _duration,
            uint40(now),
            uint128(msg.value)
        );
        _addAuction(_cutieId, auction);
    }

    /// @dev Places a bid for breeding. Requires the sender
    /// is the BlockchainCutiesCore contract because all bid methods
    /// should be wrapped. Also returns the cutie to the
    /// seller rather than the winner.
    function bid(uint40 _cutieId) public payable canBeStoredIn128Bits(msg.value) {
        require(msg.sender == address(coreContract));
        address seller = cutieIdToAuction[_cutieId].seller;
        // _bid. is token ID valid?
        _bid(_cutieId, uint128(msg.value));
        // We transfer the cutie back to the seller, the winner will get
        // the offspring
        _transfer(seller, _cutieId);
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[{"name":"_cutieId","type":"uint40"}],"name":"isOnAuction","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isBreedingMarket","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawEthFromBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_cutieId","type":"uint40"}],"name":"getCurrentPrice","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint40"}],"name":"cutieIdToAuction","outputs":[{"name":"startPrice","type":"uint128"},{"name":"endPrice","type":"uint128"},{"name":"seller","type":"address"},{"name":"duration","type":"uint40"},{"name":"startedAt","type":"uint40"},{"name":"featuringFee","type":"uint128"}],"payable":false,"stateMutability":"view","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":false,"inputs":[{"name":"_fee","type":"uint16"}],"name":"setFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_cutieId","type":"uint40"}],"name":"cancelActiveAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_cutieId","type":"uint40"}],"name":"getAuctionInfo","outputs":[{"name":"seller","type":"address"},{"name":"startPrice","type":"uint128"},{"name":"endPrice","type":"uint128"},{"name":"duration","type":"uint40"},{"name":"startedAt","type":"uint40"},{"name":"featuringFee","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_cutieId","type":"uint40"}],"name":"cancelActiveAuctionWhenPaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_cutieId","type":"uint40"}],"name":"bid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_cutieId","type":"uint40"},{"name":"_startPrice","type":"uint128"},{"name":"_endPrice","type":"uint128"},{"name":"_duration","type":"uint40"},{"name":"_seller","type":"address"}],"name":"createAuction","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"ownerFee","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_coreContractAddress","type":"address"},{"name":"_fee","type":"uint16"}],"name":"setup","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"coreContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"cutieId","type":"uint40"},{"indexed":false,"name":"startPrice","type":"uint128"},{"indexed":false,"name":"endPrice","type":"uint128"},{"indexed":false,"name":"duration","type":"uint40"},{"indexed":false,"name":"fee","type":"uint128"}],"name":"AuctionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"cutieId","type":"uint40"},{"indexed":false,"name":"totalPrice","type":"uint128"},{"indexed":false,"name":"winner","type":"address"}],"name":"AuctionSuccessful","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"cutieId","type":"uint40"}],"name":"AuctionCancelled","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

6060604052600080546003805460ff19166001179055600160a060020a033316600160a860020a03199091161790556110f28061003d6000396000f3006060604052600436106100ed5763ffffffff60e060020a6000350416632177885d81146100fa578063310e5ce71461012b5780633f4ba83a1461013e5780635c975abb14610151578063776247c4146101645780637ea310d41461017757806381baab24146101b05780638456cb59146102205780638da5cb5b146102335780638e0055531461026257806398c9faac1461027c5780639ccaec9814610299578063b2fb3b901461030b578063c170fd5414610328578063c1d1faf31461033a578063d5b2a01a14610373578063e410a0c61461039d578063e80db5db146103c3578063f2fde38b146103d6575b34156100f857600080fd5b005b341561010557600080fd5b61011764ffffffffff600435166103f5565b604051901515815260200160405180910390f35b341561013657600080fd5b61011761041e565b341561014957600080fd5b6100f8610427565b341561015c57600080fd5b6101176104a6565b341561016f57600080fd5b6100f86104b6565b341561018257600080fd5b61019464ffffffffff60043516610535565b6040516001608060020a03909116815260200160405180910390f35b34156101bb57600080fd5b6101cd64ffffffffff6004351661056f565b6040516001608060020a0396871681529486166020860152600160a060020a0390931660408086019190915264ffffffffff928316606086015291166080840152921660a082015260c001905180910390f35b341561022b57600080fd5b6100f86105d8565b341561023e57600080fd5b61024661065c565b604051600160a060020a03909116815260200160405180910390f35b341561026d57600080fd5b6100f861ffff6004351661066b565b341561028757600080fd5b6100f864ffffffffff600435166106cc565b34156102a457600080fd5b6102b664ffffffffff60043516610725565b604051600160a060020a0390961686526001608060020a03948516602087015292841660408087019190915264ffffffffff928316606087015291166080850152911660a083015260c0909101905180910390f35b341561031657600080fd5b6100f864ffffffffff600435166107c0565b6100f864ffffffffff6004351661083c565b6100f864ffffffffff6004358116906001608060020a036024358116916044359091169060643516600160a060020a03608435166108a8565b341561037e57600080fd5b610386610949565b60405161ffff909116815260200160405180910390f35b34156103a857600080fd5b6100f8600160a060020a036004351661ffff6024351661095a565b34156103ce57600080fd5b610246610a46565b34156103e157600080fd5b6100f8600160a060020a0360043516610a55565b64ffffffffff90811660009081526002602052604081206001015460c860020a90049091161190565b60035460ff1681565b60005433600160a060020a0390811691161461044257600080fd5b60005460a060020a900460ff16151561045a57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60005460a060020a900460ff1681565b600154600054600160a060020a0391821691338116911614806104ea575080600160a060020a031633600160a060020a0316145b15156104f557600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561053257600080fd5b50565b64ffffffffff8116600090815260026020526040812061055481610af0565b151561055f57600080fd5b61056881610b09565b9392505050565b60026020819052600091825260409091208054600182015491909201546001608060020a03808416937001000000000000000000000000000000009004811692600160a060020a0381169264ffffffffff60a060020a830481169360c860020a90930416911686565b60005433600160a060020a039081169116146105f357600080fd5b60005460a060020a900460ff161561060a57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b60005433600160a060020a0390811691161461068657600080fd5b61271061ffff8216111561069957600080fd5b6001805461ffff90921660a060020a0275ffff000000000000000000000000000000000000000019909216919091179055565b64ffffffffff81166000908152600260205260408120906106ec82610af0565b15156106f757600080fd5b506001810154600160a060020a03908116903316811461071657600080fd5b6107208382610b90565b505050565b64ffffffffff811660009081526002602052604081208190819081908190819061074e81610af0565b151561075957600080fd5b60018101548154600290920154600160a060020a0382169a6001608060020a038085169b507001000000000000000000000000000000009094048416995064ffffffffff60a060020a84048116995060c860020a9093049092169650919091169350915050565b6000805460a060020a900460ff1615156107d957600080fd5b60005433600160a060020a039081169116146107f457600080fd5b5064ffffffffff8116600090815260026020526040902061081481610af0565b151561081f57600080fd5b6001810154610838908390600160a060020a0316610b90565b5050565b6000346001608060020a0381111561085357600080fd5b60015433600160a060020a0390811691161461086e57600080fd5b64ffffffffff8316600090815260026020526040902060010154600160a060020a0316915061089d8334610be2565b506107208284610d15565b6108b0611091565b60015433600160a060020a039081169116146108cb57600080fd5b6108d58287610d86565b60c060405190810160405280866001608060020a03168152602001856001608060020a0316815260200183600160a060020a031681526020018464ffffffffff1681526020014264ffffffffff168152602001346001608060020a031681525090506109418682610def565b505050505050565b60015460a060020a900461ffff1681565b6000805433600160a060020a0390811691161461097657600080fd5b61271061ffff8316111561098957600080fd5b506001805475ffff0000000000000000000000000000000000000000191660a060020a61ffff84160217905581600160a060020a038116634d6a813a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109f357600080fd5b5af11515610a0057600080fd5b505050604051805190501515610a1557600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600154600160a060020a031681565b60005433600160a060020a03908116911614610a7057600080fd5b600160a060020a0381161515610a8557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60010154600060c860020a90910464ffffffffff161190565b60018101546000908190429064ffffffffff60c860020a90910481169082161115610b4657600184015460c860020a900464ffffffffff16810391505b83546001850154610b88916001608060020a0380821692700100000000000000000000000000000000909204169060a060020a900464ffffffffff1685610fa5565b949350505050565b610b998261100c565b610ba38183610d15565b7ff6680ade663631ec4dd74f7eaa1f75125361380cd50a22f969e9acfa5f5367048260405164ffffffffff909116815260200160405180910390a15050565b64ffffffffff8216600090815260026020526040812081808080610c0585610af0565b1515610c1057600080fd5b610c1985610b09565b93506001608060020a038085169088161015610c3457600080fd5b6001850154600160a060020a03169250610c4d8861100c565b6000846001608060020a03161115610ca957610c688461106a565b915050808303600160a060020a0383166001608060020a03821680156108fc0290604051600060405180830381858888f193505050501515610ca957600080fd5b7f8500e47909916e51e97e4880e742d8b9af1afaeb9ea54166947cf42e6616b11788853360405164ffffffffff90931683526001608060020a039091166020830152600160a060020a03166040808301919091526060909101905180910390a150919695505050505050565b600154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a03909216600483015264ffffffffff166024820152604401600060405180830381600087803b1515610d7257600080fd5b5af11515610d7f57600080fd5b5050505050565b600154600160a060020a03166323b872dd83308460405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015264ffffffffff9091166044820152606401600060405180830381600087803b1515610d7257600080fd5b603c816060015164ffffffffff161015610e0857600080fd5b64ffffffffff821660009081526002602052604090208190815181546fffffffffffffffffffffffffffffffff19166001608060020a0391909116178155602082015181546001608060020a03918216700100000000000000000000000000000000029116178155604082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560608201518160010160146101000a81548164ffffffffff021916908364ffffffffff16021790555060808201518160010160196101000a81548164ffffffffff021916908364ffffffffff16021790555060a082015160029190910180546fffffffffffffffffffffffffffffffff19166001608060020a03909216919091179055507f10812469e6e641cdef133a0556aa1bfd46bcd460e603da6af3233f8a6e242f6a828251836020015184606001518560a0015160405164ffffffffff95861681526001608060020a03948516602082015292841660408085019190915291909416606083015292909116608082015260a001905180910390a15050565b600080808064ffffffffff80871690861610610fc357869350611001565b876001608060020a0316876001608060020a03160392508564ffffffffff168564ffffffffff168402811515610ff557fe5b05915081880190508093505b505050949350505050565b64ffffffffff16600090815260026020819052604082209182556001820180547fffff0000000000000000000000000000000000000000000000000000000000001690550180546fffffffffffffffffffffffffffffffff19169055565b6001546000906127109060a060020a900461ffff1683026001608060020a03160492915050565b60c06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820152905600a165627a7a723058209b892b5b0ce22c3eb2b8066754fa4dd8a2553148f26aca630f8bafdcaa189c550029

Swarm Source

bzzr://9b892b5b0ce22c3eb2b8066754fa4dd8a2553148f26aca630f8bafdcaa189c55
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.