ETH Price: $2,667.16 (-5.05%)

Token

Hero (HERO)
 

Overview

Max Total Supply

1,090 HERO

Holders

0

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 0 Decimals)

Balance
0 HERO

Value
$0.00
0xb9be33aa06436076f5bea3f022fe3f68c64b11b2
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
HeroTokenAuction

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-03-10
*/

pragma solidity ^0.4.19;

/**
 * @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) onlyOwner public {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}


/**
 * @title JointOwnable
 * @dev Extension for the Ownable contract, where the owner can assign at most 2 other addresses
 *  to manage some functions of the contract, using the eitherOwner modifier.
 *  Note that onlyOwner modifier would still be accessible only for the original owner.
 */
contract JointOwnable is Ownable {

  event AnotherOwnerAssigned(address indexed anotherOwner);

  address public anotherOwner1;
  address public anotherOwner2;

  /**
   * @dev Throws if called by any account other than the owner or anotherOwner.
   */
  modifier eitherOwner() {
    require(msg.sender == owner || msg.sender == anotherOwner1 || msg.sender == anotherOwner2);
    _;
  }

  /**
   * @dev Allows the current owner to assign another owner.
   * @param _anotherOwner The address to another owner.
   */
  function assignAnotherOwner1(address _anotherOwner) onlyOwner public {
    require(_anotherOwner != 0);
    AnotherOwnerAssigned(_anotherOwner);
    anotherOwner1 = _anotherOwner;
  }

  /**
   * @dev Allows the current owner to assign another owner.
   * @param _anotherOwner The address to another owner.
   */
  function assignAnotherOwner2(address _anotherOwner) onlyOwner public {
    require(_anotherOwner != 0);
    AnotherOwnerAssigned(_anotherOwner);
    anotherOwner2 = _anotherOwner;
  }

}


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

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

}


/**
 * @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens.
 */
contract ERC721 {

    // Events
    event Transfer(address indexed from, address indexed to, uint indexed tokenId);
    event Approval(address indexed owner, address indexed approved, uint indexed tokenId);

    // ERC20 compatible functions.
    // function name() public constant returns (string);
    // function symbol() public constant returns (string);
    function totalSupply() public view returns (uint);
    function balanceOf(address _owner) public view returns (uint);

    // Functions that define ownership.
    function ownerOf(uint _tokenId) external view returns (address);
    function transfer(address _to, uint _tokenId) external;

    // Approval related functions, mainly used in auction contracts.
    function approve(address _to, uint _tokenId) external;
    function approvedFor(uint _tokenId) external view returns (address);
    function transferFrom(address _from, address _to, uint _tokenId) external;

    /**
     * @dev Each non-fungible token owner can own more than one token at one time.
     * Because each token is referenced by its unique ID, however,
     * it can get difficult to keep track of the individual tokens that a user may own.
     * To do this, the contract keeps a record of the IDs of each token that each user owns.
     */
    mapping(address => uint[]) public ownerTokens;

}


/**
 * @title The ERC-721 compliance token contract.
 */
contract ERC721Token is ERC721, Pausable {

    /* ======== STATE VARIABLES ======== */

    /**
     * @dev A mapping from token IDs to the address that owns them.
     */
    mapping(uint => address) tokenIdToOwner;

    /**
     * @dev A mapping from token ids to an address that has been approved to call
     *  transferFrom(). Each token can only have one approved address for transfer
     *  at any time. A zero value means no approval is outstanding.
     */
    mapping (uint => address) tokenIdToApproved;

    /**
     * @dev A mapping from token ID to index of the ownerTokens' tokens list.
     */
    mapping(uint => uint) tokenIdToOwnerTokensIndex;


    /* ======== PUBLIC/EXTERNAL FUNCTIONS ======== */

    /**
     * @dev Returns the number of tokens owned by a specific address.
     * @param _owner The owner address to check.
     */
    function balanceOf(address _owner) public view returns (uint) {
        return ownerTokens[_owner].length;
    }

    /**
     * @dev Returns the address currently assigned ownership of a given token.
     */
    function ownerOf(uint _tokenId) external view returns (address) {
        require(tokenIdToOwner[_tokenId] != address(0));

        return tokenIdToOwner[_tokenId];
    }

    /**
    * @dev Returns the approved address of a given token.
    */
    function approvedFor(uint _tokenId) external view returns (address) {
        return tokenIdToApproved[_tokenId];
    }

    /**
     * @dev Get an array of IDs of each token that an user owns.
     */
    function getOwnerTokens(address _owner) external view returns(uint[]) {
        return ownerTokens[_owner];
    }

    /**
     * @dev External function to transfers a token to another address.
     * @param _to The address of the recipient, can be a user or contract.
     * @param _tokenId The ID of the token to transfer.
     */
    function transfer(address _to, uint _tokenId) whenNotPaused external {
        // Safety check to prevent against an unexpected 0x0 default.
        require(_to != address(0));

        // Disallow transfers to this contract to prevent accidental misuse.
        require(_to != address(this));

        // You can only send your own token.
        require(_owns(msg.sender, _tokenId));

        // Reassign ownership, clear pending approvals, emit Transfer event.
        _transfer(msg.sender, _to, _tokenId);
    }

    /**
     * @dev Grant another address the right to transfer a specific Kitty via
     *  transferFrom(). This is the preferred flow for transfering NFTs to contracts.
     * @param _to The address to be granted transfer approval. Pass address(0) to
     *  clear all approvals.
     * @param _tokenId The ID of the Kitty that can be transferred if this call succeeds.
     */
    function approve(address _to, uint _tokenId) whenNotPaused external {
        // Only an owner can grant transfer approval.
        require(_owns(msg.sender, _tokenId));

        // Register the approval (replacing any previous approval).
        _approve(_tokenId, _to);

        // Emit approval event.
        Approval(msg.sender, _to, _tokenId);
    }

    /**
     * @dev Transfer a Kitty owned by another address, for which the calling address
     *  has previously been granted transfer approval by the owner.
     * @param _from The address that owns the Kitty to be transfered.
     * @param _to The address that should take ownership of the Kitty. Can be any address,
     *  including the caller.
     * @param _tokenId The ID of the Kitty to be transferred.
     */
    function transferFrom(address _from, address _to, uint _tokenId) whenNotPaused external {
        // Safety check to prevent against an unexpected 0x0 default.
        require(_to != address(0));

        // Check for approval and valid ownership
        require(tokenIdToApproved[_tokenId] == msg.sender);
        require(_owns(_from, _tokenId));

        // Reassign ownership (also clears pending approvals and emits Transfer event).
        _transfer(_from, _to, _tokenId);
    }


    /* ======== INTERNAL/PRIVATE FUNCTIONS ======== */

    /**
     * @dev Assigns ownership of a specific token to an address.
     */
    function _transfer(address _from, address _to, uint _tokenId) internal {
        // Step 1: Remove token from _form address.
        // When creating new token, _from is 0x0.
        if (_from != address(0)) {
            uint[] storage fromTokens = ownerTokens[_from];
            uint tokenIndex = tokenIdToOwnerTokensIndex[_tokenId];

            // Put the last token to the transferred token index and update its index in ownerTokensIndexes.
            uint lastTokenId = fromTokens[fromTokens.length - 1];

            // Do nothing if the transferring token is the last item.
            if (_tokenId != lastTokenId) {
                fromTokens[tokenIndex] = lastTokenId;
                tokenIdToOwnerTokensIndex[lastTokenId] = tokenIndex;
            }

            fromTokens.length--;
        }

        // Step 2: Add token to _to address.
        // Transfer ownership.
        tokenIdToOwner[_tokenId] = _to;

        // Add the _tokenId to ownerTokens[_to] and remember the index in ownerTokensIndexes.
        tokenIdToOwnerTokensIndex[_tokenId] = ownerTokens[_to].length;
        ownerTokens[_to].push(_tokenId);

        // Emit the Transfer event.
        Transfer(_from, _to, _tokenId);
    }

    /**
     * @dev Marks an address as being approved for transferFrom(), overwriting any previous
     *  approval. Setting _approved to address(0) clears all transfer approval.
     */
    function _approve(uint _tokenId, address _approved) internal {
        tokenIdToApproved[_tokenId] = _approved;
    }


    /* ======== MODIFIERS ======== */

    /**
     * @dev Throws if _dungeonId is not created yet.
     */
    modifier tokenExists(uint _tokenId) {
        require(_tokenId < totalSupply());
        _;
    }

    /**
     * @dev Checks if a given address is the current owner of a particular token.
     * @param _claimant The address we are validating against.
     * @param _tokenId Token ID
     */
    function _owns(address _claimant, uint _tokenId) internal view returns (bool) {
        return tokenIdToOwner[_tokenId] == _claimant;
    }

}


