ETH Price: $3,316.53 (-1.11%)
Gas: 3.58 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw Balance124334452021-05-14 16:00:031335 days ago1621008003IN
0xD43e3a7c...675cd245a
0 ETH0.00695988185
Cancel Auction84218792019-08-25 21:39:321963 days ago1566769172IN
0xD43e3a7c...675cd245a
0 ETH0.000044881.1
Cancel Auction73568842019-03-12 21:57:182129 days ago1552427838IN
0xD43e3a7c...675cd245a
0 ETH0.00008162
Bid68700582018-12-12 1:12:232220 days ago1544577143IN
0xD43e3a7c...675cd245a
0 ETH0.0001898
Bid67785752018-11-26 22:02:002235 days ago1543269720IN
0xD43e3a7c...675cd245a
0 ETH0.00009454
Bid67785732018-11-26 22:01:432235 days ago1543269703IN
0xD43e3a7c...675cd245a
0 ETH0.00009454
Bid67626932018-11-24 7:49:502237 days ago1543045790IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67626912018-11-24 7:49:192237 days ago1543045759IN
0xD43e3a7c...675cd245a
0 ETH0.000142146
Bid67626882018-11-24 7:48:572237 days ago1543045737IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67626882018-11-24 7:48:572237 days ago1543045737IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67626852018-11-24 7:48:472237 days ago1543045727IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67626852018-11-24 7:48:472237 days ago1543045727IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67626262018-11-24 7:30:202237 days ago1543044620IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67626142018-11-24 7:28:382237 days ago1543044518IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67625202018-11-24 7:08:042238 days ago1543043284IN
0xD43e3a7c...675cd245a
0 ETH0.000115
Bid67622002018-11-24 5:57:532238 days ago1543039073IN
0xD43e3a7c...675cd245a
0 ETH0.0001898
Bid67578902018-11-23 12:54:112238 days ago1542977651IN
0xD43e3a7c...675cd245a
0 ETH0.000118135
Bid67578902018-11-23 12:54:112238 days ago1542977651IN
0xD43e3a7c...675cd245a
0 ETH0.000118135
Bid67578812018-11-23 12:50:432238 days ago1542977443IN
0xD43e3a7c...675cd245a
0 ETH0.000118135
Bid67578812018-11-23 12:50:432238 days ago1542977443IN
0xD43e3a7c...675cd245a
0 ETH0.000118135
Bid67578632018-11-23 12:46:372238 days ago1542977197IN
0xD43e3a7c...675cd245a
0 ETH0.000118135
Bid67578462018-11-23 12:43:072238 days ago1542976987IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67517072018-11-22 12:41:062239 days ago1542890466IN
0xD43e3a7c...675cd245a
0 ETH0.000142146
Bid67517002018-11-22 12:39:342239 days ago1542890374IN
0xD43e3a7c...675cd245a
0 ETH0.000141756
Bid67316662018-11-19 5:04:432243 days ago1542603883IN
0xD43e3a7c...675cd245a
0 ETH0.0002842812
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
124334452021-05-14 16:00:031335 days ago1621008003
0xD43e3a7c...675cd245a
0.16330928 ETH
66383182018-11-03 22:18:142258 days ago1541283494
0xD43e3a7c...675cd245a
0.27985 ETH
65165862018-10-15 0:23:352278 days ago1539563015
0xD43e3a7c...675cd245a
0.18335 ETH
63013532018-09-09 17:56:592313 days ago1536515819
0xD43e3a7c...675cd245a
0.18335 ETH
62685912018-09-04 5:33:162319 days ago1536039196
0xD43e3a7c...675cd245a
0.18335 ETH
62637542018-09-03 10:01:472319 days ago1535968907
0xD43e3a7c...675cd245a
0.18335 ETH
62574942018-09-02 8:57:532320 days ago1535878673
0xD43e3a7c...675cd245a
0.000965 ETH
62213292018-08-27 6:18:022327 days ago1535350682
0xD43e3a7c...675cd245a
0.18335 ETH
62181802018-08-26 17:25:152327 days ago1535304315
0xD43e3a7c...675cd245a
0.14455501 ETH
62061862018-08-24 17:02:242329 days ago1535130144
0xD43e3a7c...675cd245a
0.193 ETH
61697812018-08-18 13:34:542335 days ago1534599294
0xD43e3a7c...675cd245a
0.27985 ETH
61603392018-08-16 22:46:472337 days ago1534459607
0xD43e3a7c...675cd245a
0.14475 ETH
60900682018-08-05 1:53:162349 days ago1533433996
0xD43e3a7c...675cd245a
0.14475 ETH
60775042018-08-02 23:11:162351 days ago1533251476
0xD43e3a7c...675cd245a
0.14533637 ETH
60681582018-08-01 9:04:352352 days ago1533114275
0xD43e3a7c...675cd245a
0.37635 ETH
60658562018-07-31 23:29:422353 days ago1533079782
0xD43e3a7c...675cd245a
0.08981581 ETH
60646702018-07-31 18:45:512353 days ago1533062751
0xD43e3a7c...675cd245a
0.0965 ETH
60633762018-07-31 13:32:362353 days ago1533043956
0xD43e3a7c...675cd245a
0.12363448 ETH
60597192018-07-30 22:39:442354 days ago1532990384
0xD43e3a7c...675cd245a
0.14475 ETH
60592202018-07-30 20:31:552354 days ago1532982715
0xD43e3a7c...675cd245a
0.0965 ETH
60592182018-07-30 20:31:322354 days ago1532982692
0xD43e3a7c...675cd245a
0.0965 ETH
60591752018-07-30 20:19:282354 days ago1532981968
0xD43e3a7c...675cd245a
0.193 ETH
60591612018-07-30 20:15:502354 days ago1532981750
0xD43e3a7c...675cd245a
0.07461158 ETH
60591462018-07-30 20:12:012354 days ago1532981521
0xD43e3a7c...675cd245a
0.27985 ETH
60591412018-07-30 20:11:102354 days ago1532981470
0xD43e3a7c...675cd245a
0.193 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SaleClockAuction

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

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

