Contract 0x56c945f90c9cd1aafbcac78936f569e5fd2438bf

 

TxHash Block Age From To Value [TxFee]
0xbff8c2525f3b2628190308268f98ee4d4c59e8ccb2c3aa3f234b8fc7507a0715718359510 days 23 hrs ago0x528f720a5e3e644ec92bdcd9a8e2497881a4aa2b  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0003912843
0x65f02b70ef0dbf8b0696c9b6daa40e8138d9d4a05fd5d76bb45adc24508c7bab718358610 days 23 hrs ago0x528f720a5e3e644ec92bdcd9a8e2497881a4aa2b  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0004077843
0x16b74a496942b37d4ea06089837468909b6ec4f20db7bb9f54a70c900bf3d086718339111 days 5 mins ago0xf08b9767ec4216098c7350f21e08672772a2f284  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001067331
0xc5b397d24858c86eeae09537d446e8363ed8cc1fdac2bf492c0417c5d24939ce718339011 days 5 mins ago0xf08b9767ec4216098c7350f21e08672772a2f284  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001022139
0x8b4096cedb133063e27a53239177a4def39dba4ee5d21640ad8403c9a8843381718338611 days 6 mins ago0xf08b9767ec4216098c7350f21e08672772a2f284  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001022139
0xa4d1e9b365e7f802ff7f98670373393a923a2c28b0c5e7f4af5d3817892019d2718338311 days 7 mins ago0xf08b9767ec4216098c7350f21e08672772a2f284  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001067139
0x09ea7cbb2b048d18bd066b61d4004088565ee06b74b02c605be0cc72fdec85df716899113 days 22 hrs ago0x8db129ef15b5c4c6b749d3fe6c5cfe81e6b83db5  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001363108
0x2c5237cd3ab2136525c78e308d3a6ae43c430b929f651e5e699d5d2c7fa45fc9715859216 days 1 hr ago0xedbbdf2c29ccf6a0272b36b10eadc1b17b8d7e67  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001022331
0xee833f7e9a893492bd614cbfc43c65f15923bda615f7375257f3010b1cbfb01f715254617 days 7 hrs ago0xd5314cf3913da993b2197b83fc0f085a49f56216  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001067139
0xb9b59b592dd6567f363b8c1b386ecb4c4d90e3eead1b2ebfec007e856797f840715254517 days 7 hrs ago0xd5314cf3913da993b2197b83fc0f085a49f56216  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001112139
0x6c25a5b081fba095c8a0007fa9ae27bac2435d81e6635eb7d62cffc92a8de36e715254317 days 7 hrs ago0xd5314cf3913da993b2197b83fc0f085a49f56216  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001157331
0xda6402a144738cf138d2f93fd5c79ac5607737b873acfa9ee9dd387fa9d2e246714891518 days 28 mins ago0xedbbdf2c29ccf6a0272b36b10eadc1b17b8d7e67  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.000681554
0x1b94aad263bfa5de9dc82483f202fc623998f8664d154bdad1d9b490a3f90763714891518 days 28 mins ago0xedbbdf2c29ccf6a0272b36b10eadc1b17b8d7e67  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.000741554
0x89605856f16a7ab6307e8aea06f6328f4ed08f7eff4245a79d1f08395536786b714868118 days 1 hr ago0xedbbdf2c29ccf6a0272b36b10eadc1b17b8d7e67  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0007497094
0x0cb7c9f10f0484ac421e8b39a1392bbbfd71cc68419fc49c8f579e725c62c910713932319 days 23 hrs ago0x528f720a5e3e644ec92bdcd9a8e2497881a4aa2b  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0005110695
0x58debe385177a7ab902455c5555d931191db3322924ed1a33df74acbdfb5a63b713930119 days 23 hrs ago0x528f720a5e3e644ec92bdcd9a8e2497881a4aa2b  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0005560695
0x047b9aff3f4429a00687c77bb94a3164c4b7ba03fdbb1df24dd915bc165e969e713930119 days 23 hrs ago0x528f720a5e3e644ec92bdcd9a8e2497881a4aa2b  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0005560695
0x1872b06921e60837ccb5c109b428b31235c59cbd80a4be400cb5b55fd2bf1067713890520 days 1 hr ago0x528f720a5e3e644ec92bdcd9a8e2497881a4aa2b  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0008526399
0xc361073d9482b4e130ea7b291e6c5ed717fd93e17272b139b35015280b2de0da713857220 days 3 hrs ago0xb06acd8fb3ad6a2b852bea57c06a168f823aad39  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.0004235101
0x3b829f0e9094277b22858af810ec3d4be54e079d6c829f0960be2e7f5fff43f6708602630 days 5 hrs ago0x7a35bc1886350f9c44996ef50c77970cd1211853  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001928565
0x526c6b41649d9fb4acaf77a3630b227b3e5a609c421913eb7560f14e80a8c6a8707721031 days 19 hrs ago0x29957ca5e1967de7e0b9cd3048a7c3a32e54305a  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.000651426
0xe1f19440ee78e8127773c571676e89ae98f57e4c5a9ca6e80b33ebe83e16fba5707717031 days 19 hrs ago0x29957ca5e1967de7e0b9cd3048a7c3a32e54305a  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.000049324
0x6e1781161da8ba1c3ad902657b3098c3c5b293ff089abcea9c276b8aee189746707716731 days 19 hrs ago0x29957ca5e1967de7e0b9cd3048a7c3a32e54305a  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.000073986
0x2beeb8eee9d6fc49e3b06eb3712463cca9336edbe27380060f5f059eacdbda7d707716631 days 19 hrs ago0x29957ca5e1967de7e0b9cd3048a7c3a32e54305a  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.001067331
0xe79365d658e54c65fe948db8e2de74c57d9f2dabd4dfd38506b5de78b4452a7c706424234 days 3 hrs ago0xf6db90fd21760c660a02251ea6aa0aa29f3e7f1a  IN   0x56c945f90c9cd1aafbcac78936f569e5fd2438bf0 Ether0.00325713
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: HeroUp
Compiler Version: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.24;