contract EDStructs {

    /**
     * @dev The main Dungeon struct. Every dungeon in the game is represented by this structure.
     * A dungeon is consists of an unlimited number of floors for your heroes to challenge,
     * the power level of a dungeon is encoded in the floorGenes. Some dungeons are in fact more "challenging" than others,
     * the secret formula for that is left for user to find out.
     *
     * Each dungeon also has a "training area", heroes can perform trainings and upgrade their stat,
     * and some dungeons are more effective in the training, which is also a secret formula!
     *
     * When player challenge or do training in a dungeon, the fee will be collected as the dungeon rewards,
     * which will be rewarded to the player who successfully challenged the current floor.
     *
     * Each dungeon fits in fits into three 256-bit words.
     */
    struct Dungeon {

        // Each dungeon has an ID which is the index in the storage array.

        // The timestamp of the block when this dungeon is created.
        uint32 creationTime;

        // The status of the dungeon, each dungeon can have 5 status, namely:
        // 0: Active | 1: Transport Only | 2: Challenge Only | 3: Train Only | 4: InActive
        uint8 status;

        // The dungeon's difficulty, the higher the difficulty,
        // normally, the "rarer" the seedGenes, the higher the diffculty,
        // and the higher the contribution fee it is to challenge, train, and transport to the dungeon,
        // the formula for the contribution fee is in DungeonChallenge and DungeonTraining contracts.
        // A dungeon's difficulty never change.
        uint8 difficulty;

        // The dungeon's capacity, maximum number of players allowed to stay on this dungeon.
        // The capacity of the newbie dungeon (Holyland) is set at 0 (which is infinity).
        // Using 16-bit unsigned integers can have a maximum of 65535 in capacity.
        // A dungeon's capacity never change.
        uint16 capacity;

        // The current floor number, a dungeon is consists of an umlimited number of floors,
        // when there is heroes successfully challenged a floor, the next floor will be
        // automatically generated. Using 32-bit unsigned integer can have a maximum of 4 billion floors.
        uint32 floorNumber;

        // The timestamp of the block when the current floor is generated.
        uint32 floorCreationTime;

        // Current accumulated rewards, successful challenger will get a large proportion of it.
        uint128 rewards;

        // The seed genes of the dungeon, it is used as the base gene for first floor,
        // some dungeons are rarer and some are more common, the exact details are,
        // of course, top secret of the game!
        // A dungeon's seedGenes never change.
        uint seedGenes;

        // The genes for current floor, it encodes the difficulty level of the current floor.
        // We considered whether to store the entire array of genes for all floors, but
        // in order to save some precious gas we're willing to sacrifice some functionalities with that.
        uint floorGenes;

    }

    /**
     * @dev The main Hero struct. Every hero in the game is represented by this structure.
     */
    struct Hero {

        // Each hero has an ID which is the index in the storage array.

        // The timestamp of the block when this dungeon is created.
        uint64 creationTime;

        // The timestamp of the block where a challenge is performed, used to calculate when a hero is allowed to engage in another challenge.
        uint64 cooldownStartTime;

        // Every time a hero challenge a dungeon, its cooldown index will be incremented by one.
        uint32 cooldownIndex;

        // The seed of the hero, the gene encodes the power level of the hero.
        // This is another top secret of the game! Hero's gene can be upgraded via
        // training in a dungeon.
        uint genes;

    }

}


contract HeroTokenInterface is ERC721, EDStructs {

    /**
     * @dev Name of token.
     */
    string public constant name = "Hero";

    /**
     * @dev Symbol of token.
     */
    string public constant symbol = "HERO";

    /**
     * @dev An array containing the Hero struct, which contains all the heroes in existance.
     *  The ID for each hero is the index of this array.
     */
    Hero[] public heroes;

    /**
     * @dev An external function that creates a new hero and stores it,
     *  only contract owners can create new token.
     *  method doesn't do any checking and should only be called when the
     *  input data is known to be valid.
     * @param _genes The gene of the new hero.
     * @param _owner The inital owner of this hero.
     * @return The hero ID of the new hero.
     */
    function createHero(uint _genes, address _owner) external returns (uint);

    /**
     * @dev The external function to set the hero genes by its ID,
     *  only contract owners can alter hero state.
     */
    function setHeroGenes(uint _id, uint _newGenes) external;

    /**
     * @dev Set the cooldownStartTime for the given hero. Also increments the cooldownIndex.
     */
    function triggerCooldown(uint _id) external;

}


