Contract 0x55e851ecB4a8Ee090F7b097BA1804dB94D90175e

 
Txn Hash Method
Block
From
To
Value
0xdd2c3902e878458cde5555efd0fab2ffe8eaca3c90c2c0bd72a6290d0557b34dWithdraw Eth Fro...123825132021-05-06 19:02:0347 days 17 hrs agoBlockchain Cuties: Deployer IN  BC: Sale Market 40 Ether0.00279407279
0x847cbfd9700aac6f111c1e4813a254894a503a86e4da7be05f1f0c04ee527d9eSetup123825022021-05-06 18:58:4947 days 17 hrs agoBlockchain Cuties: Deployer IN  BC: Sale Market 40 Ether0.002442270673.7
0x15747dd0ae4ff401d60bca666388f9ef20daffa3662e4bdde07106e8e1cddcc8Bid123464922021-05-01 5:45:0053 days 6 hrs ago0xefc885ce358f4ca04f09d24fb064d0d3e0f6d079 IN  BC: Sale Market 40.0010000001 Ether0.00060357525
0x52fda5d8138097c444f2f1d5a469dd7c8d3a6a27efb736eca4a656631c2519f2Bid122882372021-04-22 5:50:5062 days 6 hrs ago0x216b428e877e587dcb7f19890daa2b947ba0f645 IN  BC: Sale Market 40.010000001 Ether0.002582017107
0xc126b25fd14468eb9cbd764fc30a2d7737e87c9bc62f79609f5891cb518c2994Bid122868482021-04-22 0:30:0262 days 11 hrs ago0x216b428e877e587dcb7f19890daa2b947ba0f645 IN  BC: Sale Market 40.010000001 Ether0.008188464124
0x50b7d4ff5f82712ab77ffbc784ce41b6edab40abfc2defa7d6bf078e7940abb3Bid120279442021-03-13 4:15:43102 days 8 hrs ago0x092e33187b0c84237c7945a9e3ce9e4f0daf8ed2 IN  BC: Sale Market 40.0010000001 Ether0.002467044108
0xe7e6f13a9e16b129445455a642aa5dc3adbb2382b44e5480b01500156642179fBid120261582021-03-12 21:37:07102 days 14 hrs ago0xa1ea79ce10594692de104aeea283146249ea9d03 IN  BC: Sale Market 40.0010000001 Ether0.003517822154
0x4d37ddb0d5c028165e638a89e105a2641cf3f14917d51e821ed9ea5f4911fdf2Bid120261182021-03-12 21:27:00102 days 14 hrs ago0xa1ea79ce10594692de104aeea283146249ea9d03 IN  BC: Sale Market 40.0010000001 Ether0.003472136152
0x124bb4320623965431a4ef28ba1289de4039f45832f885381b5d44d078621303Bid120260292021-03-12 21:08:25102 days 15 hrs ago0xa1ea79ce10594692de104aeea283146249ea9d03 IN  BC: Sale Market 40.0010000001 Ether0.003472136152
0x6e79644a72d8b79b2608721ae9815bd81cd2c207b5be50cb9bdff11c6c9dcc73Bid120188572021-03-11 18:20:39103 days 18 hrs ago0xe70c40193bf9aee0b097acf942b6d007194c8dd1 IN  BC: Sale Market 40.0010000001 Ether0.00365488160
0x365488652c4dddb44d12350e2473777bf6aa46ff9fdb3f07d96d988feadcb506Bid120188572021-03-11 18:20:39103 days 18 hrs ago0xe70c40193bf9aee0b097acf942b6d007194c8dd1 IN  BC: Sale Market 40.0010000001 Ether0.00365488160
0xb0d329e7af974e0643f7b141c110962174760b690fc812b50bba090d33586b6cBid119860012021-03-06 16:34:14108 days 19 hrs ago0x57d526f3267af7dd1f39fbe7f024e2451027fd03 IN  BC: Sale Market 40.040000004 Ether0.002398515105
0xbdb2013ddd0baec96f7b59ae4130d653e6737acf59547ed839ad6cc354aafeb0Bid119845872021-03-06 11:28:38109 days 54 mins ago0x245c817bb7c5648cdaddc96cee166173094391f6 IN  BC: Sale Market 40.0010000001 Ether0.0015990170
0xc15f6b847ed88354324d1f09e477df1aba48b9c7451387e91f918b4be622e329Bid119779542021-03-05 11:14:38110 days 1 hr agoENS Name bykur.eth IN  BC: Sale Market 40.0010000001 Ether0.002718317119
0x53fc0d0632a4cebfe2ed650b43dc4467fd7944a3ab995cb9f40a52d5b94e8a0dBid119731722021-03-04 17:33:50110 days 18 hrs ago0x218a46763370492732eab85faa336abe0338f1e1 IN  BC: Sale Market 40.0010000001 Ether0.002764003121
0x69f2559dda97f19fe4a4350344927f5ae80d56ae9866463a21f3fbebe2fff342Bid119505692021-03-01 5:57:58114 days 6 hrs ago0xad9fc7765d95f0976b971cebecbdf6939ce2a90b IN  BC: Sale Market 40.0050000005 Ether0.00164383272
0x820406f1eb92d5c33636d9a8821a7f1a6219f0c893fda0475d175d2de4155b20Bid119501352021-03-01 4:20:46114 days 8 hrs ago0xad9fc7765d95f0976b971cebecbdf6939ce2a90b IN  BC: Sale Market 40.0050000005 Ether0.00171232575
0xc22fba0f1fe2cbdff993935c9940aace657b4b25387845af95672d7eb6d40354Cancel Active Au...118835152021-02-18 22:30:40124 days 13 hrs ago0x9b5cfd35cd4d76a7c8eb9724b5763da49dfa332d IN  BC: Sale Market 40 Ether0.004534200
0xacdf83910dc3079f54c19e3905386dafd53fd1d8b5174a248fd635c7c5060138Bid117937772021-02-05 3:11:20138 days 9 hrs ago0x06711b7c65963522119d6cec5284c60010c7ca42 IN  BC: Sale Market 40.0010000001 Ether0.003234147
0x7839340694b7a31e0b102a50be058f4ac79e34a119e7df7590e0e561d6e9590bCancel Active Au...115051002020-12-22 19:11:30182 days 17 hrs ago0x9b5cfd35cd4d76a7c8eb9724b5763da49dfa332d IN  BC: Sale Market 40 Ether0.0008841339
0xfd10949727d4a9cedb646f7e4937a7294931c1e6d191cd173c7cffae86c7a32dCancel Active Au...115050722020-12-22 19:06:17182 days 17 hrs ago0x9b5cfd35cd4d76a7c8eb9724b5763da49dfa332d IN  BC: Sale Market 40 Ether0.000680130
0x5971761ac49c13d8539ef81d97ccb773d0f82b120b42c1c51d9eb834268437b2Cancel Active Au...115044972020-12-22 16:54:26182 days 19 hrs ago0x9b5cfd35cd4d76a7c8eb9724b5763da49dfa332d IN  BC: Sale Market 40 Ether0.0013375359
0xcddfc260ad1a977448ad6e85979073e8778aa042d607b2abb92b748293e7250bCancel Active Au...115041792020-12-22 15:46:46182 days 20 hrs ago0x9b5cfd35cd4d76a7c8eb9724b5763da49dfa332d IN  BC: Sale Market 40 Ether0.0013375359
0xff225a35d9489c4721efad96362691f3d17b9e422b77e5ac59a6893d88cb45aeCancel Active Au...115040792020-12-22 15:28:14182 days 20 hrs ago0x9b5cfd35cd4d76a7c8eb9724b5763da49dfa332d IN  BC: Sale Market 40 Ether0.0014055462
0xcc93e34e57ef0c66b5768c7cd53e29bdbd2b669fecabf070c95bc6273409db24Cancel Active Au...115040112020-12-22 15:12:54182 days 21 hrs ago0x9b5cfd35cd4d76a7c8eb9724b5763da49dfa332d IN  BC: Sale Market 40 Ether0.0011788452
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xdd2c3902e878458cde5555efd0fab2ffe8eaca3c90c2c0bd72a6290d0557b34d123825132021-05-06 19:02:0347 days 17 hrs ago BC: Sale Market 4 0xf64899806138ba624a8647b1a88fe2cb1f2ac56b0.255455908220137519 Ether
0xc126b25fd14468eb9cbd764fc30a2d7737e87c9bc62f79609f5891cb518c2994122868482021-04-22 0:30:0262 days 11 hrs ago BC: Sale Market 40x9852f8956973e8830e08cad3f2a7f6d04e8d837e0.0096 Ether
0x55633d3dbeb3a9c9c9eb114e57e7a1c7ea097aa5b5f6b4c36f6702db97bceaf1102168172020-06-07 5:34:09381 days 6 hrs ago BC: Sale Market 4ENS Name hiddenfox.eth0.00576 Ether
0x9fe41fc6c78f1d0227c967ec0ef2c03d65dd770d865aa33758b79201b8d607c5102168172020-06-07 5:34:09381 days 6 hrs ago BC: Sale Market 40x4f1b1ccfb20e4a27195e2fba5c9eaf90f06f56c80.0096 Ether
0x1609422465b955df53e3e0ba149b98b57101c5842b8fcb9e06db8cd51bf360dc91052032019-12-14 12:05:11557 days 17 mins ago BC: Sale Market 40xb793b04a2240a3171afedfe95de37e945d8931450.042624001919999994 Ether
0x66d3e8de850cb2a9de883488129bb77870c4f9a18b37c573cdb56a5a0b0e162991036162019-12-14 4:36:32557 days 7 hrs ago BC: Sale Market 40xf7320033e7ab1d4ed5be95c7b62c6ca670cca3250.0744 Ether
0x50b811b69eaceb2a9d5d0165abd746dabb88725665c25b99ac81b98b35a42a8491028422019-12-14 1:04:31557 days 11 hrs ago BC: Sale Market 40xf7320033e7ab1d4ed5be95c7b62c6ca670cca3250.034464000000000001 Ether
0xb3ca8862eb7d9c870294abe6f224c62b2d03ef91adc19104ccbc8bcb7a2ede8e91025762019-12-13 23:50:14557 days 12 hrs ago BC: Sale Market 40xf7320033e7ab1d4ed5be95c7b62c6ca670cca3250.016896000000000001 Ether
0x4153bcadd2def17673a7e712541d688daf8b767fe799bc24f1dbd076be27f0a691025522019-12-13 23:44:20557 days 12 hrs ago BC: Sale Market 40xf7320033e7ab1d4ed5be95c7b62c6ca670cca3250.018432000960000001 Ether
0x12bab8f63ee51804c9be1285f1daaf76de5af517cd776a53524e1bfa3b07eb9691025522019-12-13 23:44:20557 days 12 hrs ago BC: Sale Market 40xf7320033e7ab1d4ed5be95c7b62c6ca670cca3250.016512 Ether
0x0b9f877496725374adaf825b3136869ce97103665a0ea338d046dd8dd3e06b4a85660382019-09-17 9:07:06645 days 3 hrs ago BC: Sale Market 40x8facaca7ad490c70a0abaad5881663326917a83b0.06393600000000001 Ether
0x9fba1fbeb806c1f0133e6fc8e59e08f946ab6d1af27bd770a0b77802de5df4a985401792019-09-13 8:12:44649 days 4 hrs ago BC: Sale Market 40x7feae9b2947dce8b4d38d805382aee4e9a41f86f0.21024000096 Ether
0x9724ff8912c7cc8be60678cf320229d9747830c7fe67a071c1a61436f0991e1376496132019-04-27 12:59:06787 days 23 hrs ago BC: Sale Market 4ENS Name hiddenfox.eth0.008045444961240311 Ether
0x44f7900bc2cea2a9a43282e8e3921c998565e1af63608147c73ec04c92fed69572701752019-02-26 12:46:10847 days 23 hrs ago BC: Sale Market 40xd736144c39dac0122d70a2ca6b1725a67b0fc00b0.0288 Ether
0xfa58993d02eac0b9c7631d2de248b9e38845565f88fd6c73431e1e886c15365371787422019-02-05 14:46:27868 days 21 hrs ago BC: Sale Market 40xf7320033e7ab1d4ed5be95c7b62c6ca670cca3250.143999999999999995 Ether
0x9a91ecbb25a8d63271c6d5574def3a4e9c1e450d998c262f9486bce6752c3b8670904642019-01-19 2:52:43886 days 9 hrs ago BC: Sale Market 40xd736144c39dac0122d70a2ca6b1725a67b0fc00b0.033600000000000004 Ether
0x240c39319f835a3b9a7e302698abf5489948f280f44c59938f8c9574f1dc9aa469726282018-12-29 7:18:47907 days 5 hrs ago BC: Sale Market 40x6f436add6c41f048ab796c34b04e0756798c54d00.00384 Ether
0xbb5bfd3e5ebf07d6ed209395f08bdd9e2887ca8e2bc42e6f57bc935b7b21833469540512018-12-26 3:49:07910 days 8 hrs ago BC: Sale Market 40x46f9a1dc80df2e5d1cc0efd24f4ec341523753d30.034559999999999997 Ether
0xa6e3d6d1e52a30e25da548c25164530b7c8994a98a4e061b771b9fd371a2ef2469540062018-12-26 3:39:27910 days 8 hrs ago BC: Sale Market 40x46f9a1dc80df2e5d1cc0efd24f4ec341523753d30.033600000000000004 Ether
0x7a5986c5900c27b66b544f9239719083573d4d4d70014c0feb3c883942c5096b69423652018-12-24 4:40:43912 days 7 hrs ago BC: Sale Market 40xf679de224c6f685f25af2c91f4c8775bbce27a460.238080000959999998 Ether
0x8b63b55f1ab1e8de594f82d5cdd548c795efa66bc664d85f6b51ab007672b60e69413912018-12-24 0:49:08912 days 11 hrs ago BC: Sale Market 40x9852f8956973e8830e08cad3f2a7f6d04e8d837e0.0384 Ether
0x492b1a66842e22cbd427b153dad0aac7f49a13e771a5aa0f1c925620c8e94caa69296322018-12-22 0:51:46914 days 11 hrs ago BC: Sale Market 40x7feae9b2947dce8b4d38d805382aee4e9a41f86f0.272639999999999976 Ether
0x5ded29a666e5c532486fbb4c3ffe5593939faef824667545d96ca9ba8a28a84669106502018-12-18 19:10:54917 days 17 hrs ago BC: Sale Market 40xb793b04a2240a3171afedfe95de37e945d8931450.044256000960000001 Ether
0x7ad4ec5c27fbb5bebb1f36eb6a38bdb4e8b5965bbad14093df61d742bcd8385e69106462018-12-18 19:10:02917 days 17 hrs ago BC: Sale Market 40xa691ca9f1958c09489185231ac509fbf0e03a94d0.010077624154589373 Ether
0x85a4cb5a7d69d9a140d67e87f6b3cc226d68b173c5ae3dac4c2df5c2e7e6f43469105292018-12-18 18:42:21917 days 17 hrs ago BC: Sale Market 40xf7320033e7ab1d4ed5be95c7b62c6ca670cca3250.01756800096 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SaleMarket

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 cuties sale 
/// @author https://BlockChainArchitect.io
contract SaleMarket is Market
{
    // @dev Sanity check reveals that the
    //  auction in our setSaleAuctionAddress() call is right.
    bool public isSaleMarket = true;
    

    // @dev create and start a new auction
    // @param _cutieId - ID of cutie to auction, sender must be owner.
    // @param _startPrice - Price of item (in wei) at the beginning of auction.
    // @param _endPrice - Price of item (in wei) at the end of auction.
    // @param _duration - Length of auction (in seconds).
    // @param _seller - Seller
    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 LastSalePrice is updated if seller is the token contract.
    // Otherwise, default bid method is used.
    function bid(uint40 _cutieId)
        public
        payable
        canBeStoredIn128Bits(msg.value)
    {
        // _bid verifies token ID size
        _bid(_cutieId, uint128(msg.value));
        _transfer(msg.sender, _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":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":true,"inputs":[],"name":"isSaleMarket","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"}]

6060604052600080546003805460ff19166001179055600160a060020a033316600160a860020a03199091161790556110b08061003d6000396000f3006060604052600436106100ed5763ffffffff60e060020a6000350416632177885d81146100fa5780633f4ba83a1461012b5780635c975abb1461013e5780636066b06614610151578063776247c4146101645780637ea310d41461017757806381baab24146101b05780638456cb59146102205780638da5cb5b146102335780638e0055531461026257806398c9faac1461027c5780639ccaec9814610299578063b2fb3b901461030b578063c170fd5414610328578063c1d1faf31461033a578063d5b2a01a14610373578063e410a0c61461039d578063e80db5db146103c3578063f2fde38b146103d6575b34156100f857600080fd5b005b341561010557600080fd5b61011764ffffffffff600435166103f5565b604051901515815260200160405180910390f35b341561013657600080fd5b6100f861041e565b341561014957600080fd5b61011761049d565b341561015c57600080fd5b6101176104ad565b341561016f57600080fd5b6100f86104b6565b341561018257600080fd5b61019464ffffffffff60043516610535565b6040516001608060020a03909116815260200160405180910390f35b34156101bb57600080fd5b6101cd64ffffffffff6004351661056f565b6040516001608060020a0396871681529486166020860152600160a060020a0390931660408086019190915264ffffffffff928316606086015291166080840152921660a082015260c001905180910390f35b341561022b57600080fd5b6100f86105d8565b341561023e57600080fd5b61024661065c565b604051600160a060020a03909116815260200160405180910390f35b341561026d57600080fd5b6100f861ffff6004351661066b565b341561028757600080fd5b6100f864ffffffffff600435166106cc565b34156102a457600080fd5b6102b664ffffffffff60043516610725565b604051600160a060020a0390961686526001608060020a03948516602087015292841660408087019190915264ffffffffff928316606087015291166080850152911660a083015260c0909101905180910390f35b341561031657600080fd5b6100f864ffffffffff600435166107c0565b6100f864ffffffffff6004351661083c565b6100f864ffffffffff6004358116906001608060020a036024358116916044359091169060643516600160a060020a0360843516610866565b341561037e57600080fd5b610386610907565b60405161ffff909116815260200160405180910390f35b34156103a857600080fd5b6100f8600160a060020a036004351661ffff60243516610918565b34156103ce57600080fd5b610246610a04565b34156103e157600080fd5b6100f8600160a060020a0360043516610a13565b64ffffffffff90811660009081526002602052604081206001015460c860020a90049091161190565b60005433600160a060020a0390811691161461043957600080fd5b60005460a060020a900460ff16151561045157600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60005460a060020a900460ff1681565b60035460ff1681565b600154600054600160a060020a0391821691338116911614806104ea575080600160a060020a031633600160a060020a0316145b15156104f557600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561053257600080fd5b50565b64ffffffffff8116600090815260026020526040812061055481610aae565b151561055f57600080fd5b61056881610ac7565b9392505050565b60026020819052600091825260409091208054600182015491909201546001608060020a03808416937001000000000000000000000000000000009004811692600160a060020a0381169264ffffffffff60a060020a830481169360c860020a90930416911686565b60005433600160a060020a039081169116146105f357600080fd5b60005460a060020a900460ff161561060a57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b60005433600160a060020a0390811691161461068657600080fd5b61271061ffff8216111561069957600080fd5b6001805461ffff90921660a060020a0275ffff000000000000000000000000000000000000000019909216919091179055565b64ffffffffff81166000908152600260205260408120906106ec82610aae565b15156106f757600080fd5b506001810154600160a060020a03908116903316811461071657600080fd5b6107208382610b4e565b505050565b64ffffffffff811660009081526002602052604081208190819081908190819061074e81610aae565b151561075957600080fd5b60018101548154600290920154600160a060020a0382169a6001608060020a038085169b507001000000000000000000000000000000009094048416995064ffffffffff60a060020a84048116995060c860020a9093049092169650919091169350915050565b6000805460a060020a900460ff1615156107d957600080fd5b60005433600160a060020a039081169116146107f457600080fd5b5064ffffffffff8116600090815260026020526040902061081481610aae565b151561081f57600080fd5b6001810154610838908390600160a060020a0316610b4e565b5050565b346001608060020a0381111561085157600080fd5b61085b8234610ba0565b506108383383610cd3565b61086e61104f565b60015433600160a060020a0390811691161461088957600080fd5b6108938287610d44565b60c060405190810160405280866001608060020a03168152602001856001608060020a0316815260200183600160a060020a031681526020018464ffffffffff1681526020014264ffffffffff168152602001346001608060020a031681525090506108ff8682610dad565b505050505050565b60015460a060020a900461ffff1681565b6000805433600160a060020a0390811691161461093457600080fd5b61271061ffff8316111561094757600080fd5b506001805475ffff0000000000000000000000000000000000000000191660a060020a61ffff84160217905581600160a060020a038116634d6a813a6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156109b157600080fd5b5af115156109be57600080fd5b5050506040518051905015156109d357600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600154600160a060020a031681565b60005433600160a060020a03908116911614610a2e57600080fd5b600160a060020a0381161515610a4357600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60010154600060c860020a90910464ffffffffff161190565b60018101546000908190429064ffffffffff60c860020a90910481169082161115610b0457600184015460c860020a900464ffffffffff16810391505b83546001850154610b46916001608060020a0380821692700100000000000000000000000000000000909204169060a060020a900464ffffffffff1685610f63565b949350505050565b610b5782610fca565b610b618183610cd3565b7ff6680ade663631ec4dd74f7eaa1f75125361380cd50a22f969e9acfa5f5367048260405164ffffffffff909116815260200160405180910390a15050565b64ffffffffff8216600090815260026020526040812081808080610bc385610aae565b1515610bce57600080fd5b610bd785610ac7565b93506001608060020a038085169088161015610bf257600080fd5b6001850154600160a060020a03169250610c0b88610fca565b6000846001608060020a03161115610c6757610c2684611028565b915050808303600160a060020a0383166001608060020a03821680156108fc0290604051600060405180830381858888f193505050501515610c6757600080fd5b7f8500e47909916e51e97e4880e742d8b9af1afaeb9ea54166947cf42e6616b11788853360405164ffffffffff90931683526001608060020a039091166020830152600160a060020a03166040808301919091526060909101905180910390a150919695505050505050565b600154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a03909216600483015264ffffffffff166024820152604401600060405180830381600087803b1515610d3057600080fd5b5af11515610d3d57600080fd5b5050505050565b600154600160a060020a03166323b872dd83308460405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015264ffffffffff9091166044820152606401600060405180830381600087803b1515610d3057600080fd5b603c816060015164ffffffffff161015610dc657600080fd5b64ffffffffff821660009081526002602052604090208190815181546fffffffffffffffffffffffffffffffff19166001608060020a0391909116178155602082015181546001608060020a03918216700100000000000000000000000000000000029116178155604082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560608201518160010160146101000a81548164ffffffffff021916908364ffffffffff16021790555060808201518160010160196101000a81548164ffffffffff021916908364ffffffffff16021790555060a082015160029190910180546fffffffffffffffffffffffffffffffff19166001608060020a03909216919091179055507f10812469e6e641cdef133a0556aa1bfd46bcd460e603da6af3233f8a6e242f6a828251836020015184606001518560a0015160405164ffffffffff95861681526001608060020a03948516602082015292841660408085019190915291909416606083015292909116608082015260a001905180910390a15050565b600080808064ffffffffff80871690861610610f8157869350610fbf565b876001608060020a0316876001608060020a03160392508564ffffffffff168564ffffffffff168402811515610fb357fe5b05915081880190508093505b505050949350505050565b64ffffffffff16600090815260026020819052604082209182556001820180547fffff0000000000000000000000000000000000000000000000000000000000001690550180546fffffffffffffffffffffffffffffffff19169055565b6001546000906127109060a060020a900461ffff1683026001608060020a03160492915050565b60c06040519081016040908152600080835260208301819052908201819052606082018190526080820181905260a0820152905600a165627a7a723058205f212fe896014f2d0d159ed6c7949ef40e5cc1541135a3776a565dc716f1d4190029

Swarm Source

bzzr://5f212fe896014f2d0d159ed6c7949ef40e5cc1541135a3776a565dc716f1d419
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.