// File: node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address private _owner;

  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );

  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() internal {
    _owner = msg.sender;
    emit OwnershipTransferred(address(0), _owner);
  }

  /**
   * @return the address of the owner.
   */
  function owner() public view returns(address) {
    return _owner;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(isOwner());
    _;
  }

  /**
   * @return true if `msg.sender` is the owner of the contract.
   */
  function isOwner() public view returns(bool) {
    return msg.sender == _owner;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipTransferred(_owner, address(0));
    _owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    _transferOwnership(newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address newOwner) internal {
    require(newOwner != address(0));
    emit OwnershipTransferred(_owner, newOwner);
    _owner = newOwner;
  }
}

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
  function totalSupply() external view returns (uint256);

  function balanceOf(address who) external view returns (uint256);

  function allowance(address owner, address spender)
    external view returns (uint256);

  function transfer(address to, uint256 value) external returns (bool);

  function approve(address spender, uint256 value)
    external returns (bool);

  function transferFrom(address from, address to, uint256 value)
    external returns (bool);

  event Transfer(
    address indexed from,
    address indexed to,
    uint256 value
  );

  event Approval(
    address indexed owner,
    address indexed spender,
    uint256 value
  );
}

// File: lib/CanReclaimToken.sol

/**
 * @title Contracts that should be able to recover tokens
 * @author SylTi
 * @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
 * This will prevent any accidental loss of tokens.
 */
contract CanReclaimToken is Ownable {

  /**
   * @dev Reclaim all ERC20 compatible tokens
   * @param token ERC20 The address of the token contract
   */
  function reclaimToken(IERC20 token) external onlyOwner {
    if (address(token) == address(0)) {
      owner().transfer(address(this).balance);
      return;
    }
    uint256 balance = token.balanceOf(this);
    token.transfer(owner(), balance);
  }

}

// File: contracts/HeroUp.sol

