Sponsored:   Ubex.com: Top ratings from all agencies. Big partnerships. 70% hard cap reached. Join us!
 Latest 25 txns from a total Of 33510 transactions
(+15 PendingTxns)

TxHash Age From To Value [TxFee]
0x4196de1e681bdca403050f3dad6b9ebf59a4b05acdac99b13005733e698bcfb1(pending)0xaa5bbf28febf3ec1ae0effac8ff60993dfdf76d0  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x35dffd1f03d2fe59542c2e3fad848855a6994daf3aa6e1dc759a9797d2bdcc08(pending)0xaa5bbf28febf3ec1ae0effac8ff60993dfdf76d0  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x6931764fd05ee3ffdde0f8ab9ec803a95142c637542ab0522645c1d00b41043f(pending)0xaa5bbf28febf3ec1ae0effac8ff60993dfdf76d0  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x1756478f59893395b3be90aa48beb0fd83082d6de78019d5c50b2c72f06b6367(pending)0x12823ac4c9521b415f315e951a3819537db717c2  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.0097 Ether(pending)
0xa12cf65b2f1bbc67e6bf0571ee78f1c853fcd655a7ba97368802491e2deca505(pending)0xe912145bb163062c24c06ed8701eb1fb233198fc  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x9721cc1c7749aa022813f96c6c8b0ddd7f5118ced90475c0588addb3746895a7(pending)0xe912145bb163062c24c06ed8701eb1fb233198fc  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0xe9929369f63298236484f768f7321b62331760e74336a97192efddeb63c5bf70(pending)0xe912145bb163062c24c06ed8701eb1fb233198fc  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0xcbbc40256a3ab4e8d1ff7c948a799c606c70013f4ca043b661ca361a29412b12(pending)0x8a8ffda92dd0422999bac947f2d5a9c72ce915da  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0xefdf66fe4f3776e84b5b9ba3a726c069e8cf34495ebffedaec7b6fa528d4fe35(pending)0x8a8ffda92dd0422999bac947f2d5a9c72ce915da  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x5cc7206a8970e017ad61db687de08488a1e5f1395285d85f993a819512b496d7(pending)0xe912145bb163062c24c06ed8701eb1fb233198fc  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0xac36e7c7ede8c1150b669c84f86159cb13a4daf5afe96403c369495414505337(pending)0xe912145bb163062c24c06ed8701eb1fb233198fc  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x6cd4d3e15c020129566a05f6af74da11e52e540a71c372ecf555459a515a53d6(pending)0xe912145bb163062c24c06ed8701eb1fb233198fc  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x19fb5487e4c86c61559cc295c0120342d360abd0fd9b55c91f993878bcb27306(pending)0xe912145bb163062c24c06ed8701eb1fb233198fc  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x50df2d190683b4ca30d878d1b2866f00d367e01187a7d2fcfe76d39e4ce13d80(pending)0x76fa5876ecef7cecfbe8f94566a1e7252c20bf39  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70 Ether(pending)
0x1502b57a22b8085540fafd95cd4ff21b22db4f490509b5a3950165bfa725c596(pending)0x847712f8c965abed0b2521cb0631aa375ed37227  IN  0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.0097 Ether(pending)
0x33d293a4ffdd03c98538a701395ba42b63ec68bc4c910caa2e75da76a78840eb11 hrs 46 mins ago0x7d1c097a9ee545d01a428a3cc071039cde6633c7  IN   CryptoCelebrities0 Ether0.0000915
0x6464e5f710ed3bc37d0c277c2c131d1df0329d10e6e29572d53f63752cf6ebc31 day 19 hrs ago0x3b131085b1d73572e11cfe54e679a57ab09749f7  IN   CryptoCelebrities0 Ether0.00004707
0x55c05ebb064a68c15c93bd82d17915d8ce8d305613d39f0254b74c1e671e404b1 day 19 hrs ago0x3b131085b1d73572e11cfe54e679a57ab09749f7  IN   CryptoCelebrities0 Ether0.00004707
0x5a22fea09054402e877b439b6bf8f23b05798e5aa2fa1945ce2f97335b70545e1 day 19 hrs ago0x3b131085b1d73572e11cfe54e679a57ab09749f7  IN   CryptoCelebrities0 Ether0.000047198
0xbd522bacb8d735a6fb149baa9e61c728d3e523767e07e2ccd468d573f5ce84a11 day 19 hrs ago0x3b131085b1d73572e11cfe54e679a57ab09749f7  IN   CryptoCelebrities0 Ether0.00004707
0xca4f6531180724f312219163612e0fdee0f5d48874de130b60b9c7e41b09a8901 day 19 hrs ago0x3b131085b1d73572e11cfe54e679a57ab09749f7  IN   CryptoCelebrities0 Ether0.000047198
0xbf19be09afabad24bbe88bfe2086b8f1284f78fe5053a387b52d4d420f65759c1 day 19 hrs ago0x3b131085b1d73572e11cfe54e679a57ab09749f7  IN   CryptoCelebrities0 Ether0.00004707
0x70623a589c287b281b0670eeb6248c78e5812fefa2d0db2241e05906fd86c21f2 days 3 hrs ago0xaa5bbf28febf3ec1ae0effac8ff60993dfdf76d0  IN   CryptoCelebrities0 Ether0.00004575
0xa0a5bf3cdf4baa43227e62d5fd0f3430f7bccf423fb5c4bbf0afe8f5b0d928aa2 days 4 hrs ago0x12823ac4c9521b415f315e951a3819537db717c2  IN   CryptoCelebrities0.0097 Ether0.000022982
0x399fb0e35107b48c5dd72ffc5f901b05dea109ba763e3e88f60633ca0d5693ef2 days 5 hrs ago0xcde993b6cc5cf39a3087fa166a81769f924146f6  IN   CryptoCelebrities0 Ether0.000045814
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here to View More View All
ParentTxHash Block Age From To Value
0x4f3288fc5ab0f8e3e98b799d87209985c8f6161222dfe57f514bb224fff6a7c559820264 days 12 hrs ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x5ee0526daa4c2317703bb400e6f75175f7dd28e80.000063296186779425 Ether
0x4f3288fc5ab0f8e3e98b799d87209985c8f6161222dfe57f514bb224fff6a7c559820264 days 12 hrs ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x9bc9f983bf9bc0042552478e7e63d8025c8abab82.58183850158442734 Ether
0xd815f4abd960fe5edd71177bb1179db911c477849974b1d44f2ea3976cb95a3f589167719 days 21 hrs ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70xad5731dcbf385bab32e2d65d1da31fcf435be2451.443937659680017311 Ether
0xf24b52fd6b2514fb37e5f30058d064a62d8abac71e94ceac31c645db20ce86665178109142 days 14 hrs ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70xfed8eac5c0a82c3291977fb3bcf1ad52e57b1b9b0.00004758642554621 Ether
0xf24b52fd6b2514fb37e5f30058d064a62d8abac71e94ceac31c645db20ce86665178109142 days 14 hrs ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x78215a5142d4844ee1e00258aaf2702465ccbb553.091427268759986562 Ether
0x6406d2d166b76d78bebc8cb295724b3112cfc938d66a74639589262dbffb59bd5166483144 days 14 hrs ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x21cf07a29ba3338f646c8ed56cc144d42d8245070.000047363215992973 Ether
0x6406d2d166b76d78bebc8cb295724b3112cfc938d66a74639589262dbffb59bd5166483144 days 14 hrs ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x0308bba41f27dda85c4fe84f991c4f087e3f1ba41.377995478576966605 Ether
0xe913b589f450c428274f219b6dce15e141cefc8cc6545808583f08a52a9735725163934145 days 22 mins ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x0308bba41f27dda85c4fe84f991c4f087e3f1ba40.10174306210698556 Ether
0xe913b589f450c428274f219b6dce15e141cefc8cc6545808583f08a52a9735725163934145 days 22 mins ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda1.126361521619433573 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0.920678113323710921 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.979444801408203108 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0.75255428393416371 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.800589663759748628 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0.615131327737490337 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.654395029507968444 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0.481852873394367431 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.512609439781241948 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0.377451417492254488 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.40154406116197286 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0.295670277035599349 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.314542847910212074 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0.231608383677886157 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.246391897529666125 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70x3589e746f6e5e5ea41a2af1682a8f5e11f9ecdda0.181426567214344157 Ether
0x0d70095046684adb41dae231bec4d811b8101c483ca6417de41ee76ef3ff4a425157954146 days 1 hr ago0xb22075c48b2a260ddd1d7f5efadc81c94d5bc7ce0xbb5ed1edeb5149af3ab43ea9c7a6963b3c1374f70.193006986398238465 Ether
[ Download CSV Export  ] 
Contract Source Code Verified (Exact match)
Contract Name: CelebrityToken
Compiler Version: v0.4.18+commit.9cf6e910
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.18; // solhint-disable-line



