Contract 0x521D32f3d23F1fC82b1dbe306eDC3eF668E5D973 1

 
 
Txn Hash
Method
Block
From
To
Value
0xb705b245e2a9f90162bb79ec3083020ae867571b7b452fe36b11d87d492b863bClaim Clover85489412019-09-14 17:02:471178 days 15 hrs ago0xf3aab663fb3f428c8f82f1e0791c23284325f8db IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.0015513220
0x790d304c78a0b1ed30e4dfccc9749bd1ee7378995fa805cf80da62c21929e8f2Claim Clover84525952019-08-30 16:16:421193 days 16 hrs ago0x2728bd4123e556de30f398a071535c12a77030f5 IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.0012085513.37960026
0xe6eccfa77e4396ae8cf99c041b011e4ef0a2e9caef61cd77677ecd37f320b678Claim Clover84525892019-08-30 16:16:031193 days 16 hrs ago0x2728bd4123e556de30f398a071535c12a77030f5 IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.0011844113.11238431
0x9a0da606bb5a8bba9e4e856fb38e56c7d5fda66e4283e11b086226187a75b956Claim Clover84505822019-08-30 8:51:271193 days 23 hrs ago0x51bab87c42d384d1cd3056d52d97c84ddaa65fe4 IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000812379
0xfc7ab40f7904e569f3ef08e9ae0cf1c43c6d1c1d4833b349076fca467072e2b9Claim Clover84504742019-08-30 8:26:521193 days 23 hrs ago0x51bab87c42d384d1cd3056d52d97c84ddaa65fe4 IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000812379
0xa8517d7ab3d072ec43e6a664ed835de3b2f97517b43941940780a8411d13ebfcClaim Clover84503852019-08-30 8:06:531194 days 11 mins ago0x51bab87c42d384d1cd3056d52d97c84ddaa65fe4 IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000812379
0xaf6746444087b3bf3b423a24164cd55601fed1f5b0aff416b9e4949512cf569bClaim Clover84447662019-08-29 11:16:431194 days 21 hrs ago0x4f38f2da7720f1077a45b80e88c0a78c0144c136 IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000090261
0x1da4ad1c8be9ea1848a5f7cf03c1616f64351319da3fb51a683559f4fd79c44fClaim Clover84446152019-08-29 10:48:471194 days 21 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0xb8b4bbc44512098fb7f20b7e4e3111e54bd5edaa4a3161d3ab4bd69f20bd6aaeClaim Clover84445712019-08-29 10:37:131194 days 21 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.00013531.5
0xa901042369f81c42627ca61623e4227e5968c18334ad0e4250259910a7568c7eClaim Clover84444792019-08-29 10:16:491194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0x636d2116cc823b30429e180523770ae8786221a4c005fa282c422a8f1d863800Claim Clover84444402019-08-29 10:07:271194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0x83a0d4b01e4c64a2f089780ebbfaf4e4fc978c268da28cf6b68f72238f2a1f75Claim Clover84444402019-08-29 10:07:271194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0x8c6c0d9c8b3d25bb489b272e5a3d15f5f6927d54ac2483ad73d5c54d9b16709cClaim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.00013531.5
0x9f4d33d022991944c9aca1194b97b85ef5c50a735b25ef0ef610f3421f412d1fClaim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0xc660a30a20f00fa4280d6a1d7734b6f09cbbfd87d2d3abbf8854c7c9d2bb6b6bClaim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0xb96f45e4d373d8acd1e046f525fb6894aaac16efe2518a36cf05747953a1800dClaim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0xd7c8a8ded520049296d41c76794cdfd7f16ff91fd81c3f6c12f431fb6c95bf16Claim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0x1d335aa647526545b018e43812cdf0a497162a2a0c74133a9fffc385e491d08cClaim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0xf57d73ae8c83d29ca670995f7986fb25dbc44d14f3e184b3b98da2952ef20e48Claim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0x96a76f6cf1fec754a86bc242c73f2cb68e9a0355e1ef45ec1656f9d9d1f5d1c3Claim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.00013531.5
0x968b3b04e3f6b479292578fd279757ca555b76d5db6433cf45c48ec469abae8fClaim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0x66529a089b77d32726deb20c567940afef5c24f8282781e486b796134d3b57b5Claim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
0xb856c2991fd9fea9eb02e7944168b33eb83eedbb20d3492cf06f438c1cf4d557Claim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.00013531.5
0x34a8ff0c17c9896f897c476d7a49e0c44b7a57bc633e4d24c0e536f37446c8ffClaim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.00013531.5
0x4d727561fdceedd15a2830aabddca4029115e51916266964a01ee1870dc03980Claim Clover84444262019-08-29 10:05:371194 days 22 hrs ago0xabcded3c9bd09729c23ac5d678659cecba6a8a0a IN  0x521d32f3d23f1fc82b1dbe306edc3ef668e5d9730.00190621 Ether0.000135391.5
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x790d304c78a0b1ed30e4dfccc9749bd1ee7378995fa805cf80da62c21929e8f284525952019-08-30 16:16:421193 days 16 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xe6eccfa77e4396ae8cf99c041b011e4ef0a2e9caef61cd77677ecd37f320b67884525892019-08-30 16:16:031193 days 16 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x9a0da606bb5a8bba9e4e856fb38e56c7d5fda66e4283e11b086226187a75b95684505822019-08-30 8:51:271193 days 23 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xfc7ab40f7904e569f3ef08e9ae0cf1c43c6d1c1d4833b349076fca467072e2b984504742019-08-30 8:26:521193 days 23 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xa8517d7ab3d072ec43e6a664ed835de3b2f97517b43941940780a8411d13ebfc84503852019-08-30 8:06:531194 days 11 mins ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xaf6746444087b3bf3b423a24164cd55601fed1f5b0aff416b9e4949512cf569b84447662019-08-29 11:16:431194 days 21 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x1da4ad1c8be9ea1848a5f7cf03c1616f64351319da3fb51a683559f4fd79c44f84446152019-08-29 10:48:471194 days 21 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xb8b4bbc44512098fb7f20b7e4e3111e54bd5edaa4a3161d3ab4bd69f20bd6aae84445712019-08-29 10:37:131194 days 21 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xa901042369f81c42627ca61623e4227e5968c18334ad0e4250259910a7568c7e84444792019-08-29 10:16:491194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x636d2116cc823b30429e180523770ae8786221a4c005fa282c422a8f1d86380084444402019-08-29 10:07:271194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x83a0d4b01e4c64a2f089780ebbfaf4e4fc978c268da28cf6b68f72238f2a1f7584444402019-08-29 10:07:271194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x8c6c0d9c8b3d25bb489b272e5a3d15f5f6927d54ac2483ad73d5c54d9b16709c84444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x9f4d33d022991944c9aca1194b97b85ef5c50a735b25ef0ef610f3421f412d1f84444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xc660a30a20f00fa4280d6a1d7734b6f09cbbfd87d2d3abbf8854c7c9d2bb6b6b84444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xb96f45e4d373d8acd1e046f525fb6894aaac16efe2518a36cf05747953a1800d84444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xd7c8a8ded520049296d41c76794cdfd7f16ff91fd81c3f6c12f431fb6c95bf1684444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x1d335aa647526545b018e43812cdf0a497162a2a0c74133a9fffc385e491d08c84444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xf57d73ae8c83d29ca670995f7986fb25dbc44d14f3e184b3b98da2952ef20e4884444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x96a76f6cf1fec754a86bc242c73f2cb68e9a0355e1ef45ec1656f9d9d1f5d1c384444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x968b3b04e3f6b479292578fd279757ca555b76d5db6433cf45c48ec469abae8f84444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x66529a089b77d32726deb20c567940afef5c24f8282781e486b796134d3b57b584444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xb856c2991fd9fea9eb02e7944168b33eb83eedbb20d3492cf06f438c1cf4d55784444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x34a8ff0c17c9896f897c476d7a49e0c44b7a57bc633e4d24c0e536f37446c8ff84444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0x4d727561fdceedd15a2830aabddca4029115e51916266964a01ee1870dc0398084444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
0xc80883cd8933df9e6fef04bc98533b9f660cd389cc2baee23bca1de6785e95c584444262019-08-29 10:05:371194 days 22 hrs ago 0x521d32f3d23f1fc82b1dbe306edc3ef668e5d973 Clovers Network: CLV Token0.00190621 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CloversController

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion, None license

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-08-16
*/

// File: contracts/Reversi.sol

pragma solidity ^0.4.18;

library Reversi {
    // event DebugBool(bool boolean);
    // event DebugBoard(bytes16 board);
    // event DebugUint(uint u);
    uint8 constant BLACK = 1; //0b01 //0x1
    uint8 constant WHITE = 2; //0b10 //0x2
    uint8 constant EMPTY = 3; //0b11 //0x3

    struct Game {
        bool error;
        bool complete;
        bool symmetrical;
        bool RotSym;
        bool Y0Sym;
        bool X0Sym;
        bool XYSym;
        bool XnYSym;
        bytes16 board;
        bytes28 first32Moves;
        bytes28 lastMoves;

        uint8 currentPlayer;
        uint8 moveKey;
        uint8 blackScore;
        uint8 whiteScore;
        // string msg;
    }


    function isValid (bytes28[2] moves) public pure returns (bool) {
        Game memory game = playGame(moves);
        if (game.error) {
            return false;
        } else if (!game.complete) {
            return false;
        } else {
            return true;
        }
    }

    function getGame (bytes28[2] moves) public pure returns (bool error, bool complete, bool symmetrical, bytes16 board, uint8 currentPlayer, uint8 moveKey) {
      Game memory game = playGame(moves);
        return (
            game.error,
            game.complete,
            game.symmetrical,
            game.board,
            game.currentPlayer,
            game.moveKey
            // game.msg
        );
    }

    function showColors () public pure returns(uint8, uint8, uint8) {
        return (EMPTY, BLACK, WHITE);
    }

    function playGame (bytes28[2] moves) internal pure returns (Game)  {
        Game memory game;

        game.first32Moves = moves[0];
        game.lastMoves = moves[1];
        game.moveKey = 0;
        game.blackScore = 2;
        game.whiteScore = 2;

        game.error = false;
        game.complete = false;
        game.currentPlayer = BLACK;


        // game.board = bytes16(10625432672847758622720); // completely empty board
        game.board = bytes16(340282366920938456379662753540715053055); // empty board except for center pieces

        bool skip;
        uint8 move;
        uint8 col;
        uint8 row;
        uint8 i;
        bytes28 currentMoves;

        for (i = 0; i < 60 && !skip; i++) {
            currentMoves = game.moveKey < 32 ? game.first32Moves : game.lastMoves;
            move = readMove(currentMoves, game.moveKey % 32, 32);
            (col, row) = convertMove(move);
            skip = !validMove(move);
            if (i == 0 && (col != 2 || row != 3)) {
                skip = true; // this is to force the first move to always be C4 to avoid repeatable boards via mirroring translations
                game.error = true;
            }
            if (!skip && col < 8 && row < 8 && col >= 0 && row >= 0) {
                // game.msg = "make a move";
                game = makeMove(game, col, row);
                game.moveKey = game.moveKey + 1;
                if (game.error) {
                    game.error = false;
                    // maybe player has no valid moves and must pass
                    if (game.currentPlayer == BLACK) {
                        game.currentPlayer = WHITE;
                    } else {
                        game.currentPlayer = BLACK;
                    }
                    game = makeMove(game, col, row);
                    if (game.error) {
                        game.error = true;
                        skip = true;
                    }
                }
            }
        }
        if (!game.error) {
            game.error = false;
            game = isComplete(game);
            game = isSymmetrical(game);
        }
        return game;
    }

    function makeMove (Game memory game, uint8 col, uint8 row) internal pure returns (Game)  {
        // square is already occupied
        if (returnTile(game.board, col, row) != EMPTY){
            game.error = true;
            // game.msg = "Invalid Game (square is already occupied)";
            return game;
        }
        int8[2][8] memory possibleDirections;
        uint8  possibleDirectionsLength;
        (possibleDirections, possibleDirectionsLength) = getPossibleDirections(game, col, row);
        // no valid directions
        if (possibleDirectionsLength == 0) {
            game.error = true;
            // game.msg = "Invalid Game (doesnt border other tiles)";
            return game;
        }

        bytes28 newFlips;
        uint8 newFlipsLength;
        uint8 newFlipCol;
        uint8 newFlipRow;
        uint8 j;
        bool valid = false;
        for (uint8 i = 0; i < possibleDirectionsLength; i++) {
            delete newFlips;
            delete newFlipsLength;
            (newFlips, newFlipsLength) = traverseDirection(game, possibleDirections[i], col, row);
            for (j = 0; j < newFlipsLength; j++) {
                if (!valid) valid = true;
                (newFlipCol, newFlipRow) = convertMove(readMove(newFlips, j, newFlipsLength));
                game.board = turnTile(game.board, game.currentPlayer, newFlipCol, newFlipRow);
                if (game.currentPlayer == WHITE) {
                    game.whiteScore += 1;
                    game.blackScore -= 1;
                } else {
                    game.whiteScore -= 1;
                    game.blackScore += 1;
                }
            }
        }

        //no valid flips in directions
        if (valid) {
            game.board = turnTile(game.board, game.currentPlayer, col, row);
            if (game.currentPlayer == WHITE) {
                game.whiteScore += 1;
            } else {
                game.blackScore += 1;
            }
        } else {
            game.error = true;
            // game.msg = "Invalid Game (doesnt flip any other tiles)";
            return game;
        }

        // switch players
        if (game.currentPlayer == BLACK) {
            game.currentPlayer = WHITE;
        } else {
            game.currentPlayer = BLACK;
        }
        return game;
    }

    function getPossibleDirections (Game memory game, uint8 col, uint8 row) internal pure returns(int8[2][8], uint8){

        int8[2][8] memory possibleDirections;
        uint8 possibleDirectionsLength = 0;
        int8[2][8] memory dirs = [
            [int8(-1), int8(0)], // W
            [int8(-1), int8(1)], // SW
            [int8(0), int8(1)], // S
            [int8(1), int8(1)], // SE
            [int8(1), int8(0)], // E
            [int8(1), int8(-1)], // NE
            [int8(0), int8(-1)], // N
            [int8(-1), int8(-1)] // NW
        ];
        int8 focusedRowPos;
        int8 focusedColPos;
        int8[2] memory dir;
        uint8 testSquare;

        for (uint8 i = 0; i < 8; i++) {
            dir = dirs[i];
            focusedColPos = int8(col) + dir[0];
            focusedRowPos = int8(row) + dir[1];

            // if tile is off the board it is not a valid move
            if (!(focusedRowPos > 7 || focusedRowPos < 0 || focusedColPos > 7 || focusedColPos < 0)) {
                testSquare = returnTile(game.board, uint8(focusedColPos), uint8(focusedRowPos));

                // if the surrounding tile is current color or no color it can"t be part of a capture
                if (testSquare != game.currentPlayer) {
                    if (testSquare != EMPTY) {
                        possibleDirections[possibleDirectionsLength] = dir;
                        possibleDirectionsLength++;
                    }
                }
            }
        }
        return (possibleDirections, possibleDirectionsLength);
    }

    function traverseDirection (Game memory game, int8[2] dir, uint8 col, uint8 row) internal pure returns(bytes28, uint8) {
        bytes28 potentialFlips;
        uint8 potentialFlipsLength = 0;

        if (game.currentPlayer == BLACK) {
            uint8 opponentColor = WHITE;
        } else {
            opponentColor = BLACK;
        }

        // take one step at a time in this direction
        // ignoring the first step look for the same color as your tile
        bool skip = false;
        int8 testCol;
        int8 testRow;
        uint8 tile;
        for (uint8 j = 1; j < 9; j++) {
            if (!skip) {
                testCol = (int8(j) * dir[0]) + int8(col);
                testRow = (int8(j) * dir[1]) + int8(row);
                // ran off the board before hitting your own tile
                if (testCol > 7 || testCol < 0 || testRow > 7 || testRow < 0) {
                    delete potentialFlips;
                    potentialFlipsLength = 0;
                    skip = true;
                } else{

                    tile = returnTile(game.board, uint8(testCol), uint8(testRow));

                    if (tile == opponentColor) {
                        // if tile is opposite color it could be flipped, so add to potential flip array
                        (potentialFlips, potentialFlipsLength) = addMove(potentialFlips, potentialFlipsLength, uint8(testCol), uint8(testRow));
                    } else if (tile == game.currentPlayer && j > 1) {
                        // hit current players tile which means capture is complete
                        skip = true;
                    } else {
                        // either hit current players own color before hitting an opponent"s
                        // or hit an empty space
                        delete potentialFlips;
                        delete potentialFlipsLength;
                        skip = true;
                    }
                }
            }
        }
        return (potentialFlips, potentialFlipsLength);
    }

    function isComplete (Game memory game) internal pure returns (Game) {

        if (game.moveKey == 60) {
            // game.msg = "good game";
            game.complete = true;
            return game;
        } else {
            uint8[2][60] memory empties;
            uint8 emptiesLength = 0;
            for (uint8 i = 0; i < 64; i++) {
                uint8 tile = returnTile(game.board, ((i - (i % 8)) / 8), (i % 8));
                if (tile == EMPTY) {
                    empties[emptiesLength] = [((i - (i % 8)) / 8), (i % 8)];
                    emptiesLength++;
                }
            }
            bool validMovesRemains = false;
            if (emptiesLength > 0) {
                bytes16 board = game.board;
                uint8[2] memory move;
                for (i = 0; i < emptiesLength && !validMovesRemains; i++) {
                    move = empties[i];

                    game.currentPlayer = BLACK;
                    game.error = false;
                    game.board = board;
                    game = makeMove(game, move[0], move[1]);
                    if (!game.error) {
                        validMovesRemains = true;
                    }
                    game.currentPlayer = WHITE;
                    game.error = false;
                    game.board = board;
                    game = makeMove(game, move[0], move[1]);
                    if (!game.error) {
                        validMovesRemains = true;
                    }
                }
                game.board = board;
            }
            if (validMovesRemains) {
                game.error = true;
                // game.msg = "Invalid Game (moves still available)";
            } else {
                // game.msg = "good game";
                game.complete = true;
                game.error = false;
            }
        }
        return game;
    }

    function isSymmetrical (Game memory game) internal pure returns (Game) {
        bool RotSym = true;
        bool Y0Sym = true;
        bool X0Sym = true;
        bool XYSym = true;
        bool XnYSym = true;
        for (uint8 i = 0; i < 8 && (RotSym || Y0Sym || X0Sym || XYSym || XnYSym); i++) {
            for (uint8 j = 0; j < 8 && (RotSym || Y0Sym || X0Sym || XYSym || XnYSym); j++) {

                // rotational symmetry
                if (returnBytes(game.board, i, j) != returnBytes(game.board, (7 - i), (7 - j))) {
                    RotSym = false;
                }
                // symmetry on y = 0
                if (returnBytes(game.board, i, j) != returnBytes(game.board, i, (7 - j))) {
                    Y0Sym = false;
                }
                // symmetry on x = 0
                if (returnBytes(game.board, i, j) != returnBytes(game.board, (7 - i), j)) {
                    X0Sym = false;
                }
                // symmetry on x = y
                if (returnBytes(game.board, i, j) != returnBytes(game.board, (7 - j), (7 - i))) {
                    XYSym = false;
                }
                // symmetry on x = -y
                if (returnBytes(game.board, i, j) != returnBytes(game.board, j, i)) {
                    XnYSym = false;
                }
            }
        }
        if (RotSym || Y0Sym || X0Sym || XYSym || XnYSym) {
            game.symmetrical = true;
            game.RotSym = RotSym;
            game.Y0Sym = Y0Sym;
            game.X0Sym = X0Sym;
            game.XYSym = XYSym;
            game.XnYSym = XnYSym;
        }
        return game;
    }



    // Utilities

    function returnSymmetricals (bool RotSym, bool Y0Sym, bool X0Sym, bool XYSym, bool XnYSym) public view returns (uint256) {
        uint256 symmetries = (RotSym ? 1  : 0) << 1;
        symmetries = (symmetries & (Y0Sym ? 1 : 0)) << 1;
        symmetries = (symmetries & (X0Sym ? 1 : 0)) << 1;
        symmetries = (symmetries & (XYSym ? 1 : 0)) << 1;
        symmetries = symmetries & (XnYSym ? 1 : 0);
        return symmetries;
    }


    function returnBytes (bytes16 board, uint8 col, uint8 row) internal pure returns (bytes16) {
        uint128 push = posToPush(col, row);
        return (board >> push) & bytes16(3);
    }

    function turnTile (bytes16 board, uint8 color, uint8 col, uint8 row) internal pure returns (bytes16){
        if (col > 7) revert();
        if (row > 7) revert();
        uint128 push = posToPush(col, row);
        bytes16 mask = bytes16(3) << push;// 0b00000011 (ones)

        board = ((board ^ mask) & board);

        return board | (bytes16(color) << push);
    }

    function returnTile (bytes16 board, uint8 col, uint8 row) internal pure returns (uint8){
        uint128 push = posToPush(col, row);
        bytes16 tile = (board >> push ) & bytes16(3);
        return uint8(tile); // returns 2
    }

    function posToPush (uint8 col, uint8 row) internal pure returns (uint128){
        return uint128(((64) - ((8 * col) + row + 1)) * 2);
    }

    function readMove (bytes28 moveSequence, uint8 moveKey, uint8 movesLength) public pure returns(uint8) {
        bytes28 mask = bytes28(127);
        uint8 push = (movesLength * 7) - (moveKey * 7) - 7;
        return uint8((moveSequence >> push) & mask);
    }

    function addMove (bytes28 moveSequence, uint8 movesLength, uint8 col, uint8 row) internal pure returns (bytes28, uint8) {
        bytes28 move = bytes28(col + (row * 8) + 64);
        moveSequence = moveSequence << 7;
        moveSequence = moveSequence | move;
        movesLength++;
        return (moveSequence, movesLength);
    }

    function validMove (uint8 move) internal pure returns(bool) {
        return move >= 64;
    }

    function convertMove (uint8 move) public pure returns(uint8, uint8) {
        move = move - 64;
        uint8 col = move % 8;
        uint8 row = (move - col) / 8;
        return (col, row);
    }


}

// File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol

pragma solidity ^0.4.24;


/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * See https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address who) public view returns (uint256);
  function transfer(address to, uint256 value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol

pragma solidity ^0.4.24;



/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
  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);
  event Approval(
    address indexed owner,
    address indexed spender,
    uint256 value
  );
}

// File: zeppelin-solidity/contracts/introspection/ERC165.sol

pragma solidity ^0.4.24;


/**
 * @title ERC165
 * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
 */
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.
   */
  function supportsInterface(bytes4 _interfaceId)
    external
    view
    returns (bool);
}

// File: zeppelin-solidity/contracts/token/ERC721/ERC721Basic.sol

pragma solidity ^0.4.24;



/**
 * @title ERC721 Non-Fungible Token Standard basic interface
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Basic is ERC165 {
  event Transfer(
    address indexed _from,
    address indexed _to,
    uint256 indexed _tokenId
  );
  event Approval(
    address indexed _owner,
    address indexed _approved,
    uint256 indexed _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 exists(uint256 _tokenId) public view returns (bool _exists);

  function approve(address _to, uint256 _tokenId) public;
  function getApproved(uint256 _tokenId)
    public view returns (address _operator);

  function setApprovalForAll(address _operator, bool _approved) public;
  function isApprovedForAll(address _owner, address _operator)
    public view returns (bool);

  function transferFrom(address _from, address _to, uint256 _tokenId) public;
  function safeTransferFrom(address _from, address _to, uint256 _tokenId)
    public;

  function safeTransferFrom(
    address _from,
    address _to,
    uint256 _tokenId,
    bytes _data
  )
    public;
}

// File: zeppelin-solidity/contracts/token/ERC721/ERC721.sol

pragma solidity ^0.4.24;



/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Enumerable is ERC721Basic {
  function totalSupply() public view returns (uint256);
  function tokenOfOwnerByIndex(
    address _owner,
    uint256 _index
  )
    public
    view
    returns (uint256 _tokenId);

  function tokenByIndex(uint256 _index) public view returns (uint256);
}


/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Metadata is ERC721Basic {
  function name() external view returns (string _name);
  function symbol() external view returns (string _symbol);
  function tokenURI(uint256 _tokenId) public view returns (string);
}


/**
 * @title ERC-721 Non-Fungible Token Standard, full implementation interface
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721 is ERC721Basic, ERC721Enumerable, ERC721Metadata {
}

// File: zeppelin-solidity/contracts/token/ERC721/ERC721Receiver.sol

pragma solidity ^0.4.24;


/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
contract ERC721Receiver {
  /**
   * @dev Magic value to be returned upon successful reception of an NFT
   *  Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`,
   *  which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
   */
  bytes4 internal constant ERC721_RECEIVED = 0x150b7a02;

  /**
   * @notice Handle the receipt of an NFT
   * @dev The ERC721 smart contract calls this function on the recipient
   * after a `safetransfer`. This function MAY throw to revert and reject the
   * transfer. Return of other than the magic value MUST result in the 
   * transaction being reverted.
   * Note: the contract address is always the message sender.
   * @param _operator The address which called `safeTransferFrom` function
   * @param _from The address which previously owned the token
   * @param _tokenId The NFT identifier which is being transfered
   * @param _data Additional data with no specified format
   * @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
   */
  function onERC721Received(
    address _operator,
    address _from,
    uint256 _tokenId,
    bytes _data
  )
    public
    returns(bytes4);
}

// File: zeppelin-solidity/contracts/math/SafeMath.sol

pragma solidity ^0.4.24;


/**
 * @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;
  }
}

// File: zeppelin-solidity/contracts/AddressUtils.sol

pragma solidity ^0.4.24;


/**
 * Utility library of inline functions on addresses
 */
library AddressUtils {

  /**
   * Returns whether the target address is a contract
   * @dev This function will return false if invoked during the constructor of a contract,
   * as the code is not actually created until after the constructor finishes.
   * @param addr address to check
   * @return whether the target address is a contract
   */
  function isContract(address addr) internal view returns (bool) {
    uint256 size;
    // XXX Currently there is no better way to check if there is a contract in an address
    // than to check the size of the code at that address.
    // See https://ethereum.stackexchange.com/a/14016/36603
    // for more details about how this works.
    // TODO Check this again before the Serenity release, because all addresses will be
    // contracts then.
    // solium-disable-next-line security/no-inline-assembly
    assembly { size := extcodesize(addr) }
    return size > 0;
  }

}

// File: zeppelin-solidity/contracts/introspection/SupportsInterfaceWithLookup.sol

pragma solidity ^0.4.24;



/**
 * @title SupportsInterfaceWithLookup
 * @author Matt Condon (@shrugs)
 * @dev Implements ERC165 using a lookup table.
 */
contract SupportsInterfaceWithLookup is ERC165 {
  bytes4 public constant InterfaceId_ERC165 = 0x01ffc9a7;
  /**
   * 0x01ffc9a7 ===
   *   bytes4(keccak256('supportsInterface(bytes4)'))
   */

  /**
   * @dev a mapping of interface id to whether or not it's supported
   */
  mapping(bytes4 => bool) internal supportedInterfaces;

  /**
   * @dev A contract implementing SupportsInterfaceWithLookup
   * implement ERC165 itself
   */
  constructor()
    public
  {
    _registerInterface(InterfaceId_ERC165);
  }

  /**
   * @dev implement supportsInterface(bytes4) using a lookup table
   */
  function supportsInterface(bytes4 _interfaceId)
    external
    view
    returns (bool)
  {
    return supportedInterfaces[_interfaceId];
  }

  /**
   * @dev private method for registering an interface
   */
  function _registerInterface(bytes4 _interfaceId)
    internal
  {
    require(_interfaceId != 0xffffffff);
    supportedInterfaces[_interfaceId] = true;
  }
}

// File: zeppelin-solidity/contracts/token/ERC721/ERC721BasicToken.sol

pragma solidity ^0.4.24;







