Contract 0xCBc77A967C3A62208CE1b3E99323deB7a8668F4C

 
 
Txn Hash
Method
Block
From
To
Value
0x6fd6a3c6e98da921ace536cb5d093db49e74992c8892bcc56ca051210eabe4b5Buy Item52924362018-03-21 1:25:541722 days 8 hrs ago0x57d5d25041975c2e42ec82d116e409b4716de22f IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000029151
0xcf45324f564ccd10b2e52589ab885ddf509286ad592a9fc96f5ac0991850bce9Buy Item52919262018-03-20 23:23:231722 days 10 hrs ago0x57d5d25041975c2e42ec82d116e409b4716de22f IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000029151
0x46dbc830970d45e0932f9ecf9d0044e950cfea6ae892d102ae4df9c1eef6a967Buy Item52823142018-03-19 8:43:281724 days 1 hr ago0x55611b747af18e27ba99c251377912fcd96ea656 IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000060871
0x4b1421e142b85e4a1ae7dd459e5ad4a1131bed900e5969c3a3ffbd1681da9093Buy Item52816752018-03-19 6:03:251724 days 4 hrs ago0x55611b747af18e27ba99c251377912fcd96ea656 IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000099961.1
0x8b3c38a40446b8f54d2fc514305577dafecace9581940e9cdc727d8de27e529dBuy Item52427072018-03-12 15:16:001730 days 19 hrs ago0xf18071414b73557de6a454c171c1b62ea30a254a IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000151622
0x30f245bf1b7cdc40cd139a4568af18e3a20c503cdae592c0e725a29026618131Buy Item52422472018-03-12 13:22:271730 days 20 hrs ago0xf18071414b73557de6a454c171c1b62ea30a254a IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000227433
0x351e28306d4b084ffd742a03cd1c122e4b2a2934abdbbae7ce0bfa32940eafa7Buy Item52421822018-03-12 13:08:301730 days 21 hrs ago0xf18071414b73557de6a454c171c1b62ea30a254a IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000220743.63
0x020d39d07bd504e1d307c1ddfbb7a252f79baa66801cf389221f8f33abb3c8deBuy Item52421632018-03-12 13:04:291730 days 21 hrs ago0xf18071414b73557de6a454c171c1b62ea30a254a IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000227433
0x3692ccb20b18b91bf0d013b988f452ae51da2815155cf946fb689eabc2ec6db4Buy Item52406062018-03-12 6:29:141731 days 3 hrs ago0xcfdf78b41635704ec3b45333ce71935783ee6f80 IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000908110
0x40940ebc9a8be8e2dad6e96a59aaa85e0da274361de581c523bcf0977db0d93aBuy Item52070292018-03-06 13:59:121736 days 20 hrs ago0xfcfaaae965550c381898a725c5be321d30904c38 IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000087463
0x1eb3126b71650f5833b90323a524c6784b79362d2f4160ff1789cc0991e0fe31Buy Item52067142018-03-06 12:45:011736 days 21 hrs ago0xfcfaaae965550c381898a725c5be321d30904c38 IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000087463
0xd44c112f2208dc2fc23a6e5a7643829f811678725ff0c4222110a03f9a3eb862Buy Item52067142018-03-06 12:45:011736 days 21 hrs ago0xfcfaaae965550c381898a725c5be321d30904c38 IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.000087463
0x783617a81861737f56086bb766036e7091d42f062b91be3cb5f9e27e98e7efeeSet Item52063092018-03-06 10:59:101736 days 23 hrs ago0x04485eb766dd6c9409503dd8f91186340c0526ba IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.0004321510
0x0f7e58e4b3b8d46ed93e5af7b793e0a3057c94405bef42797e4c2f677e82f994Set Item52063002018-03-06 10:55:401736 days 23 hrs ago0x04485eb766dd6c9409503dd8f91186340c0526ba IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.0004321510
0xa13b772b7c5513984cfb66f59148bce5d3111468097595790c6b559f5759667eSet Item52062942018-03-06 10:54:411736 days 23 hrs ago0x04485eb766dd6c9409503dd8f91186340c0526ba IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.0004315110
0x1ec2ef459e259f18930e77bdbb957e92e8158e5748fd7604651679cdfa45f5eeSet Item52062892018-03-06 10:52:361736 days 23 hrs ago0x04485eb766dd6c9409503dd8f91186340c0526ba IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.0004315110
0xf5e54c8c877c56c53fbf732c0fbd24da25998bbdab869ccd43359d681d56707aSet Item52062812018-03-06 10:49:481736 days 23 hrs ago0x04485eb766dd6c9409503dd8f91186340c0526ba IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.0017718141
0x2cb8aad23301e6167f92c8ef4ebf1ca81ce77cd2dc70d4f89d6997959b0cf379Set Item52062732018-03-06 10:48:071736 days 23 hrs ago0x04485eb766dd6c9409503dd8f91186340c0526ba IN  0xcbc77a967c3a62208ce1b3e99323deb7a8668f4c0 Ether0.0017718141
0x9a342c0d95e393eb2d49c399e6b4a67cfc928a3dcb36ebfe70dc44bc05be6a470x6060604052060372018-03-06 9:54:171737 days 25 mins ago0x04485eb766dd6c9409503dd8f91186340c0526ba IN  Create: MagicStore0 Ether0.005592110
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MagicStore

