Contract Overview |  GU_LegendaryPackTwo
Balance: 0 Ether
Ether Value: $0
Transactions: 443 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x32001fcccc7e1b3193818bb88b5eb1bd827e2bc6at txn 0x95eebe164bdb9007a82881e481b0860f62fcb7efa2f9234715e525a29fd74d90
 Latest 25 transactions from a total of 443 transactions

TxHash Age From To Value [TxFee]
0xc55006849062c8dfed21a5d891e5305134f4e94e4bb6854e4ba80e102c5240af179 days 2 hrs ago0x95b697e13f227d55ef4336f7aa762fe243eef590  IN   GU_LegendaryPackTwo0 Ether0.00054896
0xedca2a20d44e2f24c1b6c9b804c47e4c5e2a1f8ce91314f55e539b992970e922188 days 17 hrs ago0xdc94fb2cef70695874f4e4703d9fa077df99a6c8  IN   GU_LegendaryPackTwo0.3735 Ether0.00067167
0x360b6f1249646dd75e179e3d34ffed96c733d190b4291c3b784cb24df66c0390188 days 17 hrs ago0xdc94fb2cef70695874f4e4703d9fa077df99a6c8  IN   GU_LegendaryPackTwo0.3735 Ether0.000694059
0xf102616a8d1fa94a231d74d81621605e536d055a8783dce8e68c547a94163c09189 days 8 hrs ago0x31a59f382c9f93a601a7b409d412a000c56f8afb  IN   GU_LegendaryPackTwo0 Ether0.001153416
0x496e73981ae685e1602b8a635e5020a55a3093b15c5215fba0783f6c470b6653189 days 8 hrs ago0x31a59f382c9f93a601a7b409d412a000c56f8afb  IN   GU_LegendaryPackTwo0 Ether0.0011308
0xa0792e95d1cff07edcb529c6c9fd374a6089109f5029c05323fb06bbf4069e28189 days 21 hrs ago0x68b5d2b865da2c90f05e10c62ade13edc4461708  IN   GU_LegendaryPackTwo0.369 Ether0.00134334
0xf8da31d0c68f1e32ea37b2b8920b8cef8311d81701992ec7f7a109fa5f02b617189 days 21 hrs ago0x68b5d2b865da2c90f05e10c62ade13edc4461708  IN   GU_LegendaryPackTwo0.369 Ether0.000514947
0x706b008b343da229caa12ee09803071658270bafcb857617b39178465f0521b9189 days 21 hrs ago0x68b5d2b865da2c90f05e10c62ade13edc4461708  IN   GU_LegendaryPackTwo0.3645 Ether0.000873171
0x8c98373e5b57a3def9c5abc6cea80fbca11e54a034e6175bdb99754e4f37aeb0189 days 21 hrs ago0x68b5d2b865da2c90f05e10c62ade13edc4461708  IN   GU_LegendaryPackTwo0.3645 Ether0.0002343231
0xf95a91c571498532adffb9330edcd4706f1851d757675462f55aafecec8b61cd190 days 8 hrs ago0xe0fb7622091e3d9ef9b438471b10b9ea88c7cf6b  IN   GU_LegendaryPackTwo0.369 Ether0.000260359
0x60829f26fe57481bd3ddde635930ee6f67ceee458ec26737b1cae18dd6a5dc04190 days 8 hrs ago0xe0fb7622091e3d9ef9b438471b10b9ea88c7cf6b  IN   GU_LegendaryPackTwo0.369 Ether0.000213021
0x79cef9247ec43685e104a4683c20324dbf7fe28aa4cd0f86c500830c2d62bcbb190 days 18 hrs ago0xe459007dd0ee9b5d377af00c071c9b30155617b3  IN   GU_LegendaryPackTwo0.378 Ether0.000783615
0xca7554f8d13416333114118b5a1adc2257b015687daedac45c8d37801477c8db190 days 18 hrs ago0xe459007dd0ee9b5d377af00c071c9b30155617b3  IN   GU_LegendaryPackTwo0.378 Ether0.000783615
0xa3666ddb2657a1fcb59ba92e5f35be21d4c46b7984e609372ccfd41e74cf1b8e190 days 19 hrs ago0xe459007dd0ee9b5d377af00c071c9b30155617b3  IN   GU_LegendaryPackTwo0.378 Ether0.000783615
0x911f8b38651ce188ede272dd0c05ab3beee468b3d99e1fd1ee378bfbc753c44c191 days 8 hrs ago0x7a8660a241bc6640118276a2b0cded05e11a6998  IN   GU_LegendaryPackTwo0.378 Ether0.00044778
0x5e37bda4f4ec7be61bfeaab09b9264be388c92ef883c4de45381e353730a44c3191 days 9 hrs ago0x7a8660a241bc6640118276a2b0cded05e11a6998  IN   GU_LegendaryPackTwo0.378 Ether0.00044778
0xf395c37ac8ef8c2f8a4469f2492b1966465eb6b581f25da03639e6ecd01b557b191 days 9 hrs ago0xe459007dd0ee9b5d377af00c071c9b30155617b3  IN   GU_LegendaryPackTwo0.378 Ether0.000828393
0xf8e03423eed7e5a8baea10e8204fc112bb9af229e3773ee2ab36a7eeae51be56191 days 9 hrs ago0x95b697e13f227d55ef4336f7aa762fe243eef590  IN   GU_LegendaryPackTwo0 Ether0.00113228
0x876d2390cf0e83104de4b303d6c89f1c37c941ebd9afe7f63b6843dc8a67c486191 days 9 hrs ago0x1ae5f902319ab59f3c6420fb405f64d4632dc4ec  IN   GU_LegendaryPackTwo0 Ether0.0018982
0xd6246e7ccd23652927ee1c2124817fbf407c40ce7044f05e8a72401fbc6d2345191 days 9 hrs ago0xe459007dd0ee9b5d377af00c071c9b30155617b3  IN   GU_LegendaryPackTwo0.378 Ether0.004196429
0xc06a5d05574d4796b65bc2996858fae103cf0f5219f07e4b04a392d1eb96e395191 days 9 hrs ago0x1ae5f902319ab59f3c6420fb405f64d4632dc4ec  IN   GU_LegendaryPackTwo0 Ether0.00180329
0x42709a0f8a550f277aec5f79438db5dd09c7bae844540c9b8fbe60a329c7a7ee191 days 9 hrs ago0xe459007dd0ee9b5d377af00c071c9b30155617b3  IN   GU_LegendaryPackTwo0.378 Ether0.003969595
0xce6b31a85f2e1462023962d27ccb3ec7b43fb721ca92cb1c514584e18529476b191 days 9 hrs ago0xcb3562dd15807e2bcf35092b1e873971af0a51da  IN   GU_LegendaryPackTwo0 Ether0.00087588
0xe8bdddec4330c2a8ddeb3e11ca3a79864522b0f878dc09892033fc57faef08ec191 days 9 hrs ago0x1ae5f902319ab59f3c6420fb405f64d4632dc4ec  IN   GU_LegendaryPackTwo0 Ether0.001281285
0x89e7b6ab78a56c04548348b7893a35d86973c448ea466ec224a18b4e0eeabaa5191 days 9 hrs ago0x7a8660a241bc6640118276a2b0cded05e11a6998  IN   GU_LegendaryPackTwo2.268 Ether0.00226834
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here To View More View All
ParentTxHash Block Age From To Value
0xd6246e7ccd23652927ee1c2124817fbf407c40ce7044f05e8a72401fbc6d23455966332191 days 9 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x42709a0f8a550f277aec5f79438db5dd09c7bae844540c9b8fbe60a329c7a7ee5966315191 days 9 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x89e7b6ab78a56c04548348b7893a35d86973c448ea466ec224a18b4e0eeabaa55966207191 days 9 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6892.268 Ether
0x6a17146e1eeadbd2d9a8ab4a8c7fb1bc9d0a0ec422de2985018cfff15e521f255965830191 days 11 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x4da336a58b2038de217041ded10c748f313ef91915a261dbcaf8e26dc855dc075965764191 days 11 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x48be30bca7c2980f14c2a43c3fb066c12c54e6060229ba1917d293f332877b945965437191 days 12 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x4e2f5a6f264133643a69542e35e39419dd562627cf2edd4d082d5e9ed584cd9e5964833191 days 15 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x46f2a45ce034f80d92ad377d96d32d30332fa74b2ae899bb688c4a225a1da3f25964138191 days 18 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x42420baf8b99b0adf709559800512ae85c6ef7700b6b30a51376b00393f171d65963889191 days 19 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0xe8594185c3f23f10d077e0209041f2b0a0faf03814e258b7902531af65e78d495963869191 days 19 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0xc53472f6b0e7da3ec7f5ece0e1a904340dd9b6c843a4ab8d225589f51c8ad7bc5963262191 days 21 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0xeec6449f038760b1c309be4687cb1ccc69e7abe8b791d396f5cd3c79014cb4e05963205191 days 21 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6891.89 Ether
0x6c5f9378de3885eefdff502705885b860a9b8e898a8d20049f1a8ca9a88158db5963144191 days 22 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.378 Ether
0x1adb749315a62156341b51910e5de82c6e3c93ba974e21e2a6db524bafa978f35962969191 days 22 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6891.8675 Ether
0x8d4b5aa7a314505bbb3f2523178e7b9e4e5d031615dccc74c0ed81eabc95635b5962504192 days 40 mins ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6897.47 Ether
0x6a503441ad0d5619d76ff234ff740e4bb682c2375cfa0a170f977bddcca288395962446192 days 55 mins ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6897.47 Ether
0xab01e70debf752469cb960bc9c2a553366c7937491561aa8f55a5b7ba46a07d65962094192 days 2 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
0xc03156ca85f16d2f86539d25b542732d931cf19f2e21628cb11461c0414fea215961965192 days 2 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
0x96447b799d5bf6d346ed430194c1e44c58b13be516b718c17262fe6c81bdea155961679192 days 4 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6891.8675 Ether
0x965ed78c49ca0923d09eac067bab5224ef18d04a26572e76b66fa916d85742cd5960954192 days 6 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
0xfba119fe4ea75f48af4d1ff08f170271badccd841cd835295141fe5b46b27d4b5960783192 days 7 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
0x9ef398311b6e06277653ed4c6678670cb540e7682cbafd909c6a112e50bd01ae5960188192 days 9 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
0x2f6d3f3f195caf3858f3d642aeb116afcf053a7b8235447444fd010a459202385960089192 days 10 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
0x32bc5f12cec320d07ee70913a9aae8f477879bf8e79f253d6ed14292dec37b225960073192 days 10 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
0xc29a63d908be8f40028ccc4b55e078cacdc95f374205f4780d410b88e39fa4ac5960030192 days 10 hrs ago0x6c5dc1dcda3d309a6e919e6d0965f197e0fc19130x91b9d2835ad914bc1dcfe09bd1816febd04fd6890.3735 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: LegendaryPackTwo
Compiler Text: v0.4.24+commit.e67f0147
Optimization Enabled: No
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity 0.4.24;