/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721BasicToken is SupportsInterfaceWithLookup, ERC721Basic {

  bytes4 private constant InterfaceId_ERC721 = 0x80ac58cd;
  /*
   * 0x80ac58cd ===
   *   bytes4(keccak256('balanceOf(address)')) ^
   *   bytes4(keccak256('ownerOf(uint256)')) ^
   *   bytes4(keccak256('approve(address,uint256)')) ^
   *   bytes4(keccak256('getApproved(uint256)')) ^
   *   bytes4(keccak256('setApprovalForAll(address,bool)')) ^
   *   bytes4(keccak256('isApprovedForAll(address,address)')) ^
   *   bytes4(keccak256('transferFrom(address,address,uint256)')) ^
   *   bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^
   *   bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
   */

  bytes4 private constant InterfaceId_ERC721Exists = 0x4f558e79;
  /*
   * 0x4f558e79 ===
   *   bytes4(keccak256('exists(uint256)'))
   */

  using SafeMath for uint256;
  using AddressUtils for address;

  // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
  // which can be also obtained as `ERC721Receiver(0).onERC721Received.selector`
  bytes4 private constant ERC721_RECEIVED = 0x150b7a02;

  // Mapping from token ID to owner
  mapping (uint256 => address) internal tokenOwner;

  // Mapping from token ID to approved address
  mapping (uint256 => address) internal tokenApprovals;

  // Mapping from owner to number of owned token
  mapping (address => uint256) internal ownedTokensCount;

  // Mapping from owner to operator approvals
  mapping (address => mapping (address => bool)) internal operatorApprovals;

  /**
   * @dev Guarantees msg.sender is owner of the given token
   * @param _tokenId uint256 ID of the token to validate its ownership belongs to msg.sender
   */
  modifier onlyOwnerOf(uint256 _tokenId) {
    require(ownerOf(_tokenId) == msg.sender);
    _;
  }

  /**
   * @dev Checks msg.sender can transfer a token, by being owner, approved, or operator
   * @param _tokenId uint256 ID of the token to validate
   */
  modifier canTransfer(uint256 _tokenId) {
    require(isApprovedOrOwner(msg.sender, _tokenId));
    _;
  }

  constructor()
    public
  {
    // register the supported interfaces to conform to ERC721 via ERC165
    _registerInterface(InterfaceId_ERC721);
    _registerInterface(InterfaceId_ERC721Exists);
  }

  /**
   * @dev Gets the balance of the specified address
   * @param _owner address to query the balance of
   * @return uint256 representing the amount owned by the passed address
   */
  function balanceOf(address _owner) public view returns (uint256) {
    require(_owner != address(0));
    return ownedTokensCount[_owner];
  }

  /**
   * @dev Gets the owner of the specified token ID
   * @param _tokenId uint256 ID of the token to query the owner of
   * @return owner address currently marked as the owner of the given token ID
   */
  function ownerOf(uint256 _tokenId) public view returns (address) {
    address owner = tokenOwner[_tokenId];
    require(owner != address(0));
    return owner;
  }

  /**
   * @dev Returns whether the specified token exists
   * @param _tokenId uint256 ID of the token to query the existence of
   * @return whether the token exists
   */
  function exists(uint256 _tokenId) public view returns (bool) {
    address owner = tokenOwner[_tokenId];
    return owner != address(0);
  }

  /**
   * @dev Approves another address to transfer the given token ID
   * The zero address indicates there is no approved address.
   * There can only be one approved address per token at a given time.
   * Can only be called by the token owner or an approved operator.
   * @param _to address to be approved for the given token ID
   * @param _tokenId uint256 ID of the token to be approved
   */
  function approve(address _to, uint256 _tokenId) public {
    address owner = ownerOf(_tokenId);
    require(_to != owner);
    require(msg.sender == owner || isApprovedForAll(owner, msg.sender));

    tokenApprovals[_tokenId] = _to;
    emit Approval(owner, _to, _tokenId);
  }

  /**
   * @dev Gets the approved address for a token ID, or zero if no address set
   * @param _tokenId uint256 ID of the token to query the approval of
   * @return address currently approved for the given token ID
   */
  function getApproved(uint256 _tokenId) public view returns (address) {
    return tokenApprovals[_tokenId];
  }

  /**
   * @dev Sets or unsets the approval of a given operator
   * An operator is allowed to transfer all tokens of the sender on their behalf
   * @param _to operator address to set the approval
   * @param _approved representing the status of the approval to be set
   */
  function setApprovalForAll(address _to, bool _approved) public {
    require(_to != msg.sender);
    operatorApprovals[msg.sender][_to] = _approved;
    emit ApprovalForAll(msg.sender, _to, _approved);
  }

  /**
   * @dev Tells whether an operator is approved by a given owner
   * @param _owner owner address which you want to query the approval of
   * @param _operator operator address which you want to query the approval of
   * @return bool whether the given operator is approved by the given owner
   */
  function isApprovedForAll(
    address _owner,
    address _operator
  )
    public
    view
    returns (bool)
  {
    return operatorApprovals[_owner][_operator];
  }

  /**
   * @dev Transfers the ownership of a given token ID to another address
   * Usage of this method is discouraged, use `safeTransferFrom` whenever possible
   * Requires the msg sender to be the owner, approved, or operator
   * @param _from current owner of the token
   * @param _to address to receive the ownership of the given token ID
   * @param _tokenId uint256 ID of the token to be transferred
  */
  function transferFrom(
    address _from,
    address _to,
    uint256 _tokenId
  )
    public
    canTransfer(_tokenId)
  {
    require(_from != address(0));
    require(_to != address(0));

    clearApproval(_from, _tokenId);
    removeTokenFrom(_from, _tokenId);
    addTokenTo(_to, _tokenId);

    emit Transfer(_from, _to, _tokenId);
  }

  /**
   * @dev Safely transfers the ownership of a given token ID to another address
   * If the target address is a contract, it must implement `onERC721Received`,
   * which is called upon a safe transfer, and return the magic value
   * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
   * the transfer is reverted.
   *
   * Requires the msg sender to be the owner, approved, or operator
   * @param _from current owner of the token
   * @param _to address to receive the ownership of the given token ID
   * @param _tokenId uint256 ID of the token to be transferred
  */
  function safeTransferFrom(
    address _from,
    address _to,
    uint256 _tokenId
  )
    public
    canTransfer(_tokenId)
  {
    // solium-disable-next-line arg-overflow
    safeTransferFrom(_from, _to, _tokenId, "");
  }

  /**
   * @dev Safely transfers the ownership of a given token ID to another address
   * If the target address is a contract, it must implement `onERC721Received`,
   * which is called upon a safe transfer, and return the magic value
   * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
   * the transfer is reverted.
   * Requires the msg sender to be the owner, approved, or operator
   * @param _from current owner of the token
   * @param _to address to receive the ownership of the given token ID
   * @param _tokenId uint256 ID of the token to be transferred
   * @param _data bytes data to send along with a safe transfer check
   */
  function safeTransferFrom(
    address _from,
    address _to,
    uint256 _tokenId,
    bytes _data
  )
    public
    canTransfer(_tokenId)
  {
    transferFrom(_from, _to, _tokenId);
    // solium-disable-next-line arg-overflow
    require(checkAndCallSafeTransfer(_from, _to, _tokenId, _data));
  }

  /**
   * @dev Returns whether the given spender can transfer a given token ID
   * @param _spender address of the spender to query
   * @param _tokenId uint256 ID of the token to be transferred
   * @return bool whether the msg.sender is approved for the given token ID,
   *  is an operator of the owner, or is the owner of the token
   */
  function isApprovedOrOwner(
    address _spender,
    uint256 _tokenId
  )
    internal
    view
    returns (bool)
  {
    address owner = ownerOf(_tokenId);
    // Disable solium check because of
    // https://github.com/duaraghav8/Solium/issues/175
    // solium-disable-next-line operator-whitespace
    return (
      _spender == owner ||
      getApproved(_tokenId) == _spender ||
      isApprovedForAll(owner, _spender)
    );
  }

  /**
   * @dev Internal function to mint a new token
   * Reverts if the given token ID already exists
   * @param _to The address that will own the minted token
   * @param _tokenId uint256 ID of the token to be minted by the msg.sender
   */
  function _mint(address _to, uint256 _tokenId) internal {
    require(_to != address(0));
    addTokenTo(_to, _tokenId);
    emit Transfer(address(0), _to, _tokenId);
  }

  /**
   * @dev Internal function to burn a specific token
   * Reverts if the token does not exist
   * @param _tokenId uint256 ID of the token being burned by the msg.sender
   */
  function _burn(address _owner, uint256 _tokenId) internal {
    clearApproval(_owner, _tokenId);
    removeTokenFrom(_owner, _tokenId);
    emit Transfer(_owner, address(0), _tokenId);
  }

  /**
   * @dev Internal function to clear current approval of a given token ID
   * Reverts if the given address is not indeed the owner of the token
   * @param _owner owner of the token
   * @param _tokenId uint256 ID of the token to be transferred
   */
  function clearApproval(address _owner, uint256 _tokenId) internal {
    require(ownerOf(_tokenId) == _owner);
    if (tokenApprovals[_tokenId] != address(0)) {
      tokenApprovals[_tokenId] = address(0);
    }
  }

  /**
   * @dev Internal function to add a token ID to the list of a given address
   * @param _to address representing the new owner of the given token ID
   * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
   */
  function addTokenTo(address _to, uint256 _tokenId) internal {
    require(tokenOwner[_tokenId] == address(0));
    tokenOwner[_tokenId] = _to;
    ownedTokensCount[_to] = ownedTokensCount[_to].add(1);
  }

  /**
   * @dev Internal function to remove a token ID from the list of a given address
   * @param _from address representing the previous owner of the given token ID
   * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
   */
  function removeTokenFrom(address _from, uint256 _tokenId) internal {
    require(ownerOf(_tokenId) == _from);
    ownedTokensCount[_from] = ownedTokensCount[_from].sub(1);
    tokenOwner[_tokenId] = address(0);
  }

  /**
   * @dev Internal function to invoke `onERC721Received` on a target address
   * The call is not executed if the target address is not a contract
   * @param _from address representing the previous owner of the given token ID
   * @param _to target address that will receive the tokens
   * @param _tokenId uint256 ID of the token to be transferred
   * @param _data bytes optional data to send along with the call
   * @return whether the call correctly returned the expected magic value
   */
  function checkAndCallSafeTransfer(
    address _from,
    address _to,
    uint256 _tokenId,
    bytes _data
  )
    internal
    returns (bool)
  {
    if (!_to.isContract()) {
      return true;
    }
    bytes4 retval = ERC721Receiver(_to).onERC721Received(
      msg.sender, _from, _tokenId, _data);
    return (retval == ERC721_RECEIVED);
  }
}

// File: zeppelin-solidity/contracts/token/ERC721/ERC721Token.sol

pragma solidity ^0.4.24;





/**
 * @title Full ERC721 Token
 * This implementation includes all the required and some optional functionality of the ERC721 standard
 * Moreover, it includes approve all functionality using operator terminology
 * @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
 */
contract ERC721Token is SupportsInterfaceWithLookup, ERC721BasicToken, ERC721 {

  bytes4 private constant InterfaceId_ERC721Enumerable = 0x780e9d63;
  /**
   * 0x780e9d63 ===
   *   bytes4(keccak256('totalSupply()')) ^
   *   bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) ^
   *   bytes4(keccak256('tokenByIndex(uint256)'))
   */

  bytes4 private constant InterfaceId_ERC721Metadata = 0x5b5e139f;
  /**
   * 0x5b5e139f ===
   *   bytes4(keccak256('name()')) ^
   *   bytes4(keccak256('symbol()')) ^
   *   bytes4(keccak256('tokenURI(uint256)'))
   */

  // Token name
  string internal name_;

  // Token symbol
  string internal symbol_;

  // Mapping from owner to list of owned token IDs
  mapping(address => uint256[]) internal ownedTokens;

  // Mapping from token ID to index of the owner tokens list
  mapping(uint256 => uint256) internal ownedTokensIndex;

  // Array with all token ids, used for enumeration
  uint256[] internal allTokens;

  // Mapping from token id to position in the allTokens array
  mapping(uint256 => uint256) internal allTokensIndex;

  // Optional mapping for token URIs
  mapping(uint256 => string) internal tokenURIs;

  /**
   * @dev Constructor function
   */
  constructor(string _name, string _symbol) public {
    name_ = _name;
    symbol_ = _symbol;

    // register the supported interfaces to conform to ERC721 via ERC165
    _registerInterface(InterfaceId_ERC721Enumerable);
    _registerInterface(InterfaceId_ERC721Metadata);
  }

  /**
   * @dev Gets the token name
   * @return string representing the token name
   */
  function name() external view returns (string) {
    return name_;
  }

  /**
   * @dev Gets the token symbol
   * @return string representing the token symbol
   */
  function symbol() external view returns (string) {
    return symbol_;
  }

  /**
   * @dev Returns an URI for a given token ID
   * Throws if the token ID does not exist. May return an empty string.
   * @param _tokenId uint256 ID of the token to query
   */
  function tokenURI(uint256 _tokenId) public view returns (string) {
    require(exists(_tokenId));
    return tokenURIs[_tokenId];
  }

  /**
   * @dev Gets the token ID at a given index of the tokens list of the requested owner
   * @param _owner address owning the tokens list to be accessed
   * @param _index uint256 representing the index to be accessed of the requested tokens list
   * @return uint256 token ID at the given index of the tokens list owned by the requested address
   */
  function tokenOfOwnerByIndex(
    address _owner,
    uint256 _index
  )
    public
    view
    returns (uint256)
  {
    require(_index < balanceOf(_owner));
    return ownedTokens[_owner][_index];
  }

  /**
   * @dev Gets the total amount of tokens stored by the contract
   * @return uint256 representing the total amount of tokens
   */
  function totalSupply() public view returns (uint256) {
    return allTokens.length;
  }

  /**
   * @dev Gets the token ID at a given index of all the tokens in this contract
   * Reverts if the index is greater or equal to the total number of tokens
   * @param _index uint256 representing the index to be accessed of the tokens list
   * @return uint256 token ID at the given index of the tokens list
   */
  function tokenByIndex(uint256 _index) public view returns (uint256) {
    require(_index < totalSupply());
    return allTokens[_index];
  }

  /**
   * @dev Internal function to set the token URI for a given token
   * Reverts if the token ID does not exist
   * @param _tokenId uint256 ID of the token to set its URI
   * @param _uri string URI to assign
   */
  function _setTokenURI(uint256 _tokenId, string _uri) internal {
    require(exists(_tokenId));
    tokenURIs[_tokenId] = _uri;
  }

  /**
   * @dev Internal function to add a token ID to the list of a given address
   * @param _to address representing the new owner of the given token ID
   * @param _tokenId uint256 ID of the token to be added to the tokens list of the given address
   */
  function addTokenTo(address _to, uint256 _tokenId) internal {
    super.addTokenTo(_to, _tokenId);
    uint256 length = ownedTokens[_to].length;
    ownedTokens[_to].push(_tokenId);
    ownedTokensIndex[_tokenId] = length;
  }

  /**
   * @dev Internal function to remove a token ID from the list of a given address
   * @param _from address representing the previous owner of the given token ID
   * @param _tokenId uint256 ID of the token to be removed from the tokens list of the given address
   */
  function removeTokenFrom(address _from, uint256 _tokenId) internal {
    super.removeTokenFrom(_from, _tokenId);

    uint256 tokenIndex = ownedTokensIndex[_tokenId];
    uint256 lastTokenIndex = ownedTokens[_from].length.sub(1);
    uint256 lastToken = ownedTokens[_from][lastTokenIndex];

    ownedTokens[_from][tokenIndex] = lastToken;
    ownedTokens[_from][lastTokenIndex] = 0;
    // Note that this will handle single-element arrays. In that case, both tokenIndex and lastTokenIndex are going to
    // be zero. Then we can make sure that we will remove _tokenId from the ownedTokens list since we are first swapping
    // the lastToken to the first position, and then dropping the element placed in the last position of the list

    ownedTokens[_from].length--;
    ownedTokensIndex[_tokenId] = 0;
    ownedTokensIndex[lastToken] = tokenIndex;
  }

  /**
   * @dev Internal function to mint a new token
   * Reverts if the given token ID already exists
   * @param _to address the beneficiary that will own the minted token
   * @param _tokenId uint256 ID of the token to be minted by the msg.sender
   */
  function _mint(address _to, uint256 _tokenId) internal {
    super._mint(_to, _tokenId);

    allTokensIndex[_tokenId] = allTokens.length;
    allTokens.push(_tokenId);
  }

  /**
   * @dev Internal function to burn a specific token
   * Reverts if the token does not exist
   * @param _owner owner of the token to burn
   * @param _tokenId uint256 ID of the token being burned by the msg.sender
   */
  function _burn(address _owner, uint256 _tokenId) internal {
    super._burn(_owner, _tokenId);

    // Clear metadata (if any)
    if (bytes(tokenURIs[_tokenId]).length != 0) {
      delete tokenURIs[_tokenId];
    }

    // Reorg all tokens array
    uint256 tokenIndex = allTokensIndex[_tokenId];
    uint256 lastTokenIndex = allTokens.length.sub(1);
    uint256 lastToken = allTokens[lastTokenIndex];

    allTokens[tokenIndex] = lastToken;
    allTokens[lastTokenIndex] = 0;

    allTokens.length--;
    allTokensIndex[_tokenId] = 0;
    allTokensIndex[lastToken] = tokenIndex;
  }

}

// File: zeppelin-solidity/contracts/ownership/Ownable.sol

pragma solidity ^0.4.24;


/**
 * @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;


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


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    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 relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

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

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

// File: contracts/helpers/Admin.sol

pragma solidity ^0.4.24;


/**
 * @title Ownable
 * @dev The Ownable contract has an admin address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Admin {
  mapping (address => bool) public admins;


  event AdminshipRenounced(address indexed previousAdmin);
  event AdminshipTransferred(
    address indexed previousAdmin,
    address indexed newAdmin
  );


  /**
   * @dev The Ownable constructor sets the original `admin` of the contract to the sender
   * account.
   */
  constructor() public {
    admins[msg.sender] = true;
  }

  /**
   * @dev Throws if called by any account other than the admin.
   */
  modifier onlyAdmin() {
    require(admins[msg.sender]);
    _;
  }

  function isAdmin(address _admin) public view returns(bool) {
    return admins[_admin];
  }

  /**
   * @dev Allows the current admin to relinquish control of the contract.
   * @notice Renouncing to adminship will leave the contract without an admin.
   * It will not be possible to call the functions with the `onlyAdmin`
   * modifier anymore.
   */
  function renounceAdminship(address _previousAdmin) public onlyAdmin {
    emit AdminshipRenounced(_previousAdmin);
    admins[_previousAdmin] = false;
  }

  /**
   * @dev Allows the current admin to transfer control of the contract to a newAdmin.
   * @param _newAdmin The address to transfer adminship to.
   */
  function transferAdminship(address _newAdmin) public onlyAdmin {
    _transferAdminship(_newAdmin);
  }

  /**
   * @dev Transfers control of the contract to a newAdmin.
   * @param _newAdmin The address to transfer adminship to.
   */
  function _transferAdminship(address _newAdmin) internal {
    require(_newAdmin != address(0));
    emit AdminshipTransferred(msg.sender, _newAdmin);
    admins[_newAdmin] = true;
  }
}

// File: contracts/helpers/strings.sol

/*
 * @title String & slice utility library for Solidity contracts.
 * @author Nick Johnson <[email protected]>
 *
 * @dev Functionality in this library is largely implemented using an
 *      abstraction called a 'slice'. A slice represents a part of a string -
 *      anything from the entire string to a single character, or even no
 *      characters at all (a 0-length slice). Since a slice only has to specify
 *      an offset and a length, copying and manipulating slices is a lot less
 *      expensive than copying and manipulating the strings they reference.
 *
 *      To further reduce gas costs, most functions on slice that need to return
 *      a slice modify the original one instead of allocating a new one; for
 *      instance, `s.split(".")` will return the text up to the first '.',
 *      modifying s to only contain the remainder of the string after the '.'.
 *      In situations where you do not want to modify the original slice, you
 *      can make a copy first with `.copy()`, for example:
 *      `s.copy().split(".")`. Try and avoid using this idiom in loops; since
 *      Solidity has no memory management, it will result in allocating many
 *      short-lived slices that are later discarded.
 *
 *      Functions that return two slices come in two versions: a non-allocating
 *      version that takes the second slice as an argument, modifying it in
 *      place, and an allocating version that allocates and returns the second
 *      slice; see `nextRune` for example.
 *
 *      Functions that have to copy string data will return strings rather than
 *      slices; these can be cast back to slices for further processing if
 *      required.
 *
 *      For convenience, some functions are provided with non-modifying
 *      variants that create a new slice and return both; for instance,
 *      `s.splitNew('.')` leaves s unmodified, and returns two values
 *      corresponding to the left and right parts of the string.
 */

pragma solidity ^0.4.14;