interface HEROES_NEW {
  function mint(address to, uint256 genes, uint256 level) external returns (uint);
  function mint(uint256 tokenId, address to, uint256 genes, uint256 level) external returns (uint);
}


interface HEROES_OLD {
  function getLock(uint256 _tokenId) external view returns (uint256 lockedTo, uint16 lockId);
  function unlock(uint256 _tokenId, uint16 _lockId) external returns (bool);
  function lock(uint256 _tokenId, uint256 _lockedTo, uint16 _lockId) external returns (bool);
  function transferFrom(address _from, address _to, uint256 _tokenId) external;
  function getCharacter(uint256 _tokenId) external view returns (uint256 genes, uint256 mintedAt, uint256 godfather, uint256 mentor, uint32 wins, uint32 losses, uint32 level, uint256 lockedTo, uint16 lockId);
  function ownerOf(uint256 _tokenId) external view returns (address);
}

contract HeroUp is Ownable, CanReclaimToken {
  event HeroUpgraded(uint tokenId, address owner);

  HEROES_OLD public heroesOld;
  HEROES_NEW public heroesNew;
  constructor (HEROES_OLD _heroesOld, HEROES_NEW _heroesNew) public {
    require(address(_heroesOld) != address(0));
    require(address(_heroesNew) != address(0));
    heroesOld = _heroesOld;
    heroesNew = _heroesNew;
  }

  function() public {}

  function setOld(HEROES_OLD _heroesOld) public onlyOwner {
    require(address(_heroesOld) != address(0));
    heroesOld = _heroesOld;
  }

  function setNew(HEROES_NEW _heroesNew) public onlyOwner {
    require(address(_heroesNew) != address(0));
    heroesNew = _heroesNew;
  }

  function upgrade(uint _tokenId) public {
    require(msg.sender == heroesOld.ownerOf(_tokenId));
    uint256 genes;
    uint32 level;
    uint256 lockedTo;
    uint16 lockId;

    //transfer old hero
    (genes,,,,,,level,lockedTo,lockId) = heroesOld.getCharacter(_tokenId);
    heroesOld.unlock(_tokenId, lockId);
    heroesOld.lock(_tokenId, 0, 999);
    heroesOld.transferFrom(msg.sender, address(this), _tokenId);
//    heroesOld.unlock(_tokenId, 999);

    //mint new hero
    heroesNew.mint(_tokenId, msg.sender, genes, level);

    emit HeroUpgraded(_tokenId, msg.sender);
  }
}