contract Governable {

    event Pause();
    event Unpause();

    address public governor;
    bool public paused = false;

    constructor() public {
        governor = msg.sender;
    }

    function setGovernor(address _gov) public onlyGovernor {
        governor = _gov;
    }

    modifier onlyGovernor {
        require(msg.sender == governor);
        _;
    }

    /**
    * @dev Modifier to make a function callable only when the contract is not paused.
    */
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /**
    * @dev Modifier to make a function callable only when the contract is paused.
    */
    modifier whenPaused() {
        require(paused);
        _;
    }

    /**
    * @dev called by the owner to pause, triggers stopped state
    */
    function pause() onlyGovernor whenNotPaused public {
        paused = true;
        emit Pause();
    }

    /**
    * @dev called by the owner to unpause, returns to normal state
    */
    function unpause() onlyGovernor whenPaused public {
        paused = false;
        emit Unpause();
    }

}

contract CardBase is Governable {


    struct Card {
        uint16 proto;
        uint16 purity;
    }

    function getCard(uint id) public view returns (uint16 proto, uint16 purity) {
        Card memory card = cards[id];
        return (card.proto, card.purity);
    }

    function getShine(uint16 purity) public pure returns (uint8) {
        return uint8(purity / 1000);
    }

    Card[] public cards;
    
}