/// @title Interface for contracts conforming to ERC-721: Non-Fungible Tokens
/// @author Dieter Shirley <dete@axiomzen.co> (https://github.com/dete)
contract ERC721 {
  // Required methods
  function approve(address _to, uint256 _tokenId) public;
  function balanceOf(address _owner) public view returns (uint256 balance);
  function implementsERC721() public pure returns (bool);
  function ownerOf(uint256 _tokenId) public view returns (address addr);
  function takeOwnership(uint256 _tokenId) public;
  function totalSupply() public view returns (uint256 total);
  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 tokenId);
  event Approval(address indexed owner, address indexed approved, uint256 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);
}


contract CelebrityToken is ERC721 {

  /*** EVENTS ***/

  /// @dev The Birth event is fired whenever a new person comes into existence.
  event Birth(uint256 tokenId, string name, address owner);

  /// @dev The TokenSold event is fired whenever a token is sold.
  event TokenSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address winner, string name);

  /// @dev Transfer event as defined in current draft of ERC721. 
  ///  ownership is assigned, including births.
  event Transfer(address from, address to, uint256 tokenId);

  /*** CONSTANTS ***/

  /// @notice Name and symbol of the non fungible token, as defined in ERC721.
  string public constant NAME = "CryptoCelebrities"; // solhint-disable-line
  string public constant SYMBOL = "CelebrityToken"; // solhint-disable-line

  uint256 private startingPrice = 0.001 ether;
  uint256 private constant PROMO_CREATION_LIMIT = 5000;
  uint256 private firstStepLimit =  0.053613 ether;
  uint256 private secondStepLimit = 0.564957 ether;

  /*** STORAGE ***/

  /// @dev A mapping from person IDs to the address that owns them. All persons have
  ///  some valid owner address.
  mapping (uint256 => address) public personIndexToOwner;

  // @dev A mapping from owner address to count of tokens that address owns.
  //  Used internally inside balanceOf() to resolve ownership count.
  mapping (address => uint256) private ownershipTokenCount;

  /// @dev A mapping from PersonIDs to an address that has been approved to call
  ///  transferFrom(). Each Person can only have one approved address for transfer
  ///  at any time. A zero value means no approval is outstanding.
  mapping (uint256 => address) public personIndexToApproved;

  // @dev A mapping from PersonIDs to the price of the token.
  mapping (uint256 => uint256) private personIndexToPrice;

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

  uint256 public promoCreatedCount;

  /*** DATATYPES ***/
  struct Person {
    string name;
  }

  Person[] private persons;

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

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

  /// Access modifier for contract owner only functionality
  modifier onlyCLevel() {
    require(
      msg.sender == ceoAddress ||
      msg.sender == cooAddress
    );
    _;
  }

  /*** CONSTRUCTOR ***/
  function CelebrityToken() public {
    ceoAddress = msg.sender;
    cooAddress = msg.sender;
  }

  /*** PUBLIC FUNCTIONS ***/
  /// @notice Grant another address the right to transfer token via takeOwnership() and transferFrom().
  /// @param _to The address to be granted transfer approval. Pass address(0) to
  ///  clear all approvals.
  /// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
  /// @dev Required for ERC-721 compliance.
  function approve(
    address _to,
    uint256 _tokenId
  ) public {
    // Caller must own token.
    require(_owns(msg.sender, _tokenId));

    personIndexToApproved[_tokenId] = _to;

    Approval(msg.sender, _to, _tokenId);
  }

  /// For querying balance of a particular account
  /// @param _owner The address for balance query
  /// @dev Required for ERC-721 compliance.
  function balanceOf(address _owner) public view returns (uint256 balance) {
    return ownershipTokenCount[_owner];
  }

  /// @dev Creates a new promo Person with the given name, with given _price and assignes it to an address.
  function createPromoPerson(address _owner, string _name, uint256 _price) public onlyCOO {
    require(promoCreatedCount < PROMO_CREATION_LIMIT);

    address personOwner = _owner;
    if (personOwner == address(0)) {
      personOwner = cooAddress;
    }

    if (_price <= 0) {
      _price = startingPrice;
    }

    promoCreatedCount++;
    _createPerson(_name, personOwner, _price);
  }

  /// @dev Creates a new Person with the given name.
  function createContractPerson(string _name) public onlyCOO {
    _createPerson(_name, address(this), startingPrice);
  }

  /// @notice Returns all the relevant information about a specific person.
  /// @param _tokenId The tokenId of the person of interest.
  function getPerson(uint256 _tokenId) public view returns (
    string personName,
    uint256 sellingPrice,
    address owner
  ) {
    Person storage person = persons[_tokenId];
    personName = person.name;
    sellingPrice = personIndexToPrice[_tokenId];
    owner = personIndexToOwner[_tokenId];
  }

  function implementsERC721() public pure returns (bool) {
    return true;
  }

  /// @dev Required for ERC-721 compliance.
  function name() public pure returns (string) {
    return NAME;
  }

  /// For querying owner of token
  /// @param _tokenId The tokenID for owner inquiry
  /// @dev Required for ERC-721 compliance.
  function ownerOf(uint256 _tokenId)
    public
    view
    returns (address owner)
  {
    owner = personIndexToOwner[_tokenId];
    require(owner != address(0));
  }

  function payout(address _to) public onlyCLevel {
    _payout(_to);
  }

  // Allows someone to send ether and obtain the token
  function purchase(uint256 _tokenId) public payable {
    address oldOwner = personIndexToOwner[_tokenId];
    address newOwner = msg.sender;

    uint256 sellingPrice = personIndexToPrice[_tokenId];

    // Making sure token owner is not sending to self
    require(oldOwner != newOwner);

    // Safety check to prevent against an unexpected 0x0 default.
    require(_addressNotNull(newOwner));

    // Making sure sent amount is greater than or equal to the sellingPrice
    require(msg.value >= sellingPrice);

    uint256 payment = uint256(SafeMath.div(SafeMath.mul(sellingPrice, 94), 100));
    uint256 purchaseExcess = SafeMath.sub(msg.value, sellingPrice);

    // Update prices
    if (sellingPrice < firstStepLimit) {
      // first stage
      personIndexToPrice[_tokenId] = SafeMath.div(SafeMath.mul(sellingPrice, 200), 94);
    } else if (sellingPrice < secondStepLimit) {
      // second stage
      personIndexToPrice[_tokenId] = SafeMath.div(SafeMath.mul(sellingPrice, 120), 94);
    } else {
      // third stage
      personIndexToPrice[_tokenId] = SafeMath.div(SafeMath.mul(sellingPrice, 115), 94);
    }

    _transfer(oldOwner, newOwner, _tokenId);

    // Pay previous tokenOwner if owner is not contract
    if (oldOwner != address(this)) {
      oldOwner.transfer(payment); //(1-0.06)
    }

    TokenSold(_tokenId, sellingPrice, personIndexToPrice[_tokenId], oldOwner, newOwner, persons[_tokenId].name);

    msg.sender.transfer(purchaseExcess);
  }

  function priceOf(uint256 _tokenId) public view returns (uint256 price) {
    return personIndexToPrice[_tokenId];
  }

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

    ceoAddress = _newCEO;
  }

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

    cooAddress = _newCOO;
  }

  /// @dev Required for ERC-721 compliance.
  function symbol() public pure returns (string) {
    return SYMBOL;
  }

  /// @notice Allow pre-approved user to take ownership of a token
  /// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
  /// @dev Required for ERC-721 compliance.
  function takeOwnership(uint256 _tokenId) public {
    address newOwner = msg.sender;
    address oldOwner = personIndexToOwner[_tokenId];

    // Safety check to prevent against an unexpected 0x0 default.
    require(_addressNotNull(newOwner));

    // Making sure transfer is approved
    require(_approved(newOwner, _tokenId));

    _transfer(oldOwner, newOwner, _tokenId);
  }

  /// @param _owner The owner whose celebrity tokens we are interested in.
  /// @dev This method MUST NEVER be called by smart contract code. First, it's fairly
  ///  expensive (it walks the entire Persons array looking for persons belonging to owner),
  ///  but it also returns a dynamic array, which is only supported for web3 calls, and
  ///  not contract-to-contract calls.
  function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) {
    uint256 tokenCount = balanceOf(_owner);
    if (tokenCount == 0) {
        // Return an empty array
      return new uint256[](0);
    } else {
      uint256[] memory result = new uint256[](tokenCount);
      uint256 totalPersons = totalSupply();
      uint256 resultIndex = 0;

      uint256 personId;
      for (personId = 0; personId <= totalPersons; personId++) {
        if (personIndexToOwner[personId] == _owner) {
          result[resultIndex] = personId;
          resultIndex++;
        }
      }
      return result;
    }
  }

  /// For querying totalSupply of token
  /// @dev Required for ERC-721 compliance.
  function totalSupply() public view returns (uint256 total) {
    return persons.length;
  }

  /// Owner initates the transfer of the token to another account
  /// @param _to The address for the token to be transferred to.
  /// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
  /// @dev Required for ERC-721 compliance.
  function transfer(
    address _to,
    uint256 _tokenId
  ) public {
    require(_owns(msg.sender, _tokenId));
    require(_addressNotNull(_to));

    _transfer(msg.sender, _to, _tokenId);
  }

  /// Third-party initiates transfer of token from address _from to address _to
  /// @param _from The address for the token to be transferred from.
  /// @param _to The address for the token to be transferred to.
  /// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
  /// @dev Required for ERC-721 compliance.
  function transferFrom(
    address _from,
    address _to,
    uint256 _tokenId
  ) public {
    require(_owns(_from, _tokenId));
    require(_approved(_to, _tokenId));
    require(_addressNotNull(_to));

    _transfer(_from, _to, _tokenId);
  }

  /*** PRIVATE FUNCTIONS ***/
  /// Safety check on _to address to prevent against an unexpected 0x0 default.
  function _addressNotNull(address _to) private pure returns (bool) {
    return _to != address(0);
  }

  /// For checking approval of transfer for address _to
  function _approved(address _to, uint256 _tokenId) private view returns (bool) {
    return personIndexToApproved[_tokenId] == _to;
  }

  /// For creating Person
  function _createPerson(string _name, address _owner, uint256 _price) private {
    Person memory _person = Person({
      name: _name
    });
    uint256 newPersonId = persons.push(_person) - 1;

    // It's probably never going to happen, 4 billion tokens are A LOT, but
    // let's just be 100% sure we never let this happen.
    require(newPersonId == uint256(uint32(newPersonId)));

    Birth(newPersonId, _name, _owner);

    personIndexToPrice[newPersonId] = _price;

    // This will assign ownership, and also emit the Transfer event as
    // per ERC721 draft
    _transfer(address(0), _owner, newPersonId);
  }

  /// Check for token ownership
  function _owns(address claimant, uint256 _tokenId) private view returns (bool) {
    return claimant == personIndexToOwner[_tokenId];
  }

  /// For paying out balance on contract
  function _payout(address _to) private {
    if (_to == address(0)) {
      ceoAddress.transfer(this.balance);
    } else {
      _to.transfer(this.balance);
    }
  }

  /// @dev Assigns ownership of a specific Person to an address.
  function _transfer(address _from, address _to, uint256 _tokenId) private {
    // Since the number of persons is capped to 2^32 we can't overflow this
    ownershipTokenCount[_to]++;
    //transfer ownership
    personIndexToOwner[_tokenId] = _to;

    // When creating new persons _from is 0x0, but we can't account that address.
    if (_from != address(0)) {
      ownershipTokenCount[_from]--;
      // clear any previously approved ownership exchange
      delete personIndexToApproved[_tokenId];
    }

    // Emit the transfer event.
    Transfer(_from, _to, _tokenId);
  }
}
library SafeMath {

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

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

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

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

    Contract ABI  
[{"constant":true,"inputs":[],"name":"promoCreatedCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ceoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"payout","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"implementsERC721","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"total","type":"uint256"}],"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":"_tokenId","type":"uint256"}],"name":"getPerson","outputs":[{"name":"personName","type":"string"},{"name":"sellingPrice","type":"uint256"},{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newCEO","type":"address"}],"name":"setCEO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCOO","type":"address"}],"name":"setCOO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"},{"name":"_name","type":"string"},{"name":"_price","type":"uint256"}],"name":"createPromoPerson","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"}],"name":"createContractPerson","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"name":"ownerTokens","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"personIndexToApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"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":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"personIndexToOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cooAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"takeOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"priceOf","outputs":[{"name":"price","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"purchase","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"SYMBOL","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"owner","type":"address"}],"name":"Birth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"oldPrice","type":"uint256"},{"indexed":false,"name":"newPrice","type":"uint256"},{"indexed":false,"name":"prevOwner","type":"address"},{"indexed":false,"name":"winner","type":"address"},{"indexed":false,"name":"name","type":"string"}],"name":"TokenSold","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"approved","type":"address"},{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405266038d7ea4c6800060005566be78bd4c57d0006001556707d72165f25ed000600255341561003157600080fd5b60078054600160a060020a033316600160a060020a031991821681179092556008805490911690911790556113c78061006b6000396000f3006060604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305e45546811461015857806306fdde031461017d578063095ea7b3146102075780630a0f81681461022b5780630b7e9c441461025a5780631051db341461027957806318160ddd146102a057806323b872dd146102b3578063246982c4146102db57806327d7874c146103805780632ba73c151461039f57806342287b66146103be5780634955f2801461041f5780636352211e1461047057806370a08231146104865780638462151c146104a55780639433a81e1461051757806395d89b411461052d578063a3f4df7e14610540578063a9059cbb14610553578063aa1d98af14610575578063b047fb501461058b578063b2e6ceeb1461059e578063b9186d7d146105b4578063efef39a1146105ca578063f76f8d78146105d5575b600080fd5b341561016357600080fd5b61016b6105e8565b60405190815260200160405180910390f35b341561018857600080fd5b6101906105ee565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101cc5780820151838201526020016101b4565b50505050905090810190601f1680156101f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021257600080fd5b610229600160a060020a0360043516602435610630565b005b341561023657600080fd5b61023e6106bc565b604051600160a060020a03909116815260200160405180910390f35b341561026557600080fd5b610229600160a060020a03600435166106cb565b341561028457600080fd5b61028c61070d565b604051901515815260200160405180910390f35b34156102ab57600080fd5b61016b610712565b34156102be57600080fd5b610229600160a060020a0360043581169060243516604435610718565b34156102e657600080fd5b6102f1600435610766565b60405160208101839052600160a060020a038216604082015260608082528190810185818151815260200191508051906020019080838360005b8381101561034357808201518382015260200161032b565b50505050905090810190601f1680156103705780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561038b57600080fd5b610229600160a060020a036004351661085c565b34156103aa57600080fd5b610229600160a060020a03600435166108bb565b34156103c957600080fd5b61022960048035600160a060020a03169060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650509335935061091a92505050565b341561042a57600080fd5b61022960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061099195505050505050565b341561047b57600080fd5b61023e6004356109b9565b341561049157600080fd5b61016b600160a060020a03600435166109e2565b34156104b057600080fd5b6104c4600160a060020a03600435166109fd565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156105035780820151838201526020016104eb565b505050509050019250505060405180910390f35b341561052257600080fd5b61023e600435610ade565b341561053857600080fd5b610190610af9565b341561054b57600080fd5b610190610b3a565b341561055e57600080fd5b610229600160a060020a0360043516602435610b71565b341561058057600080fd5b61023e600435610ba9565b341561059657600080fd5b61023e610bc4565b34156105a957600080fd5b610229600435610bd3565b34156105bf57600080fd5b61016b600435610c21565b610229600435610c33565b34156105e057600080fd5b610190610eb2565b60095481565b6105f661124d565b60408051908101604052601181527f43727970746f43656c6562726974696573000000000000000000000000000000602082015290505b90565b61063a3382610ee9565b151561064557600080fd5b60008181526005602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b600754600160a060020a031681565b60075433600160a060020a03908116911614806106f6575060085433600160a060020a039081169116145b151561070157600080fd5b61070a81610f09565b50565b600190565b600a5490565b6107228382610ee9565b151561072d57600080fd5b6107378282610f94565b151561074257600080fd5b61074b82610fb4565b151561075657600080fd5b610761838383610fc2565b505050565b61076e61124d565b6000806000600a8581548110151561078257fe5b90600052602060002090019050806000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108275780601f106107fc57610100808354040283529160200191610827565b820191906000526020600020905b81548152906001019060200180831161080a57829003601f168201915b50505060009788525050600660209081526040808820546003909252909620549096600160a060020a03909116945092505050565b60075433600160a060020a0390811691161461087757600080fd5b600160a060020a038116151561088c57600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60075433600160a060020a039081169116146108d657600080fd5b600160a060020a03811615156108eb57600080fd5b6008805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60085460009033600160a060020a0390811691161461093857600080fd5b600954611388901061094957600080fd5b5082600160a060020a03811615156109695750600854600160a060020a03165b600082116109775760005491505b60098054600101905561098b8382846110b2565b50505050565b60085433600160a060020a039081169116146109ac57600080fd5b61070a81306000546110b2565b600081815260036020526040902054600160a060020a03168015156109dd57600080fd5b919050565b600160a060020a031660009081526004602052604090205490565b610a0561124d565b6000610a0f61124d565b6000806000610a1d876109e2565b9450841515610a4d576000604051805910610a355750595b90808252806020026020018201604052509550610ad4565b84604051805910610a5b5750595b90808252806020026020018201604052509350610a76610712565b925060009150600090505b828111610ad057600081815260036020526040902054600160a060020a0388811691161415610ac85780848381518110610ab757fe5b602090810290910101526001909101905b600101610a81565b8395505b5050505050919050565b600560205260009081526040902054600160a060020a031681565b610b0161124d565b60408051908101604052600e81527f43656c656272697479546f6b656e0000000000000000000000000000000000006020820152905090565b60408051908101604052601181527f43727970746f43656c6562726974696573000000000000000000000000000000602082015281565b610b7b3382610ee9565b1515610b8657600080fd5b610b8f82610fb4565b1515610b9a57600080fd5b610ba5338383610fc2565b5050565b600360205260009081526040902054600160a060020a031681565b600854600160a060020a031681565b6000818152600360205260409020543390600160a060020a0316610bf682610fb4565b1515610c0157600080fd5b610c0b8284610f94565b1515610c1657600080fd5b610761818385610fc2565b60009081526006602052604090205490565b6000818152600360209081526040808320546006909252822054600160a060020a0391821692339281908416851415610c6b57600080fd5b610c7484610fb4565b1515610c7f57600080fd5b3483901015610c8d57600080fd5b610ca2610c9b84605e6111ee565b6064611224565b9150610cae348461123b565b9050600154831015610ce357610ccf610cc88460c86111ee565b605e611224565b600087815260066020526040902055610d19565b600254831015610cfb57610ccf610cc88460786111ee565b610d09610cc88460736111ee565b6000878152600660205260409020555b610d24858588610fc2565b30600160a060020a031685600160a060020a0316141515610d7057600160a060020a03851682156108fc0283604051600060405180830381858888f193505050501515610d7057600080fd5b7e8201e7bcbf010c2c07de59d6e97cb7e3cf67a46125c49cbc89b9d2cde1f48f8684600660008a8152602001908152602001600020548888600a8c815481101515610db757fe5b60009182526020909120016040518681526020810186905260408101859052600160a060020a0380851660608301528316608082015260c060a082018181528354600260001961010060018416150201909116049183018290529060e083019084908015610e665780601f10610e3b57610100808354040283529160200191610e66565b820191906000526020600020905b815481529060010190602001808311610e4957829003601f168201915b505097505050505050505060405180910390a1600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610eaa57600080fd5b505050505050565b60408051908101604052600e81527f43656c656272697479546f6b656e000000000000000000000000000000000000602082015281565b600090815260036020526040902054600160a060020a0390811691161490565b600160a060020a0381161515610f5757600754600160a060020a039081169030163180156108fc0290604051600060405180830381858888f193505050501515610f5257600080fd5b61070a565b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561070a57600080fd5b600090815260056020526040902054600160a060020a0391821691161490565b600160a060020a0316151590565b600160a060020a0380831660008181526004602090815260408083208054600101905585835260039091529020805473ffffffffffffffffffffffffffffffffffffffff1916909117905583161561105d57600160a060020a0383166000908152600460209081526040808320805460001901905583835260059091529020805473ffffffffffffffffffffffffffffffffffffffff191690555b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a1505050565b6110ba61125f565b60006020604051908101604052858152600a80549193506001918083016110e18382611278565b6000928352602090922085910181518190805161110292916020019061129c565b50505003905063ffffffff8116811461111a57600080fd5b7fb3b0cf861f168bcdb275c69da97b2543631552ba562628aa3c7317d4a6089ef2818686604051838152600160a060020a038216604082015260606020820181815290820184818151815260200191508051906020019080838360005b8381101561118f578082015183820152602001611177565b50505050905090810190601f1680156111bc5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a160008181526006602052604081208490556111e7908583610fc2565b5050505050565b600080831515611201576000915061121d565b5082820282848281151561121157fe5b041461121957fe5b8091505b5092915050565b600080828481151561123257fe5b04949350505050565b60008282111561124757fe5b50900390565b60206040519081016040526000815290565b60206040519081016040528061127361124d565b905290565b8154818355818115116107615760008381526020902061076191810190830161131a565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106112dd57805160ff191683800117855561130a565b8280016001018555821561130a579182015b8281111561130a5782518255916020019190600101906112ef565b5061131692915061133d565b5090565b61062d91905b808211156113165760006113348282611357565b50600101611320565b61062d91905b808211156113165760008155600101611343565b50805460018160011615610100020316600290046000825580601f1061137d575061070a565b601f01602090049060005260206000209081019061070a919061133d5600a165627a7a7230582003141a717b1c55f1a6ce63c63b68b6538ac511d369403d6db7419471a38cdf460029

   Swarm Source:
bzzr://03141a717b1c55f1a6ce63c63b68b6538ac511d369403d6db7419471a38cdf46

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.