Sponsored:   Ubex.com - World roadshow: Seoul Sep 17-19, Singapore Sep 19-20, Dubai 18-23. Meet us!.
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 123 txns
 Latest 25 txns From a total of 123 Transactions

TxHash Age From To Value [TxFee]
0x4fefb2fa65a31b56381234f2b1dc85748e52aeaaaed4b3c4bebabba8d697433f212 days 12 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xc156f13a87a4f036a0b2f5909228901eba35078c5eb8e42afd2a1e475cd76a3d212 days 13 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x6a5585117b89835ac0740cd1329ce06dad340e89b741cf508b5def77b047c0a7212 days 13 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x5a16a2bb1e87906763d51029a4a61218ef89e15e91388e26117c15e7fa2e5b73212 days 19 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x63febe1fb1d924a925af48407578a04fc5d3da30625c66424c6f970063adfd77212 days 19 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x08861ec11bdccfc7a86eb4ad589c85b915f01480413da86a0ee50fc25d3b7957212 days 19 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xcc72ef8eeb96b8352770141594e743545d885bb19b223b7237673ff8b73f28b1212 days 21 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xe50429110a4f57bdad803941a8cf3483379ee810350e87450fdd618617ebb909212 days 22 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x573a85458e98fc3e220e94c91eafdc6a2696b6b3ca4b04ff6740ab0aece1f140212 days 24 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x953e0f0a2ce57ba0fd24596430f3c464b36cbd2b31910a2e4202f71e6b81102d212 days 24 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x1231227f49b73bdd78d94601e907a4668e3d6369fbeda59f1d7590dc924fd412212 days 24 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x9342e26392c6244e4bc3265b37f7575fe24b14be07189908ea9a2ea18473cc28212 days 25 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x847cc0bbe790c381808eb82474cde85ea3d0c0097ef3e50dfa498b764c81c218212 days 25 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x4f8991165d897569b23143c5f6bbe51e5edcaac6d8f3de515a62c55cd11518ff212 days 26 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xaf55a0c19d6199d75b4180c401dedf3c53e1f74d8b4abd0344534d49650b48e0212 days 26 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x9295834234a2fe696e20e47ad1f19f16ba36b6c7f2904dc543ac8a0543dc2d2b212 days 27 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xe0e5d5b704befea4b1991557ae1cc81664d71291b30c70cfcad124563e59c9a9212 days 31 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xe8737e68b81646b02194f103d7ac6cc91b34fbce6a729f1cec1bdbf0f30f8a08212 days 33 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x7b9bbc5187768f0377677bad3548f41c3defbbd8d0ec0870615a4caa8805f1f9212 days 33 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xba1cf2e7d11dbf5cafb3dd7ea68d9ba99d8a6d3e60d711586a95f75f3fda341c212 days 34 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0xd60e86ced081096d336db15845cacbca195721b9a7e11b26b52eb05dc1497326212 days 34 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x0706635f3ca698e2194d3ec90c7543384efd609ef89d1c20d9000e98f4bdb37f212 days 35 mins ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000025440395
0x6c8734cc8305e5d52ee30c2dd49ca431485009ae5fbb9502e4a7c1591f56fa31212 days 6 hrs ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000130354049
0xba22641b4b798f5d03534b82ba93aa8ed1baaae966c3b2ed95244cc515546ede212 days 6 hrs ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000130354049
0x49d2920c4dc71f9e9cafe97e5c57f99c54bc824a1206b37bdc3261b83b9f6152212 days 6 hrs ago0x93cdb0a93fc36f6a53ed21ecf6305ab80d06beca  IN   0xddcab0ece1816a517683d858be471e377d4213000 Ether0.000130354049
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: SampleStorage
Compiler Text: v0.4.19+commit.c4cbbb05
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

contract Ownable {
  address public owner;

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

  function Ownable() public {
    owner = msg.sender;
  }

  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

contract ERC721 {
    function implementsERC721() public pure returns (bool);
    function totalSupply() public view returns (uint256 total);
    function balanceOf(address _owner) public view returns (uint256 balance);
    function ownerOf(uint256 _tokenId) public view returns (address owner);
    function approve(address _to, uint256 _tokenId) public;
    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 indexed tokenId);
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
}