contract CardProto is CardBase {

    event NewProtoCard(
        uint16 id, uint8 season, uint8 god, 
        Rarity rarity, uint8 mana, uint8 attack, 
        uint8 health, uint8 cardType, uint8 tribe, bool packable
    );

    struct Limit {
        uint64 limit;
        bool exists;
    }

    // limits for mythic cards
    mapping(uint16 => Limit) public limits;

    // can only set limits once
    function setLimit(uint16 id, uint64 limit) public onlyGovernor {
        Limit memory l = limits[id];
        require(!l.exists);
        limits[id] = Limit({
            limit: limit,
            exists: true
        });
    }

    function getLimit(uint16 id) public view returns (uint64 limit, bool set) {
        Limit memory l = limits[id];
        return (l.limit, l.exists);
    }

    // could make these arrays to save gas
    // not really necessary - will be update a very limited no of times
    mapping(uint8 => bool) public seasonTradable;
    mapping(uint8 => bool) public seasonTradabilityLocked;
    uint8 public currentSeason;

    function makeTradeable(uint8 season) public onlyGovernor {
        seasonTradable[season] = true;
    }

    function makeUntradable(uint8 season) public onlyGovernor {
        require(!seasonTradabilityLocked[season]);
        seasonTradable[season] = false;
    }

    function makePermanantlyTradable(uint8 season) public onlyGovernor {
        require(seasonTradable[season]);
        seasonTradabilityLocked[season] = true;
    }

    function isTradable(uint16 proto) public view returns (bool) {
        return seasonTradable[protos[proto].season];
    }

    function nextSeason() public onlyGovernor {
        //Seasons shouldn't go to 0 if there is more than the uint8 should hold, the governor should know this ¯\_(ツ)_/¯ -M
        require(currentSeason <= 255); 

        currentSeason++;
        mythic.length = 0;
        legendary.length = 0;
        epic.length = 0;
        rare.length = 0;
        common.length = 0;
    }

    enum Rarity {
        Common,
        Rare,
        Epic,
        Legendary, 
        Mythic
    }

    uint8 constant SPELL = 1;
    uint8 constant MINION = 2;
    uint8 constant WEAPON = 3;
    uint8 constant HERO = 4;

    struct ProtoCard {
        bool exists;
        uint8 god;
        uint8 season;
        uint8 cardType;
        Rarity rarity;
        uint8 mana;
        uint8 attack;
        uint8 health;
        uint8 tribe;
    }

    // there is a particular design decision driving this:
    // need to be able to iterate over mythics only for card generation
    // don't store 5 different arrays: have to use 2 ids
    // better to bear this cost (2 bytes per proto card)
    // rather than 1 byte per instance

    uint16 public protoCount;
    
    mapping(uint16 => ProtoCard) protos;

    uint16[] public mythic;
    uint16[] public legendary;
    uint16[] public epic;
    uint16[] public rare;
    uint16[] public common;

    function addProtos(
        uint16[] externalIDs, uint8[] gods, Rarity[] rarities, uint8[] manas, uint8[] attacks, uint8[] healths, uint8[] cardTypes, uint8[] tribes, bool[] packable
    ) public onlyGovernor returns(uint16) {

        for (uint i = 0; i < externalIDs.length; i++) {

            ProtoCard memory card = ProtoCard({
                exists: true,
                god: gods[i],
                season: currentSeason,
                cardType: cardTypes[i],
                rarity: rarities[i],
                mana: manas[i],
                attack: attacks[i],
                health: healths[i],
                tribe: tribes[i]
            });

            _addProto(externalIDs[i], card, packable[i]);
        }
        
    }

    function addProto(
        uint16 externalID, uint8 god, Rarity rarity, uint8 mana, uint8 attack, uint8 health, uint8 cardType, uint8 tribe, bool packable
    ) public onlyGovernor returns(uint16) {
        ProtoCard memory card = ProtoCard({
            exists: true,
            god: god,
            season: currentSeason,
            cardType: cardType,
            rarity: rarity,
            mana: mana,
            attack: attack,
            health: health,
            tribe: tribe
        });

        _addProto(externalID, card, packable);
    }

    function addWeapon(
        uint16 externalID, uint8 god, Rarity rarity, uint8 mana, uint8 attack, uint8 durability, bool packable
    ) public onlyGovernor returns(uint16) {

        ProtoCard memory card = ProtoCard({
            exists: true,
            god: god,
            season: currentSeason,
            cardType: WEAPON,
            rarity: rarity,
            mana: mana,
            attack: attack,
            health: durability,
            tribe: 0
        });

        _addProto(externalID, card, packable);
    }

    function addSpell(uint16 externalID, uint8 god, Rarity rarity, uint8 mana, bool packable) public onlyGovernor returns(uint16) {

        ProtoCard memory card = ProtoCard({
            exists: true,
            god: god,
            season: currentSeason,
            cardType: SPELL,
            rarity: rarity,
            mana: mana,
            attack: 0,
            health: 0,
            tribe: 0
        });

        _addProto(externalID, card, packable);
    }

    function addMinion(
        uint16 externalID, uint8 god, Rarity rarity, uint8 mana, uint8 attack, uint8 health, uint8 tribe, bool packable
    ) public onlyGovernor returns(uint16) {

        ProtoCard memory card = ProtoCard({
            exists: true,
            god: god,
            season: currentSeason,
            cardType: MINION,
            rarity: rarity,
            mana: mana,
            attack: attack,
            health: health,
            tribe: tribe
        });

        _addProto(externalID, card, packable);
    }

    function _addProto(uint16 externalID, ProtoCard memory card, bool packable) internal {

        require(!protos[externalID].exists);

        card.exists = true;

        protos[externalID] = card;

        protoCount++;

        emit NewProtoCard(
            externalID, currentSeason, card.god, 
            card.rarity, card.mana, card.attack, 
            card.health, card.cardType, card.tribe, packable
        );

        if (packable) {
            Rarity rarity = card.rarity;
            if (rarity == Rarity.Common) {
                common.push(externalID);
            } else if (rarity == Rarity.Rare) {
                rare.push(externalID);
            } else if (rarity == Rarity.Epic) {
                epic.push(externalID);
            } else if (rarity == Rarity.Legendary) {
                legendary.push(externalID);
            } else if (rarity == Rarity.Mythic) {
                mythic.push(externalID);
            } else {
                require(false);
            }
        }
    }

    function getProto(uint16 id) public view returns(
        bool exists, uint8 god, uint8 season, uint8 cardType, Rarity rarity, uint8 mana, uint8 attack, uint8 health, uint8 tribe
    ) {
        ProtoCard memory proto = protos[id];
        return (
            proto.exists,
            proto.god,
            proto.season,
            proto.cardType,
            proto.rarity,
            proto.mana,
            proto.attack,
            proto.health,
            proto.tribe
        );
    }

    function getRandomCard(Rarity rarity, uint16 random) public view returns (uint16) {
        // modulo bias is fine - creates rarity tiers etc
        // will obviously revert is there are no cards of that type: this is expected - should never happen
        if (rarity == Rarity.Common) {
            return common[random % common.length];
        } else if (rarity == Rarity.Rare) {
            return rare[random % rare.length];
        } else if (rarity == Rarity.Epic) {
            return epic[random % epic.length];
        } else if (rarity == Rarity.Legendary) {
            return legendary[random % legendary.length];
        } else if (rarity == Rarity.Mythic) {
            // make sure a mythic is available
            uint16 id;
            uint64 limit;
            bool set;
            for (uint i = 0; i < mythic.length; i++) {
                id = mythic[(random + i) % mythic.length];
                (limit, set) = getLimit(id);
                if (set && limit > 0){
                    return id;
                }
            }
            // if not, they get a legendary :(
            return legendary[random % legendary.length];
        }
        require(false);
        return 0;
    }

    // can never adjust tradable cards
    // each season gets a 'balancing beta'
    // totally immutable: season, rarity
    function replaceProto(
        uint16 index, uint8 god, uint8 cardType, uint8 mana, uint8 attack, uint8 health, uint8 tribe
    ) public onlyGovernor {
        ProtoCard memory pc = protos[index];
        require(!seasonTradable[pc.season]);
        protos[index] = ProtoCard({
            exists: true,
            god: god,
            season: pc.season,
            cardType: cardType,
            rarity: pc.rarity,
            mana: mana,
            attack: attack,
            health: health,
            tribe: tribe
        });
    }

}

interface ERC721Metadata /* is ERC721 */ {
    /// @notice A descriptive name for a collection of NFTs in this contract
    function name() external pure returns (string _name);

    /// @notice An abbreviated name for NFTs in this contract
    function symbol() external pure returns (string _symbol);

    /// @notice A distinct Uniform Resource Identifier (URI) for a given asset.
    /// @dev Throws if `_tokenId` is not a valid NFT. URIs are defined in RFC
    ///  3986. The URI may point to a JSON file that conforms to the "ERC721
    ///  Metadata JSON Schema".
    function tokenURI(uint256 _tokenId) external view returns (string);
}

interface ERC721Enumerable /* is ERC721 */ {
    /// @notice Count NFTs tracked by this contract
    /// @return A count of valid NFTs tracked by this contract, where each one of
    ///  them has an assigned and queryable owner not equal to the zero address
    function totalSupply() public view returns (uint256);

    /// @notice Enumerate valid NFTs
    /// @dev Throws if `_index` >= `totalSupply()`.
    /// @param _index A counter less than `totalSupply()`
    /// @return The token identifier for the `_index`th NFT,
    ///  (sort order not specified)
    function tokenByIndex(uint256 _index) external view returns (uint256);

    /// @notice Enumerate NFTs assigned to an owner
    /// @dev Throws if `_index` >= `balanceOf(_owner)` or if
    ///  `_owner` is the zero address, representing invalid NFTs.
    /// @param _owner An address where we are interested in NFTs    owned by them
    /// @param _index A counter less than `balanceOf(_owner)`
    /// @return The token identifier for the `_index`th NFT assigned to `_owner`,
    ///   (sort order not specified)
    function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256 _tokenId);
}

interface ERC165 {
    /// @notice Query if a contract implements an interface
    /// @param interfaceID The interface identifier, as specified in ERC-165
    /// @dev Interface identification is specified in ERC-165. This function
    ///  uses less than 30,000 gas.
    /// @return `true` if the contract implements `interfaceID` and
    ///  `interfaceID` is not 0xffffffff, `false` otherwise
    function supportsInterface(bytes4 interfaceID) external view returns (bool);
}