Contract ABI
[{"constant":false,"inputs":[{"name":"token","type":"address"}],"name":"reclaimToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_heroesOld","type":"address"}],"name":"setOld","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"upgrade","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"heroesNew","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"heroesOld","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_heroesNew","type":"address"}],"name":"setNew","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_heroesOld","type":"address"},{"name":"_heroesNew","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"owner","type":"address"}],"name":"HeroUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Contract Creation Code
608060405234801561001057600080fd5b50604051604080610aa2833981016040819052815160209092015160008054600160a060020a03191633178082559192600160a060020a0392909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600160a060020a038216151561008757600080fd5b600160a060020a038116151561009c57600080fd5b60018054600160a060020a03938416600160a060020a031991821617909155600280549290931691161790556109cb806100d76000396000f3006080604052600436106100a35763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166317ffc32081146100b2578063242d81f0146100d557806345977d03146100f6578063715018a61461010e5780637c2372c9146101235780638da5cb5b146101545780638f32d59b1461016957806397ac0ff814610192578063f2fde38b146101a7578063fecb6707146101c8575b3480156100af57600080fd5b50005b3480156100be57600080fd5b506100d3600160a060020a03600435166101e9565b005b3480156100e157600080fd5b506100d3600160a060020a0360043516610397565b34801561010257600080fd5b506100d36004356103ee565b34801561011a57600080fd5b506100d3610804565b34801561012f57600080fd5b5061013861086e565b60408051600160a060020a039092168252519081900360200190f35b34801561016057600080fd5b5061013861087d565b34801561017557600080fd5b5061017e61088c565b604080519115158252519081900360200190f35b34801561019e57600080fd5b5061013861089d565b3480156101b357600080fd5b506100d3600160a060020a03600435166108ac565b3480156101d457600080fd5b506100d3600160a060020a03600435166108cb565b60006101f361088c565b15156101fe57600080fd5b600160a060020a03821615156102545761021661087d565b604051600160a060020a039190911690303180156108fc02916000818181858888f1935050505015801561024e573d6000803e3d6000fd5b50610393565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156102b557600080fd5b505af11580156102c9573d6000803e3d6000fd5b505050506040513d60208110156102df57600080fd5b50519050600160a060020a03821663a9059cbb6102fa61087d565b836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561036657600080fd5b505af115801561037a573d6000803e3d6000fd5b505050506040513d602081101561039057600080fd5b50505b5050565b61039f61088c565b15156103aa57600080fd5b600160a060020a03811615156103bf57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154604080517f6352211e000000000000000000000000000000000000000000000000000000008152600481018490529051600092839283928392600160a060020a031691636352211e91602480830192602092919082900301818787803b15801561045a57600080fd5b505af115801561046e573d6000803e3d6000fd5b505050506040513d602081101561048457600080fd5b5051600160a060020a0316331461049a57600080fd5b600154604080517fdabb0531000000000000000000000000000000000000000000000000000000008152600481018890529051600160a060020a039092169163dabb053191602480820192610120929091908290030181600087803b15801561050257600080fd5b505af1158015610516573d6000803e3d6000fd5b505050506040513d61012081101561052d57600080fd5b50805160c082015160e083015161010090930151600154604080517fd20e30bc000000000000000000000000000000000000000000000000000000008152600481018c905261ffff8416602482015290519499509297509395509350600160a060020a039092169163d20e30bc9160448083019260209291908290030181600087803b1580156105bc57600080fd5b505af11580156105d0573d6000803e3d6000fd5b505050506040513d60208110156105e657600080fd5b5050600154604080517fb8cfbe1a000000000000000000000000000000000000000000000000000000008152600481018890526000602482018190526103e760448301529151600160a060020a039093169263b8cfbe1a92606480840193602093929083900390910190829087803b15801561066157600080fd5b505af1158015610675573d6000803e3d6000fd5b505050506040513d602081101561068b57600080fd5b5050600154604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018890529051600160a060020a03909216916323b872dd9160648082019260009290919082900301818387803b1580156106ff57600080fd5b505af1158015610713573d6000803e3d6000fd5b5050600254604080517fbf2c8a94000000000000000000000000000000000000000000000000000000008152600481018a90523360248201526044810189905263ffffffff881660648201529051600160a060020a03909216935063bf2c8a9492506084808201926020929091908290030181600087803b15801561079757600080fd5b505af11580156107ab573d6000803e3d6000fd5b505050506040513d60208110156107c157600080fd5b50506040805186815233602082015281517fe12cc09b34032a761226d1846b0059d6f8ddae8e633ea1c24382684bd7931095929181900390910190a15050505050565b61080c61088c565b151561081757600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600254600160a060020a031681565b600054600160a060020a031690565b600054600160a060020a0316331490565b600154600160a060020a031681565b6108b461088c565b15156108bf57600080fd5b6108c881610922565b50565b6108d361088c565b15156108de57600080fd5b600160a060020a03811615156108f357600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a038116151561093757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058207ae8800f55be6fa56301b4b54c361b07ef0a586501cd89c17191917ecd30a12300290000000000000000000000000ba000163959726c90d41c804386d37718d5edc8000000000000000000000000d2bae9a30a40376d25353773010ffe52dba0d688


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

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000ba000163959726c90d41c804386d37718d5edc8
Arg [1] : 000000000000000000000000d2bae9a30a40376d25353773010ffe52dba0d688


   Swarm Source:
bzzr://7ae8800f55be6fa56301b4b54c361b07ef0a586501cd89c17191917ecd30a123
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.