pragma solidity ^0.4.19;

// DopeRaider SaleClockAuction Contract
// by gasmasters.io
// contact: [email protected]

/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
contract ERC721 {
    function implementsERC721() public pure returns (bool);
    function totalSupply() public view returns (uint256 total);
    function balanceOf(address _owner) public view returns (uint256 balance);
    function ownerOf(uint256 _tokenId) public view returns (address owner);
    function approve(address _to, uint256 _tokenId) public;
    function transferFrom(address _from, address _to, uint256 _tokenId) public;
    function transfer(address _to, uint256 _tokenId) public;
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    // Optional
    // function name() public view returns (string name);
    // function symbol() public view returns (string symbol);
    // function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256 tokenId);
    // function tokenMetadata(uint256 _tokenId) public view returns (string infoUrl);
}

// File: contracts/Auction/ClockAuctionBase.sol

/// @title Auction Core
/// @dev Contains models, variables, and internal methods for the auction.
contract ClockAuctionBase {

    // Represents an auction on an NFT
    struct Auction {
        // 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
    ERC721 public nonFungibleContract;

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

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

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

    /// @dev DON'T give me your money.
    function() external {}

    // Modifiers to check that inputs can be safely stored with a certain
    // number of bits. We use constants and multiple modifiers to save gas.
    modifier canBeStoredWith64Bits(uint256 _value) {
        require(_value <= 18446744073709551615);
        _;
    }

    modifier canBeStoredWith128Bits(uint256 _value) {
        require(_value < 340282366920938463463374607431768211455);
        _;
    }

    /// @dev Returns true if the claimant owns the token.
    /// @param _claimant - Address claiming to own the token.
    /// @param _tokenId - ID of token whose ownership to verify.
    function _owns(address _claimant, uint256 _tokenId) internal view returns (bool) {
        return (nonFungibleContract.ownerOf(_tokenId) == _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 _owner, uint256 _tokenId) internal {
        // it will throw if transfer fails
        nonFungibleContract.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 _receiver, uint256 _tokenId) internal {
        // it will throw if transfer fails
        nonFungibleContract.transfer(_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(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);

        tokenIdToAuction[_tokenId] = _auction;

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

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

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

        // 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 incoming bid is higher than 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(_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 = _computeCut(price);
            uint256 sellerProceeds = price - 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);
        }

        // Tell the world!
        AuctionSuccessful(_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(uint256 _tokenId) internal {
        delete tokenIdToAuction[_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(uint256 _price) internal view returns (uint256) {
        // 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.
        return _price * ownerCut / 10000;
    }

}

// File: zeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @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;


  /**
   * @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 {
    if (newOwner != address(0)) {
      owner = newOwner;
    }
  }

}

// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol

/**
 * @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 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;
    Pause();
    return true;
  }

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

// File: contracts/Auction/ClockAuction.sol

/// @title Clock auction for non-fungible tokens.
contract ClockAuction is Pausable, ClockAuctionBase {

    /// @dev Constructor creates a reference to the NFT ownership contract
    ///  and verifies the owner cut is in the valid range.
    /// @param _nftAddress - address of a deployed contract implementing
    ///  the Nonfungible Interface.
    /// @param _cut - percent cut the owner takes on each auction, must be
    ///  between 0-10,000.
    /*
    function ClockAuction(address _nftAddress, uint256 _cut) public {
        require(_cut <= 10000);
        ownerCut = _cut;

        ERC721 candidateContract = ERC721(_nftAddress);
        require(candidateContract.implementsERC721());
        nonFungibleContract = candidateContract;
    }*/

    /// @dev Remove all Ether from the contract, which is the owner's cuts
    ///  as well as any Ether sent directly to the contract address.
    ///  Always transfers to the NFT contract, but can be called either by
    ///  the owner or the NFT contract.
    function withdrawBalance() external {
        address nftAddress = address(nonFungibleContract);

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

    /// @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(
        uint256 _tokenId,
        uint256 _startingPrice,
        uint256 _endingPrice,
        uint256 _duration,
        address _seller
    )
        public
        whenNotPaused
        canBeStoredWith128Bits(_startingPrice)
        canBeStoredWith128Bits(_endingPrice)
        canBeStoredWith64Bits(_duration)
    {
        require(_owns(msg.sender, _tokenId));
        _escrow(msg.sender, _tokenId);
        Auction memory auction = Auction(
            _seller,
            uint128(_startingPrice),
            uint128(_endingPrice),
            uint64(_duration),
            uint64(now)
        );
        _addAuction(_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(uint256 _tokenId)
        public
        payable
        whenNotPaused
    {
        // _bid will throw if the bid or funds transfer fails
        _bid(_tokenId, msg.value);
        _transfer(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(uint256 _tokenId)
        public
    {
        Auction storage auction = tokenIdToAuction[_tokenId];
        require(_isOnAuction(auction));
        address seller = auction.seller;
        require(msg.sender == seller);
        _cancelAuction(_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(uint256 _tokenId)
        whenPaused
        onlyOwner
        public
    {
        Auction storage auction = tokenIdToAuction[_tokenId];
        require(_isOnAuction(auction));
        _cancelAuction(_tokenId, auction.seller);
    }

    /// @dev Returns auction info for an NFT on auction.
    /// @param _tokenId - ID of NFT on auction.
    function getAuction(uint256 _tokenId)
        public
        view
        returns
    (
        address seller,
        uint256 startingPrice,
        uint256 endingPrice,
        uint256 duration,
        uint256 startedAt,
        uint256 tokenId
    ) {
        Auction storage auction = tokenIdToAuction[_tokenId];
        require(_isOnAuction(auction));
        return (
            auction.seller,
            auction.startingPrice,
            auction.endingPrice,
            auction.duration,
            auction.startedAt,
            _tokenId
        );
    }

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

}

// File: contracts/Auction/SaleClockAuction.sol

/// @title Clock auction modified for sale of narcos
contract SaleClockAuction is ClockAuction {

    // @dev Sanity check that allows us to ensure that we are pointing to the
    //  right auction in our setSaleAuctionAddress() call.
    bool public isSaleClockAuction = true;

    // Tracks last 4 sale price of gen0 narco sales
    uint256 public gen0SaleCount;
    uint256[4] public lastGen0SalePrices;

    function configureSaleClockAuction(address _nftAddr, uint256 _cut) public onlyOwner
    {
        require(_cut <= 10000);
        ownerCut = _cut;
        ERC721 candidateContract = ERC721(_nftAddr);
        require(candidateContract.implementsERC721());
        nonFungibleContract = candidateContract;
    }


    /// @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 auction (in seconds).
    /// @param _seller - Seller, if not the message sender
    function createAuction(
        uint256 _tokenId,
        uint256 _startingPrice,
        uint256 _endingPrice,
        uint256 _duration,
        address _seller
    )
        public
        canBeStoredWith128Bits(_startingPrice)
        canBeStoredWith128Bits(_endingPrice)
        canBeStoredWith64Bits(_duration)
    {
        require(msg.sender == address(nonFungibleContract));
        _escrow(_seller, _tokenId);
        Auction memory auction = Auction(
            _seller,
            uint128(_startingPrice),
            uint128(_endingPrice),
            uint64(_duration),
            uint64(now)
        );
        _addAuction(_tokenId, auction);
    }

    /// @dev Updates lastSalePrice if seller is the nft contract
    /// Otherwise, works the same as default bid method.
    function bid(uint256 _tokenId)
        public
        payable
    {
        // _bid verifies token ID size
        address seller = tokenIdToAuction[_tokenId].seller;
        uint256 price = _bid(_tokenId, msg.value);
        _transfer(msg.sender, _tokenId);

        // If not a gen0 auction, exit
        if (seller == address(nonFungibleContract)) {
            // Track gen0 sale prices
            lastGen0SalePrices[gen0SaleCount % 4] = price;
            gen0SaleCount++;
        }
    }

    function averageGen0SalePrice() public view returns (uint256) {
        uint256 sum = 0;
        for (uint256 i = 0; i < 4; i++) {
            sum += lastGen0SalePrices[i];
        }
        return sum / 4;
    }

}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_nftAddr","type":"address"},{"name":"_cut","type":"uint256"}],"name":"configureSaleClockAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_startingPrice","type":"uint256"},{"name":"_endingPrice","type":"uint256"},{"name":"_duration","type":"uint256"},{"name":"_seller","type":"address"}],"name":"createAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"bid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"lastGen0SalePrices","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":false,"inputs":[],"name":"withdrawBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getAuction","outputs":[{"name":"seller","type":"address"},{"name":"startingPrice","type":"uint256"},{"name":"endingPrice","type":"uint256"},{"name":"duration","type":"uint256"},{"name":"startedAt","type":"uint256"},{"name":"tokenId","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ownerCut","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isSaleClockAuction","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"cancelAuctionWhenPaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gen0SaleCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"cancelAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getCurrentPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"nonFungibleContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"averageGen0SalePrice","outputs":[{"name":"","type":"uint256"}],"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":"tokenId","type":"uint256"},{"indexed":false,"name":"startingPrice","type":"uint256"},{"indexed":false,"name":"endingPrice","type":"uint256"},{"indexed":false,"name":"duration","type":"uint256"}],"name":"AuctionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"totalPrice","type":"uint256"},{"indexed":false,"name":"winner","type":"address"}],"name":"AuctionSuccessful","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"AuctionCancelled","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"}]

6060604052600080546004805460ff19166001179055600160a060020a033316600160a860020a0319909116179055610e768061003d6000396000f3006060604052600436106100ed5763ffffffff60e060020a6000350416630b9ea95d81146100fa57806327ebe40a1461011c5780633f4ba83a14610147578063454a2ab31461016e578063484eccb4146101795780635c975abb146101a15780635fd8c710146101b457806378bd7935146101c757806383b5ff8b146102285780638456cb591461023b57806385b861881461024e578063878eb368146102615780638a98a9cc146102775780638da5cb5b1461028a57806396b5a755146102b9578063c55d0f56146102cf578063dd1b7a0f146102e5578063eac9d94c146102f8578063f2fde38b1461030b575b34156100f857600080fd5b005b341561010557600080fd5b6100f8600160a060020a036004351660243561032a565b341561012757600080fd5b6100f8600435602435604435606435600160a060020a03608435166103f9565b341561015257600080fd5b61015a6104d2565b604051901515815260200160405180910390f35b6100f8600435610556565b341561018457600080fd5b61018f6004356105c8565b60405190815260200160405180910390f35b34156101ac57600080fd5b61015a6105dc565b34156101bf57600080fd5b6100f86105ec565b34156101d257600080fd5b6101dd60043561066b565b6040518087600160a060020a0316600160a060020a03168152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b341561023357600080fd5b61018f6106fc565b341561024657600080fd5b61015a610702565b341561025957600080fd5b61015a61078b565b341561026c57600080fd5b6100f8600435610794565b341561028257600080fd5b61018f610805565b341561029557600080fd5b61029d61080b565b604051600160a060020a03909116815260200160405180910390f35b34156102c457600080fd5b6100f860043561081a565b34156102da57600080fd5b61018f600435610863565b34156102f057600080fd5b61029d610895565b341561030357600080fd5b61018f6108a4565b341561031657600080fd5b6100f8600160a060020a03600435166108d8565b6000805433600160a060020a0390811691161461034657600080fd5b61271082111561035557600080fd5b50600281905581600160a060020a038116631051db346000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156103a257600080fd5b6102c65a03f115156103b357600080fd5b5050506040518051905015156103c857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b610401610e1c565b846001608060020a03811061041557600080fd5b846001608060020a03811061042957600080fd5b8467ffffffffffffffff81111561043f57600080fd5b60015433600160a060020a0390811691161461045a57600080fd5b610464858a61092f565b60a06040519081016040528086600160a060020a03168152602001896001608060020a03168152602001886001608060020a031681526020018767ffffffffffffffff1681526020014267ffffffffffffffff1681525093506104c789856109aa565b505050505050505050565b6000805433600160a060020a039081169116146104ee57600080fd5b60005460a060020a900460ff16151561050657600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b600081815260036020526040812054600160a060020a0316906105798334610b45565b90506105853384610c3e565b600154600160a060020a03838116911614156105c35780600660046005548115156105ac57fe5b06600481106105b757fe5b01556005805460010190555b505050565b600681600481106105d557fe5b0154905081565b60005460a060020a900460ff1681565b600154600054600160a060020a039182169133811691161480610620575080600160a060020a031633600160a060020a0316145b151561062b57600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561066857600080fd5b50565b60008181526003602052604081208190819081908190819061068c81610c94565b151561069757600080fd5b80546001820154600290920154600160a060020a03909116996001608060020a038084169a70010000000000000000000000000000000090940416985067ffffffffffffffff8083169850680100000000000000009092049091169550909350915050565b60025481565b6000805433600160a060020a0390811691161461071e57600080fd5b60005460a060020a900460ff161561073557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b60045460ff1681565b6000805460a060020a900460ff1615156107ad57600080fd5b60005433600160a060020a039081169116146107c857600080fd5b5060008181526003602052604090206107e081610c94565b15156107eb57600080fd5b8054610801908390600160a060020a0316610cb5565b5050565b60055481565b600054600160a060020a031681565b60008181526003602052604081209061083282610c94565b151561083d57600080fd5b508054600160a060020a03908116903316811461085957600080fd5b6105c38382610cb5565b600081815260036020526040812061087a81610c94565b151561088557600080fd5b61088e81610cff565b9392505050565b600154600160a060020a031681565b600080805b60048110156108ce57600681600481106108bf57fe5b015491909101906001016108a9565b5060049004919050565b60005433600160a060020a039081169116146108f357600080fd5b600160a060020a038116156106685760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600154600160a060020a03166323b872dd83308460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561099257600080fd5b6102c65a03f115156109a357600080fd5b5050505050565b603c816060015167ffffffffffffffff1610156109c657600080fd5b600082815260036020526040902081908151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617815560208201516001820180546fffffffffffffffffffffffffffffffff19166001608060020a039290921691909117905560408201516001820180546001608060020a03928316700100000000000000000000000000000000029216919091179055606082015160028201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560808201516002909101805467ffffffffffffffff9290921668010000000000000000026fffffffffffffffff000000000000000019909216919091179055507fa9c8dfcda5664a5a124c713e386da27de87432d5b668e79458501eb296389ba78260208301516001608060020a031683604001516001608060020a0316846060015167ffffffffffffffff166040518085815260200184815260200183815260200182815260200194505050505060405180910390a15050565b600082815260036020526040812081808080610b6085610c94565b1515610b6b57600080fd5b610b7485610cff565b935083871015610b8357600080fd5b8454600160a060020a03169250610b9988610d86565b6000841115610be257610bab84610dd3565b915050808303600160a060020a03831681156108fc0282604051600060405180830381858888f193505050501515610be257600080fd5b7f4fcc30d90a842164dd58501ab874a101a3749c3d4747139cefe7c876f4ccebd28885336040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390a150919695505050505050565b600154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561099257600080fd5b6002015460006801000000000000000090910467ffffffffffffffff161190565b610cbe82610d86565b610cc88183610c3e565b7f2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df8260405190815260200160405180910390a15050565b6002810154600090819068010000000000000000900467ffffffffffffffff16421115610d455750600282015468010000000000000000900467ffffffffffffffff1642035b6001830154600284015461088e916001608060020a0380821692700100000000000000000000000000000000909204169067ffffffffffffffff1684610ddf565b6000908152600360205260408120805473ffffffffffffffffffffffffffffffffffffffff19168155600181019190915560020180546fffffffffffffffffffffffffffffffff19169055565b60025461271091020490565b6000808080858510610df357869350610e11565b878703925085858402811515610e0557fe5b05915081880190508093505b505050949350505050565b60a06040519081016040908152600080835260208301819052908201819052606082018190526080820152905600a165627a7a72305820252aa3e9fbfc91dbec0b14159d6b3f299f6ae331aaa901a1227866f7fd70ebb40029

Deployed Bytecode

0x6060604052600436106100ed5763ffffffff60e060020a6000350416630b9ea95d81146100fa57806327ebe40a1461011c5780633f4ba83a14610147578063454a2ab31461016e578063484eccb4146101795780635c975abb146101a15780635fd8c710146101b457806378bd7935146101c757806383b5ff8b146102285780638456cb591461023b57806385b861881461024e578063878eb368146102615780638a98a9cc146102775780638da5cb5b1461028a57806396b5a755146102b9578063c55d0f56146102cf578063dd1b7a0f146102e5578063eac9d94c146102f8578063f2fde38b1461030b575b34156100f857600080fd5b005b341561010557600080fd5b6100f8600160a060020a036004351660243561032a565b341561012757600080fd5b6100f8600435602435604435606435600160a060020a03608435166103f9565b341561015257600080fd5b61015a6104d2565b604051901515815260200160405180910390f35b6100f8600435610556565b341561018457600080fd5b61018f6004356105c8565b60405190815260200160405180910390f35b34156101ac57600080fd5b61015a6105dc565b34156101bf57600080fd5b6100f86105ec565b34156101d257600080fd5b6101dd60043561066b565b6040518087600160a060020a0316600160a060020a03168152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b341561023357600080fd5b61018f6106fc565b341561024657600080fd5b61015a610702565b341561025957600080fd5b61015a61078b565b341561026c57600080fd5b6100f8600435610794565b341561028257600080fd5b61018f610805565b341561029557600080fd5b61029d61080b565b604051600160a060020a03909116815260200160405180910390f35b34156102c457600080fd5b6100f860043561081a565b34156102da57600080fd5b61018f600435610863565b34156102f057600080fd5b61029d610895565b341561030357600080fd5b61018f6108a4565b341561031657600080fd5b6100f8600160a060020a03600435166108d8565b6000805433600160a060020a0390811691161461034657600080fd5b61271082111561035557600080fd5b50600281905581600160a060020a038116631051db346000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156103a257600080fd5b6102c65a03f115156103b357600080fd5b5050506040518051905015156103c857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b610401610e1c565b846001608060020a03811061041557600080fd5b846001608060020a03811061042957600080fd5b8467ffffffffffffffff81111561043f57600080fd5b60015433600160a060020a0390811691161461045a57600080fd5b610464858a61092f565b60a06040519081016040528086600160a060020a03168152602001896001608060020a03168152602001886001608060020a031681526020018767ffffffffffffffff1681526020014267ffffffffffffffff1681525093506104c789856109aa565b505050505050505050565b6000805433600160a060020a039081169116146104ee57600080fd5b60005460a060020a900460ff16151561050657600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b600081815260036020526040812054600160a060020a0316906105798334610b45565b90506105853384610c3e565b600154600160a060020a03838116911614156105c35780600660046005548115156105ac57fe5b06600481106105b757fe5b01556005805460010190555b505050565b600681600481106105d557fe5b0154905081565b60005460a060020a900460ff1681565b600154600054600160a060020a039182169133811691161480610620575080600160a060020a031633600160a060020a0316145b151561062b57600080fd5b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561066857600080fd5b50565b60008181526003602052604081208190819081908190819061068c81610c94565b151561069757600080fd5b80546001820154600290920154600160a060020a03909116996001608060020a038084169a70010000000000000000000000000000000090940416985067ffffffffffffffff8083169850680100000000000000009092049091169550909350915050565b60025481565b6000805433600160a060020a0390811691161461071e57600080fd5b60005460a060020a900460ff161561073557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b60045460ff1681565b6000805460a060020a900460ff1615156107ad57600080fd5b60005433600160a060020a039081169116146107c857600080fd5b5060008181526003602052604090206107e081610c94565b15156107eb57600080fd5b8054610801908390600160a060020a0316610cb5565b5050565b60055481565b600054600160a060020a031681565b60008181526003602052604081209061083282610c94565b151561083d57600080fd5b508054600160a060020a03908116903316811461085957600080fd5b6105c38382610cb5565b600081815260036020526040812061087a81610c94565b151561088557600080fd5b61088e81610cff565b9392505050565b600154600160a060020a031681565b600080805b60048110156108ce57600681600481106108bf57fe5b015491909101906001016108a9565b5060049004919050565b60005433600160a060020a039081169116146108f357600080fd5b600160a060020a038116156106685760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600154600160a060020a03166323b872dd83308460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561099257600080fd5b6102c65a03f115156109a357600080fd5b5050505050565b603c816060015167ffffffffffffffff1610156109c657600080fd5b600082815260036020526040902081908151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617815560208201516001820180546fffffffffffffffffffffffffffffffff19166001608060020a039290921691909117905560408201516001820180546001608060020a03928316700100000000000000000000000000000000029216919091179055606082015160028201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560808201516002909101805467ffffffffffffffff9290921668010000000000000000026fffffffffffffffff000000000000000019909216919091179055507fa9c8dfcda5664a5a124c713e386da27de87432d5b668e79458501eb296389ba78260208301516001608060020a031683604001516001608060020a0316846060015167ffffffffffffffff166040518085815260200184815260200183815260200182815260200194505050505060405180910390a15050565b600082815260036020526040812081808080610b6085610c94565b1515610b6b57600080fd5b610b7485610cff565b935083871015610b8357600080fd5b8454600160a060020a03169250610b9988610d86565b6000841115610be257610bab84610dd3565b915050808303600160a060020a03831681156108fc0282604051600060405180830381858888f193505050501515610be257600080fd5b7f4fcc30d90a842164dd58501ab874a101a3749c3d4747139cefe7c876f4ccebd28885336040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390a150919695505050505050565b600154600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561099257600080fd5b6002015460006801000000000000000090910467ffffffffffffffff161190565b610cbe82610d86565b610cc88183610c3e565b7f2809c7e17bf978fbc7194c0a694b638c4215e9140cacc6c38ca36010b45697df8260405190815260200160405180910390a15050565b6002810154600090819068010000000000000000900467ffffffffffffffff16421115610d455750600282015468010000000000000000900467ffffffffffffffff1642035b6001830154600284015461088e916001608060020a0380821692700100000000000000000000000000000000909204169067ffffffffffffffff1684610ddf565b6000908152600360205260408120805473ffffffffffffffffffffffffffffffffffffffff19168155600181019190915560020180546fffffffffffffffffffffffffffffffff19169055565b60025461271091020490565b6000808080858510610df357869350610e11565b878703925085858402811515610e0557fe5b05915081880190508093505b505050949350505050565b60a06040519081016040908152600080835260208301819052908201819052606082018190526080820152905600a165627a7a72305820252aa3e9fbfc91dbec0b14159d6b3f299f6ae331aaa901a1227866f7fd70ebb40029

Swarm Source

bzzr://252aa3e9fbfc91dbec0b14159d6b3f299f6ae331aaa901a1227866f7fd70ebb4

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.