contract ERC721 {
    event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
    event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    function balanceOf(address _owner) public view returns (uint256 _balance);
    function ownerOf(uint256 _tokenId) public view returns (address _owner);
    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) public payable;
    function safeTransferFrom(address _from, address _to, uint256 _tokenId) public payable;
    function transfer(address _to, uint256 _tokenId) public payable;
    function transferFrom(address _from, address _to, uint256 _tokenId) public payable;
    function approve(address _to, uint256 _tokenId) public payable;
    function setApprovalForAll(address _to, bool _approved) public;
    function getApproved(uint256 _tokenId) public view returns (address);
    function isApprovedForAll(address _owner, address _operator) public view returns (bool);
}

contract NFT is ERC721, ERC165, ERC721Metadata, ERC721Enumerable {}

contract CardOwnership is NFT, CardProto {

    // doing this strategy doesn't save gas
    // even setting the length to the max and filling in
    // unfortunately - maybe if we stop it boundschecking
    // address[] owners;
    mapping(uint => address) owners;
    mapping(uint => address) approved;
    // support multiple operators
    mapping(address => mapping(address => bool)) operators;

    // save space, limits us to 2^40 tokens (>1t)
    mapping(address => uint40[]) public ownedTokens;

    mapping(uint => string) uris;

    // save space, limits us to 2^24 tokens per user (~17m)
    uint24[] indices;

    uint public burnCount;

    /**
    * @return the name of this token
    */
    function name() public view returns (string) {
        return "Gods Unchained";
    }

    /**
    * @return the symbol of this token
    */  
    function symbol() public view returns (string) {
        return "GODS";
    }

    /**
    * @return the total number of cards in circulation
    */
    function totalSupply() public view returns (uint) {
        return cards.length - burnCount;
    }

    /**
    * @param to : the address to which the card will be transferred
    * @param id : the id of the card to be transferred
    */
    function transfer(address to, uint id) public payable {
        require(owns(msg.sender, id));
        require(isTradable(cards[id].proto));
        require(to != address(0));
        _transfer(msg.sender, to, id);
    }

    /**
    * internal transfer function which skips checks - use carefully
    * @param from : the address from which the card will be transferred
    * @param to : the address to which the card will be transferred
    * @param id : the id of the card to be transferred
    */
    function _transfer(address from, address to, uint id) internal {
        approved[id] = address(0);
        owners[id] = to;
        _addToken(to, id);
        _removeToken(from, id);
        emit Transfer(from, to, id);
    }

    /**
    * initial internal transfer function which skips checks and saves gas - use carefully
    * @param to : the address to which the card will be transferred
    * @param id : the id of the card to be transferred
    */
    function _create(address to, uint id) internal {
        owners[id] = to;
        _addToken(to, id);
        emit Transfer(address(0), to, id);
    }

    /**
    * @param to : the address to which the cards will be transferred
    * @param ids : the ids of the cards to be transferred
    */
    function transferAll(address to, uint[] ids) public payable {
        for (uint i = 0; i < ids.length; i++) {
            transfer(to, ids[i]);
        }
    }

    /**
    * @param proposed : the claimed owner of the cards
    * @param ids : the ids of the cards to check
    * @return whether proposed owns all of the cards 
    */
    function ownsAll(address proposed, uint[] ids) public view returns (bool) {
        for (uint i = 0; i < ids.length; i++) {
            if (!owns(proposed, ids[i])) {
                return false;
            }
        }
        return true;
    }

    /**
    * @param proposed : the claimed owner of the card
    * @param id : the id of the card to check
    * @return whether proposed owns the card
    */
    function owns(address proposed, uint id) public view returns (bool) {
        return ownerOf(id) == proposed;
    }

    /**
    * @param id : the id of the card
    * @return the address of the owner of the card
    */
    function ownerOf(uint id) public view returns (address) {
        return owners[id];
    }

    /**
    * @param id : the index of the token to burn
    */
    function burn(uint id) public {
        // require(isTradable(cards[id].proto));
        require(owns(msg.sender, id));
        burnCount++;
        // use the internal transfer function as the external
        // has a guard to prevent transfers to 0x0
        _transfer(msg.sender, address(0), id);
    }

    /**
    * @param ids : the indices of the tokens to burn
    */
    function burnAll(uint[] ids) public {
        for (uint i = 0; i < ids.length; i++){
            burn(ids[i]);
        }
    }

    /**
    * @param to : the address to approve for transfer
    * @param id : the index of the card to be approved
    */
    function approve(address to, uint id) public payable {
        require(owns(msg.sender, id));
        require(isTradable(cards[id].proto));
        approved[id] = to;
        emit Approval(msg.sender, to, id);
    }

    /**
    * @param to : the address to approve for transfer
    * @param ids : the indices of the cards to be approved
    */
    function approveAll(address to, uint[] ids) public payable {
        for (uint i = 0; i < ids.length; i++) {
            approve(to, ids[i]);
        }
    }

    /**
    * @param id : the index of the token to check
    * @return the address approved to transfer this token
    */
    function getApproved(uint id) public view returns(address) {
        return approved[id];
    }

    /**
    * @param owner : the address to check
    * @return the number of tokens controlled by owner
    */
    function balanceOf(address owner) public view returns (uint) {
        return ownedTokens[owner].length;
    }

    /**
    * @param id : the index of the proposed token
    * @return whether the token is owned by a non-zero address
    */
    function exists(uint id) public view returns (bool) {
        return owners[id] != address(0);
    }

    /**
    * @param to : the address to which the token should be transferred
    * @param id : the index of the token to transfer
    */
    function transferFrom(address from, address to, uint id) public payable {
        
        require(to != address(0));
        require(to != address(this));

        // TODO: why is this necessary
        // if you're approved, why does it matter where it comes from?
        require(ownerOf(id) == from);

        require(isSenderApprovedFor(id));

        require(isTradable(cards[id].proto));

        _transfer(ownerOf(id), to, id);
    }

    /**
    * @param to : the address to which the tokens should be transferred
    * @param ids : the indices of the tokens to transfer
    */
    function transferAllFrom(address to, uint[] ids) public payable {
        for (uint i = 0; i < ids.length; i++) {
            transferFrom(address(0), to, ids[i]);
        }
    }

    /**
     * @return the number of cards which have been burned
     */
    function getBurnCount() public view returns (uint) {
        return burnCount;
    }

    function isApprovedForAll(address owner, address operator) public view returns (bool) {
        return operators[owner][operator];
    }

    function setApprovalForAll(address to, bool toApprove) public {
        require(to != msg.sender);
        operators[msg.sender][to] = toApprove;
        emit ApprovalForAll(msg.sender, to, toApprove);
    }

    bytes4 constant magic = bytes4(keccak256("onERC721Received(address,uint256,bytes)"));

    function safeTransferFrom(address from, address to, uint id, bytes data) public payable {
        require(to != address(0));
        transferFrom(from, to, id);
        if (_isContract(to)) {
            bytes4 response = ERC721TokenReceiver(to).onERC721Received.gas(50000)(from, id, data);
            require(response == magic);
        }
    }

    function safeTransferFrom(address from, address to, uint id) public payable {
        safeTransferFrom(from, to, id, "");
    }

    function _addToken(address to, uint id) private {
        uint pos = ownedTokens[to].push(uint40(id)) - 1;
        indices.push(uint24(pos));
    }

    function _removeToken(address from, uint id) public payable {
        uint24 index = indices[id];
        uint lastIndex = ownedTokens[from].length - 1;
        uint40 lastId = ownedTokens[from][lastIndex];

        ownedTokens[from][index] = lastId;
        ownedTokens[from][lastIndex] = 0;
        ownedTokens[from].length--;
    }

    function isSenderApprovedFor(uint256 id) internal view returns (bool) {
        return owns(msg.sender, id) || getApproved(id) == msg.sender || isApprovedForAll(ownerOf(id), msg.sender);
    }

    function _isContract(address test) internal view returns (bool) {
        uint size; 
        assembly {
            size := extcodesize(test)
        }
        return (size > 0);
    }

    function tokenURI(uint id) public view returns (string) {
        return uris[id];
    }
    
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 _tokenId){
        return ownedTokens[owner][index];
    }

    function tokenByIndex(uint256 index) external view returns (uint256){
        return index;
    }

    function supportsInterface(bytes4 interfaceID) public view returns (bool) {
        return (
            interfaceID == this.supportsInterface.selector || // ERC165
            interfaceID == 0x5b5e139f || // ERC721Metadata
            interfaceID == 0x6466353c || // ERC-721 on 3/7/2018
            interfaceID == 0x780e9d63
        ); // ERC721Enumerable
    }

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

    function getOwnedTokens(address user) public view returns (uint40[]) {
        return ownedTokens[user];
    }
    

}