Compiler Version
v0.4.18+commit.9cf6e910

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.4.11;


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


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  function Ownable() {
    owner = msg.sender;
  }


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


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

}



/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;


  /**
   * @dev modifier to allow actions only when the contract IS paused
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev modifier to allow actions only when the contract IS NOT paused
   */
  modifier whenPaused {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() onlyOwner whenNotPaused returns (bool) {
    paused = true;
    Pause();
    return true;
  }

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


contract HeroCore{

   function ownerIndexToERC20Balance(address _address) public returns (uint256);
   function useItems(uint32 _items, uint256 tokenId, address owner,uint256 fee) public returns (bool);
   function ownerOf(uint256 _tokenId) public returns (address);
   function getHeroItems(uint256 _id) public returns ( uint32);
    
   function reduceCDFee(uint256 heroId) 
         public 
         view 
         returns (uint256);
   
}

contract MagicStore is Pausable {
		HeroCore public heroCore;
    
    mapping (uint8 =>mapping (uint8 => uint256)) public itemIndexToPrice; 
			
		function MagicStore(address _heroCore){
        HeroCore candidateContract2 = HeroCore(_heroCore);
        heroCore = candidateContract2;
		}	
    
    function buyItem(uint8 itemX,uint8 itemY, uint256 tokenId, uint256 amount) public{
        require( msg.sender == heroCore.ownerOf(tokenId) );
        require( heroCore.ownerIndexToERC20Balance(msg.sender) >= amount);
        require( itemX >0);
        uint256 fee= itemIndexToPrice[itemX][itemY];           
        require(fee !=0 && fee <= amount); 
           uint32 items = heroCore.getHeroItems(tokenId);
           uint32 location = 1;
		       for(uint8 index = 2; index <= itemX; index++){
		          location *=10;
		       }
        uint32 _itemsId = items+ uint32(itemY) *location - items%location *location;
              
        heroCore.useItems(_itemsId,tokenId,msg.sender,amount);       
    }
    
    
    function setItem(uint8 itemX,uint8 itemY, uint256 amount) public onlyOwner{
    	 require( itemX <=9 && itemY <=9 && amount !=0);
    
       itemIndexToPrice[itemX][itemY] =amount;    
    }
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[],"name":"unpause","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint8"},{"name":"","type":"uint8"}],"name":"itemIndexToPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"itemX","type":"uint8"},{"name":"itemY","type":"uint8"},{"name":"tokenId","type":"uint256"},{"name":"amount","type":"uint256"}],"name":"buyItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"heroCore","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":"itemX","type":"uint8"},{"name":"itemY","type":"uint8"},{"name":"amount","type":"uint256"}],"name":"setItem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_heroCore","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"}]