/**
 * @title The ERC-721 compliance token contract for the Hero tokens.
 * @dev See the DungeonStructs contract to see the details of the Hero token data structure.
 */
contract HeroToken is HeroTokenInterface, ERC721Token, JointOwnable {


    /* ======== EVENTS ======== */

    /**
     * @dev The Mint event is fired whenever a new hero is created.
     */
    event Mint(address indexed owner, uint newTokenId, uint genes);


    /* ======== PUBLIC/EXTERNAL FUNCTIONS ======== */

    /**
     * @dev Returns the total number of tokens currently in existence.
     */
    function totalSupply() public view returns (uint) {
        return heroes.length;
    }

    /**
     * @dev An external function that creates a new hero and stores it,
     *  only contract owners can create new token.
     *  method doesn't do any checking and should only be called when the
     *  input data is known to be valid.
     * @param _genes The gene of the new hero.
     * @param _owner The inital owner of this hero.
     * @return The hero ID of the new hero.
     */
    function createHero(uint _genes, address _owner) eitherOwner external returns (uint) {
        return _createHero(_genes, _owner);
    }

    /**
     * @dev The external function to set the hero genes by its ID,
     *  only contract owners can alter hero state.
     */
    function setHeroGenes(uint _id, uint _newGenes) eitherOwner tokenExists(_id) external {
        heroes[_id].genes = _newGenes;
    }

    /**
     * @dev Set the cooldownStartTime for the given hero. Also increments the cooldownIndex.
     */
    function triggerCooldown(uint _id) eitherOwner tokenExists(_id) external {
        Hero storage hero = heroes[_id];

        hero.cooldownStartTime = uint64(now);
        hero.cooldownIndex++;
    }


    /* ======== PRIVATE/INTERNAL FUNCTIONS ======== */

    function _createHero(uint _genes, address _owner) private returns (uint) {
        // ** STORAGE UPDATE **
        // Create a new hero.
        heroes.push(Hero(uint64(now), 0, 0, _genes));

        // Token id is the index in the storage array.
        uint newTokenId = heroes.length - 1;

        // Emit the token mint event.
        Mint(_owner, newTokenId, _genes);

        // This will assign ownership, and also emit the Transfer event.
        _transfer(0, _owner, newTokenId);

        return newTokenId;
    }


    /* ======== MIGRATION FUNCTIONS ======== */


    /**
     * @dev Since the HeroToken contract is re-deployed due to optimization.
     *  We need to migrate all heroes from Beta token contract to Version 1.
     */
    function migrateHero(uint _genes, address _owner) external {
        // Migration will be finished before maintenance period ends, tx.origin is used within a short period only.
        require(now < 1520694000 && tx.origin == 0x47169f78750Be1e6ec2DEb2974458ac4F8751714);

        _createHero(_genes, _owner);
    }

}


/**
 * @title ERC721DutchAuction
 * @dev Dutch auction / Decreasing clock auction for ERC721 tokens.
 */
contract ERC721DutchAuction is Ownable, Pausable {

    /* ======== STRUCTS/ENUMS ======== */

    // Represents an auction of an ERC721 token.
    struct Auction {

        // Current owner of the ERC721 token.
        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;

    }


    /* ======== CONTRACTS ======== */

    // Reference to contract tracking ERC721 token ownership.
    ERC721 public nonFungibleContract;


    /* ======== STATE VARIABLES ======== */

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

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


    /* ======== EVENTS ======== */

    event AuctionCreated(uint timestamp, address indexed seller, uint indexed tokenId, uint startingPrice, uint endingPrice, uint duration);
    event AuctionSuccessful(uint timestamp, address indexed seller, uint indexed tokenId, uint totalPrice, address winner);
    event AuctionCancelled(uint timestamp, address indexed seller, uint indexed tokenId);

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

        nonFungibleContract = ERC721(_tokenAddress);
        ownerCut = _ownerCut;
    }


    /* ======== PUBLIC/EXTERNAL FUNCTIONS ======== */

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

        // Transfers the token owned by this contract to another address. It will throw if transfer fails.
        nonFungibleContract.transfer(msg.sender, _tokenId);
    }

    /**
     * @dev Cancels an auction that hasn't been won yet. Returns the token 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(uint _tokenId) external {
        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 tokens are returned to
     *  the seller. This should only be used in emergencies.
     * @param _tokenId - ID of the token on auction to cancel.
     */
    function cancelAuctionWhenPaused(uint _tokenId) whenPaused onlyOwner external {
        Auction storage auction = tokenIdToAuction[_tokenId];
        require(_isOnAuction(auction));

        _cancelAuction(_tokenId, auction.seller);
    }

    /**
     * @dev Remove all Ether from the contract, which is the owner's cuts
     *  as well as any Ether sent directly to the contract address.
     */
    function withdrawBalance() onlyOwner external {
        msg.sender.transfer(this.balance);
    }

    /**
     * @dev Returns auction info for an token on auction.
     * @param _tokenId - ID of token on auction.
     */
    function getAuction(uint _tokenId) external view returns (
        address seller,
        uint startingPrice,
        uint endingPrice,
        uint duration,
        uint startedAt
    ) {
        Auction storage auction = tokenIdToAuction[_tokenId];
        require(_isOnAuction(auction));

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

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

        return _computeCurrentPrice(auction);
    }


    /* ======== INTERNAL/PRIVATE FUNCTIONS ======== */

    /**
     * @dev Creates and begins a new auction. Perform all the checkings necessary.
     * @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(
        uint _tokenId,
        uint _startingPrice,
        uint _endingPrice,
        uint _duration,
        address _seller
    ) internal {
        // Sanity check that no inputs overflow how many bits we've allocated to store them in the auction struct.
        require(_startingPrice == uint(uint128(_startingPrice)));
        require(_endingPrice == uint(uint128(_endingPrice)));
        require(_duration == uint(uint64(_duration)));

        // If the token is already on any auction, this will throw
        // because it will be owned by the auction contract.
        require(nonFungibleContract.ownerOf(_tokenId) == msg.sender);

        // Throw if the _endingPrice is larger than _startingPrice.
        require(_startingPrice >= _endingPrice);

        // Require that all auctions have a duration of at least one minute.
        require(_duration >= 1 minutes);

        // Transfer the token from its owner to this contract. It will throw if transfer fails.
        nonFungibleContract.transferFrom(msg.sender, this, _tokenId);

        Auction memory auction = Auction(
            _seller,
            uint128(_startingPrice),
            uint128(_endingPrice),
            uint64(_duration),
            uint64(now)
        );

        _addAuction(_tokenId, auction);
    }

    /**
     * @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(uint _tokenId, Auction _auction) internal {
        tokenIdToAuction[_tokenId] = _auction;

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

    /**
     * @dev Computes the price and transfers winnings.
     *  Does NOT transfer ownership of token.
     */
    function _bid(uint _tokenId, uint _bidAmount) internal returns (uint) {
        // 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 bid is greater than or equal to the current price
        uint price = _computeCurrentPrice(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.
            uint auctioneerCut = price * ownerCut / 10000;
            uint sellerProceeds = price - auctioneerCut;

            seller.transfer(sellerProceeds);
        }

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

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

        // Tell the world!
        AuctionSuccessful(now, seller, _tokenId, price, msg.sender);

        return price;
    }

    /**
     * @dev Cancels an auction unconditionally.
     */
    function _cancelAuction(uint _tokenId, address _seller) internal {
        _removeAuction(_tokenId);

        // Transfers the token owned by this contract to its original owner. It will throw if transfer fails.
        nonFungibleContract.transfer(_seller, _tokenId);

        AuctionCancelled(now, _seller, _tokenId);
    }

    /**
     * @dev Removes an auction from the list of open auctions.
     * @param _tokenId - ID of token on auction.
     */
    function _removeAuction(uint _tokenId) internal {
        delete tokenIdToAuction[_tokenId];
    }

    /**
     * @dev Returns current price of an token 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 _computeCurrentPrice(Auction storage _auction) internal view returns (uint) {
        uint 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;
        }

        if (secondsPassed >= _auction.duration) {
            // We've reached the end of the dynamic pricing portion
            // of the auction, just return the end price.
            return _auction.endingPrice;
        } else {
            // Starting price can be higher than ending price (and often is!), so
            // this delta can be negative.
            int totalPriceChange = int(_auction.endingPrice) - int(_auction.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.
            int currentPriceChange = totalPriceChange * int(secondsPassed) / int(_auction.duration);

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

            return uint(currentPrice);
        }
    }


    /* ======== MODIFIERS ======== */

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

}