/// @dev Note: the ERC-165 identifier for this interface is 0xf0b9e5ba
interface ERC721TokenReceiver {
    /// @notice Handle the receipt of an NFT
    /// @dev The ERC721 smart contract calls this function on the recipient
    ///  after a `transfer`. This function MAY throw to revert and reject the
    ///  transfer. This function MUST use 50,000 gas or less. Return of other
    ///  than the magic value MUST result in the transaction being reverted.
    ///  Note: the contract address is always the message sender.
    /// @param _from The sending address
    /// @param _tokenId The NFT identifier which is being transfered
    /// @param _data Additional data with no specified format
    /// @return `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))`
    ///  unless throwing
	function onERC721Received(address _from, uint256 _tokenId, bytes _data) external returns(bytes4);
}



contract CardIntegration is CardOwnership {
    
    CardPackTwo[] packs;

    event CardCreated(uint indexed id, uint16 proto, uint16 purity, address owner);

    function addPack(CardPackTwo approved) public onlyGovernor {
        packs.push(approved);
    }

    modifier onlyApprovedPacks {
        require(_isApprovedPack());
        _;
    }

    function _isApprovedPack() private view returns (bool) {
        for (uint i = 0; i < packs.length; i++) {
            if (msg.sender == address(packs[i])) {
                return true;
            }
        }
        return false;
    }

    function createCard(address owner, uint16 proto, uint16 purity) public whenNotPaused onlyApprovedPacks returns (uint) {
        ProtoCard memory card = protos[proto];
        require(card.season == currentSeason);
        if (card.rarity == Rarity.Mythic) {
            uint64 limit;
            bool exists;
            (limit, exists) = getLimit(proto);
            require(!exists || limit > 0);
            limits[proto].limit--;
        }
        return _createCard(owner, proto, purity);
    }

    function _createCard(address owner, uint16 proto, uint16 purity) internal returns (uint) {
        Card memory card = Card({
            proto: proto,
            purity: purity
        });

        uint id = cards.push(card) - 1;

        _create(owner, id);
        
        emit CardCreated(id, proto, purity, owner);

        return id;
    }

    /*function combineCards(uint[] ids) public whenNotPaused {
        require(ids.length == 5);
        require(ownsAll(msg.sender, ids));
        Card memory first = cards[ids[0]];
        uint16 proto = first.proto;
        uint8 shine = _getShine(first.purity);
        require(shine < shineLimit);
        uint16 puritySum = first.purity - (shine * 1000);
        burn(ids[0]);
        for (uint i = 1; i < ids.length; i++) {
            Card memory next = cards[ids[i]];
            require(next.proto == proto);
            require(_getShine(next.purity) == shine);
            puritySum += (next.purity - (shine * 1000));
            burn(ids[i]);
        }
        uint16 newPurity = uint16(((shine + 1) * 1000) + (puritySum / ids.length));
        _createCard(msg.sender, proto, newPurity);
    }*/


    // PURITY NOTES
    // currently, we only
    // however, to protect rarity, you'll never be abl
    // this is enforced by the restriction in the create-card function
    // no cards above this point can be found in packs

    

}

contract CardPackTwo {

    CardIntegration public integration;
    uint public creationBlock;

    constructor(CardIntegration _integration) public payable {
        integration = _integration;
        creationBlock = 5939061; // set to creation block of first contracts
    }

    event Referral(address indexed referrer, uint value, address purchaser);

    /**
    * purchase 'count' of this type of pack
    */
    function purchase(uint16 packCount, address referrer) public payable;

    // store purity and shine as one number to save users gas
    function _getPurity(uint16 randOne, uint16 randTwo) internal pure returns (uint16) {
        if (randOne >= 998) {
            return 3000 + randTwo;
        } else if (randOne >= 988) {
            return 2000 + randTwo;
        } else if (randOne >= 938) {
            return 1000 + randTwo;
        } else {
            return randTwo;
        }
    }

}

contract Ownable {

   address public owner;

   constructor() public {
       owner = msg.sender;
   }

   function setOwner(address _owner) public onlyOwner {
       owner = _owner;
   }

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

}

contract Vault is Ownable {

   function () public payable {

   }

   function getBalance() public view returns (uint) {
       return address(this).balance;
   }

   function withdraw(uint amount) public onlyOwner {
       require(address(this).balance >= amount);
       owner.transfer(amount);
   }

   function withdrawAll() public onlyOwner {
       withdraw(address(this).balance);
   }
}

contract CappedVault is Vault { 

    uint public limit;
    uint withdrawn = 0;

    constructor() public {
        limit = 33333 ether;
    }

    function () public payable {
        require(total() + msg.value <= limit);
    }

    function total() public view returns(uint) {
        return getBalance() + withdrawn;
    }

    function withdraw(uint amount) public onlyOwner {
        require(address(this).balance >= amount);
        owner.transfer(amount);
        withdrawn += amount;
    }

}


