ETH Price: $2,947.72 (-1.32%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Payout52077662018-03-06 16:50:002684 days ago1520355000IN
0xf8EF3034...35aD2f736
0 ETH0.000606420
Transfer52077412018-03-06 16:44:382684 days ago1520354678IN
0xf8EF3034...35aD2f736
0.01 ETH0.0003156915
Zap Villain51869772018-03-03 4:19:042688 days ago1520050744IN
0xf8EF3034...35aD2f736
0.001 ETH0.000035551
Zap Villain51869602018-03-03 4:16:142688 days ago1520050574IN
0xf8EF3034...35aD2f736
0.001 ETH0.000131112
Pinch Villain51810752018-03-02 4:23:332689 days ago1519964613IN
0xf8EF3034...35aD2f736
0.002 ETH0.000098484
Pinch Villain51810732018-03-02 4:23:022689 days ago1519964582IN
0xf8EF3034...35aD2f736
0.002 ETH0.000289734
Zap Villain51810692018-03-02 4:21:422689 days ago1519964502IN
0xf8EF3034...35aD2f736
0.001 ETH0.000071112
Purchase51691552018-02-28 3:43:552691 days ago1519789435IN
0xf8EF3034...35aD2f736
0.09216 ETH0.000045962
Purchase51691462018-02-28 3:42:222691 days ago1519789342IN
0xf8EF3034...35aD2f736
0.0768 ETH0.002298100
Purchase51691462018-02-28 3:42:222691 days ago1519789342IN
0xf8EF3034...35aD2f736
0.09216 ETH0.0020222488
Purchase51691462018-02-28 3:42:222691 days ago1519789342IN
0xf8EF3034...35aD2f736
0.0064 ETH0.000045962
Purchase51691312018-02-28 3:39:482691 days ago1519789188IN
0xf8EF3034...35aD2f736
0.0192 ETH0.0004366219
Purchase51691312018-02-28 3:39:482691 days ago1519789188IN
0xf8EF3034...35aD2f736
0.09216 ETH0.0013558259
Purchase51691312018-02-28 3:39:482691 days ago1519789188IN
0xf8EF3034...35aD2f736
0.09216 ETH0.0008962239
Purchase51691302018-02-28 3:39:452691 days ago1519789185IN
0xf8EF3034...35aD2f736
0.0768 ETH0.000045962
Purchase51691242018-02-28 3:38:412691 days ago1519789121IN
0xf8EF3034...35aD2f736
0.09216 ETH0.000045962
Purchase51691092018-02-28 3:35:252691 days ago1519788925IN
0xf8EF3034...35aD2f736
0.0096 ETH0.0006434428
Purchase51691092018-02-28 3:35:252691 days ago1519788925IN
0xf8EF3034...35aD2f736
0.0096 ETH0.0006434428
Purchase51691092018-02-28 3:35:252691 days ago1519788925IN
0xf8EF3034...35aD2f736
0.0048 ETH0.0006664229
Purchase51691092018-02-28 3:35:252691 days ago1519788925IN
0xf8EF3034...35aD2f736
0.064 ETH0.0011260249
Purchase51691092018-02-28 3:35:252691 days ago1519788925IN
0xf8EF3034...35aD2f736
0.001 ETH0.000091924
Purchase51691092018-02-28 3:35:252691 days ago1519788925IN
0xf8EF3034...35aD2f736
0.002 ETH0.000091924
Purchase51691042018-02-28 3:33:432691 days ago1519788823IN
0xf8EF3034...35aD2f736
0.008 ETH0.000045962
Purchase51690892018-02-28 3:30:362691 days ago1519788636IN
0xf8EF3034...35aD2f736
0.0024 ETH0.000045962
Purchase51690742018-02-28 3:26:512691 days ago1519788411IN
0xf8EF3034...35aD2f736
0.032 ETH0.0008962239
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Method Block
From
To
Transfer52077662018-03-06 16:50:002684 days ago1520355000
0xf8EF3034...35aD2f736
1.427854 ETH
Transfer51689192018-02-28 2:45:262691 days ago1519785926
0xf8EF3034...35aD2f736
0.02976 ETH
Transfer51689152018-02-28 2:44:252691 days ago1519785865
0xf8EF3034...35aD2f736
0.02976 ETH
Transfer51675372018-02-27 21:12:412691 days ago1519765961
0xf8EF3034...35aD2f736
0.02976 ETH
Transfer51675312018-02-27 21:11:522691 days ago1519765912
0xf8EF3034...35aD2f736
0.01488 ETH
Transfer51675282018-02-27 21:10:582691 days ago1519765858
0xf8EF3034...35aD2f736
0.02976 ETH
Transfer51675272018-02-27 21:10:232691 days ago1519765823
0xf8EF3034...35aD2f736
0.01488 ETH
Transfer51675262018-02-27 21:10:002691 days ago1519765800
0xf8EF3034...35aD2f736
0.00744 ETH
Transfer51675252018-02-27 21:09:542691 days ago1519765794
0xf8EF3034...35aD2f736
0.00744 ETH
Transfer51675252018-02-27 21:09:542691 days ago1519765794
0xf8EF3034...35aD2f736
0.01488 ETH
Transfer51675232018-02-27 21:09:312691 days ago1519765771
0xf8EF3034...35aD2f736
0.00372 ETH
Transfer51675192018-02-27 21:09:112691 days ago1519765751
0xf8EF3034...35aD2f736
0.02976 ETH
Transfer51675182018-02-27 21:09:022691 days ago1519765742
0xf8EF3034...35aD2f736
0.004 ETH
Transfer51675182018-02-27 21:09:022691 days ago1519765742
0xf8EF3034...35aD2f736
0.01488 ETH
Transfer51675162018-02-27 21:08:302691 days ago1519765710
0xf8EF3034...35aD2f736
0.02976 ETH
Transfer51675162018-02-27 21:08:302691 days ago1519765710
0xf8EF3034...35aD2f736
0.05952 ETH
Transfer51675162018-02-27 21:08:302691 days ago1519765710
0xf8EF3034...35aD2f736
0.02976 ETH
Transfer51675152018-02-27 21:08:232691 days ago1519765703
0xf8EF3034...35aD2f736
0.00372 ETH
Transfer51675152018-02-27 21:08:232691 days ago1519765703
0xf8EF3034...35aD2f736
0.018 ETH
Transfer51675152018-02-27 21:08:232691 days ago1519765703
0xf8EF3034...35aD2f736
0.00186 ETH
Transfer51675152018-02-27 21:08:232691 days ago1519765703
0xf8EF3034...35aD2f736
0.00744 ETH
Transfer51675152018-02-27 21:08:232691 days ago1519765703
0xf8EF3034...35aD2f736
0.01488 ETH
Transfer51675112018-02-27 21:07:442691 days ago1519765664
0xf8EF3034...35aD2f736
0.014 ETH
Transfer51675112018-02-27 21:07:442691 days ago1519765664
0xf8EF3034...35aD2f736
0.01488 ETH
Transfer51675112018-02-27 21:07:442691 days ago1519765664
0xf8EF3034...35aD2f736
0.02976 ETH
View All Internal Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EtherVillains

Compiler Version
v0.4.19+commit.c4cbbb05

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-02-25
*/

pragma solidity ^0.4.19; //

// EtherVillains.co


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 EtherVillains is ERC721 {

  /*** EVENTS ***/

  /// @dev The Birth event is fired whenever a new villain 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 = "EtherVillains"; //
  string public constant SYMBOL = "EVIL"; //

  uint256 public precision = 1000000000000; //0.000001 Eth

  uint256 private zapPrice =  0.001 ether;
  uint256 private pinchPrice =  0.002 ether;
  uint256 private guardPrice =  0.002 ether;

  uint256 private pinchPercentageReturn = 20; // how much a flip is worth when a villain is flipped.

  uint256 private defaultStartingPrice = 0.001 ether;
  uint256 private firstStepLimit =  0.05 ether;
  uint256 private secondStepLimit = 0.5 ether;

  /*** STORAGE ***/

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

  // @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 Villains to an address that has been approved to call
  ///  transferFrom(). Each Villain can only have one approved address for transfer
  ///  at any time. A zero value means no approval is outstanding.
  mapping (uint256 => address) public villainIndexToApproved;

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

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


  /*** DATATYPES ***/
  struct Villain {
    uint256 id; // needed for gnarly front end
    string name;
    uint256 class; // 0 = Zapper , 1 = Pincher , 2 = Guard
    uint256 level; // 0 for Zapper, 1 - 5 for Pincher, Guard - representing the max active pinches or guards
    uint256 numSkillActive; // the current number of active skill implementations (pinches or guards)
    uint256 state; // 0 = normal , 1 = zapped , 2 = pinched , 3 = guarded
    uint256 zappedExipryTime; // if this villain was disarmed, when does it expire
    uint256 affectedByToken; // token that has affected this token (zapped, pinched, guarded)
    uint256 buyPrice; // the price at which this villain was purchased
  }

  Villain[] private villains;

  /*** 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 EtherVillains() 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));

    villainIndexToApproved[_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 Villain with the given name.
  function createVillain(string _name, uint256 _startPrice, uint256 _class, uint256 _level) public onlyCLevel {
    _createVillain(_name, address(this), _startPrice,_class,_level);
  }

  /// @notice Returns all the relevant information about a specific villain.
  /// @param _tokenId The tokenId of the villain of interest.
  function getVillain(uint256 _tokenId) public view returns (
    uint256 id,
    string villainName,
    uint256 sellingPrice,
    address owner,
    uint256 class,
    uint256 level,
    uint256 numSkillActive,
    uint256 state,
    uint256 zappedExipryTime,
    uint256 buyPrice,
    uint256 nextPrice,
    uint256 affectedByToken
  ) {
    id = _tokenId;
    Villain storage villain = villains[_tokenId];
    villainName = villain.name;
    sellingPrice =villainIndexToPrice[_tokenId];
    owner = villainIndexToOwner[_tokenId];
    class = villain.class;
    level = villain.level;
    numSkillActive = villain.numSkillActive;
    state = villain.state;
    if (villain.state==1 && now>villain.zappedExipryTime){
        state=0; // time expired so say they are armed
    }
    zappedExipryTime=villain.zappedExipryTime;
    buyPrice=villain.buyPrice;
    nextPrice=calculateNewPrice(_tokenId);
    affectedByToken=villain.affectedByToken;
  }

  /// zap a villain in preparation for a pinch
  function zapVillain(uint256 _victim  , uint256 _zapper) public payable returns (bool){
    address villanOwner = villainIndexToOwner[_victim];
    require(msg.sender != villanOwner); // it doesn't make sense, but hey
    require(villains[_zapper].class==0); // they must be a zapper class
    require(msg.sender==villainIndexToOwner[_zapper]); // they must be a zapper owner

    uint256 operationPrice = zapPrice;
    // if the target sale price <0.01 then operation is free
    if (villainIndexToPrice[_victim]<0.01 ether){
      operationPrice=0;
    }

    // can be used to extend a zapped period
    if (msg.value>=operationPrice && villains[_victim].state<2){
        // zap villain
        villains[_victim].state=1;
        villains[_victim].zappedExipryTime = now + (villains[_zapper].level * 1 minutes);
    }

  }

    /// pinch a villain
  function pinchVillain(uint256 _victim, uint256 _pincher) public payable returns (bool){
    address victimOwner = villainIndexToOwner[_victim];
    require(msg.sender != victimOwner); // it doesn't make sense, but hey
    require(msg.sender==villainIndexToOwner[_pincher]);
    require(villains[_pincher].class==1); // they must be a pincher
    require(villains[_pincher].numSkillActive<villains[_pincher].level);

    uint256 operationPrice = pinchPrice;
    // if the target sale price <0.01 then operation is free
    if (villainIndexToPrice[_victim]<0.01 ether){
      operationPrice=0;
    }

    // 0 = normal , 1 = zapped , 2 = pinched
    // must be inside the zapped window
    if (msg.value>=operationPrice && villains[_victim].state==1 && now< villains[_victim].zappedExipryTime){
        // squeeze
        villains[_victim].state=2; // squeezed
        villains[_victim].affectedByToken=_pincher;
        villains[_pincher].numSkillActive++;
    }
  }

  /// guard a villain
  function guardVillain(uint256 _target, uint256 _guard) public payable returns (bool){
    require(msg.sender==villainIndexToOwner[_guard]); // sender must own this token
    require(villains[_guard].numSkillActive<villains[_guard].level);

    uint256 operationPrice = guardPrice;
    // if the target sale price <0.01 then operation is free
    if (villainIndexToPrice[_target]<0.01 ether){
      operationPrice=0;
    }

    // 0 = normal , 1 = zapped , 2 = pinched, 3 = guarded
    if (msg.value>=operationPrice && villains[_target].state<2){
        // guard this villain
        villains[_target].state=3;
        villains[_target].affectedByToken=_guard;
        villains[_guard].numSkillActive++;
    }
  }


  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 = villainIndexToOwner[_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 = villainIndexToOwner[_tokenId];
    address newOwner = msg.sender;

    uint256 sellingPrice = villainIndexToPrice[_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 = roundIt(uint256(SafeMath.div(SafeMath.mul(sellingPrice, 93), 100))); // taking 7% for the house before any pinches?
    uint256 purchaseExcess = SafeMath.sub(msg.value, sellingPrice);


    // HERE'S THE FLIPPING STRATEGY

    villainIndexToPrice[_tokenId]  = calculateNewPrice(_tokenId);


     // we check to see if there is a pinch on this villain
     // if there is, then transfer the pinch percentage to the owner of the pinch token
     if (villains[_tokenId].state==2 && villains[_tokenId].affectedByToken!=0){
         uint256 profit = sellingPrice - villains[_tokenId].buyPrice;
         uint256 pinchPayment = roundIt(SafeMath.mul(SafeMath.div(profit,100),pinchPercentageReturn));

         // release on of this villans pinch capabilitiesl
         address pincherTokenOwner = villainIndexToOwner[villains[_tokenId].affectedByToken];
         pincherTokenOwner.transfer(pinchPayment);
         payment = SafeMath.sub(payment,pinchPayment); // subtract the pinch fees
     }

     // free the villan of any pinches or guards as part of this purpose
     if (villains[villains[_tokenId].affectedByToken].numSkillActive>0){
        villains[villains[_tokenId].affectedByToken].numSkillActive--; // reset the pincher or guard affected count
     }

     villains[_tokenId].state=0;
     villains[_tokenId].affectedByToken=0;
     villains[_tokenId].buyPrice=sellingPrice;

    _transfer(oldOwner, newOwner, _tokenId);

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

    TokenSold(_tokenId, sellingPrice, villainIndexToPrice[_tokenId], oldOwner, newOwner, villains[_tokenId].name);

    msg.sender.transfer(purchaseExcess); // return any additional amount
  }

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

  function nextPrice(uint256 _tokenId) public view returns (uint256 nPrice) {
    return calculateNewPrice(_tokenId);
  }


//(note: hard coded value appreciation is 2X from a contract price of 0 ETH to 0.05 ETH, 1.2X from 0.05 to 0.5 and 1.15X from 0.5 ETH and up).


 function calculateNewPrice(uint256 _tokenId) internal view returns (uint256 price){
   uint256 sellingPrice = villainIndexToPrice[_tokenId];
   uint256 newPrice;
   // Update prices
   if (sellingPrice < firstStepLimit) {
     // first stage
    newPrice = roundIt(SafeMath.mul(sellingPrice, 2));
   } else if (sellingPrice < secondStepLimit) {
     // second stage
     newPrice = roundIt(SafeMath.div(SafeMath.mul(sellingPrice, 120), 100));
   } else {
     // third stage
     newPrice= roundIt(SafeMath.div(SafeMath.mul(sellingPrice, 115), 100));
   }
   return newPrice;

 }

  /// @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 = villainIndexToOwner[_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 tokens we are interested in.
  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 totalVillains = totalSupply();
      uint256 resultIndex = 0;

      uint256 villainId;
      for (villainId = 0; villainId <= totalVillains; villainId++) {
        if (villainIndexToOwner[villainId] == _owner) {
          result[resultIndex] = villainId;
          resultIndex++;
        }
      }
      return result;
    }
  }

  /// For querying totalSupply of token
  /// @dev Required for ERC-721 compliance.
  function totalSupply() public view returns (uint256 total) {
    return villains.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 villainIndexToApproved[_tokenId] == _to;
  }



  /// For creating Villains
  function _createVillain(string _name, address _owner, uint256 _price, uint256 _class, uint256 _level) private {

    Villain memory _villain = Villain({
      name: _name,
      class: _class,
      level: _level,
      numSkillActive: 0,
      state: 0,
      zappedExipryTime: 0,
      affectedByToken: 0,
      buyPrice: 0,
      id: villains.length-1
    });
    uint256 newVillainId = villains.push(_villain) - 1;
    villains[newVillainId].id=newVillainId;

    // 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(newVillainId == uint256(uint32(newVillainId)));

    Birth(newVillainId, _name, _owner);

    villainIndexToPrice[newVillainId] = _price;

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

  /// Check for token ownership
  function _owns(address claimant, uint256 _tokenId) private view returns (bool) {
    return claimant == villainIndexToOwner[_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 Villain to an address.
  function _transfer(address _from, address _to, uint256 _tokenId) private {
    // Since the number of villains is capped to 2^32 we can't overflow this
    ownershipTokenCount[_to]++;
    //transfer ownership
    villainIndexToOwner[_tokenId] = _to;

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

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

    // utility to round to the game precision
    function roundIt(uint256 amount) internal constant returns (uint256)
    {
        // round down to correct preicision
        uint256 result = (amount/precision)*precision;
        return result;
    }

}



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 Security Audit

Contract ABI

API
[{"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":false,"inputs":[{"name":"_newCEO","type":"address"}],"name":"setCEO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"nextPrice","outputs":[{"name":"nPrice","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newCOO","type":"address"}],"name":"setCOO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_victim","type":"uint256"},{"name":"_zapper","type":"uint256"}],"name":"zapVillain","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_startPrice","type":"uint256"},{"name":"_class","type":"uint256"},{"name":"_level","type":"uint256"}],"name":"createVillain","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":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"villainIndexToOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","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":"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":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getVillain","outputs":[{"name":"id","type":"uint256"},{"name":"villainName","type":"string"},{"name":"sellingPrice","type":"uint256"},{"name":"owner","type":"address"},{"name":"class","type":"uint256"},{"name":"level","type":"uint256"},{"name":"numSkillActive","type":"uint256"},{"name":"state","type":"uint256"},{"name":"zappedExipryTime","type":"uint256"},{"name":"buyPrice","type":"uint256"},{"name":"nextPrice","type":"uint256"},{"name":"affectedByToken","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"precision","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_victim","type":"uint256"},{"name":"_pincher","type":"uint256"}],"name":"pinchVillain","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_target","type":"uint256"},{"name":"_guard","type":"uint256"}],"name":"guardVillain","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"purchase","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"villainIndexToApproved","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"},{"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"}]

606060405264e8d4a5100060005566038d7ea4c6800060015566071afd498d000060025566071afd498d0000600355601460045566038d7ea4c6800060055566b1a2bc2ec500006006556706f05b59d3b20000600755341561006057600080fd5b600c8054600160a060020a033316600160a060020a03199182168117909255600d80549091169091179055611c5b8061009a6000396000f3006060604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610179578063095ea7b3146102035780630a0f8168146102275780630b7e9c44146102565780631051db341461027557806318160ddd1461029c57806323b872dd146102c157806327d7874c146102e95780632821ca71146103085780632ba73c151461031e5780634de2eee91461033d5780635436c1631461034b5780636352211e146103a957806370a08231146103bf5780638462151c146103de57806395d89b411461045057806397992a0414610463578063a3f4df7e14610479578063a9059cbb1461048c578063b047fb50146104ae578063b2e6ceeb146104c1578063b9186d7d146104d7578063bfbd5074146104ed578063d3b5dc3b146105da578063d8fce0d4146105ed578063df4f0088146105fb578063efef39a114610609578063f661e76714610614578063f76f8d781461062a575b600080fd5b341561018457600080fd5b61018c61063d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c85780820151838201526020016101b0565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020e57600080fd5b610225600160a060020a036004351660243561067f565b005b341561023257600080fd5b61023a61070b565b604051600160a060020a03909116815260200160405180910390f35b341561026157600080fd5b610225600160a060020a036004351661071a565b341561028057600080fd5b61028861075c565b604051901515815260200160405180910390f35b34156102a757600080fd5b6102af610761565b60405190815260200160405180910390f35b34156102cc57600080fd5b610225600160a060020a0360043581169060243516604435610767565b34156102f457600080fd5b610225600160a060020a03600435166107b5565b341561031357600080fd5b6102af600435610814565b341561032957600080fd5b610225600160a060020a0360043516610827565b610288600435602435610886565b341561035657600080fd5b61022560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050843594602081013594506040013592506109d8915050565b34156103b457600080fd5b61023a600435610a21565b34156103ca57600080fd5b6102af600160a060020a0360043516610a45565b34156103e957600080fd5b6103fd600160a060020a0360043516610a60565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561043c578082015183820152602001610424565b505050509050019250505060405180910390f35b341561045b57600080fd5b61018c610b41565b341561046e57600080fd5b61023a600435610b82565b341561048457600080fd5b61018c610b9d565b341561049757600080fd5b610225600160a060020a0360043516602435610bd4565b34156104b957600080fd5b61023a610c0c565b34156104cc57600080fd5b610225600435610c1b565b34156104e257600080fd5b6102af600435610c69565b34156104f857600080fd5b610503600435610c7b565b604051808d8152602001806020018c81526020018b600160a060020a0316600160a060020a031681526020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815260200182810382528d818151815260200191508051906020019080838360005b8381101561059457808201518382015260200161057c565b50505050905090810190601f1680156105c15780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b34156105e557600080fd5b6102af610e03565b610288600435602435610e09565b610288600435602435610fd4565b61022560043561111f565b341561061f57600080fd5b61023a600435611583565b341561063557600080fd5b61018c61159e565b610645611a68565b60408051908101604052600d81527f457468657256696c6c61696e7300000000000000000000000000000000000000602082015290505b90565b61068933826115d5565b151561069457600080fd5b6000818152600a602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b600c54600160a060020a031681565b600c5433600160a060020a03908116911614806107455750600d5433600160a060020a039081169116145b151561075057600080fd5b610759816115f5565b50565b600190565b600e5490565b61077183826115d5565b151561077c57600080fd5b6107868282611680565b151561079157600080fd5b61079a826116a0565b15156107a557600080fd5b6107b08383836116ae565b505050565b600c5433600160a060020a039081169116146107d057600080fd5b600160a060020a03811615156107e557600080fd5b600c805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600061081f8261179e565b90505b919050565b600c5433600160a060020a0390811691161461084257600080fd5b600160a060020a038116151561085757600080fd5b600d805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082815260086020526040812054600160a060020a0390811690829033168214156108b157600080fd5b600e8054859081106108bf57fe5b90600052602060002090600902016002015460001415156108df57600080fd5b60008481526008602052604090205433600160a060020a0390811691161461090657600080fd5b506001546000858152600b6020526040902054662386f26fc1000090101561092c575060005b80341015801561095c57506002600e8681548110151561094857fe5b906000526020600020906009020160050154105b156109d0576001600e8681548110151561097257fe5b6000918252602090912060056009909202010155600e80548590811061099457fe5b906000526020600020906009020160030154603c024201600e868154811015156109ba57fe5b9060005260206000209060090201600601819055505b505092915050565b600c5433600160a060020a0390811691161480610a035750600d5433600160a060020a039081169116145b1515610a0e57600080fd5b610a1b8430858585611804565b50505050565b600081815260086020526040902054600160a060020a031680151561082257600080fd5b600160a060020a031660009081526009602052604090205490565b610a68611a68565b6000610a72611a68565b6000806000610a8087610a45565b9450841515610ab0576000604051805910610a985750595b90808252806020026020018201604052509550610b37565b84604051805910610abe5750595b90808252806020026020018201604052509350610ad9610761565b925060009150600090505b828111610b3357600081815260086020526040902054600160a060020a0388811691161415610b2b5780848381518110610b1a57fe5b602090810290910101526001909101905b600101610ae4565b8395505b5050505050919050565b610b49611a68565b60408051908101604052600481527f4556494c000000000000000000000000000000000000000000000000000000006020820152905090565b600860205260009081526040902054600160a060020a031681565b60408051908101604052600d81527f457468657256696c6c61696e7300000000000000000000000000000000000000602082015281565b610bde33826115d5565b1515610be957600080fd5b610bf2826116a0565b1515610bfd57600080fd5b610c083383836116ae565b5050565b600d54600160a060020a031681565b6000818152600860205260409020543390600160a060020a0316610c3e826116a0565b1515610c4957600080fd5b610c538284611680565b1515610c5e57600080fd5b6107b08183856116ae565b6000908152600b602052604090205490565b6000610c85611a68565b60008060008060008060008060008060008d9c50600e8e815481101515610ca857fe5b90600052602060002090600902019050806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d505780601f10610d2557610100808354040283529160200191610d50565b820191906000526020600020905b815481529060010190602001808311610d3357829003601f168201915b50505050509b50600b60008f8152602001908152602001600020549a50600860008f815260200190815260200160002060009054906101000a9004600160a060020a031699508060020154985080600301549750806004015496508060050154955080600501546001148015610dc95750806006015442115b15610dd357600095505b8060060154945080600801549350610dea8e61179e565b9250806007015491505091939597999b5091939597999b565b60005481565b600082815260086020526040812054600160a060020a039081169082903316821415610e3457600080fd5b60008481526008602052604090205433600160a060020a03908116911614610e5b57600080fd5b600e805485908110610e6957fe5b9060005260206000209060090201600201546001141515610e8957600080fd5b600e805485908110610e9757fe5b906000526020600020906009020160030154600e85815481101515610eb857fe5b906000526020600020906009020160040154101515610ed657600080fd5b506002546000858152600b6020526040902054662386f26fc10000901015610efc575060005b803410158015610f2b5750600e805486908110610f1557fe5b9060005260206000209060090201600501546001145b8015610f555750600e805486908110610f4057fe5b90600052602060002090600902016006015442105b156109d0576002600e86815481101515610f6b57fe5b90600052602060002090600902016005018190555083600e86815481101515610f9057fe5b6000918252602090912060076009909202010155600e805485908110610fb257fe5b6000918252602090912060046009909202010180546001019055505092915050565b600081815260086020526040812054819033600160a060020a03908116911614610ffd57600080fd5b600e80548490811061100b57fe5b906000526020600020906009020160030154600e8481548110151561102c57fe5b90600052602060002090600902016004015410151561104a57600080fd5b506003546000848152600b6020526040902054662386f26fc10000901015611070575060005b8034101580156110a057506002600e8581548110151561108c57fe5b906000526020600020906009020160050154105b15611118576003600e858154811015156110b657fe5b90600052602060002090600902016005018190555082600e858154811015156110db57fe5b6000918252602090912060076009909202010155600e8054849081106110fd57fe5b60009182526020909120600460099092020101805460010190555b5092915050565b600081815260086020908152604080832054600b909252822054600160a060020a039182169233928190819081908190871688141561115d57600080fd5b611166876116a0565b151561117157600080fd5b348690101561117f57600080fd5b61119c61119761119088605d6119f8565b6064611a23565b611a3a565b94506111a83487611a56565b93506111b38961179e565b60008a8152600b6020526040902055600e80548a9081106111d057fe5b90600052602060002090600902016005015460021480156112115750600e80548a9081106111fa57fe5b906000526020600020906009020160070154600014155b156112de57600e80548a90811061122457fe5b9060005260206000209060090201600801548603925061125361119761124b856064611a23565b6004546119f8565b915060086000600e8b81548110151561126857fe5b906000526020600020906009020160070154815260200190815260200160002060009054906101000a9004600160a060020a0316905080600160a060020a03166108fc839081150290604051600060405180830381858888f1935050505015156112d157600080fd5b6112db8583611a56565b94505b6000600e808b8154811015156112f057fe5b90600052602060002090600902016007015481548110151561130e57fe5b906000526020600020906009020160040154111561137057600e808a81548110151561133657fe5b90600052602060002090600902016007015481548110151561135457fe5b6000918252602090912060046009909202010180546000190190555b6000600e8a81548110151561138157fe5b9060005260206000209060090201600501819055506000600e8a8154811015156113a757fe5b90600052602060002090600902016007018190555085600e8a8154811015156113cc57fe5b9060005260206000209060090201600801819055506113ec88888b6116ae565b30600160a060020a031688600160a060020a031614151561143857600160a060020a03881685156108fc0286604051600060405180830381858888f19350505050151561143857600080fd5b7e8201e7bcbf010c2c07de59d6e97cb7e3cf67a46125c49cbc89b9d2cde1f48f8987600b60008d8152602001908152602001600020548b8b600e8f81548110151561147f57fe5b90600052602060002090600902016001016040518681526020810186905260408101859052600160a060020a0380851660608301528316608082015260c060a082018181528354600260001961010060018416150201909116049183018290529060e0830190849080156115345780601f1061150957610100808354040283529160200191611534565b820191906000526020600020905b81548152906001019060200180831161151757829003601f168201915b505097505050505050505060405180910390a1600160a060020a03331684156108fc0285604051600060405180830381858888f19350505050151561157857600080fd5b505050505050505050565b600a60205260009081526040902054600160a060020a031681565b60408051908101604052600481527f4556494c00000000000000000000000000000000000000000000000000000000602082015281565b600090815260086020526040902054600160a060020a0390811691161490565b600160a060020a038116151561164357600c54600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561163e57600080fd5b610759565b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561075957600080fd5b6000908152600a6020526040902054600160a060020a0391821691161490565b600160a060020a0316151590565b600160a060020a0380831660008181526009602090815260408083208054600101905585835260089091529020805473ffffffffffffffffffffffffffffffffffffffff1916909117905583161561174957600160a060020a03831660009081526009602090815260408083208054600019019055838352600a9091529020805473ffffffffffffffffffffffffffffffffffffffff191690555b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a1505050565b6000818152600b602052604081205460065482908210156117ce576117c76111978360026119f8565b90506117fd565b6007548210156117e9576117c76111976111908460786119f8565b6117fa6111976111908460736119f8565b90505b9392505050565b61180c611a7a565b6000610120604051908101604052806001600e8054905003815260200188815260200185815260200184815260200160008152602001600081526020016000815260200160008152602001600081525091506001600e80548060010182816118749190611acd565b60009283526020909220859160090201815181556020820151816001019080516118a2929160200190611af9565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155505003905080600e828154811015156118ff57fe5b600091825260209091206009909102015563ffffffff8116811461192257600080fd5b7fb3b0cf861f168bcdb275c69da97b2543631552ba562628aa3c7317d4a6089ef2818888604051838152600160a060020a038216604082015260606020820181815290820184818151815260200191508051906020019080838360005b8381101561199757808201518382015260200161197f565b50505050905090810190601f1680156119c45780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a16000818152600b602052604081208690556119ef9087836116ae565b50505050505050565b600080831515611a0b5760009150611118565b50828202828482811515611a1b57fe5b04146117fd57fe5b6000808284811515611a3157fe5b04949350505050565b60008060005460005484811515611a4d57fe5b04029392505050565b600082821115611a6257fe5b50900390565b60206040519081016040526000815290565b6101206040519081016040528060008152602001611a96611a68565b8152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8154818355818115116107b0576009028160090283600052602060002091820191016107b09190611b77565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611b3a57805160ff1916838001178555611b67565b82800160010185558215611b67579182015b82811115611b67578251825591602001919060010190611b4c565b50611b73929150611bd1565b5090565b61067c91905b80821115611b73576000808255611b976001830182611beb565b5060006002820181905560038201819055600482018190556005820181905560068201819055600782018190556008820155600901611b7d565b61067c91905b80821115611b735760008155600101611bd7565b50805460018160011615610100020316600290046000825580601f10611c115750610759565b601f0160209004906000526020600020908101906107599190611bd15600a165627a7a723058207893e54c2860304fc7336be31b3ea7cb08b8d5d320f09666d65b354a93b40fa50029

Deployed Bytecode

0x6060604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610179578063095ea7b3146102035780630a0f8168146102275780630b7e9c44146102565780631051db341461027557806318160ddd1461029c57806323b872dd146102c157806327d7874c146102e95780632821ca71146103085780632ba73c151461031e5780634de2eee91461033d5780635436c1631461034b5780636352211e146103a957806370a08231146103bf5780638462151c146103de57806395d89b411461045057806397992a0414610463578063a3f4df7e14610479578063a9059cbb1461048c578063b047fb50146104ae578063b2e6ceeb146104c1578063b9186d7d146104d7578063bfbd5074146104ed578063d3b5dc3b146105da578063d8fce0d4146105ed578063df4f0088146105fb578063efef39a114610609578063f661e76714610614578063f76f8d781461062a575b600080fd5b341561018457600080fd5b61018c61063d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c85780820151838201526020016101b0565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020e57600080fd5b610225600160a060020a036004351660243561067f565b005b341561023257600080fd5b61023a61070b565b604051600160a060020a03909116815260200160405180910390f35b341561026157600080fd5b610225600160a060020a036004351661071a565b341561028057600080fd5b61028861075c565b604051901515815260200160405180910390f35b34156102a757600080fd5b6102af610761565b60405190815260200160405180910390f35b34156102cc57600080fd5b610225600160a060020a0360043581169060243516604435610767565b34156102f457600080fd5b610225600160a060020a03600435166107b5565b341561031357600080fd5b6102af600435610814565b341561032957600080fd5b610225600160a060020a0360043516610827565b610288600435602435610886565b341561035657600080fd5b61022560046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050843594602081013594506040013592506109d8915050565b34156103b457600080fd5b61023a600435610a21565b34156103ca57600080fd5b6102af600160a060020a0360043516610a45565b34156103e957600080fd5b6103fd600160a060020a0360043516610a60565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561043c578082015183820152602001610424565b505050509050019250505060405180910390f35b341561045b57600080fd5b61018c610b41565b341561046e57600080fd5b61023a600435610b82565b341561048457600080fd5b61018c610b9d565b341561049757600080fd5b610225600160a060020a0360043516602435610bd4565b34156104b957600080fd5b61023a610c0c565b34156104cc57600080fd5b610225600435610c1b565b34156104e257600080fd5b6102af600435610c69565b34156104f857600080fd5b610503600435610c7b565b604051808d8152602001806020018c81526020018b600160a060020a0316600160a060020a031681526020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815260200182810382528d818151815260200191508051906020019080838360005b8381101561059457808201518382015260200161057c565b50505050905090810190601f1680156105c15780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b34156105e557600080fd5b6102af610e03565b610288600435602435610e09565b610288600435602435610fd4565b61022560043561111f565b341561061f57600080fd5b61023a600435611583565b341561063557600080fd5b61018c61159e565b610645611a68565b60408051908101604052600d81527f457468657256696c6c61696e7300000000000000000000000000000000000000602082015290505b90565b61068933826115d5565b151561069457600080fd5b6000818152600a602052604090819020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038581169182179092559133909116907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259084905190815260200160405180910390a35050565b600c54600160a060020a031681565b600c5433600160a060020a03908116911614806107455750600d5433600160a060020a039081169116145b151561075057600080fd5b610759816115f5565b50565b600190565b600e5490565b61077183826115d5565b151561077c57600080fd5b6107868282611680565b151561079157600080fd5b61079a826116a0565b15156107a557600080fd5b6107b08383836116ae565b505050565b600c5433600160a060020a039081169116146107d057600080fd5b600160a060020a03811615156107e557600080fd5b600c805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600061081f8261179e565b90505b919050565b600c5433600160a060020a0390811691161461084257600080fd5b600160a060020a038116151561085757600080fd5b600d805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082815260086020526040812054600160a060020a0390811690829033168214156108b157600080fd5b600e8054859081106108bf57fe5b90600052602060002090600902016002015460001415156108df57600080fd5b60008481526008602052604090205433600160a060020a0390811691161461090657600080fd5b506001546000858152600b6020526040902054662386f26fc1000090101561092c575060005b80341015801561095c57506002600e8681548110151561094857fe5b906000526020600020906009020160050154105b156109d0576001600e8681548110151561097257fe5b6000918252602090912060056009909202010155600e80548590811061099457fe5b906000526020600020906009020160030154603c024201600e868154811015156109ba57fe5b9060005260206000209060090201600601819055505b505092915050565b600c5433600160a060020a0390811691161480610a035750600d5433600160a060020a039081169116145b1515610a0e57600080fd5b610a1b8430858585611804565b50505050565b600081815260086020526040902054600160a060020a031680151561082257600080fd5b600160a060020a031660009081526009602052604090205490565b610a68611a68565b6000610a72611a68565b6000806000610a8087610a45565b9450841515610ab0576000604051805910610a985750595b90808252806020026020018201604052509550610b37565b84604051805910610abe5750595b90808252806020026020018201604052509350610ad9610761565b925060009150600090505b828111610b3357600081815260086020526040902054600160a060020a0388811691161415610b2b5780848381518110610b1a57fe5b602090810290910101526001909101905b600101610ae4565b8395505b5050505050919050565b610b49611a68565b60408051908101604052600481527f4556494c000000000000000000000000000000000000000000000000000000006020820152905090565b600860205260009081526040902054600160a060020a031681565b60408051908101604052600d81527f457468657256696c6c61696e7300000000000000000000000000000000000000602082015281565b610bde33826115d5565b1515610be957600080fd5b610bf2826116a0565b1515610bfd57600080fd5b610c083383836116ae565b5050565b600d54600160a060020a031681565b6000818152600860205260409020543390600160a060020a0316610c3e826116a0565b1515610c4957600080fd5b610c538284611680565b1515610c5e57600080fd5b6107b08183856116ae565b6000908152600b602052604090205490565b6000610c85611a68565b60008060008060008060008060008060008d9c50600e8e815481101515610ca857fe5b90600052602060002090600902019050806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d505780601f10610d2557610100808354040283529160200191610d50565b820191906000526020600020905b815481529060010190602001808311610d3357829003601f168201915b50505050509b50600b60008f8152602001908152602001600020549a50600860008f815260200190815260200160002060009054906101000a9004600160a060020a031699508060020154985080600301549750806004015496508060050154955080600501546001148015610dc95750806006015442115b15610dd357600095505b8060060154945080600801549350610dea8e61179e565b9250806007015491505091939597999b5091939597999b565b60005481565b600082815260086020526040812054600160a060020a039081169082903316821415610e3457600080fd5b60008481526008602052604090205433600160a060020a03908116911614610e5b57600080fd5b600e805485908110610e6957fe5b9060005260206000209060090201600201546001141515610e8957600080fd5b600e805485908110610e9757fe5b906000526020600020906009020160030154600e85815481101515610eb857fe5b906000526020600020906009020160040154101515610ed657600080fd5b506002546000858152600b6020526040902054662386f26fc10000901015610efc575060005b803410158015610f2b5750600e805486908110610f1557fe5b9060005260206000209060090201600501546001145b8015610f555750600e805486908110610f4057fe5b90600052602060002090600902016006015442105b156109d0576002600e86815481101515610f6b57fe5b90600052602060002090600902016005018190555083600e86815481101515610f9057fe5b6000918252602090912060076009909202010155600e805485908110610fb257fe5b6000918252602090912060046009909202010180546001019055505092915050565b600081815260086020526040812054819033600160a060020a03908116911614610ffd57600080fd5b600e80548490811061100b57fe5b906000526020600020906009020160030154600e8481548110151561102c57fe5b90600052602060002090600902016004015410151561104a57600080fd5b506003546000848152600b6020526040902054662386f26fc10000901015611070575060005b8034101580156110a057506002600e8581548110151561108c57fe5b906000526020600020906009020160050154105b15611118576003600e858154811015156110b657fe5b90600052602060002090600902016005018190555082600e858154811015156110db57fe5b6000918252602090912060076009909202010155600e8054849081106110fd57fe5b60009182526020909120600460099092020101805460010190555b5092915050565b600081815260086020908152604080832054600b909252822054600160a060020a039182169233928190819081908190871688141561115d57600080fd5b611166876116a0565b151561117157600080fd5b348690101561117f57600080fd5b61119c61119761119088605d6119f8565b6064611a23565b611a3a565b94506111a83487611a56565b93506111b38961179e565b60008a8152600b6020526040902055600e80548a9081106111d057fe5b90600052602060002090600902016005015460021480156112115750600e80548a9081106111fa57fe5b906000526020600020906009020160070154600014155b156112de57600e80548a90811061122457fe5b9060005260206000209060090201600801548603925061125361119761124b856064611a23565b6004546119f8565b915060086000600e8b81548110151561126857fe5b906000526020600020906009020160070154815260200190815260200160002060009054906101000a9004600160a060020a0316905080600160a060020a03166108fc839081150290604051600060405180830381858888f1935050505015156112d157600080fd5b6112db8583611a56565b94505b6000600e808b8154811015156112f057fe5b90600052602060002090600902016007015481548110151561130e57fe5b906000526020600020906009020160040154111561137057600e808a81548110151561133657fe5b90600052602060002090600902016007015481548110151561135457fe5b6000918252602090912060046009909202010180546000190190555b6000600e8a81548110151561138157fe5b9060005260206000209060090201600501819055506000600e8a8154811015156113a757fe5b90600052602060002090600902016007018190555085600e8a8154811015156113cc57fe5b9060005260206000209060090201600801819055506113ec88888b6116ae565b30600160a060020a031688600160a060020a031614151561143857600160a060020a03881685156108fc0286604051600060405180830381858888f19350505050151561143857600080fd5b7e8201e7bcbf010c2c07de59d6e97cb7e3cf67a46125c49cbc89b9d2cde1f48f8987600b60008d8152602001908152602001600020548b8b600e8f81548110151561147f57fe5b90600052602060002090600902016001016040518681526020810186905260408101859052600160a060020a0380851660608301528316608082015260c060a082018181528354600260001961010060018416150201909116049183018290529060e0830190849080156115345780601f1061150957610100808354040283529160200191611534565b820191906000526020600020905b81548152906001019060200180831161151757829003601f168201915b505097505050505050505060405180910390a1600160a060020a03331684156108fc0285604051600060405180830381858888f19350505050151561157857600080fd5b505050505050505050565b600a60205260009081526040902054600160a060020a031681565b60408051908101604052600481527f4556494c00000000000000000000000000000000000000000000000000000000602082015281565b600090815260086020526040902054600160a060020a0390811691161490565b600160a060020a038116151561164357600c54600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561163e57600080fd5b610759565b80600160a060020a03166108fc30600160a060020a0316319081150290604051600060405180830381858888f19350505050151561075957600080fd5b6000908152600a6020526040902054600160a060020a0391821691161490565b600160a060020a0316151590565b600160a060020a0380831660008181526009602090815260408083208054600101905585835260089091529020805473ffffffffffffffffffffffffffffffffffffffff1916909117905583161561174957600160a060020a03831660009081526009602090815260408083208054600019019055838352600a9091529020805473ffffffffffffffffffffffffffffffffffffffff191690555b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a1505050565b6000818152600b602052604081205460065482908210156117ce576117c76111978360026119f8565b90506117fd565b6007548210156117e9576117c76111976111908460786119f8565b6117fa6111976111908460736119f8565b90505b9392505050565b61180c611a7a565b6000610120604051908101604052806001600e8054905003815260200188815260200185815260200184815260200160008152602001600081526020016000815260200160008152602001600081525091506001600e80548060010182816118749190611acd565b60009283526020909220859160090201815181556020820151816001019080516118a2929160200190611af9565b5060408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701556101008201518160080155505003905080600e828154811015156118ff57fe5b600091825260209091206009909102015563ffffffff8116811461192257600080fd5b7fb3b0cf861f168bcdb275c69da97b2543631552ba562628aa3c7317d4a6089ef2818888604051838152600160a060020a038216604082015260606020820181815290820184818151815260200191508051906020019080838360005b8381101561199757808201518382015260200161197f565b50505050905090810190601f1680156119c45780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a16000818152600b602052604081208690556119ef9087836116ae565b50505050505050565b600080831515611a0b5760009150611118565b50828202828482811515611a1b57fe5b04146117fd57fe5b6000808284811515611a3157fe5b04949350505050565b60008060005460005484811515611a4d57fe5b04029392505050565b600082821115611a6257fe5b50900390565b60206040519081016040526000815290565b6101206040519081016040528060008152602001611a96611a68565b8152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b8154818355818115116107b0576009028160090283600052602060002091820191016107b09190611b77565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611b3a57805160ff1916838001178555611b67565b82800160010185558215611b67579182015b82811115611b67578251825591602001919060010190611b4c565b50611b73929150611bd1565b5090565b61067c91905b80821115611b73576000808255611b976001830182611beb565b5060006002820181905560038201819055600482018190556005820181905560068201819055600782018190556008820155600901611b7d565b61067c91905b80821115611b735760008155600101611bd7565b50805460018160011615610100020316600290046000825580601f10611c115750610759565b601f0160209004906000526020600020908101906107599190611bd15600a165627a7a723058207893e54c2860304fc7336be31b3ea7cb08b8d5d320f09666d65b354a93b40fa50029

Swarm Source

bzzr://7893e54c2860304fc7336be31b3ea7cb08b8d5d320f09666d65b354a93b40fa5

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.