contract HeroTokenAuction is HeroToken, ERC721DutchAuction {

    function HeroTokenAuction(uint _ownerCut) ERC721DutchAuction(this, _ownerCut) public { }

    /**
     * @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).
     */
    function createAuction(
        uint _tokenId,
        uint _startingPrice,
        uint _endingPrice,
        uint _duration
    ) whenNotPaused external {
        _approve(_tokenId, this);

        // This will perform all the checkings necessary.
        _createAuction(_tokenId, _startingPrice, _endingPrice, _duration, msg.sender);
    }

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_genes","type":"uint256"},{"name":"_owner","type":"address"}],"name":"createHero","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"},{"name":"_newGenes","type":"uint256"}],"name":"setHeroGenes","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"anotherOwner1","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"name":"ownerTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"approvedFor","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","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":"createAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"bid","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_anotherOwner","type":"address"}],"name":"assignAnotherOwner2","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":"withdrawBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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"}],"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":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"cancelAuctionWhenPaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"cancelAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"uint256"}],"name":"triggerCooldown","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"heroes","outputs":[{"name":"creationTime","type":"uint64"},{"name":"cooldownStartTime","type":"uint64"},{"name":"cooldownIndex","type":"uint32"},{"name":"genes","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_genes","type":"uint256"},{"name":"_owner","type":"address"}],"name":"migrateHero","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"anotherOwner2","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","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":"_owner","type":"address"}],"name":"getOwnerTokens","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":false,"inputs":[{"name":"_anotherOwner","type":"address"}],"name":"assignAnotherOwner1","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_ownerCut","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"timestamp","type":"uint256"},{"indexed":true,"name":"seller","type":"address"},{"indexed":true,"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":"timestamp","type":"uint256"},{"indexed":true,"name":"seller","type":"address"},{"indexed":true,"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":"timestamp","type":"uint256"},{"indexed":true,"name":"seller","type":"address"},{"indexed":true,"name":"tokenId","type":"uint256"}],"name":"AuctionCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"newTokenId","type":"uint256"},{"indexed":false,"name":"genes","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"anotherOwner","type":"address"}],"name":"AnotherOwnerAssigned","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"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":true,"name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"approved","type":"address"},{"indexed":true,"name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"}]