contract Pausable is Ownable {
    
    event Pause();
    event Unpause();

    bool public paused = false;


    /**
    * @dev Modifier to make a function callable only when the contract is not paused.
    */
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /**
    * @dev Modifier to make a function callable only when the contract is paused.
    */
    modifier whenPaused() {
        require(paused);
        _;
    }

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

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

contract PresalePackTwo is CardPackTwo, Pausable {

    CappedVault public vault;

    Purchase[] purchases;

    struct Purchase {
        uint16 current;
        uint16 count;
        address user;
        uint randomness;
        uint64 commit;
    }

    event PacksPurchased(uint indexed id, address indexed user, uint16 count);
    event PackOpened(uint indexed id, uint16 startIndex, address indexed user, uint[] cardIDs);
    event RandomnessReceived(uint indexed id, address indexed user, uint16 count, uint randomness);

    constructor(CardIntegration integration, CappedVault _vault) public payable CardPackTwo(integration) {
        vault = _vault;
    }

    function basePrice() public returns (uint);
    function getCardDetails(uint16 packIndex, uint8 cardIndex, uint result) public view returns (uint16 proto, uint16 purity);
    
    function packSize() public view returns (uint8) {
        return 5;
    }

    function packsPerClaim() public view returns (uint16) {
        return 15;
    }

    // start in bytes, length in bytes
    function extract(uint num, uint length, uint start) internal pure returns (uint) {
        return (((1 << (length * 8)) - 1) & (num >> ((start * 8) - 1)));
    }

    function purchase(uint16 packCount, address referrer) whenNotPaused public payable {

        require(packCount > 0);
        require(referrer != msg.sender);

        uint price = calculatePrice(basePrice(), packCount);

        require(msg.value >= price);

        Purchase memory p = Purchase({
            user: msg.sender,
            count: packCount,
            commit: uint64(block.number),
            randomness: 0,
            current: 0
        });

        uint id = purchases.push(p) - 1;

        emit PacksPurchased(id, msg.sender, packCount);

        if (referrer != address(0)) {
            uint commission = price / 10;
            referrer.transfer(commission);
            price -= commission;
            emit Referral(referrer, commission, msg.sender);
        }
        
        address(vault).transfer(price); 
    }

    // can be called by anybody
    // can miners withhold blocks --> not really
    // giving up block reward for extra chance --> still really low
    function callback(uint id) public {

        Purchase storage p = purchases[id];

        require(p.randomness == 0);

        bytes32 bhash = blockhash(p.commit);
        // will get the same on every block
        // only use properties which can't be altered by the user
        uint random = uint(keccak256(abi.encodePacked(bhash, p.user, address(this), p.count)));

        // can't callback on the original block
        require(uint64(block.number) != p.commit);

        if (uint(bhash) == 0) {
            // should never happen (must call within next 256 blocks)
            // if it does, just give them 1: will become common and therefore less valuable
            // set to 1 rather than 0 to avoid calling claim before randomness
            p.randomness = 1;
        } else {
            p.randomness = random;
        }

        emit RandomnessReceived(id, p.user, p.count, p.randomness);
    }

    

    function claim(uint id) public {
        
        Purchase storage p = purchases[id];

        require(canClaim);

        uint16 proto;
        uint16 purity;
        uint16 count = p.count;
        uint result = p.randomness;
        uint8 size = packSize();

        address user = p.user;
        uint16 current = p.current;

        require(result != 0); // have to wait for the callback
        // require(user == msg.sender); // not needed
        require(count > 0);

        uint[] memory ids = new uint[](size);

        uint16 end = current + packsPerClaim() > count ? count : current + packsPerClaim();

        require(end > current);

        for (uint16 i = current; i < end; i++) {
            for (uint8 j = 0; j < size; j++) {
                (proto, purity) = getCardDetails(i, j, result);
                ids[j] = integration.createCard(user, proto, purity);
            }
            emit PackOpened(id, (i * size), user, ids);
        }
        p.current += (end - current);
    }

    function predictPacks(uint id) external view returns (uint16[] protos, uint16[] purities) {

        Purchase memory p = purchases[id];

        uint16 proto;
        uint16 purity;
        uint16 count = p.count;
        uint result = p.randomness;
        uint8 size = packSize();

        purities = new uint16[](size * count);
        protos = new uint16[](size * count);

        for (uint16 i = 0; i < count; i++) {
            for (uint8 j = 0; j < size; j++) {
                (proto, purity) = getCardDetails(i, j, result);
                purities[(i * size) + j] = purity;
                protos[(i * size) + j] = proto;
            }
        }
        return (protos, purities);
    }

    function calculatePrice(uint base, uint16 packCount) public view returns (uint) {
        // roughly 6k blocks per day
        uint difference = block.number - creationBlock;
        uint numDays = difference / 6000;
        if (20 > numDays) {
            return (base - (((20 - numDays) * base) / 100)) * packCount;
        }
        return base * packCount;
    }

    function _getCommonPlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
        if (rand == 999999) {
            return CardProto.Rarity.Mythic;
        } else if (rand >= 998345) {
            return CardProto.Rarity.Legendary;
        } else if (rand >= 986765) {
            return CardProto.Rarity.Epic;
        } else if (rand >= 924890) {
            return CardProto.Rarity.Rare;
        } else {
            return CardProto.Rarity.Common;
        }
    }

    function _getRarePlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
        if (rand == 999999) {
            return CardProto.Rarity.Mythic;
        } else if (rand >= 981615) {
            return CardProto.Rarity.Legendary;
        } else if (rand >= 852940) {
            return CardProto.Rarity.Epic;
        } else {
            return CardProto.Rarity.Rare;
        } 
    }

    function _getEpicPlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
        if (rand == 999999) {
            return CardProto.Rarity.Mythic;
        } else if (rand >= 981615) {
            return CardProto.Rarity.Legendary;
        } else {
            return CardProto.Rarity.Epic;
        }
    }

    function _getLegendaryPlusRarity(uint32 rand) internal pure returns (CardProto.Rarity) {
        if (rand == 999999) {
            return CardProto.Rarity.Mythic;
        } else {
            return CardProto.Rarity.Legendary;
        } 
    }

    bool public canClaim = true;

    function setCanClaim(bool claim) public onlyOwner {
        canClaim = claim;
    }

    function getComponents(
        uint16 i, uint8 j, uint rand
    ) internal returns (
        uint random, uint32 rarityRandom, uint16 purityOne, uint16 purityTwo, uint16 protoRandom
    ) {
        random = uint(keccak256(abi.encodePacked(i, rand, j)));
        rarityRandom = uint32(extract(random, 4, 10) % 1000000);
        purityOne = uint16(extract(random, 2, 4) % 1000);
        purityTwo = uint16(extract(random, 2, 6) % 1000);
        protoRandom = uint16(extract(random, 2, 8) % (2**16-1));
        return (random, rarityRandom, purityOne, purityTwo, protoRandom);
    }

    function withdraw() public onlyOwner {
        owner.transfer(address(this).balance);
    }

}

contract ERC20 {

    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Transfer(address indexed from, address indexed to, uint256 value);
    
    function allowance(address owner, address spender) public view returns (uint256);
    
    function transferFrom(address from, address to, uint256 value) public returns (bool);

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

    function totalSupply() public view returns (uint256);

    function balanceOf(address who) public view returns (uint256);
    
    function transfer(address to, uint256 value) public returns (bool);
    
  
}

pragma solidity 0.4.24;