contract SampleStorage is Ownable {
    
    struct Sample {
        string ipfsHash;
        uint rarity;
    }
    
    mapping (uint32 => Sample) public sampleTypes;
    
    uint32 public numOfSampleTypes;
    
    uint32 public numOfCommon;
    uint32 public numOfRare;
    uint32 public numOfLegendary;

    // The mythical sample is a type common that appears only once in a 1000
    function addNewSampleType(string _ipfsHash, uint _rarityType) public onlyOwner {
        
        if (_rarityType == 0) {
            numOfCommon++;
        } else if (_rarityType == 1) {
            numOfRare++;
        } else if(_rarityType == 2) {
            numOfLegendary++;
        } else if(_rarityType == 3) {
            numOfCommon++;
        }
        
        sampleTypes[numOfSampleTypes] = Sample({
           ipfsHash: _ipfsHash,
           rarity: _rarityType
        });
        
        numOfSampleTypes++;
    }
    
    function getType(uint _randomNum) public view returns (uint32) {
        uint32 range = 0;
        
        if (_randomNum > 0 && _randomNum < 600) {
            range = 600 / numOfCommon;
            return uint32(_randomNum) / range;
            
        } else if(_randomNum >= 600 && _randomNum < 900) {
            range = 300 / numOfRare;
            return uint32(_randomNum) / range;
        } else {
            range = 100 / numOfLegendary;
            return uint32(_randomNum) / range;
        }
    }
    
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"numOfCommon","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_randomNum","type":"uint256"}],"name":"getType","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numOfRare","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"numOfLegendary","outputs":[{"name":"","type":"uint32"}],"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":"numOfSampleTypes","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint32"}],"name":"sampleTypes","outputs":[{"name":"ipfsHash","type":"string"},{"name":"rarity","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_ipfsHash","type":"string"},{"name":"_rarityType","type":"uint256"}],"name":"addNewSampleType","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
6060604052336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061096d806100536000396000f300606060405260043610610099576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631ac961241461009e5780634036ab78146100d357806358aa0f1b146101165780638957d6f21461014b5780638da5cb5b1461018057806396fcbf65146101d5578063b56aef621461020a578063e576038f146102d0578063f2fde38b14610336575b600080fd5b34156100a957600080fd5b6100b161036f565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156100de57600080fd5b6100f46004808035906020019091905050610385565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561012157600080fd5b610129610490565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561015657600080fd5b61015e6104a6565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561018b57600080fd5b6101936104bc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e057600080fd5b6101e86104e1565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561021557600080fd5b610231600480803563ffffffff169060200190919050506104f7565b60405180806020018381526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156102c05780601f10610295576101008083540402835291602001916102c0565b820191906000526020600020905b8154815290600101906020018083116102a357829003601f168201915b5050935050505060405180910390f35b34156102db57600080fd5b610334600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001909190505061051a565b005b341561034157600080fd5b61036d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610747565b005b600260049054906101000a900463ffffffff1681565b6000806000905060008311801561039d575061025883105b156103e957600260049054906101000a900463ffffffff1663ffffffff166102588115156103c757fe5b0490508063ffffffff168363ffffffff168115156103e157fe5b04915061048a565b61025883101580156103fc575061038483105b1561044857600260089054906101000a900463ffffffff1663ffffffff1661012c81151561042657fe5b0490508063ffffffff168363ffffffff1681151561044057fe5b04915061048a565b6002600c9054906101000a900463ffffffff1663ffffffff16606481151561046c57fe5b0490508063ffffffff168363ffffffff1681151561048657fe5b0491505b50919050565b600260089054906101000a900463ffffffff1681565b6002600c9054906101000a900463ffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900463ffffffff1681565b600160205280600052604060002060009150905080600001908060010154905082565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561057557600080fd5b60008114156105be576002600481819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050610698565b6001811415610607576002600881819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050610697565b6002811415610650576002600c81819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff16021790555050610696565b6003811415610695576002600481819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550505b5b5b5b60408051908101604052808381526020018281525060016000600260009054906101000a900463ffffffff1663ffffffff1663ffffffff16815260200190815260200160002060008201518160000190805190602001906106fa92919061089c565b50602082015181600101559050506002600081819054906101000a900463ffffffff168092919060010191906101000a81548163ffffffff021916908363ffffffff160217905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107a257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156107de57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106108dd57805160ff191683800117855561090b565b8280016001018555821561090b579182015b8281111561090a5782518255916020019190600101906108ef565b5b509050610918919061091c565b5090565b61093e91905b8082111561093a576000816000905550600101610922565b5090565b905600a165627a7a723058207f7d505078f01f6c5b10176853f1480fb69a4a12f02e5f951195702c917524430029

   Swarm Source:
bzzr://7f7d505078f01f6c5b10176853f1480fb69a4a12f02e5f951195702c91752443

 

View All
Block Age transaction Difficulty Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.