60606040526002805460a060020a60ff0219169055341561001f57600080fd5b604051602080611c258339810160405280805160028054600160a060020a03191633600160a060020a031617905591503090508161271081111561006257600080fd5b60088054600160a060020a031916600160a060020a03939093169290921790915560095550611b8f806100966000396000f3006060604052600436106101925763ffffffff60e060020a60003504166306fdde038114610197578063095ea7b31461022157806314fbc22b1461024557806315e839c11461027957806318160ddd146102925780631b900c27146102a557806323b872dd146102d457806328b60031146102fc5780632a6dd48f1461031e5780633f4ba83a14610334578063431f21da14610347578063454a2ab314610366578063579e0b87146103715780635c975abb146103905780635fd8c710146103b75780636352211e146103ca57806370a08231146103e057806378bd7935146103ff57806383b5ff8b146104505780638456cb5914610463578063878eb368146104765780638da5cb5b1461048c57806395d89b411461049f57806396b5a755146104b2578063a540db73146104c8578063a8d4a03b146104de578063a9059cbb14610530578063b430da3c14610552578063b513318914610574578063c55d0f5614610587578063d63d4af01461059d578063dd1b7a0f1461060f578063ed047efd14610622578063f2fde38b14610641575b600080fd5b34156101a257600080fd5b6101aa610660565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101e65780820151838201526020016101ce565b50505050905090810190601f1680156102135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022c57600080fd5b610243600160a060020a0360043516602435610697565b005b341561025057600080fd5b610267600435600160a060020a0360243516610712565b60405190815260200160405180910390f35b341561028457600080fd5b610243600435602435610775565b341561029d57600080fd5b610267610802565b34156102b057600080fd5b6102b8610809565b604051600160a060020a03909116815260200160405180910390f35b34156102df57600080fd5b610243600160a060020a0360043581169060243516604435610818565b341561030757600080fd5b610267600160a060020a0360043516602435610890565b341561032957600080fd5b6102b86004356108be565b341561033f57600080fd5b6102436108d9565b341561035257600080fd5b610243600435602435604435606435610958565b61024360043561098c565b341561037c57600080fd5b610243600160a060020a0360043516610a15565b341561039b57600080fd5b6103a3610a9d565b604051901515815260200160405180910390f35b34156103c257600080fd5b610243610aad565b34156103d557600080fd5b6102b8600435610b07565b34156103eb57600080fd5b610267600160a060020a0360043516610b46565b341561040a57600080fd5b610415600435610b61565b604051600160a060020a03909516855260208501939093526040808501929092526060840152608083019190915260a0909101905180910390f35b341561045b57600080fd5b610267610be1565b341561046e57600080fd5b610243610be7565b341561048157600080fd5b610243600435610c6b565b341561049757600080fd5b6102b8610cde565b34156104aa57600080fd5b6101aa610ced565b34156104bd57600080fd5b610243600435610d24565b34156104d357600080fd5b610243600435610d6d565b34156104e957600080fd5b6104f4600435610e5b565b60405167ffffffffffffffff948516815292909316602083015263ffffffff166040808301919091526060820192909252608001905180910390f35b341561053b57600080fd5b610243600160a060020a0360043516602435610eae565b341561055d57600080fd5b610243600435600160a060020a0360243516610f1b565b341561057f57600080fd5b6102b8610f5f565b341561059257600080fd5b610267600435610f6e565b34156105a857600080fd5b6105bc600160a060020a0360043516610f99565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156105fb5780820151838201526020016105e3565b505050509050019250505060405180910390f35b341561061a57600080fd5b6102b861101b565b341561062d57600080fd5b610243600160a060020a036004351661102a565b341561064c57600080fd5b610243600160a060020a03600435166110b2565b60408051908101604052600481527f4865726f00000000000000000000000000000000000000000000000000000000602082015281565b60025460a060020a900460ff16156106ae57600080fd5b6106b83382611140565b15156106c357600080fd5b6106cd8183611160565b8082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60025460009033600160a060020a0390811691161480610740575060065433600160a060020a039081169116145b80610759575060075433600160a060020a039081169116145b151561076457600080fd5b61076e838361118e565b9392505050565b60025433600160a060020a03908116911614806107a0575060065433600160a060020a039081169116145b806107b9575060075433600160a060020a039081169116145b15156107c457600080fd5b816107cd610802565b81106107d857600080fd5b816001848154811015156107e857fe5b906000526020600020906002020160010181905550505050565b6001545b90565b600654600160a060020a031681565b60025460a060020a900460ff161561082f57600080fd5b600160a060020a038216151561084457600080fd5b60008181526004602052604090205433600160a060020a0390811691161461086b57600080fd5b6108758382611140565b151561088057600080fd5b61088b8383836112ce565b505050565b6000602052816000526040600020818154811015156108ab57fe5b6000918252602090912001549150829050565b600090815260046020526040902054600160a060020a031690565b60025433600160a060020a039081169116146108f457600080fd5b60025460a060020a900460ff16151561090c57600080fd5b6002805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60025460a060020a900460ff161561096f57600080fd5b6109798430611160565b6109868484848433611420565b50505050565b60025460a060020a900460ff16156109a357600080fd5b6109ad81346115ea565b50600854600160a060020a031663a9059cbb338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610a0457600080fd5b6102c65a03f1151561098657600080fd5b60025433600160a060020a03908116911614610a3057600080fd5b600160a060020a0381161515610a4557600080fd5b80600160a060020a03167f867fbe6d3f29b605c4f7d8bd1d173f5d126812e9feff3bf9d0cea625c5e6873c60405160405180910390a260078054600160a060020a031916600160a060020a0392909216919091179055565b60025460a060020a900460ff1681565b60025433600160a060020a03908116911614610ac857600080fd5b33600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f193505050501515610b0557600080fd5b565b600081815260036020526040812054600160a060020a03161515610b2a57600080fd5b50600090815260036020526040902054600160a060020a031690565b600160a060020a031660009081526020819052604090205490565b6000818152600a602052604081208190819081908190610b8081611727565b1515610b8b57600080fd5b80546001820154600290920154600160a060020a03909116986001608060020a038084169950608060020a909304909216965067ffffffffffffffff808216965068010000000000000000909104169350915050565b60095481565b60025433600160a060020a03908116911614610c0257600080fd5b60025460a060020a900460ff1615610c1957600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60025460009060a060020a900460ff161515610c8657600080fd5b60025433600160a060020a03908116911614610ca157600080fd5b506000818152600a60205260409020610cb981611727565b1515610cc457600080fd5b8054610cda908390600160a060020a0316611748565b5050565b600254600160a060020a031681565b60408051908101604052600481527f4845524f00000000000000000000000000000000000000000000000000000000602082015281565b6000818152600a6020526040812090610d3c82611727565b1515610d4757600080fd5b508054600160a060020a039081169033168114610d6357600080fd5b61088b8382611748565b60025460009033600160a060020a0390811691161480610d9b575060065433600160a060020a039081169116145b80610db4575060075433600160a060020a039081169116145b1515610dbf57600080fd5b81610dc8610802565b8110610dd357600080fd5b6001805484908110610de157fe5b60009182526020909120600290910201805463ffffffff608060020a67ffffffffffffffff421668010000000000000000026fffffffffffffffff00000000000000001990931692909217828104821660010190911690910273ffffffff0000000000000000000000000000000019909116179055505050565b6001805482908110610e6957fe5b60009182526020909120600290910201805460019091015467ffffffffffffffff80831693506801000000000000000083041691608060020a900463ffffffff169084565b60025460a060020a900460ff1615610ec557600080fd5b600160a060020a0382161515610eda57600080fd5b30600160a060020a031682600160a060020a031614151515610efb57600080fd5b610f053382611140565b1515610f1057600080fd5b610cda3383836112ce565b635aa3f2f042108015610f4a57507347169f78750be1e6ec2deb2974458ac4f8751714600160a060020a033216145b1515610f5557600080fd5b61088b828261118e565b600754600160a060020a031681565b6000818152600a60205260408120610f8581611727565b1515610f9057600080fd5b61076e816117fd565b610fa1611a8a565b60008083600160a060020a0316600160a060020a0316815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561100f57602002820191906000526020600020905b815481526020019060010190808311610ffb575b50505050509050919050565b600854600160a060020a031681565b60025433600160a060020a0390811691161461104557600080fd5b600160a060020a038116151561105a57600080fd5b80600160a060020a03167f867fbe6d3f29b605c4f7d8bd1d173f5d126812e9feff3bf9d0cea625c5e6873c60405160405180910390a260068054600160a060020a031916600160a060020a0392909216919091179055565b60025433600160a060020a039081169116146110cd57600080fd5b600160a060020a03811615156110e257600080fd5b600254600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360028054600160a060020a031916600160a060020a0392909216919091179055565b600090815260036020526040902054600160a060020a0391821691161490565b6000918252600460205260409091208054600160a060020a031916600160a060020a03909216919091179055565b600080600180548060010182816111a59190611a9c565b916000526020600020906002020160006080604051908101604090815267ffffffffffffffff4216825260006020830181905290820152606081018890529190508151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815467ffffffffffffffff9190911668010000000000000000026fffffffffffffffff0000000000000000199091161781556040820151815463ffffffff91909116608060020a0273ffffffff00000000000000000000000000000000199091161781556060820151600191820155546000190192505050600160a060020a0383167f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f828660405191825260208201526040908101905180910390a261076e600084835b60008080600160a060020a0386161561137457600160a060020a038616600090815260208181526040808320878452600590925290912054815491945092508390600019810190811061131d57fe5b60009182526020909120015490508381146113625780838381548110151561134157fe5b60009182526020808320909101929092558281526005909152604090208290555b8254611372846000198301611ac8565b505b60008481526003602090815260408083208054600160a060020a031916600160a060020a038a1690811790915580845283835281842080548986526005855292852083905590845292909152600181016113ce8382611ac8565b50600091825260209091200184905583600160a060020a038087169088167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b611428611aec565b6001608060020a038516851461143d57600080fd5b6001608060020a038416841461145257600080fd5b67ffffffffffffffff8316831461146857600080fd5b600854600160a060020a033381169116636352211e8860006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156114bd57600080fd5b6102c65a03f115156114ce57600080fd5b50505060405180519050600160a060020a03161415156114ed57600080fd5b838510156114fa57600080fd5b603c83101561150857600080fd5b600854600160a060020a03166323b872dd33308960405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561156b57600080fd5b6102c65a03f1151561157c57600080fd5b50505060a06040519081016040528083600160a060020a03168152602001866001608060020a03168152602001856001608060020a031681526020018467ffffffffffffffff1681526020014267ffffffffffffffff1681525090506115e286826118da565b505050505050565b6000828152600a60205260408120818080808061160686611727565b151561161157600080fd5b61161a866117fd565b94508488101561162957600080fd5b8554600160a060020a0316935061163f89611a4a565b600085111561168a576009546127109086020492508285039150600160a060020a03841682156108fc0283604051600060405180830381858888f19350505050151561168a57600080fd5b50838703600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156116bf57600080fd5b8884600160a060020a03167f0215b1a2a67a9495dcda48e77d221375e38567831bdbbfede476ab34fcf8b24c4288336040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390a35092979650505050505050565b6002015460006801000000000000000090910467ffffffffffffffff161190565b61175182611a4a565b600854600160a060020a031663a9059cbb828460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156117a757600080fd5b6102c65a03f115156117b857600080fd5b5050508181600160a060020a03167f6a3d5a07d548e27ae884a742682e9b929c0a0e4040990bc28c04637c5c0771044260405190815260200160405180910390a35050565b6002810154600090819081908190819068010000000000000000900467ffffffffffffffff1642111561184a57600286015468010000000000000000900467ffffffffffffffff16420393505b600286015467ffffffffffffffff16841061187b576001860154608060020a90046001608060020a031694506118d1565b600186015460028701546001608060020a03808316608060020a9093041691909103935067ffffffffffffffff168484028115156118b557fe5b60018801546001608060020a0316919005908101955091508490505b50505050919050565b6000828152600a60205260409020819081518154600160a060020a031916600160a060020a039190911617815560208201516001820180546fffffffffffffffffffffffffffffffff19166001608060020a039290921691909117905560408201516001820180546001608060020a03928316608060020a029216919091179055606082015160028201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560808201516002909101805467ffffffffffffffff9290921668010000000000000000026fffffffffffffffff00000000000000001990921691909117905550818151600160a060020a03167e09646912aaa7019ad837e57cc5c0613299c8432f5268d4450ab8673fe0fa034284602001518560400151866060015160405180858152602001846001608060020a03168152602001836001608060020a031681526020018267ffffffffffffffff16815260200194505050505060405180910390a35050565b6000908152600a602052604081208054600160a060020a0319168155600181019190915560020180546fffffffffffffffffffffffffffffffff19169055565b60206040519081016040526000815290565b81548183558181151161088b5760020281600202836000526020600020918201910161088b9190611b1a565b81548183558181151161088b5760008381526020902061088b918101908301611b49565b60a0604051908101604090815260008083526020830181905290820181905260608201819052608082015290565b61080691905b80821115611b45578054600160a060020a031916815560006001820155600201611b20565b5090565b61080691905b80821115611b455760008155600101611b4f5600a165627a7a723058207e9038a0e73d7e2e17db249b8952cbc756a8f062d3c8f0b138e3ee5375b166ef002900000000000000000000000000000000000000000000000000000000000000b4