// from OZ

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    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 a / b;
  }

  /**
  * @dev Subtracts 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 c) {
    c = a + b;
    assert(c >= a);
    return c;
  }
}

contract TournamentPass is ERC20, Ownable {

    using SafeMath for uint256;

    Vault vault;

    constructor(Vault _vault) public {
        vault = _vault;
    }

    mapping(address => uint256) balances;
    mapping (address => mapping (address => uint256)) internal allowed;
    address[] public minters;
    uint256 supply;
    uint mintLimit = 20000;
    
    function name() public view returns (string){
        return "GU Tournament Passes";
    }

    function symbol() public view returns (string) {
        return "PASS";
    }

    function addMinter(address minter) public onlyOwner {
        minters.push(minter);
    }

    function totalSupply() public view returns (uint256) {
        return supply;
    }

    function transfer(address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[msg.sender]);

        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    function balanceOf(address _owner) public view returns (uint256) {
        return balances[_owner];
    }

    function isMinter(address test) internal view returns (bool) {
        for (uint i = 0; i < minters.length; i++) {
            if (minters[i] == test) {
                return true;
            }
        }
        return false;
    }

    function mint(address to, uint amount) public returns (bool) {
        require(isMinter(msg.sender));
        if (amount.add(supply) > mintLimit) {
            return false;
        } 
        supply = supply.add(amount);
        balances[to] = balances[to].add(amount);
        emit Transfer(address(0), to, amount);
        return true;
    }

    function approve(address _spender, uint256 _value) public returns (bool) {
        allowed[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

    function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
        require(_to != address(0));
        require(_value <= balances[_from]);
        require(_value <= allowed[_from][msg.sender]);

        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        emit Transfer(_from, _to, _value);
        return true;
    }

    function increaseApproval(address spender, uint256 addedValue) public returns (bool) {
        allowed[msg.sender][spender] = allowed[msg.sender][spender].add(addedValue);
        emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
        return true;
    }

    function decreaseApproval(address spender, uint256 subtractedValue) public returns (bool) {
        uint256 oldValue = allowed[msg.sender][spender];
        if (subtractedValue > oldValue) {
            allowed[msg.sender][spender] = 0;
        } else {
            allowed[msg.sender][spender] = oldValue.sub(subtractedValue);
        }
        emit Approval(msg.sender, spender, allowed[msg.sender][spender]);
        return true;
    }

    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
        return allowed[_owner][_spender];
    }

    uint public price = 250 finney;

    function purchase(uint amount) public payable {
        
        require(msg.value >= price.mul(amount));
        require(supply.add(amount) <= mintLimit);

        supply = supply.add(amount);
        balances[msg.sender] = balances[msg.sender].add(amount);
        emit Transfer(address(0), msg.sender, amount);

        address(vault).transfer(msg.value);
    }

}

contract LegendaryPackTwo is PresalePackTwo {

    TournamentPass pass;

    constructor(CardIntegration integration, CappedVault _vault, TournamentPass _pass) public payable PresalePackTwo(integration, _vault) {
        pass = _pass;
    }

    function purchase(uint16 packCount, address referrer) public payable {
        super.purchase(packCount, referrer);
        pass.mint(msg.sender, packCount);
    }

    function basePrice() public returns (uint) {
        return 450 finney;
    }

    function getCardDetails(uint16 packIndex, uint8 cardIndex, uint result) public view returns (uint16 proto, uint16 purity) {
        uint random;
        uint32 rarityRandom;
        uint16 protoRandom;
        uint16 purityOne;
        uint16 purityTwo;

        CardProto.Rarity rarity;

        (random, rarityRandom, purityOne, purityTwo, protoRandom) = getComponents(packIndex, cardIndex, result);

        if (cardIndex == 4) {
            rarity = _getLegendaryPlusRarity(rarityRandom);
        } else if (cardIndex == 3) {
            rarity = _getRarePlusRarity(rarityRandom);
        } else {
            rarity = _getCommonPlusRarity(rarityRandom);
        }

        purity = _getPurity(purityOne, purityTwo);
    
        proto = integration.getRandomCard(rarity, protoRandom);

        return (proto, purity);
    } 
    
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"packSize","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"creationBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"claim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"packCount","type":"uint16"},{"name":"referrer","type":"address"}],"name":"purchase","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"integration","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"canClaim","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"packsPerClaim","outputs":[{"name":"","type":"uint16"}],"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":"packIndex","type":"uint16"},{"name":"cardIndex","type":"uint8"},{"name":"result","type":"uint256"}],"name":"getCardDetails","outputs":[{"name":"proto","type":"uint16"},{"name":"purity","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"claim","type":"bool"}],"name":"setCanClaim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"basePrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"id","type":"uint256"}],"name":"predictPacks","outputs":[{"name":"protos","type":"uint16[]"},{"name":"purities","type":"uint16[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"base","type":"uint256"},{"name":"packCount","type":"uint16"}],"name":"calculatePrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"id","type":"uint256"}],"name":"callback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"integration","type":"address"},{"name":"_vault","type":"address"},{"name":"_pass","type":"address"}],"payable":true,"stateMutability":"payable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"count","type":"uint16"}],"name":"PacksPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":false,"name":"startIndex","type":"uint16"},{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"cardIDs","type":"uint256[]"}],"name":"PackOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"id","type":"uint256"},{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"count","type":"uint16"},{"indexed":false,"name":"randomness","type":"uint256"}],"name":"RandomnessReceived","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"referrer","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"purchaser","type":"address"}],"name":"Referral","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040526000600260146101000a81548160ff0219169083151502179055506001600560006101000a81548160ff021916908315150217905550604051606080611f10833981018060405281019080805190602001909291908051906020019092919080519060200190929190505050828281806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550625a9f756001819055505033600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505080600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050611d7b806101956000396000f300608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306a628d41461011757806313af403514610148578063176345141461018b578063379607f5146101b6578063396c8228146101e35780633ccfd60b146102275780633f4ba83a1461023e5780635c975abb14610255578063622104d9146102845780636dc7a627146102db5780638456cb591461030a5780638be4339b146103215780638da5cb5b14610354578063c2f0bb29146103ab578063c503101e1461041e578063c7876ea41461044d578063ca2bf04714610478578063e3f7faaf14610542578063fbfa77cf14610591578063ff585caf146105e8575b600080fd5b34801561012357600080fd5b5061012c610615565b604051808260ff1660ff16815260200191505060405180910390f35b34801561015457600080fd5b50610189600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061061e565b005b34801561019757600080fd5b506101a06106be565b6040518082815260200191505060405180910390f35b3480156101c257600080fd5b506101e1600480360381019080803590602001909291905050506106c4565b005b610225600480360381019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a7e565b005b34801561023357600080fd5b5061023c610b91565b005b34801561024a57600080fd5b50610253610c6f565b005b34801561026157600080fd5b5061026a610d2f565b604051808215151515815260200191505060405180910390f35b34801561029057600080fd5b50610299610d42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e757600080fd5b506102f0610d67565b604051808215151515815260200191505060405180910390f35b34801561031657600080fd5b5061031f610d7a565b005b34801561032d57600080fd5b50610336610e3b565b604051808261ffff1661ffff16815260200191505060405180910390f35b34801561036057600080fd5b50610369610e44565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103b757600080fd5b506103f1600480360381019080803561ffff169060200190929190803560ff16906020019092919080359060200190929190505050610e6a565b604051808361ffff1661ffff1681526020018261ffff1661ffff1681526020019250505060405180910390f35b34801561042a57600080fd5b5061044b600480360381019080803515159060200190929190505050610fe5565b005b34801561045957600080fd5b5061046261105e565b6040518082815260200191505060405180910390f35b34801561048457600080fd5b506104a36004803603810190808035906020019092919050505061106e565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156104ea5780820151818401526020810190506104cf565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561052c578082015181840152602081019050610511565b5050505090500194505050505060405180910390f35b34801561054e57600080fd5b5061057b60048036038101908080359060200190929190803561ffff1690602001909291905050506112e1565b6040518082815260200191505060405180910390f35b34801561059d57600080fd5b506105a6611339565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105f457600080fd5b506106136004803603810190808035906020019092919050505061135f565b005b60006005905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561067a57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60015481565b6000806000806000806000806060600080600060048d8154811015156106e657fe5b90600052602060002090600302019b50600560009054906101000a900460ff16151561071157600080fd5b8b60000160029054906101000a900461ffff1698508b600101549750610735610615565b96508b60000160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695508b60000160009054906101000a900461ffff1694506000881415151561078357600080fd5b60008961ffff1611151561079657600080fd5b8660ff166040519080825280602002602001820160405280156107c85781602001602082028038833980820191505090505b5093508861ffff166107d8610e3b565b860161ffff16116107f2576107eb610e3b565b85016107f4565b885b92508461ffff168361ffff1611151561080c57600080fd5b8491505b8261ffff168261ffff161015610a3b57600090505b8660ff168160ff1610156109895761083e82828a610e6a565b809b50819c5050506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fb36eba1878d8d6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018361ffff1661ffff1681526020018261ffff1661ffff1681526020019350505050602060405180830381600087803b15801561092257600080fd5b505af1158015610936573d6000803e3d6000fd5b505050506040513d602081101561094c57600080fd5b8101908080519060200190929190505050848260ff1681518110151561096e57fe5b90602001906020020181815250508080600101915050610825565b8573ffffffffffffffffffffffffffffffffffffffff168d7f69ac64af86d3ef40c9def928534f6a6a9e12d85ec3af2948bd66b802afcc10468960ff16850287604051808361ffff1661ffff16815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015610a1a5780820151818401526020810190506109ff565b50505050905001935050505060405180910390a38180600101925050610810565b8483038c60000160008282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff16021790555050505050505050505050505050565b610a888282611639565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1933846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018261ffff16815260200192505050602060405180830381600087803b158015610b5157600080fd5b505af1158015610b65573d6000803e3d6000fd5b505050506040513d6020811015610b7b57600080fd5b8101908080519060200190929190505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bed57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610c6c573d6000803e3d6000fd5b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ccb57600080fd5b600260149054906101000a900460ff161515610ce657600080fd5b6000600260146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600260149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dd657600080fd5b600260149054906101000a900460ff16151515610df257600080fd5b6001600260146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000600f905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080610e818b8b8b6119fd565b809850819650829750839950849a50505050505060048a60ff161415610eb157610eaa85611b79565b9050610eda565b60038a60ff161415610ecd57610ec685611b9f565b9050610ed9565b610ed685611bfb565b90505b5b610ee48383611c72565b96506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663caa1916882866040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836004811115610f6057fe5b60ff1681526020018261ffff1661ffff16815260200192505050602060405180830381600087803b158015610f9457600080fd5b505af1158015610fa8573d6000803e3d6000fd5b505050506040513d6020811015610fbe57600080fd5b81019080805190602001909291905050509750878797509750505050505050935093915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104157600080fd5b80600560006101000a81548160ff02191690831515021790555050565b600067063eb89da4ed0000905090565b606080611079611cf7565b600080600080600080600060048b81548110151561109357fe5b906000526020600020906003020160a060405190810160405290816000820160009054906101000a900461ffff1661ffff1661ffff1681526020016000820160029054906101000a900461ffff1661ffff1661ffff1681526020016000820160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff168152505097508760200151945087606001519350611197610615565b9250848360ff160261ffff166040519080825280602002602001820160405280156111d15781602001602082028038833980820191505090505b509850848360ff160261ffff1660405190808252806020026020018201604052801561120c5781602001602082028038833980820191505090505b509950600091505b8461ffff168261ffff1610156112ce57600090505b8260ff168160ff1610156112c157611242828286610e6a565b809750819850505085898260ff168560ff1685020161ffff1681518110151561126757fe5b9060200190602002019061ffff16908161ffff1681525050868a8260ff168560ff1685020161ffff1681518110151561129c57fe5b9060200190602002019061ffff16908161ffff16815250508080600101915050611229565b8180600101925050611214565b8989995099505050505050505050915091565b600080600060015443039150611770828115156112fa57fe5b0490508060141115611327578361ffff16606486836014030281151561131c57fe5b048603029250611331565b8361ffff16850292505b505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600060048481548110151561137357fe5b906000526020600020906003020192506000836001015414151561139657600080fd5b8260020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16409150818360000160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff16308560000160029054906101000a900461ffff166040516020018085600019166000191681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018261ffff1661ffff167e010000000000000000000000000000000000000000000000000000000000000281526002019450505050506040516020818303038152906040526040518082805190602001908083835b60208310151561150657805182526020820191506020810190506020830392506114e1565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206001900490508260020160009054906101000a900467ffffffffffffffff1667ffffffffffffffff164367ffffffffffffffff161415151561157457600080fd5b600082600190041415611590576001836001018190555061159a565b8083600101819055505b8260000160049054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16847fedb5ce4012b6e9c5904afa2ffad9811d5c2e91e6bca8914cf7e3ffc28e630c578560000160029054906101000a900461ffff168660010154604051808361ffff1661ffff1681526020018281526020019250505060405180910390a350505050565b6000611643611cf7565b600080600260149054906101000a900460ff1615151561166257600080fd5b60008661ffff1611151561167557600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515156116b057600080fd5b6116c16116bb61105e565b876112e1565b93508334101515156116d257600080fd5b60a060405190810160405280600061ffff1681526020018761ffff1681526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020014367ffffffffffffffff16815250925060016004849080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a81548161ffff021916908361ffff16021790555060408201518160000160046101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506060820151816001015560808201518160020160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050500391503373ffffffffffffffffffffffffffffffffffffffff16827f861fd6f8fe14603acc05fa404f8cca86371619cac8a65a92edf687f81b9bafbd88604051808261ffff1661ffff16815260200191505060405180910390a3600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151561198c57600a848115156118ba57fe5b0490508473ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611903573d6000803e3d6000fd5b5080840393508473ffffffffffffffffffffffffffffffffffffffff167f13aa7090696e2a1d666cfc6046f2f72f1c4e0290649b47bab28d1b370ad737838233604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a25b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501580156119f4573d6000803e3d6000fd5b50505050505050565b6000806000806000878688604051602001808461ffff1661ffff167e010000000000000000000000000000000000000000000000000000000000000281526002018381526020018260ff1660ff167f010000000000000000000000000000000000000000000000000000000000000002815260010193505050506040516020818303038152906040526040518082805190602001908083835b602083101515611abb5780518252602082019150602081019050602083039250611a96565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600190049450620f4240611aff866004600a611ccf565b811515611b0857fe5b0693506103e8611b1b8660026004611ccf565b811515611b2457fe5b0692506103e8611b378660026006611ccf565b811515611b4057fe5b06915061ffff611b538660026008611ccf565b811515611b5c57fe5b069050848484848494509450945094509450939792965093509350565b6000620f423f8263ffffffff161415611b955760049050611b9a565b600390505b919050565b6000620f423f8263ffffffff161415611bbb5760049050611bf6565b620efa6f8263ffffffff16101515611bd65760039050611bf6565b620d03cc8263ffffffff16101515611bf15760029050611bf6565b600190505b919050565b6000620f423f8263ffffffff161415611c175760049050611c6d565b620f3bc98263ffffffff16101515611c325760039050611c6d565b620f0e8d8263ffffffff16101515611c4d5760029050611c6d565b620e1cda8263ffffffff16101515611c685760019050611c6d565b600090505b919050565b60006103e68361ffff16101515611c8f5781610bb8019050611cc9565b6103dc8361ffff16101515611caa57816107d0019050611cc9565b6103aa8361ffff16101515611cc557816103e8019050611cc9565b8190505b92915050565b600060016008830203849060020a900460016008850260019060020a02031690509392505050565b60a060405190810160405280600061ffff168152602001600061ffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600067ffffffffffffffff16815250905600a165627a7a72305820a936967c5be36a387447b446ef507c86233192a89d26d781c00eac1adaad4e390029000000000000000000000000512fbd15bde6570ff09e4438af27ede60402451500000000000000000000000091b9d2835ad914bc1dcfe09bd1816febd04fd68900000000000000000000000022365168c8705e95b2d08876c23a8c13e3ad72e2

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

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000512fbd15bde6570ff09e4438af27ede604024515
Arg [1] : 00000000000000000000000091b9d2835ad914bc1dcfe09bd1816febd04fd689
Arg [2] : 00000000000000000000000022365168c8705e95b2d08876c23a8c13e3ad72e2


   Swarm Source:
bzzr://a936967c5be36a387447b446ef507c86233192a89d26d781c00eac1adaad4e39

 

View All
Block Age transaction Difficulty GasUsed 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.