library strings {
    struct slice {
        uint _len;
        uint _ptr;
    }

    function memcpy(uint dest, uint src, uint len) private pure{
        // Copy word-length chunks while possible
        for(; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        // Copy remaining bytes
        uint mask = 256 ** (32 - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

    /*
     * @dev Returns a slice containing the entire string.
     * @param self The string to make a slice from.
     * @return A newly allocated slice containing the entire string.
     */
    function toSlice(string self) internal pure returns (slice) {
        uint ptr;
        assembly {
            ptr := add(self, 0x20)
        }
        return slice(bytes(self).length, ptr);
    }

    /*
     * @dev Returns the length of a null-terminated bytes32 string.
     * @param self The value to find the length of.
     * @return The length of the string, from 0 to 32.
     */
    function len(bytes32 self) internal pure returns (uint) {
        uint ret;
        if (self == 0)
            return 0;
        if (self & 0xffffffffffffffffffffffffffffffff == 0) {
            ret += 16;
            self = bytes32(uint(self) / 0x100000000000000000000000000000000);
        }
        if (self & 0xffffffffffffffff == 0) {
            ret += 8;
            self = bytes32(uint(self) / 0x10000000000000000);
        }
        if (self & 0xffffffff == 0) {
            ret += 4;
            self = bytes32(uint(self) / 0x100000000);
        }
        if (self & 0xffff == 0) {
            ret += 2;
            self = bytes32(uint(self) / 0x10000);
        }
        if (self & 0xff == 0) {
            ret += 1;
        }
        return 32 - ret;
    }

    /*
     * @dev Returns a slice containing the entire bytes32, interpreted as a
     *      null-termintaed utf-8 string.
     * @param self The bytes32 value to convert to a slice.
     * @return A new slice containing the value of the input argument up to the
     *         first null.
     */
    function toSliceB32(bytes32 self) internal pure returns (slice ret) {
        // Allocate space for `self` in memory, copy it there, and point ret at it
        assembly {
            let ptr := mload(0x40)
            mstore(0x40, add(ptr, 0x20))
            mstore(ptr, self)
            mstore(add(ret, 0x20), ptr)
        }
        ret._len = len(self);
    }

    /*
     * @dev Returns a new slice containing the same data as the current slice.
     * @param self The slice to copy.
     * @return A new slice containing the same data as `self`.
     */
    function copy(slice self) internal pure returns (slice) {
        return slice(self._len, self._ptr);
    }

    /*
     * @dev Copies a slice to a new string.
     * @param self The slice to copy.
     * @return A newly allocated string containing the slice's text.
     */
    function toString(slice self) internal pure returns (string) {
        var ret = new string(self._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        memcpy(retptr, self._ptr, self._len);
        return ret;
    }

    /*
     * @dev Returns the length in runes of the slice. Note that this operation
     *      takes time proportional to the length of the slice; avoid using it
     *      in loops, and call `slice.empty()` if you only need to know whether
     *      the slice is empty or not.
     * @param self The slice to operate on.
     * @return The length of the slice in runes.
     */
    function len(slice self) internal pure returns (uint l) {
        // Starting at ptr-31 means the LSB will be the byte we care about
        var ptr = self._ptr - 31;
        var end = ptr + self._len;
        for (l = 0; ptr < end; l++) {
            uint8 b;
            assembly { b := and(mload(ptr), 0xFF) }
            if (b < 0x80) {
                ptr += 1;
            } else if(b < 0xE0) {
                ptr += 2;
            } else if(b < 0xF0) {
                ptr += 3;
            } else if(b < 0xF8) {
                ptr += 4;
            } else if(b < 0xFC) {
                ptr += 5;
            } else {
                ptr += 6;
            }
        }
    }

    /*
     * @dev Returns true if the slice is empty (has a length of 0).
     * @param self The slice to operate on.
     * @return True if the slice is empty, False otherwise.
     */
    function empty(slice self) internal pure returns (bool) {
        return self._len == 0;
    }

    /*
     * @dev Returns a positive number if `other` comes lexicographically after
     *      `self`, a negative number if it comes before, or zero if the
     *      contents of the two slices are equal. Comparison is done per-rune,
     *      on unicode codepoints.
     * @param self The first slice to compare.
     * @param other The second slice to compare.
     * @return The result of the comparison.
     */
    function compare(slice self, slice other) internal pure returns (int) {
        uint shortest = self._len;
        if (other._len < self._len)
            shortest = other._len;

        var selfptr = self._ptr;
        var otherptr = other._ptr;
        for (uint idx = 0; idx < shortest; idx += 32) {
            uint a;
            uint b;
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }
            if (a != b) {
                // Mask out irrelevant bytes and check again
                uint mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                var diff = (a & mask) - (b & mask);
                if (diff != 0)
                    return int(diff);
            }
            selfptr += 32;
            otherptr += 32;
        }
        return int(self._len) - int(other._len);
    }

    /*
     * @dev Returns true if the two slices contain the same text.
     * @param self The first slice to compare.
     * @param self The second slice to compare.
     * @return True if the slices are equal, false otherwise.
     */
    function equals(slice self, slice other) internal pure returns (bool) {
        return compare(self, other) == 0;
    }

    /*
     * @dev Extracts the first rune in the slice into `rune`, advancing the
     *      slice to point to the next rune and returning `self`.
     * @param self The slice to operate on.
     * @param rune The slice that will contain the first rune.
     * @return `rune`.
     */
    function nextRune(slice self, slice rune) internal pure returns (slice) {
        rune._ptr = self._ptr;

        if (self._len == 0) {
            rune._len = 0;
            return rune;
        }

        uint len;
        uint b;
        // Load the first byte of the rune into the LSBs of b
        assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
        if (b < 0x80) {
            len = 1;
        } else if(b < 0xE0) {
            len = 2;
        } else if(b < 0xF0) {
            len = 3;
        } else {
            len = 4;
        }

        // Check for truncated codepoints
        if (len > self._len) {
            rune._len = self._len;
            self._ptr += self._len;
            self._len = 0;
            return rune;
        }

        self._ptr += len;
        self._len -= len;
        rune._len = len;
        return rune;
    }

    /*
     * @dev Returns the first rune in the slice, advancing the slice to point
     *      to the next rune.
     * @param self The slice to operate on.
     * @return A slice containing only the first rune from `self`.
     */
    function nextRune(slice self) internal pure returns (slice ret) {
        nextRune(self, ret);
    }

    /*
     * @dev Returns the number of the first codepoint in the slice.
     * @param self The slice to operate on.
     * @return The number of the first codepoint in the slice.
     */
    function ord(slice self) internal pure returns (uint ret) {
        if (self._len == 0) {
            return 0;
        }

        uint word;
        uint length;
        uint divisor = 2 ** 248;

        // Load the rune into the MSBs of b
        assembly { word:= mload(mload(add(self, 32))) }
        var b = word / divisor;
        if (b < 0x80) {
            ret = b;
            length = 1;
        } else if(b < 0xE0) {
            ret = b & 0x1F;
            length = 2;
        } else if(b < 0xF0) {
            ret = b & 0x0F;
            length = 3;
        } else {
            ret = b & 0x07;
            length = 4;
        }

        // Check for truncated codepoints
        if (length > self._len) {
            return 0;
        }

        for (uint i = 1; i < length; i++) {
            divisor = divisor / 256;
            b = (word / divisor) & 0xFF;
            if (b & 0xC0 != 0x80) {
                // Invalid UTF-8 sequence
                return 0;
            }
            ret = (ret * 64) | (b & 0x3F);
        }

        return ret;
    }

    /*
     * @dev Returns the keccak-256 hash of the slice.
     * @param self The slice to hash.
     * @return The hash of the slice.
     */
    function keccak(slice self) internal pure returns (bytes32 ret) {
        assembly {
            ret := keccak256(mload(add(self, 32)), mload(self))
        }
    }

    /*
     * @dev Returns true if `self` starts with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function startsWith(slice self, slice needle) internal pure returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        if (self._ptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let length := mload(needle)
            let selfptr := mload(add(self, 0x20))
            let needleptr := mload(add(needle, 0x20))
            equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
        }
        return equal;
    }

    /*
     * @dev If `self` starts with `needle`, `needle` is removed from the
     *      beginning of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function beyond(slice self, slice needle) internal pure returns (slice) {
        if (self._len < needle._len) {
            return self;
        }

        bool equal = true;
        if (self._ptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let selfptr := mload(add(self, 0x20))
                let needleptr := mload(add(needle, 0x20))
                equal := eq(sha3(selfptr, length), sha3(needleptr, length))
            }
        }

        if (equal) {
            self._len -= needle._len;
            self._ptr += needle._len;
        }

        return self;
    }

    /*
     * @dev Returns true if the slice ends with `needle`.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return True if the slice starts with the provided text, false otherwise.
     */
    function endsWith(slice self, slice needle) internal pure returns (bool) {
        if (self._len < needle._len) {
            return false;
        }

        var selfptr = self._ptr + self._len - needle._len;

        if (selfptr == needle._ptr) {
            return true;
        }

        bool equal;
        assembly {
            let length := mload(needle)
            let needleptr := mload(add(needle, 0x20))
            equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
        }

        return equal;
    }

    /*
     * @dev If `self` ends with `needle`, `needle` is removed from the
     *      end of `self`. Otherwise, `self` is unmodified.
     * @param self The slice to operate on.
     * @param needle The slice to search for.
     * @return `self`
     */
    function until(slice self, slice needle) internal pure returns (slice) {
        if (self._len < needle._len) {
            return self;
        }

        var selfptr = self._ptr + self._len - needle._len;
        bool equal = true;
        if (selfptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let needleptr := mload(add(needle, 0x20))
                equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
            }
        }

        if (equal) {
            self._len -= needle._len;
        }

        return self;
    }

    // Returns the memory address of the first byte of the first occurrence of
    // `needle` in `self`, or the first byte after `self` if not found.
    function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) {
        uint ptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                // Optimized assembly for 68 gas per byte on short strings
                assembly {
                    let mask := not(sub(exp(2, mul(8, sub(32, needlelen))), 1))
                    let needledata := and(mload(needleptr), mask)
                    let end := add(selfptr, sub(selflen, needlelen))
                    ptr := selfptr
                    loop:
                    jumpi(exit, eq(and(mload(ptr), mask), needledata))
                    ptr := add(ptr, 1)
                    jumpi(loop, lt(sub(ptr, 1), end))
                    ptr := add(selfptr, selflen)
                    exit:
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := sha3(needleptr, needlelen) }
                ptr = selfptr;
                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := sha3(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    // Returns the memory address of the first byte after the last occurrence of
    // `needle` in `self`, or the address of `self` if not found.
    function rfindPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private returns (uint) {
        uint ptr;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                // Optimized assembly for 69 gas per byte on short strings
                assembly {
                    let mask := not(sub(exp(2, mul(8, sub(32, needlelen))), 1))
                    let needledata := and(mload(needleptr), mask)
                    ptr := add(selfptr, sub(selflen, needlelen))
                    loop:
                    jumpi(ret, eq(and(mload(ptr), mask), needledata))
                    ptr := sub(ptr, 1)
                    jumpi(loop, gt(add(ptr, 1), selfptr))
                    ptr := selfptr
                    jump(exit)
                    ret:
                    ptr := add(ptr, needlelen)
                    exit:
                }
                return ptr;
            } else {
                // For long needles, use hashing
                bytes32 hash;
                assembly { hash := sha3(needleptr, needlelen) }
                ptr = selfptr + (selflen - needlelen);
                while (ptr >= selfptr) {
                    bytes32 testHash;
                    assembly { testHash := sha3(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr + needlelen;
                    ptr -= 1;
                }
            }
        }
        return selfptr;
    }

    /*
     * @dev Modifies `self` to contain everything from the first occurrence of
     *      `needle` to the end of the slice. `self` is set to the empty slice
     *      if `needle` is not found.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function find(slice self, slice needle) internal returns (slice) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len -= ptr - self._ptr;
        self._ptr = ptr;
        return self;
    }

    /*
     * @dev Modifies `self` to contain the part of the string from the start of
     *      `self` to the end of the first occurrence of `needle`. If `needle`
     *      is not found, `self` is set to the empty slice.
     * @param self The slice to search and modify.
     * @param needle The text to search for.
     * @return `self`.
     */
    function rfind(slice self, slice needle) internal returns (slice) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        self._len = ptr - self._ptr;
        return self;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and `token` to everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function split(slice self, slice needle, slice token) internal returns (slice) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = self._ptr;
        token._len = ptr - self._ptr;
        if (ptr == self._ptr + self._len) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
            self._ptr = ptr + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything after the first
     *      occurrence of `needle`, and returning everything before it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` up to the first occurrence of `delim`.
     */
    function split(slice self, slice needle) internal returns (slice token) {
        split(self, needle, token);
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and `token` to everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and `token` is set to the entirety of `self`.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @param token An output parameter to which the first token is written.
     * @return `token`.
     */
    function rsplit(slice self, slice needle, slice token) internal returns (slice) {
        uint ptr = rfindPtr(self._len, self._ptr, needle._len, needle._ptr);
        token._ptr = ptr;
        token._len = self._len - (ptr - self._ptr);
        if (ptr == self._ptr) {
            // Not found
            self._len = 0;
        } else {
            self._len -= token._len + needle._len;
        }
        return token;
    }

    /*
     * @dev Splits the slice, setting `self` to everything before the last
     *      occurrence of `needle`, and returning everything after it. If
     *      `needle` does not occur in `self`, `self` is set to the empty slice,
     *      and the entirety of `self` is returned.
     * @param self The slice to split.
     * @param needle The text to search for in `self`.
     * @return The part of `self` after the last occurrence of `delim`.
     */
    function rsplit(slice self, slice needle) internal returns (slice token) {
        rsplit(self, needle, token);
    }

    /*
     * @dev Counts the number of nonoverlapping occurrences of `needle` in `self`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return The number of occurrences of `needle` found in `self`.
     */
    function count(slice self, slice needle) internal returns (uint cnt) {
        uint ptr = findPtr(self._len, self._ptr, needle._len, needle._ptr) + needle._len;
        while (ptr <= self._ptr + self._len) {
            cnt++;
            ptr = findPtr(self._len - (ptr - self._ptr), ptr, needle._len, needle._ptr) + needle._len;
        }
    }

    /*
     * @dev Returns True if `self` contains `needle`.
     * @param self The slice to search.
     * @param needle The text to search for in `self`.
     * @return True if `needle` is found in `self`, false otherwise.
     */
    function contains(slice self, slice needle) internal returns (bool) {
        return rfindPtr(self._len, self._ptr, needle._len, needle._ptr) != self._ptr;
    }

    /*
     * @dev Returns a newly allocated string containing the concatenation of
     *      `self` and `other`.
     * @param self The first slice to concatenate.
     * @param other The second slice to concatenate.
     * @return The concatenation of the two strings.
     */
    function concat(slice self, slice other) internal pure returns (string) {
        var ret = new string(self._len + other._len);
        uint retptr;
        assembly { retptr := add(ret, 32) }
        memcpy(retptr, self._ptr, self._len);
        memcpy(retptr + self._len, other._ptr, other._len);
        return ret;
    }

    /*
     * @dev Joins an array of slices, using `self` as a delimiter, returning a
     *      newly allocated string.
     * @param self The delimiter to use.
     * @param parts A list of slices to join.
     * @return A newly allocated string containing all the slices in `parts`,
     *         joined with `self`.
     */
    function join(slice self, slice[] parts) internal pure returns (string) {
        if (parts.length == 0)
            return "";

        uint length = self._len * (parts.length - 1);
        for(uint i = 0; i < parts.length; i++)
            length += parts[i]._len;

        var ret = new string(length);
        uint retptr;
        assembly { retptr := add(ret, 32) }

        for(i = 0; i < parts.length; i++) {
            memcpy(retptr, parts[i]._ptr, parts[i]._len);
            retptr += parts[i]._len;
            if (i < parts.length - 1) {
                memcpy(retptr, self._ptr, self._len);
                retptr += self._len;
            }
        }

        return ret;
    }
}

// File: contracts/CloversMetadata.sol

pragma solidity ^0.4.18;

/**
* CloversMetadata contract is upgradeable and returns metadata about Clovers
*/



contract CloversMetadata {
    using strings for *;

    function tokenURI(uint _tokenId) public view returns (string _infoUrl) {
        string memory base = "https://api2.clovers.network/clovers/metadata/0x";
        string memory id = uint2hexstr(_tokenId);
        string memory suffix = "";
        return base.toSlice().concat(id.toSlice()).toSlice().concat(suffix.toSlice());
    }
    function uint2hexstr(uint i) internal pure returns (string) {
        if (i == 0) return "0";
        uint j = i;
        uint length;
        while (j != 0) {
            length++;
            j = j >> 4;
        }
        uint mask = 15;
        bytes memory bstr = new bytes(length);
        uint k = length - 1;
        while (i != 0){
            uint curr = (i & mask);
            bstr[k--] = curr > 9 ? byte(55 + curr) : byte(48 + curr); // 55 = 65 - 10
            i = i >> 4;
        }
        return string(bstr);
    }
}

// File: contracts/Clovers.sol

pragma solidity ^0.4.18;

/**
 * Digital Asset Registry for the Non Fungible Token Clover
 * with upgradeable contract reference for returning metadata.
 */







contract Clovers is ERC721Token, Admin, Ownable {

    address public cloversMetadata;
    uint256 public totalSymmetries;
    uint256[5] symmetries; // RotSym, Y0Sym, X0Sym, XYSym, XnYSym
    address public cloversController;
    address public clubTokenController;

    mapping (uint256 => Clover) public clovers;
    struct Clover {
        bool keep;
        uint256 symmetries;
        bytes28[2] cloverMoves;
        uint256 blockMinted;
        uint256 rewards;
    }

    modifier onlyOwnerOrController() {
        require(
            msg.sender == cloversController ||
            owner == msg.sender ||
            admins[msg.sender]
        );
        _;
    }


    /**
    * @dev Checks msg.sender can transfer a token, by being owner, approved, operator or cloversController
    * @param _tokenId uint256 ID of the token to validate
    */
    modifier canTransfer(uint256 _tokenId) {
        require(isApprovedOrOwner(msg.sender, _tokenId) || msg.sender == cloversController);
        _;
    }

    constructor(string name, string symbol) public
        ERC721Token(name, symbol)
    { }

    function () public payable {}

    function implementation() public view returns (address) {
        return cloversMetadata;
    }

    function tokenURI(uint _tokenId) public view returns (string _infoUrl) {
        return CloversMetadata(cloversMetadata).tokenURI(_tokenId);
    }
    function getHash(bytes28[2] moves) public pure returns (bytes32) {
        return keccak256(moves);
    }
    function getKeep(uint256 _tokenId) public view returns (bool) {
        return clovers[_tokenId].keep;
    }
    function getBlockMinted(uint256 _tokenId) public view returns (uint256) {
        return clovers[_tokenId].blockMinted;
    }
    function getCloverMoves(uint256 _tokenId) public view returns (bytes28[2]) {
        return clovers[_tokenId].cloverMoves;
    }
    function getReward(uint256 _tokenId) public view returns (uint256) {
        return clovers[_tokenId].rewards;
    }
    function getSymmetries(uint256 _tokenId) public view returns (uint256) {
        return clovers[_tokenId].symmetries;
    }
    function getAllSymmetries() public view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
        return (
            totalSymmetries,
            symmetries[0], //RotSym,
            symmetries[1], //Y0Sym,
            symmetries[2], //X0Sym,
            symmetries[3], //XYSym,
            symmetries[4] //XnYSym
        );
    }

/* ---------------------------------------------------------------------------------------------------------------------- */

    /**
    * @dev Moves Eth to a certain address for use in the CloversController
    * @param _to The address to receive the Eth.
    * @param _amount The amount of Eth to be transferred.
    */
    function moveEth(address _to, uint256 _amount) public onlyOwnerOrController {
        require(_amount <= this.balance);
        _to.transfer(_amount);
    }
    /**
    * @dev Moves Token to a certain address for use in the CloversController
    * @param _to The address to receive the Token.
    * @param _amount The amount of Token to be transferred.
    * @param _token The address of the Token to be transferred.
    */
    function moveToken(address _to, uint256 _amount, address _token) public onlyOwnerOrController returns (bool) {
        require(_amount <= ERC20(_token).balanceOf(this));
        return ERC20(_token).transfer(_to, _amount);
    }
    /**
    * @dev Approves Tokens to a certain address for use in the CloversController
    * @param _to The address to receive the Token approval.
    * @param _amount The amount of Token to be approved.
    * @param _token The address of the Token to be approved.
    */
    function approveToken(address _to, uint256 _amount, address _token) public onlyOwnerOrController returns (bool) {
        return ERC20(_token).approve(_to, _amount);
    }

    /**
    * @dev Sets whether the minter will keep the clover
    * @param _tokenId The token Id.
    * @param value Whether the clover will be kept.
    */
    function setKeep(uint256 _tokenId, bool value) public onlyOwnerOrController {
        clovers[_tokenId].keep = value;
    }
    function setBlockMinted(uint256 _tokenId, uint256 value) public onlyOwnerOrController {
        clovers[_tokenId].blockMinted = value;
    }
    function setCloverMoves(uint256 _tokenId, bytes28[2] moves) public onlyOwnerOrController {
        clovers[_tokenId].cloverMoves = moves;
    }
    function setReward(uint256 _tokenId, uint256 _amount) public onlyOwnerOrController {
        clovers[_tokenId].rewards = _amount;
    }
    function setSymmetries(uint256 _tokenId, uint256 _symmetries) public onlyOwnerOrController {
        clovers[_tokenId].symmetries = _symmetries;
    }

    /**
    * @dev Sets total tallies of symmetry counts. For use by the controller to correct for invalid Clovers.
    * @param _totalSymmetries The total number of Symmetries.
    * @param RotSym The total number of RotSym Symmetries.
    * @param Y0Sym The total number of Y0Sym Symmetries.
    * @param X0Sym The total number of X0Sym Symmetries.
    * @param XYSym The total number of XYSym Symmetries.
    * @param XnYSym The total number of XnYSym Symmetries.
    */
    function setAllSymmetries(uint256 _totalSymmetries, uint256 RotSym, uint256 Y0Sym, uint256 X0Sym, uint256 XYSym, uint256 XnYSym) public onlyOwnerOrController {
        totalSymmetries = _totalSymmetries;
        symmetries[0] = RotSym;
        symmetries[1] = Y0Sym;
        symmetries[2] = X0Sym;
        symmetries[3] = XYSym;
        symmetries[4] = XnYSym;
    }

    /**
    * @dev Deletes data about a Clover.
    * @param _tokenId The Id of the clover token to be deleted.
    */
    function deleteClover(uint256 _tokenId) public onlyOwnerOrController {
        delete(clovers[_tokenId]);
        unmint(_tokenId);
    }
    /**
    * @dev Updates the CloversController contract address and approves that contract to manage the Clovers owned by the Clovers contract.
    * @param _cloversController The address of the new contract.
    */
    function updateCloversControllerAddress(address _cloversController) public onlyOwner {
        require(_cloversController != 0);
        cloversController = _cloversController;
    }



    /**
    * @dev Updates the CloversMetadata contract address.
    * @param _cloversMetadata The address of the new contract.
    */
    function updateCloversMetadataAddress(address _cloversMetadata) public onlyOwner {
        require(_cloversMetadata != 0);
        cloversMetadata = _cloversMetadata;
    }

    function updateClubTokenController(address _clubTokenController) public onlyOwner {
        require(_clubTokenController != 0);
        clubTokenController = _clubTokenController;
    }

    /**
    * @dev Mints new Clovers.
    * @param _to The address of the new clover owner.
    * @param _tokenId The Id of the new clover token.
    */
    function mint (address _to, uint256 _tokenId) public onlyOwnerOrController {
        super._mint(_to, _tokenId);
        setApprovalForAll(clubTokenController, true);
    }


    function mintMany(address[] _tos, uint256[] _tokenIds, bytes28[2][] memory _movess, uint256[] _symmetries) public onlyAdmin {
        require(_tos.length == _tokenIds.length && _tokenIds.length == _movess.length && _movess.length == _symmetries.length);
        for (uint256 i = 0; i < _tos.length; i++) {
            address _to = _tos[i];
            uint256 _tokenId = _tokenIds[i];
            bytes28[2] memory _moves = _movess[i];
            uint256 _symmetry = _symmetries[i];
            setCloverMoves(_tokenId, _moves);
            if (_symmetry > 0) {
                setSymmetries(_tokenId, _symmetry);
            }
            super._mint(_to, _tokenId);
            setApprovalForAll(clubTokenController, true);
        }
    }

    /**
    * @dev Unmints Clovers.
    * @param _tokenId The Id of the clover token to be destroyed.
    */
    function unmint (uint256 _tokenId) public onlyOwnerOrController {
        super._burn(ownerOf(_tokenId), _tokenId);
    }


}

// File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol

pragma solidity ^0.4.24;




/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is ERC20Basic {
  using SafeMath for uint256;

  mapping(address => uint256) balances;

  uint256 totalSupply_;

  /**
  * @dev Total number of tokens in existence
  */
  function totalSupply() public view returns (uint256) {
    return totalSupply_;
  }

  /**
  * @dev Transfer token for a specified address
  * @param _to The address to transfer to.
  * @param _value The amount to be transferred.
  */
  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;
  }

  /**
  * @dev Gets the balance of the specified address.
  * @param _owner The address to query the the balance of.
  * @return An uint256 representing the amount owned by the passed address.
  */
  function balanceOf(address _owner) public view returns (uint256) {
    return balances[_owner];
  }

}

// File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol

pragma solidity ^0.4.24;




/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * https://github.com/ethereum/EIPs/issues/20
 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20, BasicToken {

  mapping (address => mapping (address => uint256)) internal allowed;


  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  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;
  }

  /**
   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
   * Beware that changing an allowance with this method brings the risk that someone may use both the old
   * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
   * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint256 _value) public returns (bool) {
    allowed[msg.sender][_spender] = _value;
    emit Approval(msg.sender, _spender, _value);
    return true;
  }

  /**
   * @dev Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(
    address _owner,
    address _spender
   )
    public
    view
    returns (uint256)
  {
    return allowed[_owner][_spender];
  }

  /**
   * @dev Increase the amount of tokens that an owner allowed to a spender.
   * approve should be called when allowed[_spender] == 0. To increment
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   * @param _spender The address which will spend the funds.
   * @param _addedValue The amount of tokens to increase the allowance by.
   */
  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;
  }

  /**
   * @dev Decrease the amount of tokens that an owner allowed to a spender.
   * approve should be called when allowed[_spender] == 0. To decrement
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   * @param _spender The address which will spend the funds.
   * @param _subtractedValue The amount of tokens to decrease the allowance by.
   */
  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;
  }

}

// File: zeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol

pragma solidity ^0.4.24;



/**
 * @title DetailedERC20 token
 * @dev The decimals are only for visualization purposes.
 * All the operations are done using the smallest and indivisible token unit,
 * just as on Ethereum all the operations are done in wei.
 */
contract DetailedERC20 is ERC20 {
  string public name;
  string public symbol;
  uint8 public decimals;

  constructor(string _name, string _symbol, uint8 _decimals) public {
    name = _name;
    symbol = _symbol;
    decimals = _decimals;
  }
}

// File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol

pragma solidity ^0.4.24;




/**
 * @title Mintable token
 * @dev Simple ERC20 Token example, with mintable token creation
 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
 */
contract MintableToken is StandardToken, Ownable {
  event Mint(address indexed to, uint256 amount);
  event MintFinished();

  bool public mintingFinished = false;


  modifier canMint() {
    require(!mintingFinished);
    _;
  }

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

  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
  function mint(
    address _to,
    uint256 _amount
  )
    hasMintPermission
    canMint
    public
    returns (bool)
  {
    totalSupply_ = totalSupply_.add(_amount);
    balances[_to] = balances[_to].add(_amount);
    emit Mint(_to, _amount);
    emit Transfer(address(0), _to, _amount);
    return true;
  }

  /**
   * @dev Function to stop minting new tokens.
   * @return True if the operation was successful.
   */
  function finishMinting() onlyOwner canMint public returns (bool) {
    mintingFinished = true;
    emit MintFinished();
    return true;
  }
}

// File: zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol

pragma solidity ^0.4.24;



/**
 * @title Burnable Token
 * @dev Token that can be irreversibly burned (destroyed).
 */
contract BurnableToken is BasicToken {

  event Burn(address indexed burner, uint256 value);

  /**
   * @dev Burns a specific amount of tokens.
   * @param _value The amount of token to be burned.
   */
  function burn(uint256 _value) public {
    _burn(msg.sender, _value);
  }

  function _burn(address _who, uint256 _value) internal {
    require(_value <= balances[_who]);
    // no need to require value <= totalSupply, since that would imply the
    // sender's balance is greater than the totalSupply, which *should* be an assertion failure

    balances[_who] = balances[_who].sub(_value);
    totalSupply_ = totalSupply_.sub(_value);
    emit Burn(_who, _value);
    emit Transfer(_who, address(0), _value);
  }
}

// File: contracts/ClubToken.sol

pragma solidity ^0.4.18;

/**
 * ClubToken adheres to ERC20
 * it is a continuously mintable token administered by CloversController/ClubTokenController
 */





contract ClubToken is StandardToken, DetailedERC20, MintableToken, BurnableToken {

    address public cloversController;
    address public clubTokenController;

    modifier hasMintPermission() {
      require(
          msg.sender == clubTokenController ||
          msg.sender == cloversController ||
          msg.sender == owner
      );
      _;
    }

    /**
    * @dev constructor for the ClubTokens contract
    * @param _name The name of the token
    * @param _symbol The symbol of the token
    * @param _decimals The decimals of the token
    */
    constructor(string _name, string _symbol, uint8 _decimals) public
        DetailedERC20(_name, _symbol, _decimals)
    {}

    function () public payable {}

    function updateClubTokenControllerAddress(address _clubTokenController) public onlyOwner {
        require(_clubTokenController != 0);
        clubTokenController = _clubTokenController;
    }

    function updateCloversControllerAddress(address _cloversController) public onlyOwner {
        require(_cloversController != 0);
        cloversController = _cloversController;
    }


      /**
       * @dev Transfer tokens from one address to another
       * @param _from address The address which you want to send tokens from
       * @param _to address The address which you want to transfer to
       * @param _value uint256 the amount of tokens to be transferred
       */
      function transferFrom(
        address _from,
        address _to,
        uint256 _value
      )
        public
        returns (bool)
      {
        require(_to != address(0));
        require(_value <= balances[_from]);
        if (msg.sender != cloversController && msg.sender != clubTokenController) {
            require(_value <= allowed[_from][msg.sender]);
            allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        }
        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        emit Transfer(_from, _to, _value);
        return true;
      }

    /**
     * @dev Burns a specific amount of tokens.
     * @param _value The amount of token to be burned.
     * NOTE: Disabled as tokens should not be burned under circumstances beside selling tokens.
     */
    function burn(uint256 _value) public {
        _value;
        revert();
    }

    /**
     * @dev Burns a specific amount of tokens.
     * @param _burner The address of the token holder burning their tokens.
     * @param _value The amount of token to be burned.
     */
    function burn(address _burner, uint256 _value) public hasMintPermission {
      _burn(_burner, _value);
    }

    /**
    * @dev Moves Eth to a certain address for use in the ClubTokenController
    * @param _to The address to receive the Eth.
    * @param _amount The amount of Eth to be transferred.
    */
    function moveEth(address _to, uint256 _amount) public hasMintPermission {
        require(this.balance >= _amount);
        _to.transfer(_amount);
    }
    /**
    * @dev Moves Tokens to a certain address for use in the ClubTokenController
    * @param _to The address to receive the Tokens.
    * @param _amount The amount of Tokens to be transferred.
    * @param _token The address of the relevant token contract.
    * @return bool Whether or not the move was successful
    */
    function moveToken(address _to, uint256 _amount, address _token) public hasMintPermission returns (bool) {
        require(_amount <= StandardToken(_token).balanceOf(this));
        return StandardToken(_token).transfer(_to, _amount);
    }
    /**
    * @dev Approves Tokens to a certain address for use in the ClubTokenController
    * @param _to The address to be approved.
    * @param _amount The amount of Tokens to be approved.
    * @param _token The address of the relevant token contract.
    * @return bool Whether or not the approval was successful
    */
    function approveToken(address _to, uint256 _amount, address _token) public hasMintPermission returns (bool) {
        return StandardToken(_token).approve(_to, _amount);
    }
}

// File: bancor-contracts/solidity/contracts/converter/interfaces/IBancorFormula.sol

pragma solidity ^0.4.24;

/*
    Bancor Formula interface
*/
contract IBancorFormula {
    function calculatePurchaseReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _depositAmount) public view returns (uint256);
    function calculateSaleReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _sellAmount) public view returns (uint256);
    function calculateCrossConnectorReturn(uint256 _fromConnectorBalance, uint32 _fromConnectorWeight, uint256 _toConnectorBalance, uint32 _toConnectorWeight, uint256 _amount) public view returns (uint256);
}

// File: bancor-contracts/solidity/contracts/utility/Utils.sol

pragma solidity ^0.4.24;

/*
    Utilities & Common Modifiers
*/
contract Utils {
    /**
        constructor
    */
    constructor() public {
    }

    // verifies that an amount is greater than zero
    modifier greaterThanZero(uint256 _amount) {
        require(_amount > 0);
        _;
    }

    // validates an address - currently only checks that it isn't null
    modifier validAddress(address _address) {
        require(_address != address(0));
        _;
    }

    // verifies that the address is different than this contract address
    modifier notThis(address _address) {
        require(_address != address(this));
        _;
    }

    // Overflow protected math functions

    /**
        @dev returns the sum of _x and _y, asserts if the calculation overflows

        @param _x   value 1
        @param _y   value 2

        @return sum
    */
    function safeAdd(uint256 _x, uint256 _y) internal pure returns (uint256) {
        uint256 z = _x + _y;
        assert(z >= _x);
        return z;
    }

    /**
        @dev returns the difference of _x minus _y, asserts if the subtraction results in a negative number

        @param _x   minuend
        @param _y   subtrahend

        @return difference
    */
    function safeSub(uint256 _x, uint256 _y) internal pure returns (uint256) {
        assert(_x >= _y);
        return _x - _y;
    }

    /**
        @dev returns the product of multiplying _x by _y, asserts if the calculation overflows

        @param _x   factor 1
        @param _y   factor 2

        @return product
    */
    function safeMul(uint256 _x, uint256 _y) internal pure returns (uint256) {
        uint256 z = _x * _y;
        assert(_x == 0 || z / _x == _y);
        return z;
    }
}

// File: bancor-contracts/solidity/contracts/converter/BancorFormula.sol

pragma solidity ^0.4.24;



contract BancorFormula is IBancorFormula, Utils {
    string public version = '0.3';

    uint256 private constant ONE = 1;
    uint32 private constant MAX_WEIGHT = 1000000;
    uint8 private constant MIN_PRECISION = 32;
    uint8 private constant MAX_PRECISION = 127;

    /**
        Auto-generated via 'PrintIntScalingFactors.py'
    */
    uint256 private constant FIXED_1 = 0x080000000000000000000000000000000;
    uint256 private constant FIXED_2 = 0x100000000000000000000000000000000;
    uint256 private constant MAX_NUM = 0x200000000000000000000000000000000;

    /**
        Auto-generated via 'PrintLn2ScalingFactors.py'
    */
    uint256 private constant LN2_NUMERATOR   = 0x3f80fe03f80fe03f80fe03f80fe03f8;
    uint256 private constant LN2_DENOMINATOR = 0x5b9de1d10bf4103d647b0955897ba80;

    /**
        Auto-generated via 'PrintFunctionOptimalLog.py' and 'PrintFunctionOptimalExp.py'
    */
    uint256 private constant OPT_LOG_MAX_VAL = 0x15bf0a8b1457695355fb8ac404e7a79e3;
    uint256 private constant OPT_EXP_MAX_VAL = 0x800000000000000000000000000000000;

    /**
        Auto-generated via 'PrintFunctionConstructor.py'
    */
    uint256[128] private maxExpArray;
    constructor() public {
    //  maxExpArray[  0] = 0x6bffffffffffffffffffffffffffffffff;
    //  maxExpArray[  1] = 0x67ffffffffffffffffffffffffffffffff;
    //  maxExpArray[  2] = 0x637fffffffffffffffffffffffffffffff;
    //  maxExpArray[  3] = 0x5f6fffffffffffffffffffffffffffffff;
    //  maxExpArray[  4] = 0x5b77ffffffffffffffffffffffffffffff;
    //  maxExpArray[  5] = 0x57b3ffffffffffffffffffffffffffffff;
    //  maxExpArray[  6] = 0x5419ffffffffffffffffffffffffffffff;
    //  maxExpArray[  7] = 0x50a2ffffffffffffffffffffffffffffff;
    //  maxExpArray[  8] = 0x4d517fffffffffffffffffffffffffffff;
    //  maxExpArray[  9] = 0x4a233fffffffffffffffffffffffffffff;
    //  maxExpArray[ 10] = 0x47165fffffffffffffffffffffffffffff;
    //  maxExpArray[ 11] = 0x4429afffffffffffffffffffffffffffff;
    //  maxExpArray[ 12] = 0x415bc7ffffffffffffffffffffffffffff;
    //  maxExpArray[ 13] = 0x3eab73ffffffffffffffffffffffffffff;
    //  maxExpArray[ 14] = 0x3c1771ffffffffffffffffffffffffffff;
    //  maxExpArray[ 15] = 0x399e96ffffffffffffffffffffffffffff;
    //  maxExpArray[ 16] = 0x373fc47fffffffffffffffffffffffffff;
    //  maxExpArray[ 17] = 0x34f9e8ffffffffffffffffffffffffffff;
    //  maxExpArray[ 18] = 0x32cbfd5fffffffffffffffffffffffffff;
    //  maxExpArray[ 19] = 0x30b5057fffffffffffffffffffffffffff;
    //  maxExpArray[ 20] = 0x2eb40f9fffffffffffffffffffffffffff;
    //  maxExpArray[ 21] = 0x2cc8340fffffffffffffffffffffffffff;
    //  maxExpArray[ 22] = 0x2af09481ffffffffffffffffffffffffff;
    //  maxExpArray[ 23] = 0x292c5bddffffffffffffffffffffffffff;
    //  maxExpArray[ 24] = 0x277abdcdffffffffffffffffffffffffff;
    //  maxExpArray[ 25] = 0x25daf6657fffffffffffffffffffffffff;
    //  maxExpArray[ 26] = 0x244c49c65fffffffffffffffffffffffff;
    //  maxExpArray[ 27] = 0x22ce03cd5fffffffffffffffffffffffff;
    //  maxExpArray[ 28] = 0x215f77c047ffffffffffffffffffffffff;
    //  maxExpArray[ 29] = 0x1fffffffffffffffffffffffffffffffff;
    //  maxExpArray[ 30] = 0x1eaefdbdabffffffffffffffffffffffff;
    //  maxExpArray[ 31] = 0x1d6bd8b2ebffffffffffffffffffffffff;
        maxExpArray[ 32] = 0x1c35fedd14ffffffffffffffffffffffff;
        maxExpArray[ 33] = 0x1b0ce43b323fffffffffffffffffffffff;
        maxExpArray[ 34] = 0x19f0028ec1ffffffffffffffffffffffff;
        maxExpArray[ 35] = 0x18ded91f0e7fffffffffffffffffffffff;
        maxExpArray[ 36] = 0x17d8ec7f0417ffffffffffffffffffffff;
        maxExpArray[ 37] = 0x16ddc6556cdbffffffffffffffffffffff;
        maxExpArray[ 38] = 0x15ecf52776a1ffffffffffffffffffffff;
        maxExpArray[ 39] = 0x15060c256cb2ffffffffffffffffffffff;
        maxExpArray[ 40] = 0x1428a2f98d72ffffffffffffffffffffff;
        maxExpArray[ 41] = 0x13545598e5c23fffffffffffffffffffff;
        maxExpArray[ 42] = 0x1288c4161ce1dfffffffffffffffffffff;
        maxExpArray[ 43] = 0x11c592761c666fffffffffffffffffffff;
        maxExpArray[ 44] = 0x110a688680a757ffffffffffffffffffff;
        maxExpArray[ 45] = 0x1056f1b5bedf77ffffffffffffffffffff;
        maxExpArray[ 46] = 0x0faadceceeff8bffffffffffffffffffff;
        maxExpArray[ 47] = 0x0f05dc6b27edadffffffffffffffffffff;
        maxExpArray[ 48] = 0x0e67a5a25da4107fffffffffffffffffff;
        maxExpArray[ 49] = 0x0dcff115b14eedffffffffffffffffffff;
        maxExpArray[ 50] = 0x0d3e7a392431239fffffffffffffffffff;
        maxExpArray[ 51] = 0x0cb2ff529eb71e4fffffffffffffffffff;
        maxExpArray[ 52] = 0x0c2d415c3db974afffffffffffffffffff;
        maxExpArray[ 53] = 0x0bad03e7d883f69bffffffffffffffffff;
        maxExpArray[ 54] = 0x0b320d03b2c343d5ffffffffffffffffff;
        maxExpArray[ 55] = 0x0abc25204e02828dffffffffffffffffff;
        maxExpArray[ 56] = 0x0a4b16f74ee4bb207fffffffffffffffff;
        maxExpArray[ 57] = 0x09deaf736ac1f569ffffffffffffffffff;
        maxExpArray[ 58] = 0x0976bd9952c7aa957fffffffffffffffff;
        maxExpArray[ 59] = 0x09131271922eaa606fffffffffffffffff;
        maxExpArray[ 60] = 0x08b380f3558668c46fffffffffffffffff;
        maxExpArray[ 61] = 0x0857ddf0117efa215bffffffffffffffff;
        maxExpArray[ 62] = 0x07ffffffffffffffffffffffffffffffff;
        maxExpArray[ 63] = 0x07abbf6f6abb9d087fffffffffffffffff;
        maxExpArray[ 64] = 0x075af62cbac95f7dfa7fffffffffffffff;
        maxExpArray[ 65] = 0x070d7fb7452e187ac13fffffffffffffff;
        maxExpArray[ 66] = 0x06c3390ecc8af379295fffffffffffffff;
        maxExpArray[ 67] = 0x067c00a3b07ffc01fd6fffffffffffffff;
        maxExpArray[ 68] = 0x0637b647c39cbb9d3d27ffffffffffffff;
        maxExpArray[ 69] = 0x05f63b1fc104dbd39587ffffffffffffff;
        maxExpArray[ 70] = 0x05b771955b36e12f7235ffffffffffffff;
        maxExpArray[ 71] = 0x057b3d49dda84556d6f6ffffffffffffff;
        maxExpArray[ 72] = 0x054183095b2c8ececf30ffffffffffffff;
        maxExpArray[ 73] = 0x050a28be635ca2b888f77fffffffffffff;
        maxExpArray[ 74] = 0x04d5156639708c9db33c3fffffffffffff;
        maxExpArray[ 75] = 0x04a23105873875bd52dfdfffffffffffff;
        maxExpArray[ 76] = 0x0471649d87199aa990756fffffffffffff;
        maxExpArray[ 77] = 0x04429a21a029d4c1457cfbffffffffffff;
        maxExpArray[ 78] = 0x0415bc6d6fb7dd71af2cb3ffffffffffff;
        maxExpArray[ 79] = 0x03eab73b3bbfe282243ce1ffffffffffff;
        maxExpArray[ 80] = 0x03c1771ac9fb6b4c18e229ffffffffffff;
        maxExpArray[ 81] = 0x0399e96897690418f785257fffffffffff;
        maxExpArray[ 82] = 0x0373fc456c53bb779bf0ea9fffffffffff;
        maxExpArray[ 83] = 0x034f9e8e490c48e67e6ab8bfffffffffff;
        maxExpArray[ 84] = 0x032cbfd4a7adc790560b3337ffffffffff;
        maxExpArray[ 85] = 0x030b50570f6e5d2acca94613ffffffffff;
        maxExpArray[ 86] = 0x02eb40f9f620fda6b56c2861ffffffffff;
        maxExpArray[ 87] = 0x02cc8340ecb0d0f520a6af58ffffffffff;
        maxExpArray[ 88] = 0x02af09481380a0a35cf1ba02ffffffffff;
        maxExpArray[ 89] = 0x0292c5bdd3b92ec810287b1b3fffffffff;
        maxExpArray[ 90] = 0x0277abdcdab07d5a77ac6d6b9fffffffff;
        maxExpArray[ 91] = 0x025daf6654b1eaa55fd64df5efffffffff;
        maxExpArray[ 92] = 0x0244c49c648baa98192dce88b7ffffffff;
        maxExpArray[ 93] = 0x022ce03cd5619a311b2471268bffffffff;
        maxExpArray[ 94] = 0x0215f77c045fbe885654a44a0fffffffff;
        maxExpArray[ 95] = 0x01ffffffffffffffffffffffffffffffff;
        maxExpArray[ 96] = 0x01eaefdbdaaee7421fc4d3ede5ffffffff;
        maxExpArray[ 97] = 0x01d6bd8b2eb257df7e8ca57b09bfffffff;
        maxExpArray[ 98] = 0x01c35fedd14b861eb0443f7f133fffffff;
        maxExpArray[ 99] = 0x01b0ce43b322bcde4a56e8ada5afffffff;
        maxExpArray[100] = 0x019f0028ec1fff007f5a195a39dfffffff;
        maxExpArray[101] = 0x018ded91f0e72ee74f49b15ba527ffffff;
        maxExpArray[102] = 0x017d8ec7f04136f4e5615fd41a63ffffff;
        maxExpArray[103] = 0x016ddc6556cdb84bdc8d12d22e6fffffff;
        maxExpArray[104] = 0x015ecf52776a1155b5bd8395814f7fffff;
        maxExpArray[105] = 0x015060c256cb23b3b3cc3754cf40ffffff;
        maxExpArray[106] = 0x01428a2f98d728ae223ddab715be3fffff;
        maxExpArray[107] = 0x013545598e5c23276ccf0ede68034fffff;
        maxExpArray[108] = 0x01288c4161ce1d6f54b7f61081194fffff;
        maxExpArray[109] = 0x011c592761c666aa641d5a01a40f17ffff;
        maxExpArray[110] = 0x0110a688680a7530515f3e6e6cfdcdffff;
        maxExpArray[111] = 0x01056f1b5bedf75c6bcb2ce8aed428ffff;
        maxExpArray[112] = 0x00faadceceeff8a0890f3875f008277fff;
        maxExpArray[113] = 0x00f05dc6b27edad306388a600f6ba0bfff;
        maxExpArray[114] = 0x00e67a5a25da41063de1495d5b18cdbfff;
        maxExpArray[115] = 0x00dcff115b14eedde6fc3aa5353f2e4fff;
        maxExpArray[116] = 0x00d3e7a3924312399f9aae2e0f868f8fff;
        maxExpArray[117] = 0x00cb2ff529eb71e41582cccd5a1ee26fff;
        maxExpArray[118] = 0x00c2d415c3db974ab32a51840c0b67edff;
        maxExpArray[119] = 0x00bad03e7d883f69ad5b0a186184e06bff;
        maxExpArray[120] = 0x00b320d03b2c343d4829abd6075f0cc5ff;
        maxExpArray[121] = 0x00abc25204e02828d73c6e80bcdb1a95bf;
        maxExpArray[122] = 0x00a4b16f74ee4bb2040a1ec6c15fbbf2df;
        maxExpArray[123] = 0x009deaf736ac1f569deb1b5ae3f36c130f;
        maxExpArray[124] = 0x00976bd9952c7aa957f5937d790ef65037;
        maxExpArray[125] = 0x009131271922eaa6064b73a22d0bd4f2bf;
        maxExpArray[126] = 0x008b380f3558668c46c91c49a2f8e967b9;
        maxExpArray[127] = 0x00857ddf0117efa215952912839f6473e6;
    }

    /**
        @dev given a token supply, connector balance, weight and a deposit amount (in the connector token),
        calculates the return for a given conversion (in the main token)

        Formula:
        Return = _supply * ((1 + _depositAmount / _connectorBalance) ^ (_connectorWeight / 1000000) - 1)

        @param _supply              token total supply
        @param _connectorBalance    total connector balance
        @param _connectorWeight     connector weight, represented in ppm, 1-1000000
        @param _depositAmount       deposit amount, in connector token

        @return purchase return amount
    */
    function calculatePurchaseReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _depositAmount) public view returns (uint256) {
        // validate input
        require(_supply > 0 && _connectorBalance > 0 && _connectorWeight > 0 && _connectorWeight <= MAX_WEIGHT);

        // special case for 0 deposit amount
        if (_depositAmount == 0)
            return 0;

        // special case if the weight = 100%
        if (_connectorWeight == MAX_WEIGHT)
            return safeMul(_supply, _depositAmount) / _connectorBalance;

        uint256 result;
        uint8 precision;
        uint256 baseN = safeAdd(_depositAmount, _connectorBalance);
        (result, precision) = power(baseN, _connectorBalance, _connectorWeight, MAX_WEIGHT);
        uint256 temp = safeMul(_supply, result) >> precision;
        return temp - _supply;
    }

    /**
        @dev given a token supply, connector balance, weight and a sell amount (in the main token),
        calculates the return for a given conversion (in the connector token)

        Formula:
        Return = _connectorBalance * (1 - (1 - _sellAmount / _supply) ^ (1 / (_connectorWeight / 1000000)))

        @param _supply              token total supply
        @param _connectorBalance    total connector
        @param _connectorWeight     constant connector Weight, represented in ppm, 1-1000000
        @param _sellAmount          sell amount, in the token itself

        @return sale return amount
    */
    function calculateSaleReturn(uint256 _supply, uint256 _connectorBalance, uint32 _connectorWeight, uint256 _sellAmount) public view returns (uint256) {
        // validate input
        require(_supply > 0 && _connectorBalance > 0 && _connectorWeight > 0 && _connectorWeight <= MAX_WEIGHT && _sellAmount <= _supply);

        // special case for 0 sell amount
        if (_sellAmount == 0)
            return 0;

        // special case for selling the entire supply
        if (_sellAmount == _supply)
            return _connectorBalance;

        // special case if the weight = 100%
        if (_connectorWeight == MAX_WEIGHT)
            return safeMul(_connectorBalance, _sellAmount) / _supply;

        uint256 result;
        uint8 precision;
        uint256 baseD = _supply - _sellAmount;
        (result, precision) = power(_supply, baseD, MAX_WEIGHT, _connectorWeight);
        uint256 temp1 = safeMul(_connectorBalance, result);
        uint256 temp2 = _connectorBalance << precision;
        return (temp1 - temp2) / result;
    }

    /**
        @dev given two connector balances/weights and a sell amount (in the first connector token),
        calculates the return for a conversion from the first connector token to the second connector token (in the second connector token)

        Formula:
        Return = _toConnectorBalance * (1 - (_fromConnectorBalance / (_fromConnectorBalance + _amount)) ^ (_fromConnectorWeight / _toConnectorWeight))

        @param _fromConnectorBalance    input connector balance
        @param _fromConnectorWeight     input connector weight, represented in ppm, 1-1000000
        @param _toConnectorBalance      output connector balance
        @param _toConnectorWeight       output connector weight, represented in ppm, 1-1000000
        @param _amount                  input connector amount

        @return second connector amount
    */
    function calculateCrossConnectorReturn(uint256 _fromConnectorBalance, uint32 _fromConnectorWeight, uint256 _toConnectorBalance, uint32 _toConnectorWeight, uint256 _amount) public view returns (uint256) {
        // validate input
        require(_fromConnectorBalance > 0 && _fromConnectorWeight > 0 && _fromConnectorWeight <= MAX_WEIGHT && _toConnectorBalance > 0 && _toConnectorWeight > 0 && _toConnectorWeight <= MAX_WEIGHT);

        // special case for equal weights
        if (_fromConnectorWeight == _toConnectorWeight)
            return safeMul(_toConnectorBalance, _amount) / safeAdd(_fromConnectorBalance, _amount);

        uint256 result;
        uint8 precision;
        uint256 baseN = safeAdd(_fromConnectorBalance, _amount);
        (result, precision) = power(baseN, _fromConnectorBalance, _fromConnectorWeight, _toConnectorWeight);
        uint256 temp1 = safeMul(_toConnectorBalance, result);
        uint256 temp2 = _toConnectorBalance << precision;
        return (temp1 - temp2) / result;
    }

    /**
        General Description:
            Determine a value of precision.
            Calculate an integer approximation of (_baseN / _baseD) ^ (_expN / _expD) * 2 ^ precision.
            Return the result along with the precision used.

        Detailed Description:
            Instead of calculating "base ^ exp", we calculate "e ^ (log(base) * exp)".
            The value of "log(base)" is represented with an integer slightly smaller than "log(base) * 2 ^ precision".
            The larger "precision" is, the more accurately this value represents the real value.
            However, the larger "precision" is, the more bits are required in order to store this value.
            And the exponentiation function, which takes "x" and calculates "e ^ x", is limited to a maximum exponent (maximum value of "x").
            This maximum exponent depends on the "precision" used, and it is given by "maxExpArray[precision] >> (MAX_PRECISION - precision)".
            Hence we need to determine the highest precision which can be used for the given input, before calling the exponentiation function.
            This allows us to compute "base ^ exp" with maximum accuracy and without exceeding 256 bits in any of the intermediate computations.
            This functions assumes that "_expN < 2 ^ 256 / log(MAX_NUM - 1)", otherwise the multiplication should be replaced with a "safeMul".
    */
    function power(uint256 _baseN, uint256 _baseD, uint32 _expN, uint32 _expD) internal view returns (uint256, uint8) {
        require(_baseN < MAX_NUM);

        uint256 baseLog;
        uint256 base = _baseN * FIXED_1 / _baseD;
        if (base < OPT_LOG_MAX_VAL) {
            baseLog = optimalLog(base);
        }
        else {
            baseLog = generalLog(base);
        }

        uint256 baseLogTimesExp = baseLog * _expN / _expD;
        if (baseLogTimesExp < OPT_EXP_MAX_VAL) {
            return (optimalExp(baseLogTimesExp), MAX_PRECISION);
        }
        else {
            uint8 precision = findPositionInMaxExpArray(baseLogTimesExp);
            return (generalExp(baseLogTimesExp >> (MAX_PRECISION - precision), precision), precision);
        }
    }

    /**
        Compute log(x / FIXED_1) * FIXED_1.
        This functions assumes that "x >= FIXED_1", because the output would be negative otherwise.
    */
    function generalLog(uint256 x) internal pure returns (uint256) {
        uint256 res = 0;

        // If x >= 2, then we compute the integer part of log2(x), which is larger than 0.
        if (x >= FIXED_2) {
            uint8 count = floorLog2(x / FIXED_1);
            x >>= count; // now x < 2
            res = count * FIXED_1;
        }

        // If x > 1, then we compute the fraction part of log2(x), which is larger than 0.
        if (x > FIXED_1) {
            for (uint8 i = MAX_PRECISION; i > 0; --i) {
                x = (x * x) / FIXED_1; // now 1 < x < 4
                if (x >= FIXED_2) {
                    x >>= 1; // now 1 < x < 2
                    res += ONE << (i - 1);
                }
            }
        }

        return res * LN2_NUMERATOR / LN2_DENOMINATOR;
    }

    /**
        Compute the largest integer smaller than or equal to the binary logarithm of the input.
    */
    function floorLog2(uint256 _n) internal pure returns (uint8) {
        uint8 res = 0;

        if (_n < 256) {
            // At most 8 iterations
            while (_n > 1) {
                _n >>= 1;
                res += 1;
            }
        }
        else {
            // Exactly 8 iterations
            for (uint8 s = 128; s > 0; s >>= 1) {
                if (_n >= (ONE << s)) {
                    _n >>= s;
                    res |= s;
                }
            }
        }

        return res;
    }

    /**
        The global "maxExpArray" is sorted in descending order, and therefore the following statements are equivalent:
        - This function finds the position of [the smallest value in "maxExpArray" larger than or equal to "x"]
        - This function finds the highest position of [a value in "maxExpArray" larger than or equal to "x"]
    */
    function findPositionInMaxExpArray(uint256 _x) internal view returns (uint8) {
        uint8 lo = MIN_PRECISION;
        uint8 hi = MAX_PRECISION;

        while (lo + 1 < hi) {
            uint8 mid = (lo + hi) / 2;
            if (maxExpArray[mid] >= _x)
                lo = mid;
            else
                hi = mid;
        }

        if (maxExpArray[hi] >= _x)
            return hi;
        if (maxExpArray[lo] >= _x)
            return lo;

        require(false);
        return 0;
    }

    /**
        This function can be auto-generated by the script 'PrintFunctionGeneralExp.py'.
        It approximates "e ^ x" via maclaurin summation: "(x^0)/0! + (x^1)/1! + ... + (x^n)/n!".
        It returns "e ^ (x / 2 ^ precision) * 2 ^ precision", that is, the result is upshifted for accuracy.
        The global "maxExpArray" maps each "precision" to "((maximumExponent + 1) << (MAX_PRECISION - precision)) - 1".
        The maximum permitted value for "x" is therefore given by "maxExpArray[precision] >> (MAX_PRECISION - precision)".
    */
    function generalExp(uint256 _x, uint8 _precision) internal pure returns (uint256) {
        uint256 xi = _x;
        uint256 res = 0;

        xi = (xi * _x) >> _precision; res += xi * 0x3442c4e6074a82f1797f72ac0000000; // add x^02 * (33! / 02!)
        xi = (xi * _x) >> _precision; res += xi * 0x116b96f757c380fb287fd0e40000000; // add x^03 * (33! / 03!)
        xi = (xi * _x) >> _precision; res += xi * 0x045ae5bdd5f0e03eca1ff4390000000; // add x^04 * (33! / 04!)
        xi = (xi * _x) >> _precision; res += xi * 0x00defabf91302cd95b9ffda50000000; // add x^05 * (33! / 05!)
        xi = (xi * _x) >> _precision; res += xi * 0x002529ca9832b22439efff9b8000000; // add x^06 * (33! / 06!)
        xi = (xi * _x) >> _precision; res += xi * 0x00054f1cf12bd04e516b6da88000000; // add x^07 * (33! / 07!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000a9e39e257a09ca2d6db51000000; // add x^08 * (33! / 08!)
        xi = (xi * _x) >> _precision; res += xi * 0x000012e066e7b839fa050c309000000; // add x^09 * (33! / 09!)
        xi = (xi * _x) >> _precision; res += xi * 0x000001e33d7d926c329a1ad1a800000; // add x^10 * (33! / 10!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000002bee513bdb4a6b19b5f800000; // add x^11 * (33! / 11!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000003a9316fa79b88eccf2a00000; // add x^12 * (33! / 12!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000048177ebe1fa812375200000; // add x^13 * (33! / 13!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000005263fe90242dcbacf00000; // add x^14 * (33! / 14!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000057e22099c030d94100000; // add x^15 * (33! / 15!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000057e22099c030d9410000; // add x^16 * (33! / 16!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000052b6b54569976310000; // add x^17 * (33! / 17!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000004985f67696bf748000; // add x^18 * (33! / 18!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000003dea12ea99e498000; // add x^19 * (33! / 19!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000031880f2214b6e000; // add x^20 * (33! / 20!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000000025bcff56eb36000; // add x^21 * (33! / 21!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000000001b722e10ab1000; // add x^22 * (33! / 22!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000001317c70077000; // add x^23 * (33! / 23!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000cba84aafa00; // add x^24 * (33! / 24!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000082573a0a00; // add x^25 * (33! / 25!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000005035ad900; // add x^26 * (33! / 26!)
        xi = (xi * _x) >> _precision; res += xi * 0x000000000000000000000002f881b00; // add x^27 * (33! / 27!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000001b29340; // add x^28 * (33! / 28!)
        xi = (xi * _x) >> _precision; res += xi * 0x00000000000000000000000000efc40; // add x^29 * (33! / 29!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000007fe0; // add x^30 * (33! / 30!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000000420; // add x^31 * (33! / 31!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000000021; // add x^32 * (33! / 32!)
        xi = (xi * _x) >> _precision; res += xi * 0x0000000000000000000000000000001; // add x^33 * (33! / 33!)

        return res / 0x688589cc0e9505e2f2fee5580000000 + _x + (ONE << _precision); // divide by 33! and then add x^1 / 1! + x^0 / 0!
    }

    /**
        Return log(x / FIXED_1) * FIXED_1
        Input range: FIXED_1 <= x <= LOG_EXP_MAX_VAL - 1
        Auto-generated via 'PrintFunctionOptimalLog.py'
        Detailed description:
        - Rewrite the input as a product of natural exponents and a single residual r, such that 1 < r < 2
        - The natural logarithm of each (pre-calculated) exponent is the degree of the exponent
        - The natural logarithm of r is calculated via Taylor series for log(1 + x), where x = r - 1
        - The natural logarithm of the input is calculated by summing up the intermediate results above
        - For example: log(250) = log(e^4 * e^1 * e^0.5 * 1.021692859) = 4 + 1 + 0.5 + log(1 + 0.021692859)
    */
    function optimalLog(uint256 x) internal pure returns (uint256) {
        uint256 res = 0;

        uint256 y;
        uint256 z;
        uint256 w;

        if (x >= 0xd3094c70f034de4b96ff7d5b6f99fcd8) {res += 0x40000000000000000000000000000000; x = x * FIXED_1 / 0xd3094c70f034de4b96ff7d5b6f99fcd8;} // add 1 / 2^1
        if (x >= 0xa45af1e1f40c333b3de1db4dd55f29a7) {res += 0x20000000000000000000000000000000; x = x * FIXED_1 / 0xa45af1e1f40c333b3de1db4dd55f29a7;} // add 1 / 2^2
        if (x >= 0x910b022db7ae67ce76b441c27035c6a1) {res += 0x10000000000000000000000000000000; x = x * FIXED_1 / 0x910b022db7ae67ce76b441c27035c6a1;} // add 1 / 2^3
        if (x >= 0x88415abbe9a76bead8d00cf112e4d4a8) {res += 0x08000000000000000000000000000000; x = x * FIXED_1 / 0x88415abbe9a76bead8d00cf112e4d4a8;} // add 1 / 2^4
        if (x >= 0x84102b00893f64c705e841d5d4064bd3) {res += 0x04000000000000000000000000000000; x = x * FIXED_1 / 0x84102b00893f64c705e841d5d4064bd3;} // add 1 / 2^5
        if (x >= 0x8204055aaef1c8bd5c3259f4822735a2) {res += 0x02000000000000000000000000000000; x = x * FIXED_1 / 0x8204055aaef1c8bd5c3259f4822735a2;} // add 1 / 2^6
        if (x >= 0x810100ab00222d861931c15e39b44e99) {res += 0x01000000000000000000000000000000; x = x * FIXED_1 / 0x810100ab00222d861931c15e39b44e99;} // add 1 / 2^7
        if (x >= 0x808040155aabbbe9451521693554f733) {res += 0x00800000000000000000000000000000; x = x * FIXED_1 / 0x808040155aabbbe9451521693554f733;} // add 1 / 2^8

        z = y = x - FIXED_1;
        w = y * y / FIXED_1;
        res += z * (0x100000000000000000000000000000000 - y) / 0x100000000000000000000000000000000; z = z * w / FIXED_1; // add y^01 / 01 - y^02 / 02
        res += z * (0x0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - y) / 0x200000000000000000000000000000000; z = z * w / FIXED_1; // add y^03 / 03 - y^04 / 04
        res += z * (0x099999999999999999999999999999999 - y) / 0x300000000000000000000000000000000; z = z * w / FIXED_1; // add y^05 / 05 - y^06 / 06
        res += z * (0x092492492492492492492492492492492 - y) / 0x400000000000000000000000000000000; z = z * w / FIXED_1; // add y^07 / 07 - y^08 / 08
        res += z * (0x08e38e38e38e38e38e38e38e38e38e38e - y) / 0x500000000000000000000000000000000; z = z * w / FIXED_1; // add y^09 / 09 - y^10 / 10
        res += z * (0x08ba2e8ba2e8ba2e8ba2e8ba2e8ba2e8b - y) / 0x600000000000000000000000000000000; z = z * w / FIXED_1; // add y^11 / 11 - y^12 / 12
        res += z * (0x089d89d89d89d89d89d89d89d89d89d89 - y) / 0x700000000000000000000000000000000; z = z * w / FIXED_1; // add y^13 / 13 - y^14 / 14
        res += z * (0x088888888888888888888888888888888 - y) / 0x800000000000000000000000000000000;                      // add y^15 / 15 - y^16 / 16

        return res;
    }

    /**
        Return e ^ (x / FIXED_1) * FIXED_1
        Input range: 0 <= x <= OPT_EXP_MAX_VAL - 1
        Auto-generated via 'PrintFunctionOptimalExp.py'
        Detailed description:
        - Rewrite the input as a sum of binary exponents and a single residual r, as small as possible
        - The exponentiation of each binary exponent is given (pre-calculated)
        - The exponentiation of r is calculated via Taylor series for e^x, where x = r
        - The exponentiation of the input is calculated by multiplying the intermediate results above
        - For example: e^5.021692859 = e^(4 + 1 + 0.5 + 0.021692859) = e^4 * e^1 * e^0.5 * e^0.021692859
    */
    function optimalExp(uint256 x) internal pure returns (uint256) {
        uint256 res = 0;

        uint256 y;
        uint256 z;

        z = y = x % 0x10000000000000000000000000000000; // get the input modulo 2^(-3)
        z = z * y / FIXED_1; res += z * 0x10e1b3be415a0000; // add y^02 * (20! / 02!)
        z = z * y / FIXED_1; res += z * 0x05a0913f6b1e0000; // add y^03 * (20! / 03!)
        z = z * y / FIXED_1; res += z * 0x0168244fdac78000; // add y^04 * (20! / 04!)
        z = z * y / FIXED_1; res += z * 0x004807432bc18000; // add y^05 * (20! / 05!)
        z = z * y / FIXED_1; res += z * 0x000c0135dca04000; // add y^06 * (20! / 06!)
        z = z * y / FIXED_1; res += z * 0x0001b707b1cdc000; // add y^07 * (20! / 07!)
        z = z * y / FIXED_1; res += z * 0x000036e0f639b800; // add y^08 * (20! / 08!)
        z = z * y / FIXED_1; res += z * 0x00000618fee9f800; // add y^09 * (20! / 09!)
        z = z * y / FIXED_1; res += z * 0x0000009c197dcc00; // add y^10 * (20! / 10!)
        z = z * y / FIXED_1; res += z * 0x0000000e30dce400; // add y^11 * (20! / 11!)
        z = z * y / FIXED_1; res += z * 0x000000012ebd1300; // add y^12 * (20! / 12!)
        z = z * y / FIXED_1; res += z * 0x0000000017499f00; // add y^13 * (20! / 13!)
        z = z * y / FIXED_1; res += z * 0x0000000001a9d480; // add y^14 * (20! / 14!)
        z = z * y / FIXED_1; res += z * 0x00000000001c6380; // add y^15 * (20! / 15!)
        z = z * y / FIXED_1; res += z * 0x000000000001c638; // add y^16 * (20! / 16!)
        z = z * y / FIXED_1; res += z * 0x0000000000001ab8; // add y^17 * (20! / 17!)
        z = z * y / FIXED_1; res += z * 0x000000000000017c; // add y^18 * (20! / 18!)
        z = z * y / FIXED_1; res += z * 0x0000000000000014; // add y^19 * (20! / 19!)
        z = z * y / FIXED_1; res += z * 0x0000000000000001; // add y^20 * (20! / 20!)
        res = res / 0x21c3677c82b40000 + y + FIXED_1; // divide by 20! and then add y^1 / 1! + y^0 / 0!

        if ((x & 0x010000000000000000000000000000000) != 0) res = res * 0x1c3d6a24ed82218787d624d3e5eba95f9 / 0x18ebef9eac820ae8682b9793ac6d1e776; // multiply by e^2^(-3)
        if ((x & 0x020000000000000000000000000000000) != 0) res = res * 0x18ebef9eac820ae8682b9793ac6d1e778 / 0x1368b2fc6f9609fe7aceb46aa619baed4; // multiply by e^2^(-2)
        if ((x & 0x040000000000000000000000000000000) != 0) res = res * 0x1368b2fc6f9609fe7aceb46aa619baed5 / 0x0bc5ab1b16779be3575bd8f0520a9f21f; // multiply by e^2^(-1)
        if ((x & 0x080000000000000000000000000000000) != 0) res = res * 0x0bc5ab1b16779be3575bd8f0520a9f21e / 0x0454aaa8efe072e7f6ddbab84b40a55c9; // multiply by e^2^(+0)
        if ((x & 0x100000000000000000000000000000000) != 0) res = res * 0x0454aaa8efe072e7f6ddbab84b40a55c5 / 0x00960aadc109e7a3bf4578099615711ea; // multiply by e^2^(+1)
        if ((x & 0x200000000000000000000000000000000) != 0) res = res * 0x00960aadc109e7a3bf4578099615711d7 / 0x0002bf84208204f5977f9a8cf01fdce3d; // multiply by e^2^(+2)
        if ((x & 0x400000000000000000000000000000000) != 0) res = res * 0x0002bf84208204f5977f9a8cf01fdc307 / 0x0000003c6ab775dd0b95b4cbee7e65d11; // multiply by e^2^(+3)

        return res;
    }
}

// File: contracts/ClubTokenController.sol

pragma solidity ^0.4.18;

/**
* The ClubTokenController is a replaceable endpoint for minting and unminting ClubToken.sol
*/





contract ClubTokenController is BancorFormula, Admin, Ownable {
    event Buy(address buyer, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply);
    event Sell(address seller, uint256 tokens, uint256 value, uint256 poolBalance, uint256 tokenSupply);

    bool public paused;
    address public clubToken;
    address public simpleCloversMarket;
    address public curationMarket;
    address public support;

    /* uint256 public poolBalance; */
    uint256 public virtualSupply;
    uint256 public virtualBalance;
    uint32 public reserveRatio; // represented in ppm, 1-1000000

    constructor(address _clubToken) public {
        clubToken = _clubToken;
        paused = true;
    }

    function () public payable {
        buy(msg.sender);
    }

    modifier notPaused() {
        require(!paused || owner == msg.sender || admins[tx.origin], "Contract must not be paused");
        _;
    }

    function poolBalance() public constant returns(uint256) {
        return clubToken.balance;
    }

    /**
    * @dev gets the amount of tokens returned from spending Eth
    * @param buyValue The amount of Eth to be spent
    * @return A uint256 representing the amount of tokens gained in exchange for the Eth.
    */
    function getBuy(uint256 buyValue) public constant returns(uint256) {
        return calculatePurchaseReturn(
            safeAdd(ClubToken(clubToken).totalSupply(), virtualSupply),
            safeAdd(poolBalance(), virtualBalance),
            reserveRatio,
            buyValue);
    }


    /**
    * @dev gets the amount of Eth returned from selling tokens
    * @param sellAmount The amount of tokens to be sold
    * @return A uint256 representing the amount of Eth gained in exchange for the tokens.
    */

    function getSell(uint256 sellAmount) public constant returns(uint256) {
        return calculateSaleReturn(
            safeAdd(ClubToken(clubToken).totalSupply(), virtualSupply),
            safeAdd(poolBalance(), virtualBalance),
            reserveRatio,
            sellAmount);
    }

    function updatePaused(bool _paused) public onlyOwner {
        paused = _paused;
    }

    /**
    * @dev updates the Reserve Ratio variable
    * @param _reserveRatio The reserve ratio that determines the curve
    * @return A boolean representing whether or not the update was successful.
    */
    function updateReserveRatio(uint32 _reserveRatio) public onlyOwner returns(bool){
        reserveRatio = _reserveRatio;
        return true;
    }

    /**
    * @dev updates the Virtual Supply variable
    * @param _virtualSupply The virtual supply of tokens used for calculating buys and sells
    * @return A boolean representing whether or not the update was successful.
    */
    function updateVirtualSupply(uint256 _virtualSupply) public onlyOwner returns(bool){
        virtualSupply = _virtualSupply;
        return true;
    }

    /**
    * @dev updates the Virtual Balance variable
    * @param _virtualBalance The virtual balance of the contract used for calculating buys and sells
    * @return A boolean representing whether or not the update was successful.
    */
    function updateVirtualBalance(uint256 _virtualBalance) public onlyOwner returns(bool){
        virtualBalance = _virtualBalance;
        return true;
    }
    /**
    * @dev updates the poolBalance
    * @param _poolBalance The eth balance of ClubToken.sol
    * @return A boolean representing whether or not the update was successful.
    */
    /* function updatePoolBalance(uint256 _poolBalance) public onlyOwner returns(bool){
        poolBalance = _poolBalance;
        return true;
    } */

    /**
    * @dev updates the SimpleCloversMarket address
    * @param _simpleCloversMarket The address of the simpleCloversMarket
    * @return A boolean representing whether or not the update was successful.
    */
    function updateSimpleCloversMarket(address _simpleCloversMarket) public onlyOwner returns(bool){
        simpleCloversMarket = _simpleCloversMarket;
        return true;
    }

    /**
    * @dev updates the CurationMarket address
    * @param _curationMarket The address of the curationMarket
    * @return A boolean representing whether or not the update was successful.
    */
    function updateCurationMarket(address _curationMarket) public onlyOwner returns(bool){
        curationMarket = _curationMarket;
        return true;
    }

    /**
    * @dev updates the Support address
    * @param _support The address of the Support
    * @return A boolean representing whether or not the update was successful.
    */
    function updateSupport(address _support) public onlyOwner returns(bool){
        support = _support;
        return true;
    }

    /**
    * @dev donate Donate Eth to the poolBalance without increasing the totalSupply
    */
    function donate() public payable {
        require(msg.value > 0);
        /* poolBalance = safeAdd(poolBalance, msg.value); */
        clubToken.transfer(msg.value);
    }

    function burn(address from, uint256 amount) public {
        require(msg.sender == simpleCloversMarket);
        ClubToken(clubToken).burn(from, amount);
    }

    function transferFrom(address from, address to, uint256 amount) public {
        require(msg.sender == simpleCloversMarket || msg.sender == curationMarket || msg.sender == support);
        ClubToken(clubToken).transferFrom(from, to, amount);
    }

    /**
    * @dev buy Buy ClubTokens with Eth
    * @param buyer The address that should receive the new tokens
    */
    function buy(address buyer) public payable notPaused returns(bool) {
        require(msg.value > 0);
        uint256 tokens = getBuy(msg.value);
        require(tokens > 0);
        require(ClubToken(clubToken).mint(buyer, tokens));
        /* poolBalance = safeAdd(poolBalance, msg.value); */
        clubToken.transfer(msg.value);
        emit Buy(buyer, tokens, msg.value, poolBalance(), ClubToken(clubToken).totalSupply());
    }


    /**
    * @dev sell Sell ClubTokens for Eth
    * @param sellAmount The amount of tokens to sell
    */
    function sell(uint256 sellAmount) public notPaused returns(bool) {
        require(sellAmount > 0);
        require(ClubToken(clubToken).balanceOf(msg.sender) >= sellAmount);
        uint256 saleReturn = getSell(sellAmount);
        require(saleReturn > 0);
        require(saleReturn <= poolBalance());
        require(saleReturn <= clubToken.balance);
        ClubToken(clubToken).burn(msg.sender, sellAmount);
        /* poolBalance = safeSub(poolBalance, saleReturn); */
        ClubToken(clubToken).moveEth(msg.sender, saleReturn);
        emit Sell(msg.sender, sellAmount, saleReturn, poolBalance(), ClubToken(clubToken).totalSupply());
    }


 }

// File: zeppelin-solidity/contracts/token/ERC20/SafeERC20.sol

pragma solidity ^0.4.24;




/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
  function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
    require(token.transfer(to, value));
  }

  function safeTransferFrom(
    ERC20 token,
    address from,
    address to,
    uint256 value
  )
    internal
  {
    require(token.transferFrom(from, to, value));
  }

  function safeApprove(ERC20 token, address spender, uint256 value) internal {
    require(token.approve(spender, value));
  }
}

// File: zeppelin-solidity/contracts/ownership/CanReclaimToken.sol

pragma solidity ^0.4.24;





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

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

}

// File: zeppelin-solidity/contracts/ownership/HasNoTokens.sol

pragma solidity ^0.4.24;



/**
 * @title Contracts that should not own Tokens
 * @author Remco Bloemen <[email protected]π.com>
 * @dev This blocks incoming ERC223 tokens to prevent accidental loss of tokens.
 * Should tokens (any ERC20Basic compatible) end up in the contract, it allows the
 * owner to reclaim the tokens.
 */
contract HasNoTokens is CanReclaimToken {

 /**
  * @dev Reject all ERC223 compatible tokens
  * @param from_ address The address that is transferring the tokens
  * @param value_ uint256 the amount of the specified token
  * @param data_ Bytes The data passed from the caller.
  */
  function tokenFallback(address from_, uint256 value_, bytes data_) external {
    from_;
    value_;
    data_;
    revert();
  }

}

// File: zeppelin-solidity/contracts/ownership/HasNoEther.sol

pragma solidity ^0.4.24;



/**
 * @title Contracts that should not own Ether
 * @author Remco Bloemen <[email protected]π.com>
 * @dev This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up
 * in the contract, it will allow the owner to reclaim this ether.
 * @notice Ether can still be sent to this contract by:
 * calling functions labeled `payable`
 * `selfdestruct(contract_address)`
 * mining directly to the contract address
 */
contract HasNoEther is Ownable {

  /**
  * @dev Constructor that rejects incoming Ether
  * The `payable` flag is added so we can access `msg.value` without compiler warning. If we
  * leave out payable, then Solidity will allow inheriting contracts to implement a payable
  * constructor. By doing it this way we prevent a payable constructor from working. Alternatively
  * we could use assembly to access msg.value.
  */
  constructor() public payable {
    require(msg.value == 0);
  }

  /**
   * @dev Disallows direct send by settings a default function without the `payable` flag.
   */
  function() external {
  }

  /**
   * @dev Transfer all Ether held by the contract to the owner.
   */
  function reclaimEther() external onlyOwner {
    owner.transfer(address(this).balance);
  }
}

// File: contracts/CloversController.sol

pragma solidity ^0.4.18;

/**
 * The CloversController is a replaceable endpoint for minting and unminting Clovers.sol and ClubToken.sol
 */









contract ISimpleCloversMarket {
    function sell(uint256 _tokenId, uint256 price) public;
} 

contract CloversController is HasNoEther, HasNoTokens {
    event cloverCommitted(bytes32 movesHash, address owner);
    event cloverClaimed(bytes28[2] moves, uint256 tokenId, address owner, uint stake, uint reward, uint256 symmetries, bool keep);
    event stakeRetrieved(uint256 tokenId, address owner, uint stake);
    event cloverChallenged(bytes28[2] moves, uint256 tokenId, address owner, address challenger, uint stake);

    using SafeMath for uint256;
    bool public paused;
    address public oracle;
    address public clovers;
    address public clubToken;
    address public clubTokenController;
    address public simpleCloversMarket;
    address public curationMarket;

    uint256 public basePrice;
    uint256 public priceMultiplier;
    uint256 public payMultiplier;
    uint256 public stakeAmount;
    uint256 public stakePeriod;

    struct Commit {
        bool collected;
        uint256 stake;
        address committer;
    }

    mapping (bytes32 => Commit) public commits;

    modifier notPaused() {
        require(!paused, "Must not be paused");
        _;
    }

    constructor(address _clovers, address _clubToken, address _clubTokenController) public {
        clovers = _clovers;
        clubToken = _clubToken;
        clubTokenController = _clubTokenController;
        paused = true;
    }
    /**
    * @dev Gets the current stake of a Clover based on the hash of the moves.
    * @param movesHash The hash of the moves that make up the clover.
    * @return A uint256 value of stake.
    */
    function getStake(bytes32 movesHash) public view returns (uint256) {
        return commits[movesHash].stake;
    }
    /**
    * @dev Gets the address of the committer of a Clover based on the hash of the moves.
    * @param movesHash The hash of the moves that make up the clover.
    * @return The address of the committer.
    */
    function getCommit(bytes32 movesHash) public view returns (address) {
        return commits[movesHash].committer;
    }
    /**
    * @dev Gets the current staking period needed to verify a Clover.
    * @param _tokenId The token Id of the clover.
    * @return A uint256 value of stake period in seconds.
    */
    function getMovesHash(uint _tokenId) public constant returns (bytes32) {
        return keccak256(Clovers(clovers).getCloverMoves(_tokenId));
    }
    /**
    * @dev Checks whether the game is valid.
    * @param moves The moves needed to play validate the game.
    * @return A boolean representing whether or not the game is valid.
    */
    function isValid(bytes28[2] moves) public constant returns (bool) {
        Reversi.Game memory game = Reversi.playGame(moves);
        return isValidGame(game.error, game.complete);
    }

    /**
    * @dev Checks whether the game is valid.
    * @param error The pre-played game error
    * @param complete The pre-played game complete boolean
    * @return A boolean representing whether or not the game is valid.
    */
    function isValidGame(bool error, bool complete) public pure returns (bool) {
        if (error) return false;
        if (!complete) return false;
        return true;
    }
    /**
    * @dev Checks whether the game has passed the verification period.
    * @param _tokenId The board being checked.
    * @return A boolean representing whether or not the game has been verified.
    */
    function isVerified(uint256 _tokenId) public constant returns (bool) {
        uint256 _blockMinted = Clovers(clovers).getBlockMinted(_tokenId);
        if(_blockMinted == 0) return false;
        return block.number.sub(_blockMinted) > stakePeriod;
    }
    /**
    * @dev Calculates the reward of the board.
    * @param _symmetries symmetries saved as a uint256 value like 00010101 where bits represent symmetry types.
    * @return A uint256 representing the reward that would be returned for claiming the board.
    */
    function calculateReward(uint256 _symmetries) public constant returns (uint256) {
        uint256 Symmetricals;
        uint256 RotSym;
        uint256 Y0Sym;
        uint256 X0Sym;
        uint256 XYSym;
        uint256 XnYSym;
        (Symmetricals,
        RotSym,
        Y0Sym,
        X0Sym,
        XYSym,
        XnYSym) = Clovers(clovers).getAllSymmetries();
        uint256 base = 0;
        if (_symmetries >> 4 & 1 == 1) base = base.add(payMultiplier.mul(Symmetricals + 1).div(RotSym + 1));
        if (_symmetries >> 3 & 1 == 1) base = base.add(payMultiplier.mul(Symmetricals + 1).div(Y0Sym + 1));
        if (_symmetries >> 2 & 1 == 1) base = base.add(payMultiplier.mul(Symmetricals + 1).div(X0Sym + 1));
        if (_symmetries >> 1 & 1 == 1) base = base.add(payMultiplier.mul(Symmetricals + 1).div(XYSym + 1));
        if (_symmetries & 1 == 1) base = base.add(payMultiplier.mul(Symmetricals + 1).div(XnYSym + 1));
        return base;
    }

/*
    // NOTE: Disabled to reduce contract size
    function instantClaimClover(bytes28[2] moves, bool _keep) public payable returns (bool) {
        Reversi.Game memory game = Reversi.playGame(moves);
        require(isValidGame(game.error, game.complete));
        uint256 tokenId = uint256(game.board);
        require(Clovers(clovers).getBlockMinted(tokenId) == 0);
        require(!Clovers(clovers).exists(tokenId));
        Clovers(clovers).setBlockMinted(tokenId, block.number);
        Clovers(clovers).setCloverMoves(tokenId, moves);

        uint256 symmetries = Reversi.returnSymmetricals(game.RotSym, game.Y0Sym, game.X0Sym, game.XYSym, game.XnYSym);
        uint256 reward;

        if (uint256(symmetries) > 0) {
            Clovers(clovers).setSymmetries(tokenId, uint256(symmetries));
            reward = calculateReward(uint256(symmetries));
            Clovers(clovers).setReward(tokenId, reward);
        }
        if (_keep) {
            // If the user decides to keep the Clover, they must
            // pay for it in club tokens according to the reward price.
            if (ClubToken(clubToken).balanceOf(msg.sender) < reward) {
                ClubTokenController(clubTokenController).buy.value(msg.value)(msg.sender); // msg.value needs to be enough to buy "reward" amount of Club Token
            }
            if (reward > 0) {
                // ClubToken(clubToken).transferFrom(msg.sender, clubToken, reward); // if we'd rather keep the money
                ClubToken(clubToken).burn(msg.sender, reward);
            }
            Clovers(clovers).mint(msg.sender, tokenId);
        } else {
            // If the user decides not to keep the Clover, they will
            // receive the reward price in club tokens, and the clover will
            // go for sale at 10x the reward price.
            if (reward > 0) {
                require(ClubToken(clubToken).mint(msg.sender, reward));
            }
            Clovers(clovers).mint(clovers, tokenId);
        }

    } */

    function getPrice(uint256 _symmetries) public constant returns(uint256) {
        return basePrice.add(calculateReward(_symmetries));
    }

    /**
    * @dev Claim the Clover without a commit or reveal. Payable so you can attach enough for the stake,
    * as well as enough to buy tokens if needed to keep the Clover.
    * @param moves The moves that make up the Clover reversi game.
    * @param _tokenId The board that results from the moves.
    * @param _symmetries symmetries saved as a uint256 value like 00010101 where bits represent symmetry
    * types.
    * @return A boolean representing whether or not the claim was successful.
    */
    function claimClover(bytes28[2] moves, uint256 _tokenId, uint256 _symmetries, bool _keep) public payable notPaused returns (bool) {
        emit cloverClaimed(moves, _tokenId, msg.sender, _tokenId, _tokenId, _symmetries, _keep);

        bytes32 movesHash = keccak256(moves);

        require(msg.value >= stakeAmount);
        require(getCommit(movesHash) == 0);

        setCommit(movesHash, msg.sender);
        if (stakeAmount > 0) {
            setStake(movesHash, stakeAmount);
            clovers.transfer(stakeAmount);
        }

        emit cloverCommitted(movesHash, msg.sender);

        require(!Clovers(clovers).exists(_tokenId));
        require(Clovers(clovers).getBlockMinted(_tokenId) == 0);

        Clovers(clovers).setBlockMinted(_tokenId, block.number);
        Clovers(clovers).setCloverMoves(_tokenId, moves);
        Clovers(clovers).setKeep(_tokenId, _keep);

        uint256 reward;
        if (_symmetries > 0) {
            Clovers(clovers).setSymmetries(_tokenId, _symmetries);
            reward = calculateReward(_symmetries);
            Clovers(clovers).setReward(_tokenId, reward);
        }
        uint256 price = basePrice.add(reward);
        if (_keep && price > 0) {
            // If the user decides to keep the Clover, they must
            // pay for it in club tokens according to the reward price.
            if (ClubToken(clubToken).balanceOf(msg.sender) < price) {
                ClubTokenController(clubTokenController).buy.value(msg.value.sub(stakeAmount))(msg.sender);
            }
            require(ClubToken(clubToken).transferFrom(msg.sender, clovers, price));
            // ClubToken(clubToken).burn(committer, price);
        }
        Clovers(clovers).mint(clovers, _tokenId);
        emit cloverClaimed(moves, _tokenId, msg.sender, stakeAmount, reward, _symmetries, _keep);
        return true;
    }


    // This is better than current commit hash because the commiter's address is part of the move sequence
    // otherwise griefing could still take place....
    // function generateCommit(bytes28[2] moves) public view returns(bytes32 commitHash) {
    //     return sha256(moves, msg.sender);
    // }

    /**
    * @dev Commit the hash of the moves needed to claim the Clover. A stake should be
    * made for counterfactual verification.
    * @param movesHash The hash of the moves that makes up the Clover reversi
    * game.
    * @return A boolean representing whether or not the commit was successful.
    NOTE: Disabled for contract size, if front running becomes a problem it can be
    implemented with an upgrade
    */
    /* function claimCloverCommit(bytes32 movesHash) public payable returns (bool) {
        require(msg.value >= stakeAmount);
        require(getCommit(movesHash) == 0);

        setCommit(movesHash, msg.sender);
        setStake(movesHash, stakeAmount);

        clovers.transfer(stakeAmount);

        emit cloverCommitted(movesHash, msg.sender);
        return true;
    }
    /**
    * @dev Reveal the solution to the previous commit to claim the Clover.
    * @param moves The moves that make up the Clover reversi game.
    * @param _tokenId The board that results from the moves.
    * @param _symmetries symmetries saved as a uint256 value like 00010101 where bits represent symmetry types.
    * @return A boolean representing whether or not the reveal and claim was successful.
    NOTE: Disabled for contract size, if front running becomes a problem it can be implemented with an upgrade
    */
    /* function claimCloverReveal(bytes28[2] moves, uint256 _tokenId, uint256 _symmetries, bool _keep) public returns (bool) {
        bytes32 movesHash = keccak256(moves);
        address committer = getCommit(movesHash);

        require(Clovers(clovers).getBlockMinted(_tokenId) == 0);

        Clovers(clovers).setBlockMinted(_tokenId, block.number);
        Clovers(clovers).setCloverMoves(_tokenId, moves);
        Clovers(clovers).setKeep(_tokenId, _keep);
        uint256 reward;
        if (_symmetries > 0) {
            Clovers(clovers).setSymmetries(_tokenId, _symmetries);
            reward = calculateReward(_symmetries);
            Clovers(clovers).setReward(_tokenId, reward);
        }
        if (_keep) {
            ClubToken(clubToken).increaseApproval(address(this), basePrice.add(reward));
        }
        uint256 stake = getStake(movesHash);
        emit cloverClaimed(moves, _tokenId, committer, stake, reward, _symmetries, _keep);
        return true;
    } */

    /**
    * @dev Retrieve the stake from a Clover claim after the stake period has ended, or with the authority of the oracle.
    * @param _tokenId The board which holds the stake.
    * @return A boolean representing whether or not the retrieval was successful.
    */
    function retrieveStake(uint256 _tokenId) public payable returns (bool) {
        bytes28[2] memory moves = Clovers(clovers).getCloverMoves(_tokenId);
        bytes32 movesHash = keccak256(moves);

        require(!commits[movesHash].collected);
        commits[movesHash].collected = true;

        require(isVerified(_tokenId) || msg.sender == owner || msg.sender == oracle);

        uint256 stake = getStake(movesHash);
        addSymmetries(_tokenId);
        address committer = getCommit(movesHash);
        require(committer == msg.sender || msg.sender == owner || msg.sender == oracle);
        uint256 reward = Clovers(clovers).getReward(_tokenId);
        bool _keep = Clovers(clovers).getKeep(_tokenId);

        if (_keep) {
            // If the user decided to keep the Clover, they will
            // receive the clover now that it has been verified
            Clovers(clovers).transferFrom(clovers, committer, _tokenId);
        } else {
            // If the user decided not to keep the Clover, they will
            // receive the reward price in club tokens, and the clover will
            // go for sale by the contract.
            ISimpleCloversMarket(simpleCloversMarket).sell(_tokenId, basePrice.add(reward.mul(priceMultiplier)));
            if (reward > 0) {
                require(ClubToken(clubToken).mint(committer, reward));
            }
        }
        if (stake > 0) {
            Clovers(clovers).moveEth(msg.sender, stake);
        }
        emit stakeRetrieved(_tokenId, msg.sender, stake);
        return true;
    }


    /**
    * @dev Convert a bytes16 board into a uint256.
    * @param _board The board being converted.
    * @return number the uint256 being converted.
    */
    function convertBytes16ToUint(bytes16 _board) public view returns(uint256 number) {
        for(uint i=0;i<_board.length;i++){
            number = number + uint(_board[i])*(2**(8*(_board.length-(i+1))));
        }
    }

    /**
    * @dev Challenge a staked Clover for being invalid.
    * @param _tokenId The board being challenged.
    * @return A boolean representing whether or not the challenge was successful.
    */
    function challengeClover(uint256 _tokenId) public returns (bool) {
        bool valid = true;
        bytes28[2] memory moves = Clovers(clovers).getCloverMoves(_tokenId);

        if (msg.sender != owner && msg.sender != oracle) {
            Reversi.Game memory game = Reversi.playGame(moves);
            if(convertBytes16ToUint(game.board) != _tokenId) {
                valid = false;
            }
            if(valid && isValidGame(game.error, game.complete)) {
                uint256 _symmetries = Clovers(clovers).getSymmetries(_tokenId);
                valid = (_symmetries >> 4 & 1) > 0 == game.RotSym ? valid : false;
                valid = (_symmetries >> 3 & 1) > 0 == game.Y0Sym ? valid : false;
                valid = (_symmetries >> 2 & 1) > 0 == game.X0Sym ? valid : false;
                valid = (_symmetries >> 1 & 1) > 0 == game.XYSym ? valid : false;
                valid = (_symmetries & 1) > 0 == game.XnYSym ? valid : false;
            } else {
                valid = false;
            }
            require(!valid);
        }
        bytes32 movesHash = keccak256(moves);
        uint256 stake = getStake(movesHash);
        if (!isVerified(_tokenId) && stake > 0) {
            Clovers(clovers).moveEth(msg.sender, stake);
        }
        if (commits[movesHash].collected) {
            removeSymmetries(_tokenId);
        }

        address committer = getCommit(movesHash);
        emit cloverChallenged(moves, _tokenId, committer, msg.sender, stake);

        Clovers(clovers).deleteClover(_tokenId);
        deleteCommit(movesHash);
        return true;
    }


    /**
    * @dev Moves clovers without explicit allow permission for use by simpleCloversMarket
    * in order to avoid double transaction (allow, transferFrom)
    * @param _from The current owner of the Clover
    * @param _to The future owner of the Clover
    * @param _tokenId The Clover
    */
    function transferFrom(address _from, address _to, uint256 _tokenId) public {
        require(msg.sender == simpleCloversMarket || msg.sender == curationMarket);
        Clovers(clovers).transferFrom(_from, _to, _tokenId);
    }

    /**
    * @dev Updates pause boolean.
    * @param _paused The new puased boolean.
    */
    function updatePaused(bool _paused) public onlyOwner {
        paused = _paused;
    }

    /**
    * @dev Updates curationMarket Address.
    * @param _curationMarket The new curationMarket Address.
    */
    function updateCurationMarket(address _curationMarket) public onlyOwner {
        curationMarket = _curationMarket;
    }
    /**
    * @dev Updates oracle Address.
    * @param _oracle The new oracle Address.
    */
    function updateOracle(address _oracle) public onlyOwner {
        oracle = _oracle;
    }

    /**
    * @dev Updates simpleCloversMarket Address.
    * @param _simpleCloversMarket The new simpleCloversMarket address.
    */
    function updateSimpleCloversMarket(address _simpleCloversMarket) public onlyOwner {
        simpleCloversMarket = _simpleCloversMarket;
    }

    /**
    * @dev Updates clubTokenController Address.
    * @param _clubTokenController The new clubTokenController address.
    */
    function updateClubTokenController(address _clubTokenController) public onlyOwner {
        clubTokenController = _clubTokenController;
    }
    /**
    * @dev Updates the stake amount.
    * @param _stakeAmount The new amount needed to stake.
    */
    function updateStakeAmount(uint256 _stakeAmount) public onlyOwner {
        stakeAmount = _stakeAmount;
    }
    /**
    * @dev Updates the stake period.
    * @param _stakePeriod The uint256 value of time needed to stake before being verified.
    */
    function updateStakePeriod(uint256 _stakePeriod) public onlyOwner {
        stakePeriod = _stakePeriod;
    }
    /**
    * @dev Updates the pay multiplier, used to calculate token reward.
    * @param _payMultiplier The uint256 value of pay multiplier.
    */
    function updatePayMultipier(uint256 _payMultiplier) public onlyOwner {
        payMultiplier = _payMultiplier;
    }
    /**
    * @dev Updates the price multiplier, used to calculate the clover price (multiplied by the original reward).
    * @param _priceMultiplier The uint256 value of the price multiplier.
    */
    function updatePriceMultipier(uint256 _priceMultiplier) public onlyOwner {
        priceMultiplier = _priceMultiplier;
    }
    /**
    * @dev Updates the base price, used to calculate the clover cost.
    * @param _basePrice The uint256 value of the base price.
    */
    function updateBasePrice(uint256 _basePrice) public onlyOwner {
        basePrice = _basePrice;
    }

    /**
    * @dev Sets the stake of a Clover based on the hash of the moves.
    * @param movesHash The hash of the moves that make up the clover.
    * @param stake A uint256 value of stake.
    */
    function setStake(bytes32 movesHash, uint256 stake) private {
        commits[movesHash].stake = stake;
    }

    /**
    * @dev Sets the address of the committer of a Clover based on the hash of the moves.
    * @param movesHash The hash of the moves that make up the clover.
    * @param committer The address of the committer.
    */
    function setCommit(bytes32 movesHash, address committer) private {
        commits[movesHash].committer = committer;
    }

    function _setCommit(bytes32 movesHash, address committer) onlyOwner {
        setCommit(movesHash, committer);
    }
    function deleteCommit(bytes32 movesHash) private {
        delete(commits[movesHash]);
    }

    /**
    * @dev Adds new tallys of the totals numbers of clover symmetries.
    * @param _tokenId The token which needs to be examined.
    */
    function addSymmetries(uint256 _tokenId) private {
        uint256 Symmetricals;
        uint256 RotSym;
        uint256 Y0Sym;
        uint256 X0Sym;
        uint256 XYSym;
        uint256 XnYSym;
        (Symmetricals,
        RotSym,
        Y0Sym,
        X0Sym,
        XYSym,
        XnYSym) = Clovers(clovers).getAllSymmetries();
        uint256 _symmetries = Clovers(clovers).getSymmetries(_tokenId);
        Symmetricals = Symmetricals.add(_symmetries > 0 ? 1 : 0);
        RotSym = RotSym.add(uint256(_symmetries >> 4 & 1));
        Y0Sym = Y0Sym.add(uint256(_symmetries >> 3 & 1));
        X0Sym = X0Sym.add(uint256(_symmetries >> 2 & 1));
        XYSym = XYSym.add(uint256(_symmetries >> 1 & 1));
        XnYSym = XnYSym.add(uint256(_symmetries & 1));
        Clovers(clovers).setAllSymmetries(Symmetricals, RotSym, Y0Sym, X0Sym, XYSym, XnYSym);
    }
    /**
    * @dev Remove false tallys of the totals numbers of clover symmetries.
    * @param _tokenId The token which needs to be examined.
    */
    function removeSymmetries(uint256 _tokenId) private {
        uint256 Symmetricals;
        uint256 RotSym;
        uint256 Y0Sym;
        uint256 X0Sym;
        uint256 XYSym;
        uint256 XnYSym;
        (Symmetricals,
        RotSym,
        Y0Sym,
        X0Sym,
        XYSym,
        XnYSym) = Clovers(clovers).getAllSymmetries();
        uint256 _symmetries = Clovers(clovers).getSymmetries(_tokenId);
        Symmetricals = Symmetricals.sub(_symmetries > 0 ? 1 : 0);
        RotSym = RotSym.sub(uint256(_symmetries >> 4 & 1));
        Y0Sym = Y0Sym.sub(uint256(_symmetries >> 3 & 1));
        X0Sym = X0Sym.sub(uint256(_symmetries >> 2 & 1));
        XYSym = XYSym.sub(uint256(_symmetries >> 1 & 1));
        XnYSym = XnYSym.sub(uint256(_symmetries & 1));
        Clovers(clovers).setAllSymmetries(Symmetricals, RotSym, Y0Sym, X0Sym, XYSym, XnYSym);
    }

}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_curationMarket","type":"address"}],"name":"updateCurationMarket","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_paused","type":"bool"}],"name":"updatePaused","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"clovers","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"}],"name":"reclaimToken","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_oracle","type":"address"}],"name":"updateOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"error","type":"bool"},{"name":"complete","type":"bool"}],"name":"isValidGame","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"moves","type":"bytes28[2]"}],"name":"isValid","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"isVerified","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"payMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"moves","type":"bytes28[2]"},{"name":"_tokenId","type":"uint256"},{"name":"_symmetries","type":"uint256"},{"name":"_keep","type":"bool"}],"name":"claimClover","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"movesHash","type":"bytes32"},{"name":"committer","type":"address"}],"name":"_setCommit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"commits","outputs":[{"name":"collected","type":"bool"},{"name":"stake","type":"uint256"},{"name":"committer","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_stakePeriod","type":"uint256"}],"name":"updateStakePeriod","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":"stakeAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"curationMarket","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"challengeClover","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"oracle","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"movesHash","type":"bytes32"}],"name":"getCommit","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_payMultiplier","type":"uint256"}],"name":"updatePayMultipier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_clubTokenController","type":"address"}],"name":"updateClubTokenController","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"simpleCloversMarket","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"reclaimEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_board","type":"bytes16"}],"name":"convertBytes16ToUint","outputs":[{"name":"number","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_priceMultiplier","type":"uint256"}],"name":"updatePriceMultipier","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"clubTokenController","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from_","type":"address"},{"name":"value_","type":"uint256"},{"name":"data_","type":"bytes"}],"name":"tokenFallback","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"stakePeriod","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"retrieveStake","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"basePrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_stakeAmount","type":"uint256"}],"name":"updateStakeAmount","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_simpleCloversMarket","type":"address"}],"name":"updateSimpleCloversMarket","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"getMovesHash","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_symmetries","type":"uint256"}],"name":"calculateReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"priceMultiplier","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"clubToken","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_symmetries","type":"uint256"}],"name":"getPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"movesHash","type":"bytes32"}],"name":"getStake","outputs":[{"name":"","type":"uint256"}],"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":"_basePrice","type":"uint256"}],"name":"updateBasePrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_clovers","type":"address"},{"name":"_clubToken","type":"address"},{"name":"_clubTokenController","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"movesHash","type":"bytes32"},{"indexed":false,"name":"owner","type":"address"}],"name":"cloverCommitted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"moves","type":"bytes28[2]"},{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"stake","type":"uint256"},{"indexed":false,"name":"reward","type":"uint256"},{"indexed":false,"name":"symmetries","type":"uint256"},{"indexed":false,"name":"keep","type":"bool"}],"name":"cloverClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"stake","type":"uint256"}],"name":"stakeRetrieved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"moves","type":"bytes28[2]"},{"indexed":false,"name":"tokenId","type":"uint256"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"challenger","type":"address"},{"indexed":false,"name":"stake","type":"uint256"}],"name":"cloverChallenged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

608060405234801561001057600080fd5b50604051606080620042d983398101604090815281516020830151919092015160008054600160a060020a03191633179055341561004d57600080fd5b60028054600160a060020a03948516600160a060020a0319918216179091556003805493851693821693909317909255600480549190931691161790556000805460a060020a60ff0219167401000000000000000000000000000000000000000017905561421880620000c16000396000f30060806040526004361061020d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416627173c8811461021c57806308cdc2a81461024c5780630d576bfa1461026657806317ffc320146102a45780631cb44dfc146102d2578063225c35b21461030057806323b872dd14610333578063271eff941461036a57806337b6d96b146103aa5780633afcba96146103c257806343be0880146103e957806346d2ce201461042a578063478857811461045b5780635759f3f7146104a95780635c975abb146104c157806360c7dc47146104d6578063715018a6146104eb57806372420f06146105005780637b7db9fa146105155780637dc0d1d01461052d5780638784ea96146105425780638a05aafa1461055a5780638da5cb5b146105725780639564e18014610587578063975e4b2a146105b55780639f727c27146105ca578063a4a83ca6146105df578063a7e901b01461060a578063a89b55da14610622578063c0ee0b8a14610637578063c1699a9914610675578063c1fe551a1461068a578063c7876ea414610695578063c90054ee146106aa578063d010ed70146106c2578063d09687f7146106f0578063d2d7231f14610708578063d50cb88b14610720578063d76bbd5214610735578063e75722301461074a578063e765c12214610762578063f2fde38b1461077a578063fd5baa88146107a8575b34801561021957600080fd5b50005b34801561022857600080fd5b5061024a73ffffffffffffffffffffffffffffffffffffffff600435166107c0565b005b34801561025857600080fd5b5061024a600435151561082b565b34801561027257600080fd5b5061027b610899565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156102b057600080fd5b5061024a73ffffffffffffffffffffffffffffffffffffffff600435166108b5565b3480156102de57600080fd5b5061024a73ffffffffffffffffffffffffffffffffffffffff600435166109a8565b34801561030c57600080fd5b5061031f60043515156024351515610a13565b604080519115158252519081900360200190f35b34801561033f57600080fd5b5061024a73ffffffffffffffffffffffffffffffffffffffff60043581169060243516604435610a3c565b34801561037657600080fd5b5060408051808201825261031f913691600491604491908390600290839083908082843750939650610b2495505050505050565b3480156103b657600080fd5b5061031f600435610b54565b3480156103ce57600080fd5b506103d7610c25565b60408051918252519081900360200190f35b60408051808201825261031f913691600491604491908390600290839083908082843750939650508335945050506020820135916040013515159050610c2b565b34801561043657600080fd5b5061024a60043573ffffffffffffffffffffffffffffffffffffffff60243516611669565b34801561046757600080fd5b50610473600435611697565b604080519315158452602084019290925273ffffffffffffffffffffffffffffffffffffffff1682820152519081900360600190f35b3480156104b557600080fd5b5061024a6004356116d2565b3480156104cd57600080fd5b5061031f6116fb565b3480156104e257600080fd5b506103d761171c565b3480156104f757600080fd5b5061024a611722565b34801561050c57600080fd5b5061027b6117b3565b34801561052157600080fd5b5061031f6004356117cf565b34801561053957600080fd5b5061027b611cde565b34801561054e57600080fd5b5061027b600435611cfa565b34801561056657600080fd5b5061024a600435611d25565b34801561057e57600080fd5b5061027b611d4e565b34801561059357600080fd5b5061024a73ffffffffffffffffffffffffffffffffffffffff60043516611d6a565b3480156105c157600080fd5b5061027b611dd5565b3480156105d657600080fd5b5061024a611df1565b3480156105eb57600080fd5b506103d76fffffffffffffffffffffffffffffffff1960043516611e60565b34801561061657600080fd5b5061024a600435611ec0565b34801561062e57600080fd5b5061027b611ee9565b34801561064357600080fd5b5061024a6004803573ffffffffffffffffffffffffffffffffffffffff16906024803591604435918201910135611f05565b34801561068157600080fd5b506103d7611f0a565b61031f600435611f10565b3480156106a157600080fd5b506103d761258c565b3480156106b657600080fd5b5061024a600435612592565b3480156106ce57600080fd5b5061024a73ffffffffffffffffffffffffffffffffffffffff600435166125bb565b3480156106fc57600080fd5b506103d7600435612626565b34801561071457600080fd5b506103d760043561270f565b34801561072c57600080fd5b506103d761291d565b34801561074157600080fd5b5061027b612923565b34801561075657600080fd5b506103d760043561293f565b34801561076e57600080fd5b506103d760043561294d565b34801561078657600080fd5b5061024a73ffffffffffffffffffffffffffffffffffffffff60043516612962565b3480156107b457600080fd5b5061024a60043561298f565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107e457600080fd5b600680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461084f57600080fd5b6000805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146108da57600080fd5b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a082319160248083019260209291908290030181600087803b15801561094857600080fd5b505af115801561095c573d6000803e3d6000fd5b505050506040513d602081101561097257600080fd5b50516000549091506109a49073ffffffffffffffffffffffffffffffffffffffff84811691168363ffffffff6129b816565b5050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109cc57600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60008215610a2357506000610a36565b811515610a3257506000610a36565b5060015b92915050565b60055473ffffffffffffffffffffffffffffffffffffffff16331480610a79575060065473ffffffffffffffffffffffffffffffffffffffff1633145b1515610a8457600080fd5b600254604080517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152858116602483015260448201859052915191909216916323b872dd91606480830192600092919082900301818387803b158015610b0757600080fd5b505af1158015610b1b573d6000803e3d6000fd5b50505050505050565b6000610b2e6140f7565b610b3783612a97565b9050610b4b81600001518260200151610a13565b91505b50919050565b600254604080517f03a53d6b000000000000000000000000000000000000000000000000000000008152600481018490529051600092839273ffffffffffffffffffffffffffffffffffffffff909116916303a53d6b9160248082019260209290919082900301818787803b158015610bcc57600080fd5b505af1158015610be0573d6000803e3d6000fd5b505050506040513d6020811015610bf657600080fd5b50519050801515610c0a5760009150610b4e565b600b54610c1d438363ffffffff612ccc16565b119392505050565b60095481565b6000805481908190819074010000000000000000000000000000000000000000900460ff1615610cbc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f4d757374206e6f74206265207061757365640000000000000000000000000000604482015290519081900360640190fd5b7f1c3b3e1e72950ae52150ec48810521d17cea4b30c2a59c807d1ba2f8dff57e658888338a8b8b8b6040518088600260200280838360005b83811015610d0c578181015183820152602001610cf4565b5050505091909101978852505073ffffffffffffffffffffffffffffffffffffffff90941660208601526040808601939093526060850191909152608084015290151560a0830152519081900360c0019150a1876040518082600260200280838360005b83811015610d88578181015183820152602001610d70565b5050505090500191505060405180910390209250600a543410151515610dad57600080fd5b610db683611cfa565b73ffffffffffffffffffffffffffffffffffffffff1615610dd657600080fd5b610de08333612cde565b6000600a541115610e4257610df783600a54612d34565b600254600a5460405173ffffffffffffffffffffffffffffffffffffffff9092169181156108fc0291906000818181858888f19350505050158015610e40573d6000803e3d6000fd5b505b6040805184815233602082015281517f4c0f83654ac2972673e4d81058f833de298389df1dce04cc2db9f231b907d5ff929181900390910190a1600254604080517f4f558e79000000000000000000000000000000000000000000000000000000008152600481018a9052905173ffffffffffffffffffffffffffffffffffffffff90921691634f558e79916024808201926020929091908290030181600087803b158015610ef057600080fd5b505af1158015610f04573d6000803e3d6000fd5b505050506040513d6020811015610f1a57600080fd5b505115610f2657600080fd5b600254604080517f03a53d6b000000000000000000000000000000000000000000000000000000008152600481018a9052905173ffffffffffffffffffffffffffffffffffffffff909216916303a53d6b916024808201926020929091908290030181600087803b158015610f9a57600080fd5b505af1158015610fae573d6000803e3d6000fd5b505050506040513d6020811015610fc457600080fd5b505115610fd057600080fd5b600254604080517fe3100d1e000000000000000000000000000000000000000000000000000000008152600481018a9052436024820152905173ffffffffffffffffffffffffffffffffffffffff9092169163e3100d1e9160448082019260009290919082900301818387803b15801561104957600080fd5b505af115801561105d573d6000803e3d6000fd5b5050600254604080517f0b628395000000000000000000000000000000000000000000000000000000008152600481018c815273ffffffffffffffffffffffffffffffffffffffff9093169450630b62839593508b928d92909160240190839080838360005b838110156110db5781810151838201526020016110c3565b5050505090500192505050600060405180830381600087803b15801561110057600080fd5b505af1158015611114573d6000803e3d6000fd5b5050600254604080517f76e4a87f000000000000000000000000000000000000000000000000000000008152600481018c90528915156024820152905173ffffffffffffffffffffffffffffffffffffffff90921693506376e4a87f925060448082019260009290919082900301818387803b15801561119357600080fd5b505af11580156111a7573d6000803e3d6000fd5b5050505060008611156112e557600254604080517fdc3f7758000000000000000000000000000000000000000000000000000000008152600481018a905260248101899052905173ffffffffffffffffffffffffffffffffffffffff9092169163dc3f77589160448082019260009290919082900301818387803b15801561122e57600080fd5b505af1158015611242573d6000803e3d6000fd5b5050505061124f8661270f565b600254604080517fa47bd496000000000000000000000000000000000000000000000000000000008152600481018b905260248101849052905192945073ffffffffffffffffffffffffffffffffffffffff9091169163a47bd4969160448082019260009290919082900301818387803b1580156112cc57600080fd5b505af11580156112e0573d6000803e3d6000fd5b505050505b6007546112f8908363ffffffff612d4916565b90508480156113075750600081115b1561152457600354604080517f70a082310000000000000000000000000000000000000000000000000000000081523360048201529051839273ffffffffffffffffffffffffffffffffffffffff16916370a082319160248083019260209291908290030181600087803b15801561137e57600080fd5b505af1158015611392573d6000803e3d6000fd5b505050506040513d60208110156113a857600080fd5b5051101561146857600454600a5473ffffffffffffffffffffffffffffffffffffffff9091169063f088d547906113e690349063ffffffff612ccc16565b604080517c010000000000000000000000000000000000000000000000000000000063ffffffff85160281523360048201529051602480830192602092919082900301818588803b15801561143a57600080fd5b505af115801561144e573d6000803e3d6000fd5b50505050506040513d602081101561146557600080fd5b50505b600354600254604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff928316602482015260448101859052905191909216916323b872dd9160648083019260209291908290030181600087803b1580156114ed57600080fd5b505af1158015611501573d6000803e3d6000fd5b505050506040513d602081101561151757600080fd5b5051151561152457600080fd5b600254604080517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90921660048301819052602483018a9052905190916340c10f1991604480830192600092919082900301818387803b15801561159e57600080fd5b505af11580156115b2573d6000803e3d6000fd5b505050507f1c3b3e1e72950ae52150ec48810521d17cea4b30c2a59c807d1ba2f8dff57e65888833600a54868b8b6040518088600260200280838360005b838110156116085781810151838201526020016115f0565b5050505091909101978852505073ffffffffffffffffffffffffffffffffffffffff90941660208601526040808601939093526060850191909152608084015290151560a0830152519081900360c0019150a1506001979650505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461168d57600080fd5b6109a48282612cde565b600c6020526000908152604090208054600182015460029092015460ff909116919073ffffffffffffffffffffffffffffffffffffffff1683565b60005473ffffffffffffffffffffffffffffffffffffffff1633146116f657600080fd5b600b55565b60005474010000000000000000000000000000000000000000900460ff1681565b600a5481565b60005473ffffffffffffffffffffffffffffffffffffffff16331461174657600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a2600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b6000806117da614173565b6117e26140f7565b600254604080517f62f9acf90000000000000000000000000000000000000000000000000000000081526004810188905281516001965060009384938493849373ffffffffffffffffffffffffffffffffffffffff909316926362f9acf99260248084019391929182900301818787803b15801561185f57600080fd5b505af1158015611873573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250604081101561189857600080fd5b5060005490965073ffffffffffffffffffffffffffffffffffffffff1633148015906118dc575060015473ffffffffffffffffffffffffffffffffffffffff163314155b15611a83576118ea86612a97565b9450886118fb866101000151611e60565b1461190557600096505b86801561191f575061191f85600001518660200151610a13565b15611a7357600254604080517fc53b4bf9000000000000000000000000000000000000000000000000000000008152600481018c9052905173ffffffffffffffffffffffffffffffffffffffff9092169163c53b4bf9916024808201926020929091908290030181600087803b15801561199857600080fd5b505af11580156119ac573d6000803e3d6000fd5b505050506040513d60208110156119c257600080fd5b50516060860151909450151560006010860460011611146119e45760006119e6565b865b608086015190975015156000600886046001161114611a06576000611a08565b865b60a086015190975015156000600486046001161114611a28576000611a2a565b865b60c086015190975015156000600160028704161114611a4a576000611a4c565b865b96508460e00151151560008560011611151514611a6a576000611a6c565b865b9650611a78565b600096505b8615611a8357600080fd5b856040518082600260200280838360005b83811015611aac578181015183820152602001611a94565b5050505090500191505060405180910390209250611ac98361294d565b9150611ad489610b54565b158015611ae15750600082115b15611b7857600254604080517f1cc1472d00000000000000000000000000000000000000000000000000000000815233600482015260248101859052905173ffffffffffffffffffffffffffffffffffffffff90921691631cc1472d9160448082019260009290919082900301818387803b158015611b5f57600080fd5b505af1158015611b73573d6000803e3d6000fd5b505050505b6000838152600c602052604090205460ff1615611b9857611b9889612d56565b611ba183611cfa565b90507f23e709ab80a4bee9454ba0d08c0b669d684531b4ec766524c43abd788cc3ca76868a8333866040518086600260200280838360005b83811015611bf1578181015183820152602001611bd9565b5050505091909101958652505073ffffffffffffffffffffffffffffffffffffffff92831660208501529116604080840191909152606083019190915251908190036080019150a1600254604080517f0e8310d6000000000000000000000000000000000000000000000000000000008152600481018c9052905173ffffffffffffffffffffffffffffffffffffffff90921691630e8310d69160248082019260009290919082900301818387803b158015611cac57600080fd5b505af1158015611cc0573d6000803e3d6000fd5b50505050611ccd83613080565b600197505b50505050505050919050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6000908152600c602052604090206002015473ffffffffffffffffffffffffffffffffffffffff1690565b60005473ffffffffffffffffffffffffffffffffffffffff163314611d4957600080fd5b600955565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314611d8e57600080fd5b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314611e1557600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff90911691303180156108fc02929091818181858888f19350505050158015611e5d573d6000803e3d6000fd5b50565b6000805b6010811015610b4e5780600101601060ff160360080260020a8382601081101515611e8b57fe5b7f010000000000000000000000000000000000000000000000000000000000000091901a810204029190910190600101611e64565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ee457600080fd5b600855565b60045473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b600b5481565b6000611f1a614173565b600254604080517f62f9acf9000000000000000000000000000000000000000000000000000000008152600481018690528151600093849384938493849373ffffffffffffffffffffffffffffffffffffffff16926362f9acf9926024808201939182900301818787803b158015611f9157600080fd5b505af1158015611fa5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506040811015611fca57600080fd5b50604080519197508791908190839080838360005b83811015611ff7578181015183820152602001611fdf565b505060408051959093018590039094206000818152600c6020529290922054919a505060ff1615935061202d9250505057600080fd5b6000858152600c6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561206d88610b54565b8061208f575060005473ffffffffffffffffffffffffffffffffffffffff1633145b806120b1575060015473ffffffffffffffffffffffffffffffffffffffff1633145b15156120bc57600080fd5b6120c58561294d565b93506120d0886130e7565b6120d985611cfa565b925073ffffffffffffffffffffffffffffffffffffffff8316331480612116575060005473ffffffffffffffffffffffffffffffffffffffff1633145b80612138575060015473ffffffffffffffffffffffffffffffffffffffff1633145b151561214357600080fd5b600254604080517f1c4b774b000000000000000000000000000000000000000000000000000000008152600481018b9052905173ffffffffffffffffffffffffffffffffffffffff90921691631c4b774b916024808201926020929091908290030181600087803b1580156121b757600080fd5b505af11580156121cb573d6000803e3d6000fd5b505050506040513d60208110156121e157600080fd5b5051600254604080517f04952631000000000000000000000000000000000000000000000000000000008152600481018c9052905192945073ffffffffffffffffffffffffffffffffffffffff909116916304952631916024808201926020929091908290030181600087803b15801561225a57600080fd5b505af115801561226e573d6000803e3d6000fd5b505050506040513d602081101561228457600080fd5b50519050801561232c57600254604080517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316600482018190529286166024820152604481018b905290516323b872dd9160648082019260009290919082900301818387803b15801561230f57600080fd5b505af1158015612323573d6000803e3d6000fd5b505050506124a4565b60055460085473ffffffffffffffffffffffffffffffffffffffff9091169063d79875eb908a906123779061236890879063ffffffff61335616565b6007549063ffffffff612d4916565b6040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050600060405180830381600087803b1580156123d057600080fd5b505af11580156123e4573d6000803e3d6000fd5b5050505060008211156124a457600354604080517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff868116600483015260248201869052915191909216916340c10f199160448083019260209291908290030181600087803b15801561246d57600080fd5b505af1158015612481573d6000803e3d6000fd5b505050506040513d602081101561249757600080fd5b505115156124a457600080fd5b600084111561253f57600254604080517f1cc1472d00000000000000000000000000000000000000000000000000000000815233600482015260248101879052905173ffffffffffffffffffffffffffffffffffffffff90921691631cc1472d9160448082019260009290919082900301818387803b15801561252657600080fd5b505af115801561253a573d6000803e3d6000fd5b505050505b6040805189815233602082015280820186905290517fa8a1a24efbea93a5c7f29342ba7652cd030828e12cc15c1416480fecee73d5899181900360600190a1506001979650505050505050565b60075481565b60005473ffffffffffffffffffffffffffffffffffffffff1633146125b657600080fd5b600a55565b60005473ffffffffffffffffffffffffffffffffffffffff1633146125df57600080fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600254604080517f62f9acf900000000000000000000000000000000000000000000000000000000815260048101849052815160009373ffffffffffffffffffffffffffffffffffffffff16926362f9acf9926024808201939182900301818787803b15801561269557600080fd5b505af11580156126a9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525060408110156126ce57600080fd5b5060408051908190839080838360005b838110156126f65781810151838201526020016126de565b5050505090500191505060405180910390209050919050565b600080600080600080600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663785d8d716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160c060405180830381600087803b1580156127a157600080fd5b505af11580156127b5573d6000803e3d6000fd5b505050506040513d60c08110156127cb57600080fd5b508051602082015160408301516060840151608085015160a090950151939b5091995097509550909350915060009050600160108a0481161415612847576128446128378760010161282b8a60010160095461335690919063ffffffff16565b9063ffffffff61337f16565b829063ffffffff612d4916565b90505b600160088a048116141561287a576128776128378660010161282b8a60010160095461335690919063ffffffff16565b90505b600160048a04811614156128ad576128aa6128378560010161282b8a60010160095461335690919063ffffffff16565b90505b600160028a04811614156128e0576128dd6128378460010161282b8a60010160095461335690919063ffffffff16565b90505b88600116600114156129115761290e6128378360010161282b8a60010160095461335690919063ffffffff16565b90505b98975050505050505050565b60085481565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b6000610a366123688361270f565b6000908152600c602052604090206001015490565b60005473ffffffffffffffffffffffffffffffffffffffff16331461298657600080fd5b611e5d81613394565b60005473ffffffffffffffffffffffffffffffffffffffff1633146129b357600080fd5b600755565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612a5b57600080fd5b505af1158015612a6f573d6000803e3d6000fd5b505050506040513d6020811015612a8557600080fd5b50511515612a9257600080fd5b505050565b612a9f6140f7565b612aa76140f7565b82517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000009081166101208301526020808501519091166101408301526000610180830181905260026101a084018190526101c084015280835290820181905260016101608301527ffffffffffffffe7ffdbfffffffffffff0000000000000000000000000000000061010083015280808080805b603c8260ff16108015612b4b575085155b15612c9c57602087610180015160ff1610612b6b57866101400151612b72565b8661012001515b9050612b9481602089610180015160ff16811515612b8c57fe5b066020613443565b9450612b9f856134b2565b9094509250612bad856134ed565b15955060ff8216158015612bd357508360ff166002141580612bd357508260ff16600314155b15612be057600180885295505b85158015612bf1575060088460ff16105b8015612c00575060088360ff16105b8015612c10575060008460ff1610155b8015612c20575060008360ff1610155b15612c9157612c308785856134fa565b6101808101805160010160ff169052805190975015612c91576000875261016087015160ff1660011415612c6b576002610160880152612c74565b60016101608801525b612c7f8785856134fa565b805190975015612c9157600180885295505b600190910190612b3a565b86511515612cbf5760008752612cb18761376e565b9650612cbc8761396a565b96505b5094979650505050505050565b600082821115612cd857fe5b50900390565b6000918252600c602052604090912060020180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000918252600c602052604090912060010155565b81810182811015610a3657fe5b6000806000806000806000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663785d8d716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160c060405180830381600087803b158015612de757600080fd5b505af1158015612dfb573d6000803e3d6000fd5b505050506040513d60c0811015612e1157600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050809750819850829950839a50849b50859c50505050505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c53b4bf9896040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b158015612efd57600080fd5b505af1158015612f11573d6000803e3d6000fd5b505050506040513d6020811015612f2757600080fd5b50519050612f5060008211612f3d576000612f40565b60015b889060ff1663ffffffff612ccc16565b9650612f68866001601084041663ffffffff612ccc16565b9550612f80856001600884041663ffffffff612ccc16565b9450612f98846001600484041663ffffffff612ccc16565b9350612fb0836002830460011663ffffffff612ccc16565b9250612fc5826001831663ffffffff612ccc16565b600254604080517f8b1b2ba8000000000000000000000000000000000000000000000000000000008152600481018b9052602481018a905260448101899052606481018890526084810187905260a48101849052905192945073ffffffffffffffffffffffffffffffffffffffff90911691638b1b2ba89160c48082019260009290919082900301818387803b15801561305e57600080fd5b505af1158015613072573d6000803e3d6000fd5b505050505050505050505050565b6000908152600c6020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168155600181019190915560020180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000806000806000806000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663785d8d716040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160c060405180830381600087803b15801561317857600080fd5b505af115801561318c573d6000803e3d6000fd5b505050506040513d60c08110156131a257600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050809750819850829950839a50849b50859c50505050505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c53b4bf9896040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15801561328e57600080fd5b505af11580156132a2573d6000803e3d6000fd5b505050506040513d60208110156132b857600080fd5b505190506132e1600082116132ce5760006132d1565b60015b889060ff1663ffffffff612d4916565b96506132f9866001601084041663ffffffff612d4916565b9550613311856001600884041663ffffffff612d4916565b9450613329846001600484041663ffffffff612d4916565b9350613341836002830460011663ffffffff612d4916565b9250612fc5826001831663ffffffff612d4916565b600082151561336757506000610a36565b5081810281838281151561337757fe5b0414610a3657fe5b6000818381151561338c57fe5b049392505050565b73ffffffffffffffffffffffffffffffffffffffff811615156133b657600080fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b640100000000647f00000000600793840292909302919091037ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90160ff1660020a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000009390931692909204160490565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc081810160071692600860ff93859003909201929092160490565b604060ff82161015919050565b6135026140f7565b61350a61418e565b600080600080600080600080600360ff1661352b8e61010001518e8e613bf5565b60ff161461353f5760018d528c995061375e565b61354a8d8d8d613c67565b909950975060ff881615156135655760018d528c995061375e565b5060009050805b8760ff168160ff1610156136b857600096508695506135a08d8a60ff84166008811061359457fe5b60200201518e8e613e4c565b9097509550600092505b8560ff168360ff1610156136b0578115156135c457600191505b6135d76135d2888589613443565b6134b2565b80955081965050506135f58d61010001518e61016001518787613f82565b6fffffffffffffffffffffffffffffffff19166101008e01526101608d015160ff1660021415613664576101c08d01805160010160ff9081169091526101a08e0180517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190911690526136a5565b6101c08d0180517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160ff9081169091526101a08e01805160010190911690525b6001909201916135aa565b60010161356c565b8115613727576136d48d61010001518e61016001518e8e613f82565b6fffffffffffffffffffffffffffffffff19166101008e01526101608d015160ff1660021415613712576101c08d01805160010160ff169052613722565b6101a08d01805160010160ff1690525b613733565b60018d528c995061375e565b6101608d015160ff16600114156137515760026101608e015261375a565b60016101608e01525b8c99505b5050505050505050509392505050565b6137766140f7565b61377e6141bd565b600080600080600061378e614173565b88610180015160ff16603c14156137ae57600160208a0152889750611cd2565b60009550600094505b60408560ff16101561383a576101008901516137e290600860078816880360ff160460078816613bf5565b935060ff84166003141561382f576040805180820190915260086007871680880360ff9081169290920482168352602083015288908816603c811061382357fe5b60200201526001909501945b6001909401936137b7565b6000925060008660ff161115613942578861010001519150600094505b8560ff168560ff1610801561386a575082155b15613927578660ff8616603c811061387e57fe5b602002015160016101608b01526000808b526fffffffffffffffffffffffffffffffff1984166101008c01529091506138c8908a9083905b602002015183600160200201516134fa565b805190995015156138d857600192505b60026101608a01526000808a526fffffffffffffffffffffffffffffffff1983166101008b015261390c908a9083906138b6565b8051909950151561391c57600192505b600190940193613857565b6fffffffffffffffffffffffffffffffff1982166101008a01525b8215613951576001895261395d565b600160208a0152600089525b5096979650505050505050565b6139726140f7565b6001808080806000805b60088260ff161080156139ab575086806139935750855b8061399b5750845b806139a35750835b806139ab5750825b15613b9d575060005b60088160ff161080156139e3575086806139cb5750855b806139d35750845b806139db5750835b806139e35750825b15613b92576139fe8961010001518360070383600703614024565b6fffffffffffffffffffffffffffffffff1916613a218a61010001518484614024565b6fffffffffffffffffffffffffffffffff191614613a3e57600096505b613a518961010001518383600703614024565b6fffffffffffffffffffffffffffffffff1916613a748a61010001518484614024565b6fffffffffffffffffffffffffffffffff191614613a9157600095505b613aa48961010001518360070383614024565b6fffffffffffffffffffffffffffffffff1916613ac78a61010001518484614024565b6fffffffffffffffffffffffffffffffff191614613ae457600094505b613afa8961010001518260070384600703614024565b6fffffffffffffffffffffffffffffffff1916613b1d8a61010001518484614024565b6fffffffffffffffffffffffffffffffff191614613b3a57600093505b613b4a8961010001518284614024565b6fffffffffffffffffffffffffffffffff1916613b6d8a61010001518484614024565b6fffffffffffffffffffffffffffffffff191614613b8a57600092505b6001016139b4565b60019091019061397c565b8680613ba65750855b80613bae5750845b80613bb65750835b80613bbe5750825b1561395d5750506001604088015293151560608701529115156080860152151560a0850152151560c0840152151560e08301525090565b6000806000613c04858561407b565b7001000000000000000000000000000000006fffffffffffffffffffffffffffffffff821660020a6fffffffffffffffffffffffffffffffff19891604700300000000000000000000000000000000169081049450909250905050509392505050565b613c6f61418e565b6000613c7961418e565b6000613c8361418e565b600080613c8e614173565b60408051610140810182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61010082018181526000610120840181905290835283518085018552828152600160208281018290528086019290925285518087018752838152808301829052858701528551808701875281815280830182905260608601528551808701875281815280830184905260808601528551808701875290815280820184905260a08501528451808601865282815280820184905260c0850152845180860190955282855284019190915260e0820192909252909550935084805b60088160ff161015613e39578560ff821660088110613d8e57fe5b6020020151925082600060200201518c01935082600160200201518b01945060078560000b1380613dc2575060008560000b125b80613dd0575060078460000b135b80613dde575060008460000b125b1515613e3157613df48d61010001518587613bf5565b91508c610160015160ff168260ff16141515613e315760ff8216600314613e3157828860ff891660088110613e2557fe5b60200201526001909601955b600101613d73565b50959b949a509398505050505050505050565b60008060008060008060008060008060009650600160ff168e610160015160ff161415613e7c5760029550613e81565b600195505b506000935060015b60098160ff161015613f6e57841515613f66578c5160208e01519082028d01945081028b0192506007600085900b1380613ec6575060008460000b125b80613ed4575060078360000b135b80613ee2575060008360000b125b15613ef857600097506000965060019450613f66565b613f088e61010001518585613bf5565b91508560ff168260ff161415613f2e57613f24888886866140b0565b9098509650613f66565b8d610160015160ff168260ff16148015613f4b575060018160ff16115b15613f595760019450613f66565b6000975060009650600194505b600101613e89565b50959c949b50939950505050505050505050565b600080600060078560ff161115613f9857600080fd5b60078460ff161115613fa957600080fd5b613fb3858561407b565b6fffffffffffffffffffffffffffffffff811660020a70030000000000000000000000000000000081028981189099169860ff8916700100000000000000000000000000000000026fffffffffffffffffffffffffffffffff19169091028917945090925090505050949350505050565b600080614031848461407b565b6fffffffffffffffffffffffffffffffff811660020a6fffffffffffffffffffffffffffffffff198716047003000000000000000000000000000000001692509050509392505050565b600891909102016040037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0160020260ff1690565b6008020160400160ff16640100000000027fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000092909216608002919091179160019190910190565b604080516101e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e08101829052610100810182905261012081018290526101408101829052610160810182905261018081018290526101a081018290526101c081019190915290565b60408051808201825290600290829080388339509192915050565b610200604051908101604052806008905b6141a7614173565b81526020019060019003908161419f5790505090565b610f0060405190810160405280603c905b6141d6614173565b8152602001906001900390816141ce57905050905600a165627a7a72305820b9bc527d71cc12744e2d010120afaa311830a27864768051accdfc2dad26461c0029000000000000000000000000b55c5cac5014c662fdbf21a2c59cd45403c482fd0000000000000000000000001a94656a6245379bc0d9c64c402197528edb2bd10000000000000000000000001754a612ca578f72d678196bcc16710f01db7655

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

000000000000000000000000b55c5cac5014c662fdbf21a2c59cd45403c482fd0000000000000000000000001a94656a6245379bc0d9c64c402197528edb2bd10000000000000000000000001754a612ca578f72d678196bcc16710f01db7655

-----Decoded View---------------
Arg [0] : _clovers (address): 0xB55C5cAc5014C662fDBF21A2C59Cd45403C482Fd
Arg [1] : _clubToken (address): 0x1A94656A6245379bC0d9c64C402197528EdB2bD1
Arg [2] : _clubTokenController (address): 0x1754a612cA578F72d678196bcC16710f01DB7655

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000b55c5cac5014c662fdbf21a2c59cd45403c482fd
Arg [1] : 0000000000000000000000001a94656a6245379bc0d9c64c402197528edb2bd1
Arg [2] : 0000000000000000000000001754a612ca578f72d678196bcc16710f01db7655


Deployed ByteCode Sourcemap

142769:22584:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;142769:22584:0;;160078:123;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;160078:123:0;;;;;;;;;159859:88;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;159859:88:0;;;;;;;143294:22;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143294:22:0;;;;;;;;;;;;;;;;;;;;;;;140101:152;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;140101:152:0;;;;;;;160306:91;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;160306:91:0;;;;;;;145815:177;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;145815:177:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;159523:230;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;159523:230:0;;;;;;;;;;;;;;145375:191;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;145375:191:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;145375:191:0;;-1:-1:-1;145375:191:0;;-1:-1:-1;;;;;;145375:191:0;146216:259;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;146216:259:0;;;;;143542:28;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143542:28:0;;;;;;;;;;;;;;;;;;;;150467:1907;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;150467:1907:0;;-1:-1:-1;;150467:1907:0;;;-1:-1:-1;;;150467:1907:0;;;;;;;;;;;-1:-1:-1;150467:1907:0;;163041:118;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;163041:118:0;;;;;;;;;143752:42;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;143752:42:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;161359:111;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;161359:111:0;;;;;143241:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143241:18:0;;;;143577:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143577:26:0;;;;46322:114;;8:9:-1;5:2;;;30:1;27;20:12;5:2;46322:114:0;;;;143436:29;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143436:29:0;;;;157567:1637;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;157567:1637:0;;;;;143266:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143266:21:0;;;;144695:122;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;144695:122:0;;;;;161631:118;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;161631:118:0;;;;;45527:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;45527:20:0;;;;160832:143;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;160832:143:0;;;;;;;143395:34;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143395:34:0;;;;142362:93;;8:9:-1;5:2;;;30:1;27;20:12;5:2;142362:93:0;;;;157127:224;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;157127:224:0;-1:-1:-1;;157127:224:0;;;;;161960:126;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;161960:126:0;;;;;143354:34;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143354:34:0;;;;140952:134;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;140952:134:0;;;;;;;;;;;;;;;;;;;;;143610:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143610:26:0;;;;155355:1594;;;;;;143474:24;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143474:24:0;;;;161095:111;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;161095:111:0;;;;;160543:143;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;160543:143:0;;;;;;;145021:149;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;145021:149:0;;;;;146755:977;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;146755:977:0;;;;;143505:30;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143505:30:0;;;;143323:24;;8:9:-1;5:2;;;30:1;27;20:12;5:2;143323:24:0;;;;149798:141;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;149798:141:0;;;;;144349:117;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;144349:117:0;;;;;46604:105;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;46604:105:0;;;;;;;162242:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;162242:103:0;;;;;160078:123;46030:5;;;;46016:10;:19;46008:28;;;;;;160161:14;:32;;;;;;;;;;;;;;;160078:123::o;159859:88::-;46030:5;;;;46016:10;:19;46008:28;;;;;;159923:6;:16;;;;;;;;;;;;;;;;;159859:88::o;143294:22::-;;;;;;:::o;140101:152::-;140167:15;46030:5;;;;46016:10;:19;46008:28;;;;;;140185:21;;;;;;140201:4;140185:21;;;;;;:15;;;;;;:21;;;;;;;;;;;;;;-1:-1:-1;140185:15:0;:21;;;5:2:-1;;;;30:1;27;20:12;5:2;140185:21:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;140185:21:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;140185:21:0;140232:5;;140185:21;;-1:-1:-1;140213:34:0;;140232:5;140213:18;;;;140232:5;140185:21;140213:34;:18;:34;:::i;:::-;140101:152;;:::o;160306:91::-;46030:5;;;;46016:10;:19;46008:28;;;;;;160373:6;:16;;;;;;;;;;;;;;;160306:91::o;145815:177::-;145884:4;145905:5;145901:23;;;-1:-1:-1;145919:5:0;145912:12;;145901:23;145940:8;145939:9;145935:27;;;-1:-1:-1;145957:5:0;145950:12;;145935:27;-1:-1:-1;145980:4:0;145815:177;;;;;:::o;159523:230::-;159631:19;;;;159617:10;:33;;:65;;-1:-1:-1;159668:14:0;;;;159654:10;:28;159617:65;159609:74;;;;;;;;159702:7;;159694:51;;;;;;159702:7;159694:51;;;;;;;;;;;;;;;;;;;;;;159702:7;;;;;159694:29;;:51;;;;;159702:7;;159694:51;;;;;;;159702:7;;159694:51;;;5:2:-1;;;;30:1;27;20:12;5:2;159694:51:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;159694:51:0;;;;159523:230;;;:::o;145375:191::-;145435:4;145452:24;;:::i;:::-;145479:23;145496:5;145479:16;:23::i;:::-;145452:50;;145520:38;145532:4;:10;;;145544:4;:13;;;145520:11;:38::i;:::-;145513:45;;145375:191;;;;;:::o;146216:259::-;146327:7;;146319:41;;;;;;;;;;;;;;146279:4;;;;146327:7;;;;;146319:31;;:41;;;;;;;;;;;;;;;146279:4;146327:7;146319:41;;;5:2:-1;;;;30:1;27;20:12;5:2;146319:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;146319:41:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;146319:41:0;;-1:-1:-1;146374:17:0;;146371:34;;;146400:5;146393:12;;;;146371:34;146456:11;;146423:30;:12;146440;146423:30;:16;:30;:::i;:::-;:44;;146216:259;-1:-1:-1;;;146216:259:0:o;143542:28::-;;;;:::o;150467:1907::-;150591:4;143844:6;;150591:4;;;;;;143844:6;;;;;143843:7;143835:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;150613:82;150627:5;150634:8;150644:10;150656:8;150666;150676:11;150689:5;150613:82;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;-1:-1;;;;150613:82:0;;;;;;;-1:-1:-1;;150613:82:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;150613:82:0;150738:5;150728:16;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;150728:16:0;;;;;;;;;;;;;;;;150708:36;;150778:11;;150765:9;:24;;150757:33;;;;;;;;150809:20;150819:9;150809;:20::i;:::-;:25;;;150801:34;;;;;;150848:32;150858:9;150869:10;150848:9;:32::i;:::-;150909:1;150895:11;;:15;150891:124;;;150927:32;150936:9;150947:11;;150927:8;:32::i;:::-;150974:7;;150991:11;;150974:29;;:7;;;;;:29;;;;;150991:11;150974:7;:29;:7;:29;150991:11;150974:7;:29;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;150974:29:0;150891:124;151032:38;;;;;;151059:10;151032:38;;;;;;;;;;;;;;;;;151100:7;;151092:33;;;;;;;;;;;;;;151100:7;;;;;151092:23;;:33;;;;;;;;;;;;;;;151100:7;;151092:33;;;5:2:-1;;;;30:1;27;20:12;5:2;151092:33:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;151092:33:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;151092:33:0;151091:34;151083:43;;;;;;151153:7;;151145:41;;;;;;;;;;;;;;151153:7;;;;;151145:31;;:41;;;;;;;;;;;;;;;151153:7;;151145:41;;;5:2:-1;;;;30:1;27;20:12;5:2;151145:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;151145:41:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;151145:41:0;:46;151137:55;;;;;;151213:7;;151205:55;;;;;;;;;;;;151247:12;151205:55;;;;;;151213:7;;;;;151205:31;;:55;;;;;151213:7;;151205:55;;;;;;;;151213:7;;151205:55;;;5:2:-1;;;;30:1;27;20:12;5:2;151205:55:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;151279:7:0;;151271:48;;;;;;;;;;;;151279:7;;;;;-1:-1:-1;151271:31:0;;-1:-1:-1;151303:8:0;;151313:5;;151271:48;;;;;151313:5;;151271:48;;151313:5;151279:7;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;151271:48:0;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;151271:48:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;151338:7:0;;151330:41;;;;;;;;;;;;;;;;;;;;;151338:7;;;;;-1:-1:-1;151330:24:0;;-1:-1:-1;151330:41:0;;;;;151338:7;;151330:41;;;;;;;;151338:7;;151330:41;;;5:2:-1;;;;30:1;27;20:12;5:2;151330:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;151330:41:0;;;;151427:1;151413:11;:15;151409:212;;;151453:7;;151445:53;;;;;;;;;;;;;;;;;;;;151453:7;;;;;151445:30;;:53;;;;;151453:7;;151445:53;;;;;;;;151453:7;;151445:53;;;5:2:-1;;;;30:1;27;20:12;5:2;151445:53:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;151445:53:0;;;;151522:28;151538:11;151522:15;:28::i;:::-;151573:7;;151565:44;;;;;;;;;;;;;;;;;;;;151513:37;;-1:-1:-1;151573:7:0;;;;;151565:26;;:44;;;;;151573:7;;151565:44;;;;;;;;151573:7;;151565:44;;;5:2:-1;;;;30:1;27;20:12;5:2;151565:44:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;151565:44:0;;;;151409:212;151647:9;;:21;;151661:6;151647:21;:13;:21;:::i;:::-;151631:37;;151683:5;:18;;;;;151700:1;151692:5;:9;151683:18;151679:516;;;151871:9;;151861:42;;;;;;151892:10;151861:42;;;;;;151906:5;;151871:9;;;151861:30;;:42;;;;;;;;;;;;;;151871:9;;151861:42;;;5:2:-1;;;;30:1;27;20:12;5:2;151861:42:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;151861:42:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;151861:42:0;:50;151857:181;;;151952:19;;151997:11;;151952:19;;;;;151932:44;;151983:26;;:9;;:26;:13;:26;:::i;:::-;151932:90;;;;;;;;;;152011:10;151932:90;;;;;;;;;;;;;;;;;;;;;;;;;5:2:-1;;;;30:1;27;20:12;5:2;151932:90:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;151932:90:0;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;151857:181:0;152070:9;;152106:7;;152060:61;;;;;;152094:10;152060:61;;;;152070:9;152106:7;;;152060:61;;;;;;;;;;;;152070:9;;;;;152060:33;;:61;;;;;;;;;;;;;;152070:9;;152060:61;;;5:2:-1;;;;30:1;27;20:12;5:2;152060:61:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;152060:61:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;152060:61:0;152052:70;;;;;;;;152213:7;;152205:40;;;;;;152213:7;;;;152205:40;;;;;;;;;;;;;;152213:7;;152205:21;;:40;;;;;152213:7;;152205:40;;;;;;;152213:7;;152205:40;;;5:2:-1;;;;30:1;27;20:12;5:2;152205:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;152205:40:0;;;;152261:83;152275:5;152282:8;152292:10;152304:11;;152317:6;152325:11;152338:5;152261:83;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;-1:-1;;;;152261:83:0;;;;;;;-1:-1:-1;;152261:83:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;152261:83:0;-1:-1:-1;152362:4:0;;150467:1907;-1:-1:-1;;;;;;;150467:1907:0:o;163041:118::-;46030:5;;;;46016:10;:19;46008:28;;;;;;163120:31;163130:9;163141;163120;:31::i;143752:42::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;161359:111::-;46030:5;;;;46016:10;:19;46008:28;;;;;;161436:11;:26;161359:111::o;143241:18::-;;;;;;;;;:::o;143577:26::-;;;;:::o;46322:114::-;46030:5;;;;46016:10;:19;46008:28;;;;;;46399:5;;;46380:25;;46399:5;;;;;46380:25;;;46428:1;46412:18;;;;;;46322:114::o;143436:29::-;;;;;;:::o;157567:1637::-;157626:4;157643:10;157671:23;;:::i;:::-;157815:24;;:::i;:::-;157705:7;;157697:41;;;;;;;;;;;;;;157656:4;;-1:-1:-1;158062:19:0;;;;;;;;157705:7;;;;;157697:31;;:41;;;;;;;;;;;;;158062:19;157705:7;157697:41;;;5:2:-1;;;;30:1;27;20:12;5:2;157697:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;157697:41:0;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;13:2;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;157769:5:0;;157697:41;;-1:-1:-1;157769:5:0;;157755:10;:19;;;;:43;;-1:-1:-1;157792:6:0;;;;157778:10;:20;;157755:43;157751:896;;;157842:23;157859:5;157842:16;:23::i;:::-;157815:50;;157919:8;157883:32;157904:4;:10;;;157883:20;:32::i;:::-;:44;157880:97;;157956:5;157948:13;;157880:97;157994:5;:47;;;;;158003:38;158015:4;:10;;;158027:4;:13;;;158003:11;:38::i;:::-;157991:615;;;158092:7;;158084:40;;;;;;;;;;;;;;158092:7;;;;;158084:30;;:40;;;;;;;;;;;;;;;158092:7;;158084:40;;;5:2:-1;;;;30:1;27;20:12;5:2;158084:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;158084:40:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;158084:40:0;158181:11;;;;158084:40;;-1:-1:-1;158151:41:0;;158176:1;158152:16;;;158171:1;158152:20;158151:26;:41;:57;;158203:5;158151:57;;;158195:5;158151:57;158265:10;;;;158143:65;;-1:-1:-1;158235:40:0;;158260:1;158236:16;;;158255:1;158236:20;158235:26;:40;:56;;158286:5;158235:56;;;158278:5;158235:56;158348:10;;;;158227:64;;-1:-1:-1;158318:40:0;;158343:1;158319:16;;;158338:1;158319:20;158318:26;:40;:56;;158369:5;158318:56;;;158361:5;158318:56;158431:10;;;;158310:64;;-1:-1:-1;158401:40:0;;158426:1;158417;158402:16;;;:20;158401:26;:40;:56;;158452:5;158401:56;;;158444:5;158401:56;158393:64;;158509:4;:11;;;158484:36;;158504:1;158485:11;158499:1;158485:15;158484:21;:36;;;:52;;158531:5;158484:52;;;158523:5;158484:52;158476:60;;157991:615;;;158585:5;158577:13;;157991:615;158628:6;;158620:15;;;;;;158687:5;158677:16;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;158677:16:0;;;;;;;;;;;;;;;;158657:36;;158720:19;158729:9;158720:8;:19::i;:::-;158704:35;;158755:20;158766:8;158755:10;:20::i;:::-;158754:21;:34;;;;;158787:1;158779:5;:9;158754:34;158750:110;;;158813:7;;158805:43;;;;;;158830:10;158805:43;;;;;;;;;;;;158813:7;;;;;158805:24;;:43;;;;;158813:7;;158805:43;;;;;;;;158813:7;;158805:43;;;5:2:-1;;;;30:1;27;20:12;5:2;158805:43:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;158805:43:0;;;;158750:110;158874:18;;;;:7;:18;;;;;:28;;;158870:87;;;158919:26;158936:8;158919:16;:26::i;:::-;158989:20;158999:9;158989;:20::i;:::-;158969:40;;159025:63;159042:5;159049:8;159059:9;159070:10;159082:5;159025:63;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;-1:-1;;;;159025:63:0;;;;;;;-1:-1:-1;;159025:63:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;159025:63:0;159109:7;;159101:39;;;;;;;;;;;;;;159109:7;;;;;159101:29;;:39;;;;;159109:7;;159101:39;;;;;;;;159109:7;;159101:39;;;5:2:-1;;;;30:1;27;20:12;5:2;159101:39:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;159101:39:0;;;;159151:23;159164:9;159151:12;:23::i;:::-;159192:4;159185:11;;157567:1637;;;;;;;;;;;:::o;143266:21::-;;;;;;:::o;144695:122::-;144754:7;144781:18;;;:7;:18;;;;;:28;;;;;;144695:122::o;161631:118::-;46030:5;;;;46016:10;:19;46008:28;;;;;;161711:13;:30;161631:118::o;45527:20::-;;;;;;:::o;160832:143::-;46030:5;;;;46016:10;:19;46008:28;;;;;;160925:19;:42;;;;;;;;;;;;;;;160832:143::o;143395:34::-;;;;;;:::o;142362:93::-;46030:5;;;;46016:10;:19;46008:28;;;;;;142412:5;;;:37;;:5;;;;;142435:4;142427:21;142412:37;;;;;142427:21;;142412:37;:5;:37;142427:21;142412:5;:37;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;142412:37:0;142362:93::o;157127:224::-;157193:14;;157220:124;157235:13;157233:15;;157220:124;;;157325:1;157327;157325:3;157310:13;:19;;;157307:1;:23;157303:1;:28;157291:6;157298:1;157291:9;;;;;;;;;;;;;;;157286:15;:46;157277:55;;;;;157249:3;;157220:124;;161960:126;46030:5;;;;46016:10;:19;46008:28;;;;;;162044:15;:34;161960:126::o;143354:34::-;;;;;;:::o;140952:134::-;141072:8;;;143610:26;;;;:::o;155355:1594::-;155420:4;155437:23;;:::i;:::-;155471:7;;155463:41;;;;;;;;;;;;;;155515:17;;;;;;;;;;155471:7;;;155463:31;;:41;;;;;;;;;;;155515:17;155471:7;155463:41;;;5:2:-1;;;;30:1;27;20:12;5:2;155463:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;155463:41:0;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;13:2;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;155535:16:0;;;155463:41;;-1:-1:-1;155463:41:0;;155535:16;;;155463:41;;155535:16;;155463:41;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;-1:-1;;155535:16:0;;;;;;;;;;;;;155573:18;;;;:7;:18;;;;;;:28;155535:16;;-1:-1:-1;;155573:28:0;;155572:29;;-1:-1:-1;155564:38:0;;-1:-1:-1;;;155564:38:0;;;;;155613:18;;;;:7;:18;;;;;:35;;;;155644:4;155613:35;;;155669:20;155680:8;155669:10;:20::i;:::-;:43;;;-1:-1:-1;155707:5:0;;;;155693:10;:19;155669:43;:67;;;-1:-1:-1;155730:6:0;;;;155716:10;:20;155669:67;155661:76;;;;;;;;155766:19;155775:9;155766:8;:19::i;:::-;155750:35;;155796:23;155810:8;155796:13;:23::i;:::-;155850:20;155860:9;155850;:20::i;:::-;155830:40;-1:-1:-1;155889:23:0;;;155902:10;155889:23;;:46;;-1:-1:-1;155930:5:0;;;;155916:10;:19;155889:46;:70;;;-1:-1:-1;155953:6:0;;;;155939:10;:20;155889:70;155881:79;;;;;;;;155996:7;;155988:36;;;;;;;;;;;;;;155996:7;;;;;155988:26;;:36;;;;;;;;;;;;;;;155996:7;;155988:36;;;5:2:-1;;;;30:1;27;20:12;5:2;155988:36:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;155988:36:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;155988:36:0;156056:7;;156048:34;;;;;;;;;;;;;;155988:36;;-1:-1:-1;156056:7:0;;;;;156048:24;;:34;;;;;155988:36;;156048:34;;;;;;;;156056:7;;156048:34;;;5:2:-1;;;;30:1;27;20:12;5:2;156048:34:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;156048:34:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;156048:34:0;;-1:-1:-1;156095:671:0;;;;156260:7;;156252:59;;;;;;156260:7;;;;156252:59;;;;;;;;;;;;;;;;;;;;;:29;;:59;;;;;156260:7;;156252:59;;;;;;;;156260:7;;156252:59;;;5:2:-1;;;;30:1;27;20:12;5:2;156252:59:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;156252:59:0;;;;156095:671;;;156557:19;;156618:15;;156557:19;;;;;156536:46;;156583:8;;156593:42;;156607:27;;:6;;:27;:10;:27;:::i;:::-;156593:9;;;:42;:13;:42;:::i;:::-;156536:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;156536:100:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;156536:100:0;;;;156664:1;156655:6;:10;156651:104;;;156704:9;;156694:44;;;;;;156704:9;156694:44;;;;;;;;;;;;;;;156704:9;;;;;156694:25;;:44;;;;;;;;;;;;;;156704:9;;156694:44;;;5:2:-1;;;;30:1;27;20:12;5:2;156694:44:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;156694:44:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;156694:44:0;156686:53;;;;;;;;156788:1;156780:5;:9;156776:85;;;156814:7;;156806:43;;;;;;156831:10;156806:43;;;;;;;;;;;;156814:7;;;;;156806:24;;:43;;;;;156814:7;;156806:43;;;;;;;;156814:7;;156806:43;;;5:2:-1;;;;30:1;27;20:12;5:2;156806:43:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;156806:43:0;;;;156776:85;156876:43;;;;;;156901:10;156876:43;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;156937:4:0;;155355:1594;-1:-1:-1;;;;;;;155355:1594:0:o;143474:24::-;;;;:::o;161095:111::-;46030:5;;;;46016:10;:19;46008:28;;;;;;161172:11;:26;161095:111::o;160543:143::-;46030:5;;;;46016:10;:19;46008:28;;;;;;160636:19;:42;;;;;;;;;;;;;;;160543:143::o;145021:149::-;145128:7;;145120:41;;;;;;;;;;;;;;145083:7;;145128;;;145120:31;;:41;;;;;;;;;;;145083:7;145128;145120:41;;;5:2:-1;;;;30:1;27;20:12;5:2;145120:41:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;145120:41:0;;;;;;;101:4:-1;97:9;90:4;84;80:15;76:31;69:5;65:43;126:6;120:4;113:20;0:138;13:2;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;145110:52:0;;;;;;145120:41;;145110:52;;145120:41;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;145110:52:0;;;;;;;;;;;;;;;;145103:59;;145021:149;;;:::o;146755:977::-;146826:7;146846:20;146877:14;146902:13;146926;146950;146974:14;147144:12;147106:7;;;;;;;;;;;147098:33;;;:35;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;147098:35:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;147098:35:0;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;147098:35:0;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;147098:35:0;;-1:-1:-1;147098:35:0;-1:-1:-1;147098:35:0;-1:-1:-1;147098:35:0;;-1:-1:-1;147098:35:0;-1:-1:-1;147159:1:0;;-1:-1:-1;147194:1:0;147175:16;;;:20;;:25;147171:99;;;147209:61;147218:51;147258:6;147267:1;147258:10;147218:35;147236:12;147251:1;147236:16;147218:13;;:17;;:35;;;;:::i;:::-;:39;:51;:39;:51;:::i;:::-;147209:4;;:61;:8;:61;:::i;:::-;147202:68;;147171:99;147304:1;147285:16;;;:20;;:25;147281:98;;;147319:60;147328:50;147368:5;147376:1;147368:9;147328:35;147346:12;147361:1;147346:16;147328:13;;:17;;:35;;;;:::i;147319:60::-;147312:67;;147281:98;147413:1;147394:16;;;:20;;:25;147390:98;;;147428:60;147437:50;147477:5;147485:1;147477:9;147437:35;147455:12;147470:1;147455:16;147437:13;;:17;;:35;;;;:::i;147428:60::-;147421:67;;147390:98;147518:1;147503:16;;;:20;;:25;147499:98;;;147537:60;147546:50;147586:5;147594:1;147586:9;147546:35;147564:12;147579:1;147564:16;147546:13;;:17;;:35;;;;:::i;147537:60::-;147530:67;;147499:98;147612:11;147626:1;147612:15;147631:1;147612:20;147608:94;;;147641:61;147650:51;147690:6;147699:1;147690:10;147650:35;147668:12;147683:1;147668:16;147650:13;;:17;;:35;;;;:::i;147641:61::-;147634:68;;147608:94;147720:4;146755:977;-1:-1:-1;;;;;;;;146755:977:0:o;143505:30::-;;;;:::o;143323:24::-;;;;;;:::o;149798:141::-;149861:7;149888:43;149902:28;149918:11;149902:15;:28::i;144349:117::-;144407:7;144434:18;;;:7;:18;;;;;:24;;;;144349:117::o;46604:105::-;46030:5;;;;46016:10;:19;46008:28;;;;;;46674:29;46693:9;46674:18;:29::i;162242:103::-;46030:5;;;;46016:10;:19;46008:28;;;;;;162315:9;:22;162242:103::o;139068:123::-;139159:5;:14;;;139174:2;139178:5;139159:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;139159:25:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;139159:25:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;139159:25:0;139151:34;;;;;;;;139068:123;;;:::o;1610:2214::-;1670:4;;:::i;:::-;1688:16;;:::i;:::-;1737:8;;1717:28;;;;:17;;;:28;1737:8;1773;;;;1756:25;;;:14;;;:25;2182:9;1792:12;;;:16;;;1837:1;1819:15;;;:19;;;1849:15;;;:19;1881:18;;;1910:13;;;:21;;;1779:1;-1:-1:-1;1942:18:0;;:26;2081:48;-1:-1:-1;2068:10:0;;:61;2182:9;;;;;2314:1330;2330:2;2326:1;:6;;;:15;;;;;2337:4;2336:5;2326:15;2314:1330;;;2393:2;2378:4;:12;;;:17;;;:54;;2418:4;:14;;;2378:54;;;2398:4;:17;;;2378:54;2363:69;;2454:45;2463:12;2492:2;2477:4;:12;;;:17;;;;;;;;;;2496:2;2454:8;:45::i;:::-;2447:52;;2527:17;2539:4;2527:11;:17::i;:::-;2514:30;;-1:-1:-1;2514:30:0;-1:-1:-1;2567:15:0;2577:4;2567:9;:15::i;:::-;2566:16;;-1:-1:-1;2601:6:0;;;;:32;;;;;2612:3;:8;;2619:1;2612:8;;:20;;;;2624:3;:8;;2631:1;2624:8;;2612:20;2597:225;;;2661:4;2789:17;;;2661:4;-1:-1:-1;2597:225:0;2841:4;2840:5;:16;;;;;2855:1;2849:3;:7;;;2840:16;:27;;;;;2866:1;2860:3;:7;;;2840:27;:39;;;;;2878:1;2871:3;:8;;;;2840:39;:51;;;;;2890:1;2883:3;:8;;;;2840:51;2836:797;;;2965:24;2974:4;2980:3;2985;2965:8;:24::i;:::-;3023:12;;;;;3038:1;3023:16;3008:31;;;;3062:10;;3023:12;;-1:-1:-1;3058:560:0;;;3110:5;3097:18;;3212;;;;:27;;3097:18;3212:27;3208:193;;;265:1;3268:18;;;:26;3208:193;;;221:1;3351:18;;;:26;3208:193;3430:24;3439:4;3445:3;3450;3430:8;:24::i;:::-;3481:10;;3423:31;;-1:-1:-1;3477:122:0;;;3533:4;3520:17;;;3533:4;-1:-1:-1;3477:122:0;2343:3;;;;;2314:1330;;;3659:10;;3658:11;3654:141;;;3699:5;3686:18;;3726:16;3686:4;3726:10;:16::i;:::-;3719:23;;3764:19;3778:4;3764:13;:19::i;:::-;3757:26;;3654:141;-1:-1:-1;3812:4:0;;1610:2214;-1:-1:-1;;;;;;;1610:2214:0:o;22928:113::-;22986:7;23009:6;;;;23002:14;;;;-1:-1:-1;23030:5:0;;;22928:113::o;162909:124::-;162985:18;;;;:7;:18;;;;;;:28;;:40;;;;;;;;;;;;;;162909:124::o;162558:111::-;162629:18;;;;:7;:18;;;;;;:24;;:32;162558:111::o;23108:127::-;23188:5;;;23207:6;;;;23200:14;;;164461:887;164524:20;164555:14;164580:13;164604;164628;164652:14;164822:19;164784:7;;;;;;;;;;;164776:33;;;:35;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;164776:35:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;164776:35:0;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;164776:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;164677:134;;;;;;;;;;;;;;;;;;;;;;;;164852:7;;;;;;;;;;;164844:30;;;164875:8;164844:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;164844:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;164844:40:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;164844:40:0;;-1:-1:-1;164910:41:0;164941:1;164927:15;;:23;;164949:1;164927:23;;;164945:1;164927:23;164910:12;;:41;;;:16;:41;:::i;:::-;164895:56;-1:-1:-1;164971:41:0;:6;165009:1;164990:16;;;:20;164971:41;:10;:41;:::i;:::-;164962:50;-1:-1:-1;165031:40:0;:5;165068:1;165049:16;;;:20;165031:40;:9;:40;:::i;:::-;165023:48;-1:-1:-1;165090:40:0;:5;165127:1;165108:16;;;:20;165090:40;:9;:40;:::i;:::-;165082:48;-1:-1:-1;165149:40:0;:5;165167:16;;;165182:1;165167:20;165149:40;:9;:40;:::i;:::-;165141:48;-1:-1:-1;165209:36:0;:6;165242:1;165228:15;;165209:36;:10;:36;:::i;:::-;165264:7;;165256:84;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;165200:45;;-1:-1:-1;165264:7:0;;;;;165256:33;;:84;;;;;165264:7;;165256:84;;;;;;;;165264:7;;165256:84;;;5:2:-1;;;;30:1;27;20:12;5:2;165256:84:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;165256:84:0;;;;164461:887;;;;;;;;:::o;163165:94::-;163232:18;;;;:7;:18;;;;;163225:26;;;;;;;;;;;;;;;;;;;;;163165:94::o;163417:884::-;163477:20;163508:14;163533:13;163557;163581;163605:14;163775:19;163737:7;;;;;;;;;;;163729:33;;;:35;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;163729:35:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;163729:35:0;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;163729:35:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;163630:134;;;;;;;;;;;;;;;;;;;;;;;;163805:7;;;;;;;;;;;163797:30;;;163828:8;163797:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;163797:40:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;163797:40:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;163797:40:0;;-1:-1:-1;163863:41:0;163894:1;163880:15;;:23;;163902:1;163880:23;;;163898:1;163880:23;163863:12;;:41;;;:16;:41;:::i;:::-;163848:56;-1:-1:-1;163924:41:0;:6;163962:1;163943:16;;;:20;163924:41;:10;:41;:::i;:::-;163915:50;-1:-1:-1;163984:40:0;:5;164021:1;164002:16;;;:20;163984:40;:9;:40;:::i;:::-;163976:48;-1:-1:-1;164043:40:0;:5;164080:1;164061:16;;;:20;164043:40;:9;:40;:::i;:::-;164035:48;-1:-1:-1;164102:40:0;:5;164120:16;;;164135:1;164120:20;164102:40;:9;:40;:::i;:::-;164094:48;-1:-1:-1;164162:36:0;:6;164195:1;164181:15;;164162:36;:10;:36;:::i;22063:384::-;22121:9;22351:6;;22347:37;;;-1:-1:-1;22375:1:0;22368:8;;22347:37;-1:-1:-1;22396:5:0;;;22400:1;22396;:5;22415;;;;;;;;:10;22408:18;;;22534:277;22592:7;22804:1;22800;:5;;;;;;;;;22534:277;-1:-1:-1;;;22534:277:0:o;46850:175::-;46921:23;;;;;46913:32;;;;;;46978:5;;;46957:38;;;;;;;46978:5;;;46957:38;;;47002:5;:17;;;;;;;;;;;;;;;46850:175::o;14998:263::-;15126:12;;15198:1;15183:11;;;15163:15;;;;15162:33;;;;:37;;15224:20;;;;;;;;;;;;;15223:29;15217:36;;14998:263::o;15721:201::-;15807:9;;;;15839:8;;;15846:1;15839:8;15871:10;;;;;;;15870:16;;;;;;15721:201::o;15617:96::-;15703:2;15695:10;;;;;15617:96;;;:::o;3832:2382::-;3914:4;;:::i;:::-;4169:36;;:::i;:::-;4216:31;4575:16;4602:20;4633:16;4660;4687:7;4705:10;4739:7;309:1;3975:41;;:32;3986:4;:10;;;3998:3;4003;3975:10;:32::i;:::-;:41;;;3971:188;;4045:4;4032:17;;:4;;-1:-1:-1;4136:11:0;;3971:188;4307:37;4329:4;4335:3;4340;4307:21;:37::i;:::-;4258:86;;-1:-1:-1;4258:86:0;-1:-1:-1;4391:29:0;;;;4387:176;;;4450:4;4437:17;;:4;;-1:-1:-1;4540:11:0;;4387:176;-1:-1:-1;4718:5:0;;-1:-1:-1;4718:5:0;4734:802;4756:24;4752:28;;:1;:28;;;4734:802;;;4802:15;;-1:-1:-1;4802:15:0;;-1:-1:-1;4897:56:0;4915:4;4921:18;:21;;;;;;;;;;;;;;4944:3;4949;4897:17;:56::i;:::-;4868:85;;-1:-1:-1;4868:85:0;-1:-1:-1;4977:1:0;;-1:-1:-1;4968:557:0;4984:14;4980:18;;:1;:18;;;4968:557;;;5029:5;5028:6;5024:24;;;5044:4;5036:12;;5024:24;5094:50;5106:37;5115:8;5125:1;5128:14;5106:8;:37::i;:::-;5094:11;:50::i;:::-;5067:77;;;;;;;;5176:64;5185:4;:10;;;5197:4;:18;;;5217:10;5229;5176:8;:64::i;:::-;-1:-1:-1;;5163:77:0;:10;;;:77;5263:18;;;;:27;;265:1;5263:27;5259:251;;;5315:15;;;:20;;5334:1;5315:20;;;;;;;;5358:15;;;:20;;;;;;;;;5259:251;;;5427:15;;;:20;;;;;;;;;;;5470:15;;;:20;;5446:1;5470:20;;;;;;5259:251;5000:3;;;;;4968:557;;;4782:3;;4734:802;;;5592:5;5588:413;;;5627:50;5636:4;:10;;;5648:4;:18;;;5668:3;5673;5627:8;:50::i;:::-;-1:-1:-1;;5614:63:0;:10;;;:63;5696:18;;;;:27;;265:1;5696:27;5692:149;;;5744:15;;;:20;;5763:1;5744:20;;;;;5692:149;;;5805:15;;;:20;;5824:1;5805:20;;;;;5692:149;5588:413;;;5886:4;5873:17;;:4;;-1:-1:-1;5978:11:0;;5588:413;6044:18;;;;:27;;221:1;6044:27;6040:145;;;265:1;6088:18;;;:26;6040:145;;;221:1;6147:18;;;:26;6040:145;6202:4;6195:11;;3832:2382;;;;;;;;;;;;;;;:::o;9918:1936::-;9980:4;;:::i;:::-;10157:27;;:::i;:::-;10199:19;10242:7;10287:10;10555:22;10642:13;10687:20;;:::i;:::-;10003:4;:12;;;:18;;10019:2;10003:18;9999:1826;;;10094:4;10078:13;;;:20;:4;;-1:-1:-1;10113:11:0;;9999:1826;10221:1;10199:23;;10252:1;10242:11;;10237:304;10259:2;10255:1;:6;;;10237:304;;;10311:10;;;;10300:52;;10340:1;10330:5;;;10325:11;;10330:5;10324:17;;10345:5;;;10300:10;:52::i;:::-;10287:65;-1:-1:-1;10375:13:0;;;309:1;10375:13;10371:155;;;10413:55;;;;;;;;;10456:1;10446:5;;;10441:11;;;10446:5;10440:17;;;;;;;10413:55;;;;;;;;:7;;:22;;;;;;;;;;;;:55;10491:15;;;;;10371:155;10263:3;;;;;10237:304;;;10580:5;10555:30;;10620:1;10604:13;:17;;;10600:912;;;10658:4;:10;;;10642:26;;10735:1;10731:5;;10726:734;10742:13;10738:17;;:1;:17;;;:39;;;;;10760:17;10759:18;10738:39;10726:734;;;10814:7;:10;;;;;;;;;;;;;;221:1;10849:18;;;:26;10911:5;10898:18;;;-1:-1:-1;;10939:18:0;;:10;;;:18;10814:10;;-1:-1:-1;10987:32:0;;10849:4;;10814:10;;11002:7;;;;;11011:4;11016:1;11011:7;;;;10987:8;:32::i;:::-;11047:10;;10980:39;;-1:-1:-1;11046:11:0;11042:92;;;11106:4;11086:24;;11042:92;265:1;11156:18;;;:26;11218:5;11205:18;;;-1:-1:-1;;11246:18:0;;:10;;;:18;11294:32;;11156:4;;11309;;:7;;11294:32;11354:10;;11287:39;;-1:-1:-1;11353:11:0;11349:92;;;11413:4;11393:24;;11349:92;10779:3;;;;;10726:734;;;-1:-1:-1;;11478:18:0;;:10;;;:18;10600:912;11530:17;11526:288;;;11581:4;11568:17;;11526:288;;;11757:4;11741:13;;;:20;;11780:18;;11526:288;-1:-1:-1;11842:4:0;;9918:1936;-1:-1:-1;;;;;;;9918:1936:0:o;11862:1674::-;11927:4;;:::i;:::-;11958;;;;;11944:11;;12086:1143;12108:1;12104;:5;;;:54;;;;;12114:6;:15;;;;12124:5;12114:15;:24;;;;12133:5;12114:24;:33;;;;12142:5;12114:33;:43;;;;12151:6;12114:43;12086:1143;;;-1:-1:-1;12195:1:0;12180:1038;12202:1;12198;:5;;;:54;;;;;12208:6;:15;;;;12218:5;12208:15;:24;;;;12227:5;12208:24;:33;;;;12236:5;12208:33;:43;;;;12245:6;12208:43;12180:1038;;;12357:41;12369:4;:10;;;12386:1;12382;:5;12395:1;12391;:5;12357:11;:41::i;:::-;12324:74;;;:29;12336:4;:10;;;12348:1;12351;12324:11;:29::i;:::-;-1:-1:-1;;12324:74:0;;12320:137;;12432:5;12423:14;;12320:137;12550:35;12562:4;:10;;;12574:1;12582;12578;:5;12550:11;:35::i;:::-;12517:68;;;:29;12529:4;:10;;;12541:1;12544;12517:11;:29::i;:::-;-1:-1:-1;;12517:68:0;;12513:130;;12618:5;12610:13;;12513:130;12736:35;12748:4;:10;;;12765:1;12761;:5;12769:1;12736:11;:35::i;:::-;12703:68;;;:29;12715:4;:10;;;12727:1;12730;12703:11;:29::i;:::-;-1:-1:-1;;12703:68:0;;12699:130;;12804:5;12796:13;;12699:130;12922:41;12934:4;:10;;;12951:1;12947;:5;12960:1;12956;:5;12922:11;:41::i;:::-;12889:74;;;:29;12901:4;:10;;;12913:1;12916;12889:11;:29::i;:::-;-1:-1:-1;;12889:74:0;;12885:136;;12996:5;12988:13;;12885:136;13115:29;13127:4;:10;;;13139:1;13142;13115:11;:29::i;:::-;13082:62;;;:29;13094:4;:10;;;13106:1;13109;13082:11;:29::i;:::-;-1:-1:-1;;13082:62:0;;13078:125;;13178:5;13169:14;;13078:125;12254:3;;12180:1038;;;12160:3;;;;;12086:1143;;;13243:6;:15;;;;13253:5;13243:15;:24;;;;13262:5;13243:24;:33;;;;13271:5;13243:33;:43;;;;13280:6;13243:43;13239:268;;;-1:-1:-1;;13322:4:0;13303:16;;;:23;13341:20;;;:11;;;:20;13376:18;;;:10;;;:18;13409;;:10;;;:18;13442;;:10;;;:18;13475:20;;:11;;;:20;-1:-1:-1;13303:16:0;11862:1674::o;14603:237::-;14684:5;14701:12;14746;14716:19;14726:3;14731;14716:9;:19::i;:::-;14780:10;14762:13;;;;;-1:-1:-1;;14762:13:0;;;14780:10;14761:29;14808:11;;;;-1:-1:-1;14701:34:0;;-1:-1:-1;14761:29:0;-1:-1:-1;14603:237:0;;;;;;;:::o;6222:1598::-;6316:10;;:::i;:::-;6328:5;6347:36;;:::i;:::-;6394:30;6439:22;;:::i;:::-;6800:18;6829;6858;;:::i;:::-;6439:350;;;;;;;;6485:2;6439:350;;;;;;6887:16;6439:350;;;;;;;;;;;;;;;;;;;6534:1;6439:350;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;6439:350:0;;;;;;;;;;;;;;;;;;-1:-1:-1;;;6439:350:0;;;;6887:16;;-1:-1:-1;6439:350:0;-1:-1:-1;6887:16:0;;6916:833;6938:1;6934;:5;;;6916:833;;;6967:4;:7;;;;;;;;;;;;;;;-1:-1:-1;6967:7:0;7021:1;7017:6;;;;7005:18;;;-1:-1:-1;7066:3:0;7070:1;7066:6;;;;7059:3;7054:18;7038:34;;7175:1;7159:13;:17;;;:38;;;;7196:1;7180:13;:17;;;7159:38;:59;;;;7217:1;7201:13;:17;;;7159:59;:80;;;;7238:1;7222:13;:17;;;7159:80;7157:83;7153:585;;;7274:66;7285:4;:10;;;7303:13;7325;7274:10;:66::i;:::-;7261:79;;7482:4;:18;;;7468:32;;:10;:32;;;;7464:259;;;7529:19;;;309:1;7529:19;7525:179;;7624:3;7577:18;:44;;;;;;;;;;;;;:50;7654:26;;;;;7525:179;6941:3;;6916:833;;;-1:-1:-1;7767:18:0;;7787:24;;-1:-1:-1;6222:1598:0;;-1:-1:-1;;;;;;;;;6222:1598:0:o;7828:2082::-;7931:7;7940:5;7958:22;7991:26;8082:19;8314:9;8342:12;8365;8388:10;8414:7;8020:1;7991:30;;221:1;8038:27;;:4;:18;;;:27;;;8034:141;;;265:1;8082:27;;8034:141;;;221:1;8142:21;;8034:141;-1:-1:-1;8326:5:0;;-1:-1:-1;8424:1:0;8409:1438;8431:1;8427;:5;;;8409:1438;;;8459:4;8458:5;8454:1382;;;8505:6;;;8564;;;8495:16;;;8494:30;;;-1:-1:-1;8554:16:0;;8553:30;;;-1:-1:-1;8683:1:0;8509;8673:11;;;;;:26;;;8698:1;8688:7;:11;;;8673:26;:41;;;;8713:1;8703:7;:11;;;8673:41;:56;;;;8728:1;8718:7;:11;;;8673:56;8669:1152;;;8754:21;;;8821:1;8798:24;;8852:4;8845:11;;8669:1152;;;8913:54;8924:4;:10;;;8942:7;8958;8913:10;:54::i;:::-;8906:61;;9004:13;8996:21;;:4;:21;;;8992:810;;;9193:77;9201:14;9217:20;9245:7;9261;9193;:77::i;:::-;9152:118;;-1:-1:-1;9152:118:0;-1:-1:-1;8992:810:0;;;9312:4;:18;;;9304:26;;:4;:26;;;:35;;;;;9338:1;9334;:5;;;9304:35;9300:502;;;9460:4;9453:11;;9300:502;;;9665:21;;;9713:27;;;9774:4;9767:11;;9300:502;8434:3;;8409:1438;;;-1:-1:-1;9865:14:0;;9881:20;;-1:-1:-1;7828:2082:0;;-1:-1:-1;;;;;;;;;;7828:2082:0:o;14217:378::-;14309:7;14392:12;14437;14338:1;14332:3;:7;;;14328:21;;;14341:8;;;14328:21;14370:1;14364:3;:7;;;14360:21;;;14373:8;;;14360:21;14407:19;14417:3;14422;14407:9;:19::i;:::-;14452:18;;;;;:10;:18;;14513:12;;;14512:22;;;;14564:14;;;14452:10;14564:14;-1:-1:-1;;14564:22:0;;;;14555:32;;;-1:-1:-1;14392:34:0;;-1:-1:-1;14452:18:0;-1:-1:-1;14217:378:0;;;;;;;;:::o;14019:190::-;14101:7;14121:12;14136:19;14146:3;14151;14136:9;:19::i;:::-;14174:13;;;;;-1:-1:-1;;14174:13:0;;;14191:10;14173:28;;-1:-1:-1;14121:34:0;-1:-1:-1;14019:190:0;;;;;;:::o;14848:142::-;14957:1;:7;;;;14956:15;14949:2;14948:28;;;14980:1;14947:34;14939:43;;;14848:142::o;15269:340::-;15436:1;15430:7;15423:15;15441:2;15423:20;15415:29;;;;15470:17;;;;;;;15513:19;;;;;15543:13;;;;;;15269:340::o;142769:22584::-;;;;;;;;;-1:-1:-1;142769:22584:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;105:10:-1;142769:22584:0;88:34:-1;-1:-1;142769:22584:0;;;-1:-1:-1;;142769:22584:0:o;:::-;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;:::o

Swarm Source

bzzr://b9bc527d71cc12744e2d010120afaa311830a27864768051accdfc2dad26461c
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.