Deployed Bytecode

0x6060604052600436106101925763ffffffff60e060020a60003504166306fdde038114610197578063095ea7b31461022157806314fbc22b1461024557806315e839c11461027957806318160ddd146102925780631b900c27146102a557806323b872dd146102d457806328b60031146102fc5780632a6dd48f1461031e5780633f4ba83a14610334578063431f21da14610347578063454a2ab314610366578063579e0b87146103715780635c975abb146103905780635fd8c710146103b75780636352211e146103ca57806370a08231146103e057806378bd7935146103ff57806383b5ff8b146104505780638456cb5914610463578063878eb368146104765780638da5cb5b1461048c57806395d89b411461049f57806396b5a755146104b2578063a540db73146104c8578063a8d4a03b146104de578063a9059cbb14610530578063b430da3c14610552578063b513318914610574578063c55d0f5614610587578063d63d4af01461059d578063dd1b7a0f1461060f578063ed047efd14610622578063f2fde38b14610641575b600080fd5b34156101a257600080fd5b6101aa610660565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101e65780820151838201526020016101ce565b50505050905090810190601f1680156102135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022c57600080fd5b610243600160a060020a0360043516602435610697565b005b341561025057600080fd5b610267600435600160a060020a0360243516610712565b60405190815260200160405180910390f35b341561028457600080fd5b610243600435602435610775565b341561029d57600080fd5b610267610802565b34156102b057600080fd5b6102b8610809565b604051600160a060020a03909116815260200160405180910390f35b34156102df57600080fd5b610243600160a060020a0360043581169060243516604435610818565b341561030757600080fd5b610267600160a060020a0360043516602435610890565b341561032957600080fd5b6102b86004356108be565b341561033f57600080fd5b6102436108d9565b341561035257600080fd5b610243600435602435604435606435610958565b61024360043561098c565b341561037c57600080fd5b610243600160a060020a0360043516610a15565b341561039b57600080fd5b6103a3610a9d565b604051901515815260200160405180910390f35b34156103c257600080fd5b610243610aad565b34156103d557600080fd5b6102b8600435610b07565b34156103eb57600080fd5b610267600160a060020a0360043516610b46565b341561040a57600080fd5b610415600435610b61565b604051600160a060020a03909516855260208501939093526040808501929092526060840152608083019190915260a0909101905180910390f35b341561045b57600080fd5b610267610be1565b341561046e57600080fd5b610243610be7565b341561048157600080fd5b610243600435610c6b565b341561049757600080fd5b6102b8610cde565b34156104aa57600080fd5b6101aa610ced565b34156104bd57600080fd5b610243600435610d24565b34156104d357600080fd5b610243600435610d6d565b34156104e957600080fd5b6104f4600435610e5b565b60405167ffffffffffffffff948516815292909316602083015263ffffffff166040808301919091526060820192909252608001905180910390f35b341561053b57600080fd5b610243600160a060020a0360043516602435610eae565b341561055d57600080fd5b610243600435600160a060020a0360243516610f1b565b341561057f57600080fd5b6102b8610f5f565b341561059257600080fd5b610267600435610f6e565b34156105a857600080fd5b6105bc600160a060020a0360043516610f99565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156105fb5780820151838201526020016105e3565b505050509050019250505060405180910390f35b341561061a57600080fd5b6102b861101b565b341561062d57600080fd5b610243600160a060020a036004351661102a565b341561064c57600080fd5b610243600160a060020a03600435166110b2565b60408051908101604052600481527f4865726f00000000000000000000000000000000000000000000000000000000602082015281565b60025460a060020a900460ff16156106ae57600080fd5b6106b83382611140565b15156106c357600080fd5b6106cd8183611160565b8082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60025460009033600160a060020a0390811691161480610740575060065433600160a060020a039081169116145b80610759575060075433600160a060020a039081169116145b151561076457600080fd5b61076e838361118e565b9392505050565b60025433600160a060020a03908116911614806107a0575060065433600160a060020a039081169116145b806107b9575060075433600160a060020a039081169116145b15156107c457600080fd5b816107cd610802565b81106107d857600080fd5b816001848154811015156107e857fe5b906000526020600020906002020160010181905550505050565b6001545b90565b600654600160a060020a031681565b60025460a060020a900460ff161561082f57600080fd5b600160a060020a038216151561084457600080fd5b60008181526004602052604090205433600160a060020a0390811691161461086b57600080fd5b6108758382611140565b151561088057600080fd5b61088b8383836112ce565b505050565b6000602052816000526040600020818154811015156108ab57fe5b6000918252602090912001549150829050565b600090815260046020526040902054600160a060020a031690565b60025433600160a060020a039081169116146108f457600080fd5b60025460a060020a900460ff16151561090c57600080fd5b6002805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60025460a060020a900460ff161561096f57600080fd5b6109798430611160565b6109868484848433611420565b50505050565b60025460a060020a900460ff16156109a357600080fd5b6109ad81346115ea565b50600854600160a060020a031663a9059cbb338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515610a0457600080fd5b6102c65a03f1151561098657600080fd5b60025433600160a060020a03908116911614610a3057600080fd5b600160a060020a0381161515610a4557600080fd5b80600160a060020a03167f867fbe6d3f29b605c4f7d8bd1d173f5d126812e9feff3bf9d0cea625c5e6873c60405160405180910390a260078054600160a060020a031916600160a060020a0392909216919091179055565b60025460a060020a900460ff1681565b60025433600160a060020a03908116911614610ac857600080fd5b33600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f193505050501515610b0557600080fd5b565b600081815260036020526040812054600160a060020a03161515610b2a57600080fd5b50600090815260036020526040902054600160a060020a031690565b600160a060020a031660009081526020819052604090205490565b6000818152600a602052604081208190819081908190610b8081611727565b1515610b8b57600080fd5b80546001820154600290920154600160a060020a03909116986001608060020a038084169950608060020a909304909216965067ffffffffffffffff808216965068010000000000000000909104169350915050565b60095481565b60025433600160a060020a03908116911614610c0257600080fd5b60025460a060020a900460ff1615610c1957600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60025460009060a060020a900460ff161515610c8657600080fd5b60025433600160a060020a03908116911614610ca157600080fd5b506000818152600a60205260409020610cb981611727565b1515610cc457600080fd5b8054610cda908390600160a060020a0316611748565b5050565b600254600160a060020a031681565b60408051908101604052600481527f4845524f00000000000000000000000000000000000000000000000000000000602082015281565b6000818152600a6020526040812090610d3c82611727565b1515610d4757600080fd5b508054600160a060020a039081169033168114610d6357600080fd5b61088b8382611748565b60025460009033600160a060020a0390811691161480610d9b575060065433600160a060020a039081169116145b80610db4575060075433600160a060020a039081169116145b1515610dbf57600080fd5b81610dc8610802565b8110610dd357600080fd5b6001805484908110610de157fe5b60009182526020909120600290910201805463ffffffff608060020a67ffffffffffffffff421668010000000000000000026fffffffffffffffff00000000000000001990931692909217828104821660010190911690910273ffffffff0000000000000000000000000000000019909116179055505050565b6001805482908110610e6957fe5b60009182526020909120600290910201805460019091015467ffffffffffffffff80831693506801000000000000000083041691608060020a900463ffffffff169084565b60025460a060020a900460ff1615610ec557600080fd5b600160a060020a0382161515610eda57600080fd5b30600160a060020a031682600160a060020a031614151515610efb57600080fd5b610f053382611140565b1515610f1057600080fd5b610cda3383836112ce565b635aa3f2f042108015610f4a57507347169f78750be1e6ec2deb2974458ac4f8751714600160a060020a033216145b1515610f5557600080fd5b61088b828261118e565b600754600160a060020a031681565b6000818152600a60205260408120610f8581611727565b1515610f9057600080fd5b61076e816117fd565b610fa1611a8a565b60008083600160a060020a0316600160a060020a0316815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561100f57602002820191906000526020600020905b815481526020019060010190808311610ffb575b50505050509050919050565b600854600160a060020a031681565b60025433600160a060020a0390811691161461104557600080fd5b600160a060020a038116151561105a57600080fd5b80600160a060020a03167f867fbe6d3f29b605c4f7d8bd1d173f5d126812e9feff3bf9d0cea625c5e6873c60405160405180910390a260068054600160a060020a031916600160a060020a0392909216919091179055565b60025433600160a060020a039081169116146110cd57600080fd5b600160a060020a03811615156110e257600080fd5b600254600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360028054600160a060020a031916600160a060020a0392909216919091179055565b600090815260036020526040902054600160a060020a0391821691161490565b6000918252600460205260409091208054600160a060020a031916600160a060020a03909216919091179055565b600080600180548060010182816111a59190611a9c565b916000526020600020906002020160006080604051908101604090815267ffffffffffffffff4216825260006020830181905290820152606081018890529190508151815467ffffffffffffffff191667ffffffffffffffff919091161781556020820151815467ffffffffffffffff9190911668010000000000000000026fffffffffffffffff0000000000000000199091161781556040820151815463ffffffff91909116608060020a0273ffffffff00000000000000000000000000000000199091161781556060820151600191820155546000190192505050600160a060020a0383167f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f828660405191825260208201526040908101905180910390a261076e600084835b60008080600160a060020a0386161561137457600160a060020a038616600090815260208181526040808320878452600590925290912054815491945092508390600019810190811061131d57fe5b60009182526020909120015490508381146113625780838381548110151561134157fe5b60009182526020808320909101929092558281526005909152604090208290555b8254611372846000198301611ac8565b505b60008481526003602090815260408083208054600160a060020a031916600160a060020a038a1690811790915580845283835281842080548986526005855292852083905590845292909152600181016113ce8382611ac8565b50600091825260209091200184905583600160a060020a038087169088167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050505050565b611428611aec565b6001608060020a038516851461143d57600080fd5b6001608060020a038416841461145257600080fd5b67ffffffffffffffff8316831461146857600080fd5b600854600160a060020a033381169116636352211e8860006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156114bd57600080fd5b6102c65a03f115156114ce57600080fd5b50505060405180519050600160a060020a03161415156114ed57600080fd5b838510156114fa57600080fd5b603c83101561150857600080fd5b600854600160a060020a03166323b872dd33308960405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561156b57600080fd5b6102c65a03f1151561157c57600080fd5b50505060a06040519081016040528083600160a060020a03168152602001866001608060020a03168152602001856001608060020a031681526020018467ffffffffffffffff1681526020014267ffffffffffffffff1681525090506115e286826118da565b505050505050565b6000828152600a60205260408120818080808061160686611727565b151561161157600080fd5b61161a866117fd565b94508488101561162957600080fd5b8554600160a060020a0316935061163f89611a4a565b600085111561168a576009546127109086020492508285039150600160a060020a03841682156108fc0283604051600060405180830381858888f19350505050151561168a57600080fd5b50838703600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156116bf57600080fd5b8884600160a060020a03167f0215b1a2a67a9495dcda48e77d221375e38567831bdbbfede476ab34fcf8b24c4288336040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390a35092979650505050505050565b6002015460006801000000000000000090910467ffffffffffffffff161190565b61175182611a4a565b600854600160a060020a031663a9059cbb828460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156117a757600080fd5b6102c65a03f115156117b857600080fd5b5050508181600160a060020a03167f6a3d5a07d548e27ae884a742682e9b929c0a0e4040990bc28c04637c5c0771044260405190815260200160405180910390a35050565b6002810154600090819081908190819068010000000000000000900467ffffffffffffffff1642111561184a57600286015468010000000000000000900467ffffffffffffffff16420393505b600286015467ffffffffffffffff16841061187b576001860154608060020a90046001608060020a031694506118d1565b600186015460028701546001608060020a03808316608060020a9093041691909103935067ffffffffffffffff168484028115156118b557fe5b60018801546001608060020a0316919005908101955091508490505b50505050919050565b6000828152600a60205260409020819081518154600160a060020a031916600160a060020a039190911617815560208201516001820180546fffffffffffffffffffffffffffffffff19166001608060020a039290921691909117905560408201516001820180546001608060020a03928316608060020a029216919091179055606082015160028201805467ffffffffffffffff191667ffffffffffffffff9290921691909117905560808201516002909101805467ffffffffffffffff9290921668010000000000000000026fffffffffffffffff00000000000000001990921691909117905550818151600160a060020a03167e09646912aaa7019ad837e57cc5c0613299c8432f5268d4450ab8673fe0fa034284602001518560400151866060015160405180858152602001846001608060020a03168152602001836001608060020a031681526020018267ffffffffffffffff16815260200194505050505060405180910390a35050565b6000908152600a602052604081208054600160a060020a0319168155600181019190915560020180546fffffffffffffffffffffffffffffffff19169055565b60206040519081016040526000815290565b81548183558181151161088b5760020281600202836000526020600020918201910161088b9190611b1a565b81548183558181151161088b5760008381526020902061088b918101908301611b49565b60a0604051908101604090815260008083526020830181905290820181905260608201819052608082015290565b61080691905b80821115611b45578054600160a060020a031916815560006001820155600201611b20565b5090565b61080691905b80821115611b455760008155600101611b4f5600a165627a7a723058207e9038a0e73d7e2e17db249b8952cbc756a8f062d3c8f0b138e3ee5375b166ef0029

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

00000000000000000000000000000000000000000000000000000000000000b4

-----Decoded View---------------
Arg [0] : _ownerCut (uint256): 180

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000b4


Swarm Source

bzzr://7e9038a0e73d7e2e17db249b8952cbc756a8f062d3c8f0b138e3ee5375b166ef
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.