60606040526000805460a060020a60ff0219169055341561001f57600080fd5b60405160208061071e8339810160405280805160008054600160a060020a03338116600160a060020a0319928316179092556001805492909316911617905550506106af8061006f6000396000f30060606040526004361061007f5763ffffffff60e060020a6000350416633f4ba83a81146100845780635c975abb146100ab5780638456cb59146100be5780638da5cb5b146100d157806393f4a34b14610100578063a3d4e4b514610131578063e7bbda1114610158578063f2fde38b1461016b578063f4d24fea1461018a575b600080fd5b341561008f57600080fd5b6100976101ac565b604051901515815260200160405180910390f35b34156100b657600080fd5b610097610230565b34156100c957600080fd5b610097610240565b34156100dc57600080fd5b6100e46102c9565b604051600160a060020a03909116815260200160405180910390f35b341561010b57600080fd5b61011f60ff600435811690602435166102d8565b60405190815260200160405180910390f35b341561013c57600080fd5b61015660ff600435811690602435166044356064356102f5565b005b341561016357600080fd5b6100e46105af565b341561017657600080fd5b610156600160a060020a03600435166105be565b341561019557600080fd5b61015660ff60043581169060243516604435610614565b6000805433600160a060020a039081169116146101c857600080fd5b60005460a060020a900460ff1615156101e057600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a150600190565b60005460a060020a900460ff1681565b6000805433600160a060020a0390811691161461025c57600080fd5b60005460a060020a900460ff161561027357600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b600054600160a060020a031681565b600260209081526000928352604080842090915290825290205481565b6001546000908190819081908190600160a060020a0316636352211e88836040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561035057600080fd5b6102c65a03f1151561036157600080fd5b50505060405180519050600160a060020a031633600160a060020a031614151561038a57600080fd5b6001548690600160a060020a0316635701b9273360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156103e557600080fd5b6102c65a03f115156103f657600080fd5b505050604051805190501015151561040d57600080fd5b600060ff8a161161041d57600080fd5b60ff808a166000908152600260209081526040808320938c16835292905220549450841580159061044e5750858511155b151561045957600080fd5b600154600160a060020a03166325fb66b98860006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156104aa57600080fd5b6102c65a03f115156104bb57600080fd5b505050604051805194506001935060029250505b60ff808a16908316116104ee57600a92909202916001909101906104cf565b828363ffffffff168563ffffffff1681151561050657fe5b6001549190069190910260ff8a1685028601039150600160a060020a031663e22fcd088289338a60006040516020015260405163ffffffff86811660e060020a0282529490941660048501526024840192909252600160a060020a031660448301526064820152608401602060405180830381600087803b151561058957600080fd5b6102c65a03f1151561059a57600080fd5b50505060405180515050505050505050505050565b600154600160a060020a031681565b60005433600160a060020a039081169116146105d957600080fd5b600160a060020a03811615610611576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b60005433600160a060020a0390811691161461062f57600080fd5b60098360ff1611158015610647575060098260ff1611155b801561065257508015155b151561065d57600080fd5b60ff928316600090815260026020908152604080832094909516825292909252919020555600a165627a7a72305820010b376f88d8a1a2ce199a2b9a2a1673c205411296dfaf1880923c7495764d7200290000000000000000000000008a1190c9a21ccc195a943ec9ee434620461b46b2

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

0000000000000000000000008a1190c9a21ccc195a943ec9ee434620461b46b2

-----Decoded View---------------
Arg [0] : _heroCore (address): 0x8A1190C9A21ccc195A943eC9Ee434620461b46b2

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000008a1190c9a21ccc195a943ec9ee434620461b46b2


Swarm Source

bzzr://010b376f88d8a1a2ce199a2b9a2a1673c205411296dfaf1880923c7495764d72
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.