{
  "contractName": "Relay",
  "abi": [
    {
      "constant": true,
      "inputs": [],
      "name": "HEIGHT_INTERVAL",
      "outputs": [
        {
          "name": "",
          "type": "uint32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "name": "_genesisHeader",
          "type": "bytes"
        },
        {
          "name": "_height",
          "type": "uint256"
        },
        {
          "name": "_periodStart",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "name": "_first",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "name": "_last",
          "type": "bytes32"
        }
      ],
      "name": "Extension",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "name": "_from",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "name": "_to",
          "type": "bytes32"
        },
        {
          "indexed": true,
          "name": "_gcd",
          "type": "bytes32"
        }
      ],
      "name": "Reorg",
      "type": "event"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "_anchor",
          "type": "bytes"
        },
        {
          "name": "_headers",
          "type": "bytes"
        }
      ],
      "name": "addHeaders",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "_oldPeriodStartHeader",
          "type": "bytes"
        },
        {
          "name": "_oldPeriodEndHeader",
          "type": "bytes"
        },
        {
          "name": "_headers",
          "type": "bytes"
        }
      ],
      "name": "addHeadersWithRetarget",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "_digest",
          "type": "bytes32"
        }
      ],
      "name": "findHeight",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "_digest",
          "type": "bytes32"
        },
        {
          "name": "_offset",
          "type": "uint256"
        }
      ],
      "name": "findAncestor",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "_ancestor",
          "type": "bytes32"
        },
        {
          "name": "_descendant",
          "type": "bytes32"
        },
        {
          "name": "_limit",
          "type": "uint256"
        }
      ],
      "name": "isAncestor",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": false,
      "inputs": [
        {
          "name": "_ancestor",
          "type": "bytes32"
        },
        {
          "name": "_currentBest",
          "type": "bytes"
        },
        {
          "name": "_newBest",
          "type": "bytes"
        },
        {
          "name": "_limit",
          "type": "uint256"
        }
      ],
      "name": "markNewHeaviest",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "_ancestor",
          "type": "bytes32"
        },
        {
          "name": "_left",
          "type": "bytes32"
        },
        {
          "name": "_right",
          "type": "bytes32"
        },
        {
          "name": "_limit",
          "type": "uint256"
        }
      ],
      "name": "isMostRecentAncestor",
      "outputs": [
        {
          "name": "",
          "type": "bool"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [
        {
          "name": "_ancestor",
          "type": "bytes32"
        },
        {
          "name": "_left",
          "type": "bytes"
        },
        {
          "name": "_right",
          "type": "bytes"
        }
      ],
      "name": "heaviestFromAncestor",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "getCurrentEpochDifficulty",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "getPrevEpochDifficulty",
      "outputs": [
        {
          "name": "",
          "type": "uint256"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "getRelayGenesis",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "getBestKnownDigest",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    },
    {
      "constant": true,
      "inputs": [],
      "name": "getLastReorgCommonAncestor",
      "outputs": [
        {
          "name": "",
          "type": "bytes32"
        }
      ],
      "payable": false,
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "metadata": "{\"compiler\":{\"version\":\"0.5.10+commit.5a6ea5b1\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"getCurrentEpochDifficulty\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getBestKnownDigest\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPrevEpochDifficulty\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_ancestor\",\"type\":\"bytes32\"},{\"name\":\"_left\",\"type\":\"bytes32\"},{\"name\":\"_right\",\"type\":\"bytes32\"},{\"name\":\"_limit\",\"type\":\"uint256\"}],\"name\":\"isMostRecentAncestor\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_digest\",\"type\":\"bytes32\"},{\"name\":\"_offset\",\"type\":\"uint256\"}],\"name\":\"findAncestor\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_digest\",\"type\":\"bytes32\"}],\"name\":\"findHeight\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_anchor\",\"type\":\"bytes\"},{\"name\":\"_headers\",\"type\":\"bytes\"}],\"name\":\"addHeaders\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"HEIGHT_INTERVAL\",\"outputs\":[{\"name\":\"\",\"type\":\"uint32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_ancestor\",\"type\":\"bytes32\"},{\"name\":\"_currentBest\",\"type\":\"bytes\"},{\"name\":\"_newBest\",\"type\":\"bytes\"},{\"name\":\"_limit\",\"type\":\"uint256\"}],\"name\":\"markNewHeaviest\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_oldPeriodStartHeader\",\"type\":\"bytes\"},{\"name\":\"_oldPeriodEndHeader\",\"type\":\"bytes\"},{\"name\":\"_headers\",\"type\":\"bytes\"}],\"name\":\"addHeadersWithRetarget\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_ancestor\",\"type\":\"bytes32\"},{\"name\":\"_left\",\"type\":\"bytes\"},{\"name\":\"_right\",\"type\":\"bytes\"}],\"name\":\"heaviestFromAncestor\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_ancestor\",\"type\":\"bytes32\"},{\"name\":\"_descendant\",\"type\":\"bytes32\"},{\"name\":\"_limit\",\"type\":\"uint256\"}],\"name\":\"isAncestor\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getLastReorgCommonAncestor\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRelayGenesis\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_genesisHeader\",\"type\":\"bytes\"},{\"name\":\"_height\",\"type\":\"uint256\"},{\"name\":\"_periodStart\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_first\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"_last\",\"type\":\"bytes32\"}],\"name\":\"Extension\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"_from\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"_to\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"_gcd\",\"type\":\"bytes32\"}],\"name\":\"Reorg\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"addHeaders(bytes,bytes)\":{\"details\":\"We check integrity and consistency of the header chain\",\"params\":{\"_anchor\":\"The header immediately preceeding the new chain\",\"_headers\":\"A tightly-packed list of 80-byte Bitcoin headers\"},\"return\":\"True if successfully written, error otherwise\"},\"addHeadersWithRetarget(bytes,bytes,bytes)\":{\"details\":\"Checks the retarget, the heights, and the linkage\",\"params\":{\"_headers\":\"A tightly-packed list of 80-byte Bitcoin headers\",\"_oldPeriodEndHeader\":\"The last header in the difficulty period being closed\",\"_oldPeriodStartHeader\":\"The first header in the difficulty period being closed\"},\"return\":\"True if successfully written, error otherwise\"},\"constructor\":{\"details\":\"We don't check this AT ALL really. Don't use relays with bad genesis\",\"params\":{\"_genesisHeader\":\"The starting header\",\"_height\":\"The starting height\",\"_periodStart\":\"The hash of the first header in the genesis epoch\"}},\"findAncestor(bytes32,uint256)\":{\"details\":\"Will fail if the header is unknown\",\"params\":{\"_digest\":\"The header digest to search for\"},\"return\":\"The height of the header, or error if unknown\"},\"findHeight(bytes32)\":{\"details\":\"Will fail if the header is unknown\",\"params\":{\"_digest\":\"The header digest to search for\"},\"return\":\"The height of the header, or error if unknown\"},\"getBestKnownDigest()\":{\"details\":\"This updated only by calling markNewHeaviest\",\"return\":\"The hash of the best marked chain tip\"},\"getCurrentEpochDifficulty()\":{\"details\":\"This is updated when a new heavist header has a new diff\",\"return\":\"The difficulty of the bestKnownDigest\"},\"getLastReorgCommonAncestor()\":{\"details\":\"This is updated only by calling markNewHeaviest\",\"return\":\"The hash of the shared ancestor of the most recent fork\"},\"getPrevEpochDifficulty()\":{\"details\":\"This is updated when a difficulty change is accepted\",\"return\":\"The difficulty of the previous epoch\"},\"getRelayGenesis()\":{\"details\":\"This is an initialization parameter\",\"return\":\"The hash of the first block of the relay\"},\"heaviestFromAncestor(bytes32,bytes,bytes)\":{\"details\":\"Does not support reorgs above 2017 blocks (:\",\"params\":{\"_ancestor\":\"The prospective shared ancestor\",\"_left\":\"A chain tip\",\"_right\":\"A chain tip\"},\"return\":\"true if it is the most recent common ancestor within _limit, false otherwise\"},\"isAncestor(bytes32,bytes32,uint256)\":{\"details\":\"Limit the amount of lookups (and thus gas usage) with _limit\",\"params\":{\"_ancestor\":\"The prospective ancestor\",\"_descendant\":\"The descendant to check\",\"_limit\":\"The maximum number of blocks to check\"},\"return\":\"true if ancestor is at most limit blocks lower than descendant, otherwise false\"},\"isMostRecentAncestor(bytes32,bytes32,bytes32,uint256)\":{\"details\":\"Limit the amount of lookups (and thus gas usage) with _limit\",\"params\":{\"_ancestor\":\"The prospective shared ancestor\",\"_left\":\"A chain tip\",\"_limit\":\"The maximum number of blocks to check\",\"_right\":\"A chain tip\"},\"return\":\"true if it is the most recent common ancestor within _limit, false otherwise\"},\"markNewHeaviest(bytes32,bytes,bytes,uint256)\":{\"details\":\"We don't check this AT ALL really. Don't use relays with bad genesis\",\"params\":{\"_ancestor\":\"The digest of the most recent common ancestor\",\"_currentBest\":\"The 80-byte header referenced by bestKnownDigest\",\"_limit\":\"Limit the amount of traversal of the chain\",\"_newBest\":\"The 80-byte header to mark as the new best\"},\"return\":\"True if successfully updates bestKnownDigest, error otherwise\"}}},\"userdoc\":{\"methods\":{\"addHeaders(bytes,bytes)\":{\"notice\":\"Adds headers to storage after validating\"},\"addHeadersWithRetarget(bytes,bytes,bytes)\":{\"notice\":\"Adds headers to storage, performs additional validation of retarget\"},\"constructor\":\"Gives a starting point for the relay\",\"findAncestor(bytes32,uint256)\":{\"notice\":\"Finds an ancestor for a block by its digest\"},\"findHeight(bytes32)\":{\"notice\":\"Finds the height of a header by its digest\"},\"getBestKnownDigest()\":{\"notice\":\"Getter for bestKnownDigest\"},\"getCurrentEpochDifficulty()\":{\"notice\":\"Getter for currentEpochDiff\"},\"getLastReorgCommonAncestor()\":{\"notice\":\"Getter for relayGenesis\"},\"getPrevEpochDifficulty()\":{\"notice\":\"Getter for prevEpochDiff\"},\"getRelayGenesis()\":{\"notice\":\"Getter for relayGenesis\"},\"heaviestFromAncestor(bytes32,bytes,bytes)\":{\"notice\":\"Decides which header is heaviest from the ancestor\"},\"isAncestor(bytes32,bytes32,uint256)\":{\"notice\":\"Checks if a digest is an ancestor of the current one\"},\"isMostRecentAncestor(bytes32,bytes32,bytes32,uint256)\":{\"notice\":\"Checks if a digest is an ancestor of the current one\"},\"markNewHeaviest(bytes32,bytes,bytes,uint256)\":{\"notice\":\"Gives a starting point for the relay\"}}}},\"settings\":{\"compilationTarget\":{\"/home/james/devel/relays/solidity/contracts/Relay.sol\":\"Relay\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/james/devel/relays/solidity/contracts/Relay.sol\":{\"keccak256\":\"0x91f24dd17a8c00da7ab462b64fd6820df7060156d4e2b6d79bf5b4538f265c33\",\"urls\":[\"bzzr://2e2736b7a8b6275451afb9d606392c14be20d51224c2265a21efef6c4e4bb338\",\"dweb:/ipfs/QmZZQCPHUdCyCZfRhpMQBRjKR8k7VDAwNaRo9BRYBWbDm2\"]},\"@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol\":{\"keccak256\":\"0xc63829e9d674bb7bb98b264aff17add28db3c19d3ee0ef49531663491af8b087\",\"urls\":[\"bzzr://9a76af9995e01cb82228d6827801929b4697eb83fc60b44faa00d5e62c69ee2d\",\"dweb:/ipfs/QmYRRfdW9qyerUaEyHSEi7LY7WymkKUQQ61YQdxVorGdNW\"]},\"@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol\":{\"keccak256\":\"0x16296b4a97cdac10bb9cd4666d29310fe25897b7644dc04ad053ae09d4aeea9c\",\"urls\":[\"bzzr://27b097b56c0dc070a4e80572e01ffc28d26d83490f56fe0947a4d62ab09e1c48\",\"dweb:/ipfs/QmXwiQCVL8MS3R2NDWwTozngTjrD3SmWmZ6fbNGgQiwdDd\"]},\"@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol\":{\"keccak256\":\"0x22d34c04c68c2a77ee83e2ef3756f6e6bad6ad675560d777e612315d7eb83935\",\"urls\":[\"bzzr://a3312aa9977669832679852788efb21430fa70e5779243861ac6400fdc72f3de\",\"dweb:/ipfs/QmWADdVTCSyvtgb76AxFFkAr9h9jbY57Mj5X6xiEqCqmMu\"]},\"@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol\":{\"keccak256\":\"0x1b26b6ec30dcf0adb9cd7a8035a6cf0a565e8e12f0adf9f0ccda1f6b78e453c1\",\"urls\":[\"bzzr://ac9acd02674dcf17e3d6b58322efbfb42111dac4332cd9ee31ba9c7b8aa9fb47\",\"dweb:/ipfs/QmcwStYYD1NMVRzwcRP4v6eCscbMLdpjp45itWnfBaVnkf\"]}},\"version\":1}",
  "bytecode": "0x60806040523480156200001157600080fd5b506040516200205a3803806200205a833981810160405260608110156200003757600080fd5b8101908080516401000000008111156200005057600080fd5b820160208101848111156200006457600080fd5b81516401000000008111828201871017156200007f57600080fd5b5050602082015160409092015181519194509192506050146200010357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f53746f70206265696e672064756d620000000000000000000000000000000000604482015290519081900360640190fd5b60006200011b84620001f260201b6200127e1760201c565b905062ffffff8216156200017b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d8152602001806200201d603d913960400191505060405180910390fd5b600081815560018290556002829055818152600460205260409020839055620001b76107e08406846200035d60201b620017061790919060201c565b6004600084815260200190815260200160002081905550620001e484620003d560201b620016231760201c565b600555506200067692505050565b600062000355600280846040518082805190602001908083835b602083106200022d5780518252601f1990920191602091820191016200020c565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa1580156200026d573d6000803e3d6000fd5b5050506040513d60208110156200028357600080fd5b50516040805160208181019390935281518082038401815290820191829052805190928291908401908083835b60208310620002d15780518252601f199092019160209182019101620002b0565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa15801562000311573d6000803e3d6000fd5b5050506040513d60208110156200032757600080fd5b5051604080516020818101939093528151808203840181529082019091529062001763620003fe821b17901c565b90505b919050565b600082821115620003cf57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e646572666c6f7720647572696e67207375627472616374696f6e2e000000604482015290519081900360640190fd5b50900390565b600062000355620003ef836001600160e01b036200041e16565b6001600160e01b036200049e16565b805160009082906200041557506000905062000358565b50506020015190565b60006060620004406048600385620004d660201b620013cc179092919060201c565b9050600083604b815181106200045257fe5b016020015160f81c905060006200048562000476846001600160e01b036200059016565b6001600160e01b036200062216565b6002199290920160ff166101000a909102949350505050565b600062000355827bffff00000000000000000000000000000000000000000000000000006200066260201b620017c21790919060201c565b6060818301845110156200054b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f536c696365206f7574206f6620626f756e647300000000000000000000000000604482015290519081900360640190fd5b604051905081604082010160405281815282840181038360208601018381015b8082101562000586578151838301526020820191506200056b565b5050509392505050565b60608082516040519080825280601f01601f191660200182016040528015620005c0576020820181803883390190505b50905060005b83518110156200061b57838181518110620005dd57fe5b602001015160f81c60f81b826001838751030381518110620005fb57fe5b60200101906001600160f81b031916908160001a905350600101620005c6565b5092915050565b600080805b83518110156200061b578060010184510360080260020a8482815181106200064b57fe5b016020015160f81c02919091019060010162000627565b60008183816200066e57fe5b049392505050565b61199780620006866000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370d53c181161008c578063b25b9b0011610066578063b25b9b001461044e578063b985621a14610513578063c58242cd1461053c578063e3d8d8d814610544576100ea565b806370d53c181461025a57806374c3a3a91461027b5780637fa637fc14610340576100ea565b80632e4f161a116100c85780632e4f161a1461011957806330017b3b1461015c57806360b5c3901461017f57806365da41b91461019c576100ea565b8063113764be146100ef5780631910d973146101095780632b97be2414610111575b600080fd5b6100f761054c565b60408051918252519081900360200190f35b6100f7610552565b6100f7610558565b6101486004803603608081101561012f57600080fd5b508035906020810135906040810135906060013561055e565b604080519115158252519081900360200190f35b6100f76004803603604081101561017257600080fd5b5080359060200135610577565b6100f76004803603602081101561019557600080fd5b503561058c565b610148600480360360408110156101b257600080fd5b810190602081018135600160201b8111156101cc57600080fd5b8201836020820111156101de57600080fd5b803590602001918460018302840111600160201b831117156101ff57600080fd5b919390929091602081019035600160201b81111561021c57600080fd5b82018360208201111561022e57600080fd5b803590602001918460018302840111600160201b8311171561024f57600080fd5b50909250905061059f565b610262610614565b6040805163ffffffff9092168252519081900360200190f35b6101486004803603608081101561029157600080fd5b81359190810190604081016020820135600160201b8111156102b257600080fd5b8201836020820111156102c457600080fd5b803590602001918460018302840111600160201b831117156102e557600080fd5b919390929091602081019035600160201b81111561030257600080fd5b82018360208201111561031457600080fd5b803590602001918460018302840111600160201b8311171561033557600080fd5b919350915035610619565b6101486004803603606081101561035657600080fd5b810190602081018135600160201b81111561037057600080fd5b82018360208201111561038257600080fd5b803590602001918460018302840111600160201b831117156103a357600080fd5b919390929091602081019035600160201b8111156103c057600080fd5b8201836020820111156103d257600080fd5b803590602001918460018302840111600160201b831117156103f357600080fd5b919390929091602081019035600160201b81111561041057600080fd5b82018360208201111561042257600080fd5b803590602001918460018302840111600160201b8311171561044357600080fd5b50909250905061069c565b6100f76004803603606081101561046457600080fd5b81359190810190604081016020820135600160201b81111561048557600080fd5b82018360208201111561049757600080fd5b803590602001918460018302840111600160201b831117156104b857600080fd5b919390929091602081019035600160201b8111156104d557600080fd5b8201836020820111156104e757600080fd5b803590602001918460018302840111600160201b8311171561050857600080fd5b509092509050610745565b6101486004803603606081101561052957600080fd5b50803590602081013590604001356107c5565b6100f76107dc565b6100f76107e2565b60055490565b60015490565b60065490565b600061056c858585856107e8565b90505b949350505050565b60006105838383610899565b90505b92915050565b600061059782610915565b90505b919050565b600061056c85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781529250879150869081908401838280828437600092018290525092506109c0915050565b600481565b60006106918787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b018190048102820181019092528981529250899150889081908401838280828437600092019190915250889250610cb8915050565b979650505050505050565b600061069187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881529250889150879081908401838280828437600092019190915250610e7392505050565b60006107bb8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a01819004810282018101909252888152925088915087908190840183828082843760009201919091525061108692505050565b9695505050505050565b60006107d28484846111d1565b90505b9392505050565b60025490565b60005490565b600083851480156107f857508285145b156108055750600161056f565b8383818160005b868110156108605789831461082e576000838152600360205260409020549294505b898214610848576000828152600360205260409020549193505b61085981600163ffffffff61122616565b905061080c565b508284141561087657600094505050505061056f565b80821461088a57600094505050505061056f565b50600198975050505050505050565b600082815b838110156108cf5760009182526003602052604090912054906108c881600163ffffffff61122616565b905061089e565b5080610583576040805162461bcd60e51b815260206004820152601060248201526f2ab735b737bbb71030b731b2b9ba37b960811b604482015290519081900360640190fd5b60008082815b60058110156109825760008281526004602052604090205492508261095057600091825260036020526040909120549061096a565b610960838263ffffffff61122616565b935050505061059a565b61097b81600163ffffffff61122616565b905061091b565b506040805162461bcd60e51b815260206004820152600d60248201526c556e6b6e6f776e20626c6f636b60981b604482015290519081900360640190fd5b60008060606000806109d18861127e565b905060006109ef6109ea8983605063ffffffff6113cc16565b61145f565b905060006109fc83610915565b90508780610a11575081610a0f8b61145f565b145b610a4c5760405162461bcd60e51b81526004018080602001828103825260248152602001806118ef6024913960400191505060405180910390fd5b6050895181610a5757fe5b0615610a945760405162461bcd60e51b815260040180806020018281038252602b8152602001806117fc602b913960400191505060405180910390fd5b60005b60508a5181610aa257fe5b04811015610c7457610acd610abe82605063ffffffff6114b816565b8b90605063ffffffff6113cc16565b9550610ae2826001830163ffffffff61122616565b9650610aed8661127e565b600081815260036020526040902054909550610bb25782610b34610b2f8760405160200180828152602001915050604051602081830303815290604052611528565b6115b5565b1115610b87576040805162461bcd60e51b815260206004820152601b60248201527f48656164657220776f726b20697320696e73756666696369656e740000000000604482015290519081900360640190fd5b600085815260036020526040902084905560048706610bb25760008581526004602052604090208790555b82610bbc8761145f565b14610c0e576040805162461bcd60e51b815260206004820152601b60248201527f546172676574206368616e67656420756e65787065637465646c790000000000604482015290519081900360640190fd5b610c1e868563ffffffff6115f216565b610c595760405162461bcd60e51b81526004018080602001828103825260268152602001806117d66026913960400191505060405180910390fd5b849350610c6d81600163ffffffff61122616565b9050610a97565b5083610c7f8b61127e565b6040517ff90e4f1d9cd0dd55e339411cbc9b152482307c3a23ed64715e4a2858f641a3f590600090a35060019998505050505050505050565b600080610cc48461127e565b90506000610cd18661127e565b90506001548114610d29576040805162461bcd60e51b815260206004820181905260248201527f50617373656420696e2062657374206973206e6f742062657374206b6e6f776e604482015290519081900360640190fd5b600082815260036020526040902054610d7f576040805162461bcd60e51b81526020600482015260136024820152722732bb903132b9ba1034b9903ab735b737bbb760691b604482015290519081900360640190fd5b610d8d8760015484876107e8565b610dc85760405162461bcd60e51b815260040180806020018281038252602981526020018061193a6029913960400191505060405180910390fd5b81610dd4888888611086565b14610e105760405162461bcd60e51b815260040180806020018281038252603381526020018061188c6033913960400191505060405180910390fd5b600182905560028790556000610e2586611623565b90506005548114610e365760058190555b8783837f26300f292d9603532a1503495d83156db6cb60433e0802cd3b8763b57f1d14d260405160405180910390a4506001979650505050505050565b600080610e87610e828661127e565b610915565b90506000610e97610e828661127e565b90506107e081066107df14610edd5760405162461bcd60e51b815260040180806020018281038252603d81526020018061184f603d913960400191505060405180910390fd5b610eef826107df63ffffffff61122616565b8114610f2c5760405162461bcd60e51b81526004018080602001828103825260288152602001806118276028913960400191505060405180910390fd5b610f3585611623565b610f3e87611623565b14610f7a5760405162461bcd60e51b81526004018080602001828103825260278152602001806119136027913960400191505060405180910390fd5b6060610f8f856000605063ffffffff6113cc16565b90506000610f9c8261145f565b90506000610fcf610fac8a61145f565b610fb58b611636565b63ffffffff16610fc48b611636565b63ffffffff1661164c565b90508181831614611027576040805162461bcd60e51b815260206004820152601960248201527f496e76616c69642072657461726765742070726f766964656400000000000000604482015290519081900360640190fd5b60006110328a611623565b90508060065414158015611061575061105e6107e0611052600154610915565b9063ffffffff61170616565b85115b1561106c5760068190555b611078898960016109c0565b9a9950505050505050505050565b60008061109285610915565b905060006110a2610e828661127e565b905060006110b2610e828661127e565b90508282101580156110c45750828110155b6110ff5760405162461bcd60e51b81526004018080602001828103825260308152602001806118bf6030913960400191505060405180910390fd5b600061111b6107e08506611052866107e063ffffffff61122616565b905080831081831081158261112d5750805b156111485761113b8961127e565b96505050505050506107d5565b818015611153575080155b156111615761113b8861127e565b81801561116b5750805b1561118f5783851015611186576111818861127e565b61113b565b61113b8961127e565b6111ad61119b89611623565b6107e0865b069063ffffffff6114b816565b6111c26111b98b611623565b6107e0886111a0565b10156111865761113b8861127e565b600082815b8381101561121a57858214156111f1576001925050506107d5565b600091825260036020526040909120549061121381600163ffffffff61122616565b90506111d6565b50600095945050505050565b81810182811015610586576040805162461bcd60e51b815260206004820152601960248201527f4f766572666c6f7720647572696e67206164646974696f6e2e00000000000000604482015290519081900360640190fd5b6000610597600280846040518082805190602001908083835b602083106112b65780518252601f199092019160209182019101611297565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa1580156112f5573d6000803e3d6000fd5b5050506040513d602081101561130a57600080fd5b50516040805160208181019390935281518082038401815290820191829052805190928291908401908083835b602083106113565780518252601f199092019160209182019101611337565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa158015611395573d6000803e3d6000fd5b5050506040513d60208110156113aa57600080fd5b5051604080516020818101939093528151808203909301835281019052611763565b60608183018451101561141c576040805162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015290519081900360640190fd5b604051905081604082010160405281815282840181038360208601018381015b808210156114555781518383015260208201915061143c565b5050509392505050565b60006060611476836048600363ffffffff6113cc16565b9050600083604b8151811061148757fe5b016020015160f81c9050600061149f610b2f84611528565b6002199290920160ff166101000a909102949350505050565b6000826114c757506000610586565b50818102818382816114d557fe5b0414610586576040805162461bcd60e51b815260206004820152601f60248201527f4f766572666c6f7720647572696e67206d756c7469706c69636174696f6e2e00604482015290519081900360640190fd5b60608082516040519080825280601f01601f191660200182016040528015611557576020820181803883390190505b50905060005b83518110156115ae5783818151811061157257fe5b602001015160f81c60f81b82600183875103038151811061158f57fe5b60200101906001600160f81b031916908160001a90535060010161155d565b5092915050565b600080805b83518110156115ae578060010184510360080260020a8482815181106115dc57fe5b016020015160f81c0291909101906001016115ba565b60008061160661160185611781565b611763565b9050828114611619576000915050610586565b5060019392505050565b60006105976116318361145f565b611796565b6000610597610b2f611647846117ad565b611528565b60008061165f838563ffffffff61170616565b905061167562127500600463ffffffff6117c216565b8110156116935761169062127500600463ffffffff6117c216565b90505b6116a762127500600463ffffffff6114b816565b8111156116c5576116c262127500600463ffffffff6114b816565b90505b60006116ea826116de886201000063ffffffff6117c216565b9063ffffffff6114b816565b90506107bb620100006116de836212750063ffffffff6117c216565b60008282111561175d576040805162461bcd60e51b815260206004820152601d60248201527f556e646572666c6f7720647572696e67207375627472616374696f6e2e000000604482015290519081900360640190fd5b50900390565b8051600090829061177857506000905061059a565b50506020015190565b6060610597826004602063ffffffff6113cc16565b600061059761ffff60d01b8363ffffffff6117c216565b6060610597826044600463ffffffff6113cc16565b60008183816117cd57fe5b04939250505056fe4865616465727320646f206e6f7420666f726d206120636f6e73697374656e7420636861696e486561646572206172726179206c656e677468206d75737420626520646976697369626c652062792038304d7573742070726f766964652065786163746c79203120646966666963756c747920706572696f644d7573742070726f7669646520746865206c61737420686561646572206f662074686520636c6f73696e6720646966666963756c747920706572696f644e65772062657374206861736820646f6573206e6f742068617665206d6f726520776f726b207468616e2070726576696f7573412064657363656e64616e74206865696768742069732062656c6f772074686520616e636573746f7220686569676874556e6578706563746564207265746172676574206f6e2065787465726e616c2063616c6c506572696f642068656164657220646966666963756c7469657320646f206e6f74206d61746368416e636573746f72206d75737420626520686561766965737420636f6d6d6f6e20616e636573746f72a265627a7a723058205f089265a488047a1b1e7040391bfe58c8b76be351ea3dede18a0c0a9acb946264736f6c634300050a0032506572696f64207374617274206861736820646f6573206e6f74206861766520776f726b2e2048696e743a2077726f6e672062797465206f726465723f",
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370d53c181161008c578063b25b9b0011610066578063b25b9b001461044e578063b985621a14610513578063c58242cd1461053c578063e3d8d8d814610544576100ea565b806370d53c181461025a57806374c3a3a91461027b5780637fa637fc14610340576100ea565b80632e4f161a116100c85780632e4f161a1461011957806330017b3b1461015c57806360b5c3901461017f57806365da41b91461019c576100ea565b8063113764be146100ef5780631910d973146101095780632b97be2414610111575b600080fd5b6100f761054c565b60408051918252519081900360200190f35b6100f7610552565b6100f7610558565b6101486004803603608081101561012f57600080fd5b508035906020810135906040810135906060013561055e565b604080519115158252519081900360200190f35b6100f76004803603604081101561017257600080fd5b5080359060200135610577565b6100f76004803603602081101561019557600080fd5b503561058c565b610148600480360360408110156101b257600080fd5b810190602081018135600160201b8111156101cc57600080fd5b8201836020820111156101de57600080fd5b803590602001918460018302840111600160201b831117156101ff57600080fd5b919390929091602081019035600160201b81111561021c57600080fd5b82018360208201111561022e57600080fd5b803590602001918460018302840111600160201b8311171561024f57600080fd5b50909250905061059f565b610262610614565b6040805163ffffffff9092168252519081900360200190f35b6101486004803603608081101561029157600080fd5b81359190810190604081016020820135600160201b8111156102b257600080fd5b8201836020820111156102c457600080fd5b803590602001918460018302840111600160201b831117156102e557600080fd5b919390929091602081019035600160201b81111561030257600080fd5b82018360208201111561031457600080fd5b803590602001918460018302840111600160201b8311171561033557600080fd5b919350915035610619565b6101486004803603606081101561035657600080fd5b810190602081018135600160201b81111561037057600080fd5b82018360208201111561038257600080fd5b803590602001918460018302840111600160201b831117156103a357600080fd5b919390929091602081019035600160201b8111156103c057600080fd5b8201836020820111156103d257600080fd5b803590602001918460018302840111600160201b831117156103f357600080fd5b919390929091602081019035600160201b81111561041057600080fd5b82018360208201111561042257600080fd5b803590602001918460018302840111600160201b8311171561044357600080fd5b50909250905061069c565b6100f76004803603606081101561046457600080fd5b81359190810190604081016020820135600160201b81111561048557600080fd5b82018360208201111561049757600080fd5b803590602001918460018302840111600160201b831117156104b857600080fd5b919390929091602081019035600160201b8111156104d557600080fd5b8201836020820111156104e757600080fd5b803590602001918460018302840111600160201b8311171561050857600080fd5b509092509050610745565b6101486004803603606081101561052957600080fd5b50803590602081013590604001356107c5565b6100f76107dc565b6100f76107e2565b60055490565b60015490565b60065490565b600061056c858585856107e8565b90505b949350505050565b60006105838383610899565b90505b92915050565b600061059782610915565b90505b919050565b600061056c85858080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f89018190048102820181019092528781529250879150869081908401838280828437600092018290525092506109c0915050565b600481565b60006106918787878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b018190048102820181019092528981529250899150889081908401838280828437600092019190915250889250610cb8915050565b979650505050505050565b600061069187878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8b01819004810282018101909252898152925089915088908190840183828082843760009201919091525050604080516020601f8a018190048102820181019092528881529250889150879081908401838280828437600092019190915250610e7392505050565b60006107bb8686868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8a01819004810282018101909252888152925088915087908190840183828082843760009201919091525061108692505050565b9695505050505050565b60006107d28484846111d1565b90505b9392505050565b60025490565b60005490565b600083851480156107f857508285145b156108055750600161056f565b8383818160005b868110156108605789831461082e576000838152600360205260409020549294505b898214610848576000828152600360205260409020549193505b61085981600163ffffffff61122616565b905061080c565b508284141561087657600094505050505061056f565b80821461088a57600094505050505061056f565b50600198975050505050505050565b600082815b838110156108cf5760009182526003602052604090912054906108c881600163ffffffff61122616565b905061089e565b5080610583576040805162461bcd60e51b815260206004820152601060248201526f2ab735b737bbb71030b731b2b9ba37b960811b604482015290519081900360640190fd5b60008082815b60058110156109825760008281526004602052604090205492508261095057600091825260036020526040909120549061096a565b610960838263ffffffff61122616565b935050505061059a565b61097b81600163ffffffff61122616565b905061091b565b506040805162461bcd60e51b815260206004820152600d60248201526c556e6b6e6f776e20626c6f636b60981b604482015290519081900360640190fd5b60008060606000806109d18861127e565b905060006109ef6109ea8983605063ffffffff6113cc16565b61145f565b905060006109fc83610915565b90508780610a11575081610a0f8b61145f565b145b610a4c5760405162461bcd60e51b81526004018080602001828103825260248152602001806118ef6024913960400191505060405180910390fd5b6050895181610a5757fe5b0615610a945760405162461bcd60e51b815260040180806020018281038252602b8152602001806117fc602b913960400191505060405180910390fd5b60005b60508a5181610aa257fe5b04811015610c7457610acd610abe82605063ffffffff6114b816565b8b90605063ffffffff6113cc16565b9550610ae2826001830163ffffffff61122616565b9650610aed8661127e565b600081815260036020526040902054909550610bb25782610b34610b2f8760405160200180828152602001915050604051602081830303815290604052611528565b6115b5565b1115610b87576040805162461bcd60e51b815260206004820152601b60248201527f48656164657220776f726b20697320696e73756666696369656e740000000000604482015290519081900360640190fd5b600085815260036020526040902084905560048706610bb25760008581526004602052604090208790555b82610bbc8761145f565b14610c0e576040805162461bcd60e51b815260206004820152601b60248201527f546172676574206368616e67656420756e65787065637465646c790000000000604482015290519081900360640190fd5b610c1e868563ffffffff6115f216565b610c595760405162461bcd60e51b81526004018080602001828103825260268152602001806117d66026913960400191505060405180910390fd5b849350610c6d81600163ffffffff61122616565b9050610a97565b5083610c7f8b61127e565b6040517ff90e4f1d9cd0dd55e339411cbc9b152482307c3a23ed64715e4a2858f641a3f590600090a35060019998505050505050505050565b600080610cc48461127e565b90506000610cd18661127e565b90506001548114610d29576040805162461bcd60e51b815260206004820181905260248201527f50617373656420696e2062657374206973206e6f742062657374206b6e6f776e604482015290519081900360640190fd5b600082815260036020526040902054610d7f576040805162461bcd60e51b81526020600482015260136024820152722732bb903132b9ba1034b9903ab735b737bbb760691b604482015290519081900360640190fd5b610d8d8760015484876107e8565b610dc85760405162461bcd60e51b815260040180806020018281038252602981526020018061193a6029913960400191505060405180910390fd5b81610dd4888888611086565b14610e105760405162461bcd60e51b815260040180806020018281038252603381526020018061188c6033913960400191505060405180910390fd5b600182905560028790556000610e2586611623565b90506005548114610e365760058190555b8783837f26300f292d9603532a1503495d83156db6cb60433e0802cd3b8763b57f1d14d260405160405180910390a4506001979650505050505050565b600080610e87610e828661127e565b610915565b90506000610e97610e828661127e565b90506107e081066107df14610edd5760405162461bcd60e51b815260040180806020018281038252603d81526020018061184f603d913960400191505060405180910390fd5b610eef826107df63ffffffff61122616565b8114610f2c5760405162461bcd60e51b81526004018080602001828103825260288152602001806118276028913960400191505060405180910390fd5b610f3585611623565b610f3e87611623565b14610f7a5760405162461bcd60e51b81526004018080602001828103825260278152602001806119136027913960400191505060405180910390fd5b6060610f8f856000605063ffffffff6113cc16565b90506000610f9c8261145f565b90506000610fcf610fac8a61145f565b610fb58b611636565b63ffffffff16610fc48b611636565b63ffffffff1661164c565b90508181831614611027576040805162461bcd60e51b815260206004820152601960248201527f496e76616c69642072657461726765742070726f766964656400000000000000604482015290519081900360640190fd5b60006110328a611623565b90508060065414158015611061575061105e6107e0611052600154610915565b9063ffffffff61170616565b85115b1561106c5760068190555b611078898960016109c0565b9a9950505050505050505050565b60008061109285610915565b905060006110a2610e828661127e565b905060006110b2610e828661127e565b90508282101580156110c45750828110155b6110ff5760405162461bcd60e51b81526004018080602001828103825260308152602001806118bf6030913960400191505060405180910390fd5b600061111b6107e08506611052866107e063ffffffff61122616565b905080831081831081158261112d5750805b156111485761113b8961127e565b96505050505050506107d5565b818015611153575080155b156111615761113b8861127e565b81801561116b5750805b1561118f5783851015611186576111818861127e565b61113b565b61113b8961127e565b6111ad61119b89611623565b6107e0865b069063ffffffff6114b816565b6111c26111b98b611623565b6107e0886111a0565b10156111865761113b8861127e565b600082815b8381101561121a57858214156111f1576001925050506107d5565b600091825260036020526040909120549061121381600163ffffffff61122616565b90506111d6565b50600095945050505050565b81810182811015610586576040805162461bcd60e51b815260206004820152601960248201527f4f766572666c6f7720647572696e67206164646974696f6e2e00000000000000604482015290519081900360640190fd5b6000610597600280846040518082805190602001908083835b602083106112b65780518252601f199092019160209182019101611297565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa1580156112f5573d6000803e3d6000fd5b5050506040513d602081101561130a57600080fd5b50516040805160208181019390935281518082038401815290820191829052805190928291908401908083835b602083106113565780518252601f199092019160209182019101611337565b51815160209384036101000a60001901801990921691161790526040519190930194509192505080830381855afa158015611395573d6000803e3d6000fd5b5050506040513d60208110156113aa57600080fd5b5051604080516020818101939093528151808203909301835281019052611763565b60608183018451101561141c576040805162461bcd60e51b8152602060048201526013602482015272536c696365206f7574206f6620626f756e647360681b604482015290519081900360640190fd5b604051905081604082010160405281815282840181038360208601018381015b808210156114555781518383015260208201915061143c565b5050509392505050565b60006060611476836048600363ffffffff6113cc16565b9050600083604b8151811061148757fe5b016020015160f81c9050600061149f610b2f84611528565b6002199290920160ff166101000a909102949350505050565b6000826114c757506000610586565b50818102818382816114d557fe5b0414610586576040805162461bcd60e51b815260206004820152601f60248201527f4f766572666c6f7720647572696e67206d756c7469706c69636174696f6e2e00604482015290519081900360640190fd5b60608082516040519080825280601f01601f191660200182016040528015611557576020820181803883390190505b50905060005b83518110156115ae5783818151811061157257fe5b602001015160f81c60f81b82600183875103038151811061158f57fe5b60200101906001600160f81b031916908160001a90535060010161155d565b5092915050565b600080805b83518110156115ae578060010184510360080260020a8482815181106115dc57fe5b016020015160f81c0291909101906001016115ba565b60008061160661160185611781565b611763565b9050828114611619576000915050610586565b5060019392505050565b60006105976116318361145f565b611796565b6000610597610b2f611647846117ad565b611528565b60008061165f838563ffffffff61170616565b905061167562127500600463ffffffff6117c216565b8110156116935761169062127500600463ffffffff6117c216565b90505b6116a762127500600463ffffffff6114b816565b8111156116c5576116c262127500600463ffffffff6114b816565b90505b60006116ea826116de886201000063ffffffff6117c216565b9063ffffffff6114b816565b90506107bb620100006116de836212750063ffffffff6117c216565b60008282111561175d576040805162461bcd60e51b815260206004820152601d60248201527f556e646572666c6f7720647572696e67207375627472616374696f6e2e000000604482015290519081900360640190fd5b50900390565b8051600090829061177857506000905061059a565b50506020015190565b6060610597826004602063ffffffff6113cc16565b600061059761ffff60d01b8363ffffffff6117c216565b6060610597826044600463ffffffff6113cc16565b60008183816117cd57fe5b04939250505056fe4865616465727320646f206e6f7420666f726d206120636f6e73697374656e7420636861696e486561646572206172726179206c656e677468206d75737420626520646976697369626c652062792038304d7573742070726f766964652065786163746c79203120646966666963756c747920706572696f644d7573742070726f7669646520746865206c61737420686561646572206f662074686520636c6f73696e6720646966666963756c747920706572696f644e65772062657374206861736820646f6573206e6f742068617665206d6f726520776f726b207468616e2070726576696f7573412064657363656e64616e74206865696768742069732062656c6f772074686520616e636573746f7220686569676874556e6578706563746564207265746172676574206f6e2065787465726e616c2063616c6c506572696f642068656164657220646966666963756c7469657320646f206e6f74206d61746368416e636573746f72206d75737420626520686561766965737420636f6d6d6f6e20616e636573746f72a265627a7a723058205f089265a488047a1b1e7040391bfe58c8b76be351ea3dede18a0c0a9acb946264736f6c634300050a0032",
  "sourceMap": "2004:21184:3:-;;;2996:740;8:9:-1;5:2;;;30:1;27;20:12;5:2;2996:740:3;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2996:740:3;;;;;;19:11:-1;14:3;11:20;8:2;;;44:1;41;34:12;8:2;62:21;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;213:10;;261:11;244:29;;285:43;;;282:58;-1:-1;233:115;230:2;;;361:1;358;351:12;230:2;-1:-1;;2996:740:3;;;;;;;;;3101:21;;2996:740;;-1:-1:-1;2996:740:3;;-1:-1:-1;3126:2:3;3101:27;3093:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3158:22;3183:24;:14;:22;;;;;:24;;:::i;:::-;3158:49;-1:-1:-1;3262:66:3;3239:90;;:104;3218:203;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3432:12;:29;;;3471:15;:32;;;3513:23;:40;;;3563:27;;;:11;:27;;;;;:37;;;3638:27;3660:4;3593:7;3650:14;3638:7;:11;;;;;;:27;;;;:::i;:::-;3610:11;:25;3622:12;3610:25;;;;;;;;;;;:55;;;;3695:34;:14;:32;;;;;:34;;:::i;:::-;3676:16;:53;-1:-1:-1;2004:21184:3;;-1:-1:-1;;;2004:21184:3;4750:156:5;4807:7;4833:66;4850:36;4874:10;4881:2;4874:10;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;4874:10:5;;;;;;;-1:-1:-1;263:2;;-1:-1;;4874:10:5;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4874:10:5;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4874:10:5;4857:28;;;4874:10;4857:28;;;;;;;;;26:21:-1;;;22:32;;6:49;;4857:28:5;;;;;;;4850:36;;4857:28;;;;4850:36;;;;;4857:28;4850:36;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;4850:36:5;;;;;;;-1:-1:-1;263:2;;-1:-1;;4850:36:5;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4850:36:5;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4850:36:5;4833:54;;;4850:36;4833:54;;;;;;;;;26:21:-1;;;22:32;;6:49;;4833:54:5;;;;;;;:64;;;;;:66;;:::i;:::-;4826:73;;4750:156;;;;:::o;2288:160:7:-;2348:7;2381:2;2375;:8;;2367:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2434:7:7;;;2288:160::o;23489:148:5:-;23561:7;23587:43;23607:22;23621:7;-1:-1:-1;;;;;23607:13:5;:22;:::i;:::-;-1:-1:-1;;;;;23587:19:5;:43;:::i;15955:303:6:-;16108:26;;16019:14;;16086:7;;16104:72;;-1:-1:-1;16162:3:6;;-1:-1:-1;16155:10:6;;16104:72;-1:-1:-1;;16238:2:6;16225:16;16219:23;;16195:57::o;20858:316:5:-;20926:7;20945:15;20963:20;20977:2;20981:1;20963:7;:13;;;;;;:20;;;;;:::i;:::-;20945:38;;20993:8;21010:7;21018:2;21010:11;;;;;;;;;;;;;;;-1:-1:-1;21032:17:5;21052:34;21064:21;21082:2;-1:-1:-1;;;;;21064:17:5;:21;:::i;:::-;-1:-1:-1;;;;;21052:11:5;:34;:::i;:::-;-1:-1:-1;;21113:6:5;;;;21096:23;;21150:3;:16;21137:30;;;;20858:316;-1:-1:-1;;;;20858:316:5:o;21554:178::-;21623:7;21700:25;21717:7;379:58;21700:16;;;;;;:25;;;;:::i;10345:819:6:-;10432:16;10495:7;10486:6;:16;10468:6;:13;:35;;10460:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10664:4;10658:11;10651:18;;10713:7;10708:2;10703:3;10699:12;10695:26;10689:4;10682:40;10747:7;10742:3;10735:20;10874:6;10866;10862:19;10857:3;10853:29;10950:6;10945:2;10937:6;10933:15;10929:28;10994:7;10989:3;10985:17;10896:252;11025:3;11020;11017:12;10896:252;;;11129:3;11123:10;11116:4;11111:3;11107:14;11100:34;11064:2;11059:3;11055:12;11048:19;;10896:252;;;10900:116;;10547:611;;;;;;:::o;1595:278:5:-;1662:12;1686:22;1721:2;:9;1711:20;;;;;;;;;;;;;;;;;;;;;;;;;21:6:-1;;104:10;1711:20:5;87:34:-1;135:17;;-1:-1;1711:20:5;-1:-1:-1;1686:45:5;-1:-1:-1;1747:6:5;1742:98;1763:2;:9;1759:1;:13;1742:98;;;1824:2;1827:1;1824:5;;;;;;;;;;;;;;;;1793:9;1819:1;1815;1803:2;:9;:13;:17;1793:28;;;;;;;;;;;:36;-1:-1:-1;;;;;1793:36:5;;;;;;;;-1:-1:-1;1774:3:5;;1742:98;;;-1:-1:-1;1857:9:5;1595:278;-1:-1:-1;;1595:278:5:o;3429:268::-;3490:7;;;3535:131;3556:2;:9;3552:1;:13;3535:131;;;3646:1;3650;3646:5;3633:2;:9;:19;3628:1;:25;3622:1;:32;3612:2;3615:1;3612:5;;;;;;;;;;;;;;3606:49;3596:59;;;;;3567:3;;3535:131;;1865:301:7;1925:7;2157:2;2152;:7;;;;;;;1865:301;-1:-1:-1;;;1865:301:7:o;2004:21184:3:-;;;;;;;",
  "deployedSourceMap": "2004:21184:3:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2004:21184:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21954:107;;;:::i;:::-;;;;;;;;;;;;;;;;22778:99;;;:::i;22241:101::-;;;:::i;18722:242::-;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;-1:-1;18722:242:3;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;12362:143;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;12362:143:3;;;;;;;:::i;11398:113::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;11398:113:3;;:::i;6901:154::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;6901:154:3;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;6901:154:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;6901:154:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;6901:154:3;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;6901:154:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;6901:154:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;-1:-1;6901:154:3;;-1:-1:-1;6901:154:3;-1:-1:-1;6901:154:3;:::i;2272:42::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;16407:259;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;16407:259:3;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;16407:259:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;16407:259:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;16407:259:3;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;16407:259:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;16407:259:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;16407:259:3;;-1:-1:-1;16407:259:3;-1:-1:-1;16407:259:3;;:::i;7611:286::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;7611:286:3;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;7611:286:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;7611:286:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;7611:286:3;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;7611:286:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;7611:286:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;7611:286:3;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;7611:286:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;7611:286:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;-1:-1;7611:286:3;;-1:-1:-1;7611:286:3;-1:-1:-1;7611:286:3;:::i;21538:227::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;21538:227:3;;;;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;21538:227:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;21538:227:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;21538:227:3;;;;;;;;;;;-1:-1:-1;;;5:28;;2:2;;;46:1;43;36:12;2:2;21538:227:3;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;21538:227:3;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;-1:-1;;;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;-1:-1;21538:227:3;;-1:-1:-1;21538:227:3;-1:-1:-1;21538:227:3;:::i;13853:172::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;13853:172:3;;;;;;;;;;;;:::i;23071:115::-;;;:::i;22509:93::-;;;:::i;21954:107::-;22038:16;;21954:107;:::o;22778:99::-;22855:15;;22778:99;:::o;22241:101::-;22322:13;;22241:101;:::o;18722:242::-;18879:4;18902:55;18924:9;18935:5;18942:6;18950;18902:21;:55::i;:::-;18895:62;;18722:242;;;;;;;:::o;12362:143::-;12441:7;12467:31;12481:7;12490;12467:13;:31::i;:::-;12460:38;;12362:143;;;;;:::o;11398:113::-;11458:7;11484:20;11496:7;11484:11;:20::i;:::-;11477:27;;11398:113;;;;:::o;6901:154::-;6988:4;7011:37;7023:7;;7011:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;;7011:37:3;;;;137:4:-1;7011:37:3;;;;;;;;;;;;;;;;;;-1:-1:-1;7032:8:3;;-1:-1:-1;7032:8:3;;;;7011:37;;7032:8;;;;7011:37;1:33:-1;99:1;81:16;;74:27;;;-1:-1;99:1;-1:-1;7011:11:3;;-1:-1:-1;;7011:37:3:i;2272:42::-;2313:1;2272:42;:::o;16407:259::-;16577:4;16600:59;16617:9;16628:12;;16600:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;;16600:59:3;;;;137:4:-1;16600:59:3;;;;;;;;;;;;;;;;;;-1:-1:-1;16642:8:3;;-1:-1:-1;16642:8:3;;;;16600:59;;16642:8;;;;16600:59;1:33:-1;99:1;81:16;;74:27;;;;-1:-1;16652:6:3;;-1:-1:-1;16600:16:3;;-1:-1:-1;;16600:59:3:i;:::-;16593:66;16407:259;-1:-1:-1;;;;;;;16407:259:3:o;7611:286::-;7790:4;7813:77;7837:21;;7813:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;;7813:77:3;;;;137:4:-1;7813:77:3;;;;;;;;;;;;;;;;;;-1:-1:-1;7860:19:3;;-1:-1:-1;7860:19:3;;;;7813:77;;7860:19;;;;7813:77;1:33:-1;99:1;81:16;;74:27;;;;-1:-1;;7813:77:3;;;;137:4:-1;7813:77:3;;;;;;;;;;;;;;;;;;-1:-1:-1;7881:8:3;;-1:-1:-1;7881:8:3;;;;7813:77;;7881:8;;;;7813:77;1:33:-1;99:1;81:16;;74:27;;;;-1:-1;7813:23:3;;-1:-1:-1;;;7813:77:3:i;21538:227::-;21685:7;21711:47;21733:9;21744:5;;21711:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;;21711:47:3;;;;137:4:-1;21711:47:3;;;;;;;;;;;;;;;;;;-1:-1:-1;21751:6:3;;-1:-1:-1;21751:6:3;;;;21711:47;;21751:6;;;;21711:47;1:33:-1;99:1;81:16;;74:27;;;;-1:-1;21711:21:3;;-1:-1:-1;;;21711:47:3:i;:::-;21704:54;21538:227;-1:-1:-1;;;;;;21538:227:3:o;13853:172::-;13952:4;13975:43;13987:9;13998:11;14011:6;13975:11;:43::i;:::-;13968:50;;13853:172;;;;;;:::o;23071:115::-;23156:23;;23071:115;:::o;22509:93::-;22557:7;22583:12;22509:93;:::o;17153:1082::-;17311:4;17375:5;17362:9;:18;:41;;;;;17397:6;17384:9;:19;17362:41;17358:83;;;-1:-1:-1;17426:4:3;17419:11;;17358:83;17474:5;17513:6;17474:5;17513:6;17451:20;17602:413;17625:6;17621:1;:10;17602:413;;;17678:9;17665;:22;17661:163;;17771:24;;;;:13;:24;;;;;;17722:9;;-1:-1:-1;17661:163:3;17855:9;17841:10;:23;17837:168;;17951:25;;;;:13;:25;;;;;;17900:10;;-1:-1:-1;17837:168:3;17637:8;:1;17643;17637:8;:5;:8;:::i;:::-;17633:12;;17602:413;;;;18044:13;18028:12;:29;18024:50;;;18067:5;18060:12;;;;;;;;18024:50;18149:10;18136:9;:23;18132:44;;18169:5;18162:12;;;;;;;;18132:44;-1:-1:-1;18224:4:3;;17153:1082;-1:-1:-1;;;;;;;;17153:1082:3:o;11770:333::-;11850:7;11888;11850;11905:106;11929:7;11925:1;:11;11905:106;;;11977:23;;;;:13;:23;;;;;;;;11942:8;:1;11948;11942:8;:5;:8;:::i;:::-;11938:12;;11905:106;;;-1:-1:-1;12028:22:3;12020:51;;;;;-1:-1:-1;;;12020:51:3;;;;;;;;;;;;-1:-1:-1;;;12020:51:3;;;;;;;;;;;;;;10683:457;10744:7;;10811;10744;10828:273;10852:19;10848:23;;10828:273;;;10911:21;;;;:11;:21;;;;;;;-1:-1:-1;10950:12:3;10946:145;;10993:23;;;;:13;:23;;;;;;;;10946:145;;;11062:14;:7;11074:1;11062:14;:11;:14;:::i;:::-;11055:21;;;;;;;10946:145;10877:8;:1;10883;10877:8;:5;:8;:::i;:::-;10873:12;;10828:273;;;-1:-1:-1;11110:23:3;;;-1:-1:-1;;;11110:23:3;;;;;;;;;;;;-1:-1:-1;;;11110:23:3;;;;;;;;;;;;;;4234:2282;4334:4;4350:15;4375:20;4405:22;4437:23;4463:17;:7;:15;:17::i;:::-;4437:43;-1:-1:-1;4491:15:3;4509:37;:21;:8;4491:15;4527:2;4509:21;:14;:21;:::i;:::-;:35;:37::i;:::-;4491:55;;4556:21;4580:28;4592:15;4580:11;:28::i;:::-;4556:52;;4669:9;:47;;;;4709:7;4682:23;:7;:21;:23::i;:::-;:34;4669:47;4648:121;;;;-1:-1:-1;;;4648:121:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4805:2;4787:8;:15;:20;;;;;;:25;4779:81;;;;-1:-1:-1;;;4779:81:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5115:9;5110:1294;5152:2;5134:8;:15;:20;;;;;;5130:1;:24;5110:1294;;;5194:29;5209:9;:1;5215:2;5209:9;:5;:9;:::i;:::-;5194:8;;5220:2;5194:29;:14;:29;:::i;:::-;5184:39;-1:-1:-1;5247:24:3;:13;5269:1;5265:5;;5247:24;:17;:24;:::i;:::-;5237:34;;5302:17;:7;:15;:17::i;:::-;5561:1;5520:29;;;:13;:29;;;;;;5285:34;;-1:-1:-1;5516:560:3;;5682:7;5612:66;:52;5629:14;5612:32;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;5612:32:3;;;:50;:52::i;:::-;:64;:66::i;:::-;:77;;5583:158;;;;;-1:-1:-1;;;5583:158:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;5759:29;;;;:13;:29;;;;;:47;;;2313:1;5828:7;:25;5824:238;;6006:27;;;;:11;:27;;;;;:37;;;5824:238;6195:7;6168:23;:7;:21;:23::i;:::-;:34;6160:74;;;;;-1:-1:-1;;;6160:74:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;6256:47;:7;6287:15;6256:47;:30;:47;:::i;:::-;6248:98;;;;-1:-1:-1;;;6248:98:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6379:14;;-1:-1:-1;5160:8:3;:1;5166;5160:8;:5;:8;:::i;:::-;5156:12;;5110:1294;;;;6473:14;6442:17;:7;:15;:17::i;:::-;6419:69;;;;;;;-1:-1:-1;6505:4:3;;4234:2282;-1:-1:-1;;;;;;;;;4234:2282:3:o;14618:1196::-;14785:4;14801:22;14826:18;:8;:16;:18::i;:::-;14801:43;;14854:26;14883:22;:12;:20;:22::i;:::-;14854:51;;14945:15;;14923:18;:37;14915:82;;;;;-1:-1:-1;;;14915:82:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15069:1;15028:29;;;:13;:29;;;;;;15007:100;;;;;-1:-1:-1;;;15007:100:3;;;;;;;;;;;;-1:-1:-1;;;15007:100:3;;;;;;;;;;;;;;;15138:73;15160:9;15171:15;;15188:14;15204:6;15138:21;:73::i;:::-;15117:152;;;;-1:-1:-1;;;15117:152:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15360:14;15300:56;15322:9;15333:12;15347:8;15300:21;:56::i;:::-;:74;15279:163;;;;-1:-1:-1;;;15279:163:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15453:15;:32;;;15495:23;:35;;;-1:-1:-1;15560:28:3;:8;:26;:28::i;:::-;15541:47;;15614:16;;15602:8;:28;15598:84;;15644:16;:27;;;15598:84;15776:9;15748:14;15716:18;15697:89;;;;;;;;;;-1:-1:-1;15803:4:3;;14618:1196;-1:-1:-1;;;;;;;14618:1196:3:o;8453:1993::-;8627:4;8697:20;8720:44;8732:31;:21;:29;:31::i;:::-;8720:11;:44::i;:::-;8697:67;;8774:18;8795:42;8807:29;:19;:27;:29::i;8795:42::-;8774:63;-1:-1:-1;8948:4:3;8774:63;8935:17;8956:4;8935:25;8914:124;;;;-1:-1:-1;;;8914:124:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9083:22;:12;9100:4;9083:22;:16;:22;:::i;:::-;9069:10;:36;9048:114;;;;-1:-1:-1;;;9048:114:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9238:39;:19;:37;:39::i;:::-;9193:41;:21;:39;:41::i;:::-;:84;9172:161;;;;-1:-1:-1;;;9172:161:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9438:28;9469:21;:8;9484:1;9487:2;9469:21;:14;:21;:::i;:::-;9438:52;;9500:21;9524:31;:15;:29;:31::i;:::-;9500:55;;9565:23;9591:193;9631:37;:21;:35;:37::i;:::-;9682:40;:21;:38;:40::i;:::-;9591:193;;9736:38;:19;:36;:38::i;:::-;9591:193;;:26;:193::i;:::-;9565:219;;9852:13;9832:15;9816:13;:31;9815:50;9794:113;;;;;-1:-1:-1;;;9794:113:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;10117:16;10136:41;:21;:39;:41::i;:::-;10117:60;;10208:8;10191:13;;:25;;:80;;;;;10233:38;10266:4;10233:28;10245:15;;10233:11;:28::i;:::-;:32;:38;:32;:38;:::i;:::-;10220:10;:51;10191:80;10187:133;;;10285:13;:24;;;10187:133;10391:48;10403:19;10424:8;10434:4;10391:11;:48::i;:::-;10384:55;8453:1993;-1:-1:-1;;;;;;;;;;8453:1993:3:o;19367:1768::-;19511:7;19530:23;19556:22;19568:9;19556:11;:22::i;:::-;19530:48;;19588:19;19610:28;19622:15;:5;:13;:15::i;19610:28::-;19588:50;;19648:20;19671:29;19683:16;:6;:14;:16::i;19671:29::-;19648:52;;19747:15;19732:11;:30;;:65;;;;;19782:15;19766:12;:31;;19732:65;19711:151;;;;-1:-1:-1;;;19711:151:3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;19970:30;20003:53;20051:4;20033:15;:22;20003:25;:15;20023:4;20003:25;:19;:25;:::i;:53::-;19970:86;-1:-1:-1;20087:36:3;;;20155:37;;;20532:14;;20087:36;20532:32;;;20550:14;20532:32;20528:63;;;20574:15;:5;:13;:15::i;:::-;20567:22;;;;;;;;;;20528:63;20604:13;:32;;;;;20622:14;20621:15;20604:32;20600:64;;;20646:16;:6;:14;:16::i;20600:64::-;20677:13;:31;;;;;20694:14;20677:31;20673:456;;;20746:12;20731:11;:27;;:64;;20779:16;:6;:14;:16::i;:::-;20731:64;;;20761:15;:5;:13;:15::i;20673:456::-;20947:53;20973:26;:6;:24;:26::i;:::-;20963:4;20948:12;:19;;;20947:53;:25;:53;:::i;:::-;20876:51;20901:25;:5;:23;:25::i;:::-;20891:4;20877:11;:18;;20876:51;20875:125;20871:248;;;21027:16;:6;:14;:16::i;12960:438::-;13060:4;13095:11;13060:4;13181:189;13205:6;13201:1;:10;13181:189;;;13257:9;13245:8;:21;13241:71;;;13293:4;13286:11;;;;;;13241:71;13336:23;;;;:13;:23;;;;;;;;13217:8;:1;13223;13217:8;:5;:8;:::i;:::-;13213:12;;13181:189;;;-1:-1:-1;13386:5:3;;12960:438;-1:-1:-1;;;;;12960:438:3:o;2520:172:7:-;2605:7;;;2630;;;;2622:45;;;;;-1:-1:-1;;;2622:45:7;;;;;;;;;;;;;;;;;;;;;;;;;;;4750:156:5;4807:7;4833:66;4850:36;4874:10;4881:2;4874:10;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;4874:10:5;;;;;;;-1:-1:-1;263:2;;-1:-1;;4874:10:5;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4874:10:5;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4874:10:5;4857:28;;;4874:10;4857:28;;;;;;;;;26:21:-1;;;22:32;;6:49;;4857:28:5;;;;;;;4850:36;;4857:28;;;;4850:36;;;;;4857:28;4850:36;36:153:-1;66:2;61:3;58:11;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;4850:36:5;;;;;;;-1:-1:-1;263:2;;-1:-1;;4850:36:5;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4850:36:5;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4850:36:5;4833:54;;;4850:36;4833:54;;;;;;;;;26:21:-1;;;22:32;;;6:49;;4833:54:5;;;;:64;:66::i;10345:819:6:-;10432:16;10495:7;10486:6;:16;10468:6;:13;:35;;10460:67;;;;;-1:-1:-1;;;10460:67:6;;;;;;;;;;;;-1:-1:-1;;;10460:67:6;;;;;;;;;;;;;;;10664:4;10658:11;10651:18;;10713:7;10708:2;10703:3;10699:12;10695:26;10689:4;10682:40;10747:7;10742:3;10735:20;10874:6;10866;10862:19;10857:3;10853:29;10950:6;10945:2;10937:6;10933:15;10929:28;10994:7;10989:3;10985:17;10896:252;11025:3;11020;11017:12;10896:252;;;11129:3;11123:10;11116:4;11111:3;11107:14;11100:34;11064:2;11059:3;11055:12;11048:19;;10896:252;;;10900:116;;10547:611;;;;;;:::o;20858:316:5:-;20926:7;20945:15;20963:20;:7;20977:2;20981:1;20963:20;:13;:20;:::i;:::-;20945:38;;20993:8;21010:7;21018:2;21010:11;;;;;;;;;;;;;;;-1:-1:-1;21032:17:5;21052:34;21064:21;21082:2;21064:17;:21::i;21052:34::-;-1:-1:-1;;21113:6:5;;;;21096:23;;21150:3;:16;21137:30;;;;20858:316;-1:-1:-1;;;;20858:316:5:o;1317:456:7:-;1377:9;1619:7;1615:46;;-1:-1:-1;1649:1:7;1642:8;;1615:46;-1:-1:-1;1675:7:7;;;1680:2;1675;:7;:2;1700:6;;;;;:12;1692:56;;;;;-1:-1:-1;;;1692:56:7;;;;;;;;;;;;;;;;;;;;;;;;;;;1595:278:5;1662:12;1686:22;1721:2;:9;1711:20;;;;;;;;;;;;;;;;;;;;;;;;;21:6:-1;;104:10;1711:20:5;87:34:-1;135:17;;-1:-1;1711:20:5;-1:-1:-1;1686:45:5;-1:-1:-1;1747:6:5;1742:98;1763:2;:9;1759:1;:13;1742:98;;;1824:2;1827:1;1824:5;;;;;;;;;;;;;;;;1793:9;1819:1;1815;1803:2;:9;:13;:17;1793:28;;;;;;;;;;;:36;-1:-1:-1;;;;;1793:36:5;;;;;;;;-1:-1:-1;1774:3:5;;1742:98;;;-1:-1:-1;1857:9:5;1595:278;-1:-1:-1;;1595:278:5:o;3429:268::-;3490:7;;;3535:131;3556:2;:9;3552:1;:13;3535:131;;;3646:1;3650;3646:5;3633:2;:9;:19;3628:1;:25;3622:1;:32;3612:2;3615:1;3612:5;;;;;;;;;;;;;;3606:49;3596:59;;;;;3567:3;;3535:131;;9306:391:8;9410:4;9473:17;9493:40;:28;:7;:26;:28::i;:::-;:38;:40::i;:::-;9473:60;;9635:17;9622:9;:30;9618:51;;9662:5;9655:12;;;;;9618:51;-1:-1:-1;9686:4:8;;9306:391;-1:-1:-1;;;9306:391:8:o;23489:148:5:-;23561:7;23587:43;23607:22;23621:7;23607:13;:22::i;:::-;23587:19;:43::i;23095:170::-;23166:6;23198:59;23210:46;23228:27;23247:7;23228:18;:27::i;:::-;23210:17;:46::i;26130:920::-;26286:7;;26328:37;:16;26349:15;26328:37;:20;:37;:::i;:::-;26305:60;-1:-1:-1;26464:22:5;486:20;26484:1;26464:22;:19;:22;:::i;:::-;26449:12;:37;26445:105;;;26517:22;486:20;26537:1;26517:22;:19;:22;:::i;:::-;26502:37;;26445:105;26578:22;486:20;26598:1;26578:22;:19;:22;:::i;:::-;26563:12;:37;26559:105;;;26631:22;486:20;26651:1;26631:22;:19;:22;:::i;:::-;26616:37;;26559:105;26921:17;26941:44;26972:12;26941:26;:15;26961:5;26941:26;:19;:26;:::i;:::-;:30;:44;:30;:44;:::i;:::-;26921:64;-1:-1:-1;27002:41:5;27037:5;27002:30;26921:64;486:20;27002:30;:13;:30;:::i;2288:160:7:-;2348:7;2381:2;2375;:8;;2367:50;;;;;-1:-1:-1;;;2367:50:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2434:7:7;;;2288:160::o;15955:303:6:-;16108:26;;16019:14;;16086:7;;16104:72;;-1:-1:-1;16162:3:6;;-1:-1:-1;16155:10:6;;16104:72;-1:-1:-1;;16238:2:6;16225:16;16219:23;;16195:57::o;21991:131:5:-;22064:12;22095:20;:7;22109:1;22112:2;22095:20;:13;:20;:::i;21554:178::-;21623:7;21700:25;-1:-1:-1;;;21717:7:5;21700:25;:16;:25;:::i;22757:131::-;22830:12;22861:20;:7;22875:2;22879:1;22861:20;:13;:20;:::i;1865:301:7:-;1925:7;2157:2;2152;:7;;;;;;;1865:301;-1:-1:-1;;;1865:301:7:o",
  "source": "pragma solidity ^0.5.10;\n\n/** @title Relay */\n/** @author Summa (https://summa.one) */\n\nimport {SafeMath} from \"@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol\";\nimport {BytesLib} from \"@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol\";\nimport {BTCUtils} from \"@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol\";\nimport {ValidateSPV} from \"@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol\";\n\ninterface IRelay {\n\n    event Extension(bytes32 indexed _first, bytes32 indexed _last);\n    event Reorg(bytes32 indexed _from, bytes32 indexed _to, bytes32 indexed _gcd);\n\n    function isMostRecentAncestor(\n        bytes32 _ancestor,\n        bytes32 _left,\n        bytes32 _right,\n        uint256 _limit\n    ) external view returns (bool);\n\n    function getCurrentEpochDifficulty() external view returns (uint256);\n    function getPrevEpochDifficulty() external view returns (uint256);\n    function getRelayGenesis() external view returns (bytes32);\n    function getBestKnownDigest() external view returns (bytes32);\n    function getLastReorgCommonAncestor() external view returns (bytes32);\n\n    function findHeight(bytes32 _digest) external view returns (uint256);\n\n    function findAncestor(bytes32 _digest, uint256 _offset) external view returns (bytes32);\n\n    function isAncestor(bytes32 _ancestor, bytes32 _descendant, uint256 _limit) external view returns (bool);\n\n    function heaviestFromAncestor(\n        bytes32 _ancestor,\n        bytes calldata _left,\n        bytes calldata _right\n    ) external view returns (bytes32);\n\n    function addHeaders(bytes calldata _anchor, bytes calldata _headers) external returns (bool);\n\n    function addHeadersWithRetarget(\n        bytes calldata _oldPeriodStartHeader,\n        bytes calldata _oldPeriodEndHeader,\n        bytes calldata _headers\n    ) external returns (bool);\n\n    function markNewHeaviest(\n        bytes32 _ancestor,\n        bytes calldata _currentBest,\n        bytes calldata _newBest,\n        uint256 _limit\n    ) external returns (bool);\n}\n\ncontract Relay is IRelay {\n    using SafeMath for uint256;\n    using BytesLib for bytes;\n    using BTCUtils for bytes;\n    using ValidateSPV for bytes;\n\n    // How often do we store the height?\n    // A higher number incurs less storage cost, but more lookup cost\n    uint32 public constant HEIGHT_INTERVAL = 4;\n\n    bytes32 internal relayGenesis;\n    bytes32 internal bestKnownDigest;\n    bytes32 internal lastReorgCommonAncestor;\n    mapping (bytes32 => bytes32) internal previousBlock;\n    mapping (bytes32 => uint256) internal blockHeight;\n\n    uint256 internal currentEpochDiff;\n    uint256 internal prevEpochDiff;\n\n\n    /// @notice                   Gives a starting point for the relay\n    /// @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n    /// @param  _genesisHeader    The starting header\n    /// @param  _height           The starting height\n    /// @param  _periodStart      The hash of the first header in the genesis epoch\n    constructor(bytes memory _genesisHeader, uint256 _height, bytes32 _periodStart) public {\n        require(_genesisHeader.length == 80, \"Stop being dumb\");\n        bytes32 _genesisDigest = _genesisHeader.hash256();\n\n        require(\n            _periodStart & bytes32(0x0000000000000000000000000000000000000000000000000000000000ffffff) == bytes32(0),\n            \"Period start hash does not have work. Hint: wrong byte order?\");\n\n        relayGenesis = _genesisDigest;\n        bestKnownDigest = _genesisDigest;\n        lastReorgCommonAncestor = _genesisDigest;\n        blockHeight[_genesisDigest] = _height;\n        blockHeight[_periodStart] = _height.sub(_height % 2016);\n\n        currentEpochDiff = _genesisHeader.extractDifficulty();\n    }\n\n    /// @notice             Adds headers to storage after validating\n    /// @dev                We check integrity and consistency of the header chain\n    /// @param  _anchor     The header immediately preceeding the new chain\n    /// @param  _headers    A tightly-packed list of new 80-byte Bitcoin headers to record\n    /// @param  _internal   True if called internally from addHeadersWithRetarget, false otherwise\n    /// @return             True if successfully written, error otherwise\n    function _addHeaders(bytes memory _anchor, bytes memory _headers, bool _internal) internal returns (bool) {\n        uint256 _height;\n        bytes memory _header;\n        bytes32 _currentDigest;\n        bytes32 _previousDigest = _anchor.hash256();\n\n        uint256 _target = _headers.slice(0, 80).extractTarget();\n        uint256 _anchorHeight = _findHeight(_previousDigest);  /* NB: errors if unknown */\n\n        require(\n            _internal || _anchor.extractTarget() == _target,\n            \"Unexpected retarget on external call\");\n        require(_headers.length % 80 == 0, \"Header array length must be divisible by 80\");\n\n        /*\n        NB:\n        1. check that the header has sufficient work\n        2. check that headers are in a coherent chain (no retargets, hash links good)\n        3. Store the block connection\n        4. Store the height\n        */\n        for (uint256 i = 0; i < _headers.length / 80; i = i.add(1)) {\n            _header = _headers.slice(i.mul(80), 80);\n            _height = _anchorHeight.add(i + 1);\n            _currentDigest = _header.hash256();\n\n            /*\n            NB:\n            if the block is already authenticated, we don't need to a work check\n            Or write anything to state. This saves gas\n            */\n            if (previousBlock[_currentDigest] == bytes32(0)) {\n                require(\n                    abi.encodePacked(_currentDigest).reverseEndianness().bytesToUint() <= _target,\n                    \"Header work is insufficient\");\n                previousBlock[_currentDigest] = _previousDigest;\n                if (_height % HEIGHT_INTERVAL == 0) {\n                    /*\n                    NB: We store the height only every 4th header to save gas\n                    */\n                    blockHeight[_currentDigest] = _height;\n                }\n            }\n\n            /* NB: we do still need to make chain level checks tho */\n            require(_header.extractTarget() == _target, \"Target changed unexpectedly\");\n            require(_header.validateHeaderPrevHash(_previousDigest), \"Headers do not form a consistent chain\");\n\n            _previousDigest = _currentDigest;\n        }\n\n        emit Extension(\n            _anchor.hash256(),\n            _currentDigest);\n        return true;\n    }\n\n    /// @notice             Adds headers to storage after validating\n    /// @dev                We check integrity and consistency of the header chain\n    /// @param  _anchor     The header immediately preceeding the new chain\n    /// @param  _headers    A tightly-packed list of 80-byte Bitcoin headers\n    /// @return             True if successfully written, error otherwise\n    function addHeaders(bytes calldata _anchor, bytes calldata _headers) external returns (bool) {\n        return _addHeaders(_anchor, _headers, false);\n    }\n\n    /// @notice                       Adds headers to storage, performs additional validation of retarget\n    /// @dev                          Checks the retarget, the heights, and the linkage\n    /// @param  _oldPeriodStartHeader The first header in the difficulty period being closed\n    /// @param  _oldPeriodEndHeader   The last header in the difficulty period being closed\n    /// @param  _headers              A tightly-packed list of 80-byte Bitcoin headers\n    /// @return                       True if successfully written, error otherwise\n    function addHeadersWithRetarget(\n        bytes calldata _oldPeriodStartHeader,\n        bytes calldata _oldPeriodEndHeader,\n        bytes calldata _headers\n    ) external returns (bool) {\n        return _addHeadersWithRetarget(_oldPeriodStartHeader, _oldPeriodEndHeader, _headers);\n    }\n\n    /// @notice                       Adds headers to storage, performs additional validation of retarget\n    /// @dev                          Checks the retarget, the heights, and the linkage\n    /// @param  _oldPeriodStartHeader The first header in the difficulty period being closed\n    /// @param  _oldPeriodEndHeader   The last header in the difficulty period being closed\n    /// @param  _headers              A tightly-packed list of 80-byte Bitcoin headers\n    /// @return                       True if successfully written, error otherwise\n    function _addHeadersWithRetarget(\n        bytes memory _oldPeriodStartHeader,\n        bytes memory _oldPeriodEndHeader,\n        bytes memory _headers\n    ) internal returns (bool) {\n        /* NB: requires that both blocks are known */\n        uint256 _startHeight = _findHeight(_oldPeriodStartHeader.hash256());\n        uint256 _endHeight = _findHeight(_oldPeriodEndHeader.hash256());\n\n        /* NB: retargets should happen at 2016 block intervals */\n        require(\n            _endHeight % 2016 == 2015,\n            \"Must provide the last header of the closing difficulty period\");\n        require(\n            _endHeight == _startHeight.add(2015),\n            \"Must provide exactly 1 difficulty period\");\n        require(\n            _oldPeriodStartHeader.extractDifficulty() == _oldPeriodEndHeader.extractDifficulty(),\n            \"Period header difficulties do not match\");\n\n        /* NB: This comparison looks weird because header nBits encoding truncates targets */\n        bytes memory _newPeriodStart = _headers.slice(0, 80);\n        uint256 _actualTarget = _newPeriodStart.extractTarget();\n        uint256 _expectedTarget = BTCUtils.retargetAlgorithm(\n            _oldPeriodStartHeader.extractTarget(),\n            _oldPeriodStartHeader.extractTimestamp(),\n            _oldPeriodEndHeader.extractTimestamp()\n        );\n        require(\n            (_actualTarget & _expectedTarget) == _actualTarget,\n            \"Invalid retarget provided\");\n\n        // If the current known prevEpochDiff doesn't match, and this old period is near the chaintip/\n        // update the stored prevEpochDiff\n        // Don't update if this is a deep past epoch\n        uint256 _oldDiff = _oldPeriodStartHeader.extractDifficulty();\n        if (prevEpochDiff != _oldDiff && _endHeight > _findHeight(bestKnownDigest).sub(2016)) {\n          prevEpochDiff = _oldDiff;\n        }\n\n        // Pass all but the first through to be added\n        return _addHeaders(_oldPeriodEndHeader, _headers, true);\n    }\n\n    /// @notice         Finds the height of a header by its digest\n    /// @dev            Will fail if the header is unknown\n    /// @param _digest  The header digest to search for\n    /// @return         The height of the header\n    function _findHeight(bytes32 _digest) internal view returns (uint256) {\n        uint256 _height = 0;\n        bytes32 _current = _digest;\n        for (uint256 i = 0; i < HEIGHT_INTERVAL + 1; i = i.add(1)) {\n            _height = blockHeight[_current];\n            if (_height == 0) {\n                _current = previousBlock[_current];\n            } else {\n                return _height.add(i);\n            }\n        }\n        revert(\"Unknown block\");\n    }\n\n    /// @notice         Finds the height of a header by its digest\n    /// @dev            Will fail if the header is unknown\n    /// @param _digest  The header digest to search for\n    /// @return         The height of the header, or error if unknown\n    function findHeight(bytes32 _digest) external view returns (uint256) {\n        return _findHeight(_digest);\n    }\n\n    /// @notice         Finds an ancestor for a block by its digest\n    /// @dev            Will fail if the header is unknown\n    /// @param _digest  The header digest to search for\n    /// @return         The height of the header, or error if unknown\n    function _findAncestor(bytes32 _digest, uint256 _offset) internal view returns (bytes32) {\n        bytes32 _current = _digest;\n        for (uint256 i = 0; i < _offset; i = i.add(1)) {\n            _current = previousBlock[_current];\n        }\n        require(_current != bytes32(0), \"Unknown ancestor\");\n        return _current;\n    }\n\n    /// @notice         Finds an ancestor for a block by its digest\n    /// @dev            Will fail if the header is unknown\n    /// @param _digest  The header digest to search for\n    /// @return         The height of the header, or error if unknown\n    function findAncestor(bytes32 _digest, uint256 _offset) external view returns (bytes32) {\n        return _findAncestor(_digest, _offset);\n    }\n\n    /// @notice             Checks if a digest is an ancestor of the current one\n    /// @dev                Limit the amount of lookups (and thus gas usage) with _limit\n    /// @param _ancestor    The prospective ancestor\n    /// @param _descendant  The descendant to check\n    /// @param _limit       The maximum number of blocks to check\n    /// @return             true if ancestor is at most limit blocks lower than descendant, otherwise false\n    function _isAncestor(bytes32 _ancestor, bytes32 _descendant, uint256 _limit) internal view returns (bool) {\n        bytes32 _current = _descendant;\n        /* NB: 200 gas/read, so gas is capped at ~200 * limit */\n        for (uint256 i = 0; i < _limit; i = i.add(1)) {\n            if (_current == _ancestor) {\n                return true;\n            }\n            _current = previousBlock[_current];\n        }\n        return false;\n    }\n\n    /// @notice             Checks if a digest is an ancestor of the current one\n    /// @dev                Limit the amount of lookups (and thus gas usage) with _limit\n    /// @param _ancestor    The prospective ancestor\n    /// @param _descendant  The descendant to check\n    /// @param _limit       The maximum number of blocks to check\n    /// @return             true if ancestor is at most limit blocks lower than descendant, otherwise false\n    function isAncestor(bytes32 _ancestor, bytes32 _descendant, uint256 _limit) external view returns (bool) {\n        return _isAncestor(_ancestor, _descendant, _limit);\n    }\n\n    /// @notice                   Gives a starting point for the relay\n    /// @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n    /// @param  _ancestor         The digest of the most recent common ancestor\n    /// @param  _currentBest      The 80-byte header referenced by bestKnownDigest\n    /// @param  _newBest          The 80-byte header to mark as the new best\n    /// @param  _limit            Limit the amount of traversal of the chain\n    /// @return                   True if successfully updates bestKnownDigest, error otherwise\n    function _markNewHeaviest(\n        bytes32 _ancestor,\n        bytes memory _currentBest,\n        bytes memory _newBest,\n        uint256 _limit\n    ) internal returns (bool) {\n        bytes32 _newBestDigest = _newBest.hash256();\n        bytes32 _currentBestDigest = _currentBest.hash256();\n        require(_currentBestDigest == bestKnownDigest, \"Passed in best is not best known\");\n        require(\n            previousBlock[_newBestDigest] != bytes32(0),\n            \"New best is unknown\");\n        require(\n            _isMostRecentAncestor(_ancestor, bestKnownDigest, _newBestDigest, _limit),\n            \"Ancestor must be heaviest common ancestor\");\n        require(\n            _heaviestFromAncestor(_ancestor, _currentBest, _newBest) == _newBestDigest,\n            \"New best hash does not have more work than previous\");\n\n        bestKnownDigest = _newBestDigest;\n        lastReorgCommonAncestor = _ancestor;\n\n        uint256 _newDiff = _newBest.extractDifficulty();\n        if (_newDiff != currentEpochDiff) {\n          currentEpochDiff = _newDiff;\n        }\n\n        emit Reorg(\n            _currentBestDigest,\n            _newBestDigest,\n            _ancestor);\n        return true;\n    }\n\n    /// @notice                   Gives a starting point for the relay\n    /// @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n    /// @param  _ancestor         The digest of the most recent common ancestor\n    /// @param  _currentBest      The 80-byte header referenced by bestKnownDigest\n    /// @param  _newBest          The 80-byte header to mark as the new best\n    /// @param  _limit            Limit the amount of traversal of the chain\n    /// @return                   True if successfully updates bestKnownDigest, error otherwise\n    function markNewHeaviest(\n        bytes32 _ancestor,\n        bytes calldata _currentBest,\n        bytes calldata _newBest,\n        uint256 _limit\n    ) external returns (bool) {\n        return _markNewHeaviest(_ancestor, _currentBest, _newBest, _limit);\n    }\n\n    /// @notice             Checks if a digest is an ancestor of the current one\n    /// @dev                Limit the amount of lookups (and thus gas usage) with _limit\n    /// @param _ancestor    The prospective shared ancestor\n    /// @param _left        A chain tip\n    /// @param _right       A chain tip\n    /// @param _limit       The maximum number of blocks to check\n    /// @return             true if it is the most recent common ancestor within _limit, false otherwise\n    function _isMostRecentAncestor(\n        bytes32 _ancestor,\n        bytes32 _left,\n        bytes32 _right,\n        uint256 _limit\n    ) internal view returns (bool) {\n        /* NB: sure why not */\n        if (_ancestor == _left && _ancestor == _right) {\n            return true;\n        }\n\n        bytes32 _leftCurrent = _left;\n        bytes32 _rightCurrent = _right;\n        bytes32 _leftPrev = _left;\n        bytes32 _rightPrev = _right;\n\n        for(uint256 i = 0; i < _limit; i = i.add(1)) {\n            if (_leftPrev != _ancestor) {\n                _leftCurrent = _leftPrev;  // cheap\n                _leftPrev = previousBlock[_leftPrev];  // expensive\n            }\n            if (_rightPrev != _ancestor) {\n                _rightCurrent = _rightPrev;  // cheap\n                _rightPrev = previousBlock[_rightPrev];  // expensive\n            }\n        }\n        if (_leftCurrent == _rightCurrent) {return false;} /* NB: If the same, they're a nearer ancestor */\n        if (_leftPrev != _rightPrev) {return false;} /* NB: Both must be ancestor */\n        return true;\n    }\n\n    /// @notice             Checks if a digest is an ancestor of the current one\n    /// @dev                Limit the amount of lookups (and thus gas usage) with _limit\n    /// @param _ancestor    The prospective shared ancestor\n    /// @param _left        A chain tip\n    /// @param _right       A chain tip\n    /// @param _limit       The maximum number of blocks to check\n    /// @return             true if it is the most recent common ancestor within _limit, false otherwise\n    function isMostRecentAncestor(\n        bytes32 _ancestor,\n        bytes32 _left,\n        bytes32 _right,\n        uint256 _limit\n    ) external view returns (bool) {\n        return _isMostRecentAncestor(_ancestor, _left, _right, _limit);\n    }\n\n    /// @notice             Decides which header is heaviest from the ancestor\n    /// @dev                Does not support reorgs above 2017 blocks (:\n    /// @param _ancestor    The prospective shared ancestor\n    /// @param _left        A chain tip\n    /// @param _right       A chain tip\n    /// @return             true if it is the most recent common ancestor within _limit, false otherwise\n    function _heaviestFromAncestor(\n        bytes32 _ancestor,\n        bytes memory _left,\n        bytes memory _right\n    ) internal view returns (bytes32) {\n        uint256 _ancestorHeight = _findHeight(_ancestor);\n        uint256 _leftHeight = _findHeight(_left.hash256());\n        uint256 _rightHeight = _findHeight(_right.hash256());\n\n        require(\n            _leftHeight >= _ancestorHeight && _rightHeight >= _ancestorHeight,\n            \"A descendant height is below the ancestor height\");\n\n        /* NB: we can shortcut if one block is in a new difficulty window and the other isn't */\n        uint256 _nextPeriodStartHeight = _ancestorHeight.add(2016).sub(_ancestorHeight % 2016);\n        bool _leftInPeriod = _leftHeight < _nextPeriodStartHeight;\n        bool _rightInPeriod = _rightHeight < _nextPeriodStartHeight;\n\n        /*\n        NB:\n        1. Left is in a new window, right is in the old window. Left is heavier\n        2. Right is in a new window, left is in the old window. Right is heavier\n        3. Both are in the same window, choose the higher one\n        4. They're in different new windows. Choose the heavier one\n        */\n        if (!_leftInPeriod && _rightInPeriod) {return _left.hash256();}\n        if (_leftInPeriod && !_rightInPeriod) {return _right.hash256();}\n        if (_leftInPeriod && _rightInPeriod) {\n            return _leftHeight >= _rightHeight ? _left.hash256() : _right.hash256();\n        } else {  // if (!_leftInPeriod && !_rightInPeriod) {\n            if (((_leftHeight % 2016).mul(_left.extractDifficulty())) <\n                (_rightHeight % 2016).mul(_right.extractDifficulty())) {\n                return _right.hash256();\n            } else {\n                return _left.hash256();\n            }\n        }\n    }\n\n    /// @notice             Decides which header is heaviest from the ancestor\n    /// @dev                Does not support reorgs above 2017 blocks (:\n    /// @param _ancestor    The prospective shared ancestor\n    /// @param _left        A chain tip\n    /// @param _right       A chain tip\n    /// @return             true if it is the most recent common ancestor within _limit, false otherwise\n    function heaviestFromAncestor(\n        bytes32 _ancestor,\n        bytes calldata _left,\n        bytes calldata _right\n    ) external view returns (bytes32) {\n        return _heaviestFromAncestor(_ancestor, _left, _right);\n    }\n\n    /// @notice     Getter for currentEpochDiff\n    /// @dev        This is updated when a new heavist header has a new diff\n    /// @return     The difficulty of the bestKnownDigest\n    function getCurrentEpochDifficulty() external view returns (uint256) {\n      return currentEpochDiff;\n    }\n    /// @notice     Getter for prevEpochDiff\n    /// @dev        This is updated when a difficulty change is accepted\n    /// @return     The difficulty of the previous epoch\n    function getPrevEpochDifficulty() external view returns (uint256) {\n      return prevEpochDiff;\n    }\n\n    /// @notice     Getter for relayGenesis\n    /// @dev        This is an initialization parameter\n    /// @return     The hash of the first block of the relay\n    function getRelayGenesis() public view returns (bytes32) {\n        return relayGenesis;\n    }\n\n    /// @notice     Getter for bestKnownDigest\n    /// @dev        This updated only by calling markNewHeaviest\n    /// @return     The hash of the best marked chain tip\n    function getBestKnownDigest() public view returns (bytes32) {\n        return bestKnownDigest;\n    }\n\n    /// @notice     Getter for relayGenesis\n    /// @dev        This is updated only by calling markNewHeaviest\n    /// @return     The hash of the shared ancestor of the most recent fork\n    function getLastReorgCommonAncestor() public view returns (bytes32) {\n        return lastReorgCommonAncestor;\n    }\n}\n",
  "sourcePath": "/home/james/devel/relays/solidity/contracts/Relay.sol",
  "ast": {
    "absolutePath": "/home/james/devel/relays/solidity/contracts/Relay.sol",
    "exportedSymbols": {
      "IRelay": [
        1166
      ],
      "Relay": [
        2252
      ]
    },
    "id": 2253,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 1034,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".10"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:3"
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol",
        "id": 1036,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 4367,
        "src": "88:74:3",
        "symbolAliases": [
          {
            "foreign": 1035,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol",
        "id": 1038,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 4270,
        "src": "163:74:3",
        "symbolAliases": [
          {
            "foreign": 1037,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol",
        "id": 1040,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 4083,
        "src": "238:74:3",
        "symbolAliases": [
          {
            "foreign": 1039,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol",
        "id": 1042,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 5009,
        "src": "313:80:3",
        "symbolAliases": [
          {
            "foreign": 1041,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "interface",
        "documentation": null,
        "fullyImplemented": false,
        "id": 1166,
        "linearizedBaseContracts": [
          1166
        ],
        "name": "IRelay",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "anonymous": false,
            "documentation": null,
            "id": 1048,
            "name": "Extension",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 1047,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1044,
                  "indexed": true,
                  "name": "_first",
                  "nodeType": "VariableDeclaration",
                  "scope": 1048,
                  "src": "435:22:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1043,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "435:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1046,
                  "indexed": true,
                  "name": "_last",
                  "nodeType": "VariableDeclaration",
                  "scope": 1048,
                  "src": "459:21:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1045,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "459:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "434:47:3"
            },
            "src": "419:63:3"
          },
          {
            "anonymous": false,
            "documentation": null,
            "id": 1056,
            "name": "Reorg",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 1055,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1050,
                  "indexed": true,
                  "name": "_from",
                  "nodeType": "VariableDeclaration",
                  "scope": 1056,
                  "src": "499:21:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1049,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "499:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1052,
                  "indexed": true,
                  "name": "_to",
                  "nodeType": "VariableDeclaration",
                  "scope": 1056,
                  "src": "522:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1051,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "522:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1054,
                  "indexed": true,
                  "name": "_gcd",
                  "nodeType": "VariableDeclaration",
                  "scope": 1056,
                  "src": "543:20:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1053,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "543:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "498:66:3"
            },
            "src": "487:78:3"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1069,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "isMostRecentAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1065,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1058,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "610:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1057,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "610:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1060,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "637:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1059,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "637:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1062,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "660:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1061,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "660:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1064,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "684:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1063,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "684:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "600:104:3"
            },
            "returnParameters": {
              "id": 1068,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1067,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "728:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1066,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "728:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "727:6:3"
            },
            "scope": 1166,
            "src": "571:163:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1074,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getCurrentEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1070,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "774:2:3"
            },
            "returnParameters": {
              "id": 1073,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1072,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1074,
                  "src": "800:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1071,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "800:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "799:9:3"
            },
            "scope": 1166,
            "src": "740:69:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1079,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getPrevEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1075,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "845:2:3"
            },
            "returnParameters": {
              "id": 1078,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1077,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1079,
                  "src": "871:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1076,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "871:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "870:9:3"
            },
            "scope": 1166,
            "src": "814:66:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1084,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getRelayGenesis",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1080,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "909:2:3"
            },
            "returnParameters": {
              "id": 1083,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1082,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1084,
                  "src": "935:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1081,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "935:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "934:9:3"
            },
            "scope": 1166,
            "src": "885:59:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1089,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getBestKnownDigest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1085,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "976:2:3"
            },
            "returnParameters": {
              "id": 1088,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1087,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1089,
                  "src": "1002:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1086,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1002:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1001:9:3"
            },
            "scope": 1166,
            "src": "949:62:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1094,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getLastReorgCommonAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1090,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1051:2:3"
            },
            "returnParameters": {
              "id": 1093,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1092,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1094,
                  "src": "1077:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1091,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1077:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1076:9:3"
            },
            "scope": 1166,
            "src": "1016:70:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1101,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "findHeight",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1097,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1096,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1101,
                  "src": "1112:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1095,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1112:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1111:17:3"
            },
            "returnParameters": {
              "id": 1100,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1099,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1101,
                  "src": "1152:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1098,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1152:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1151:9:3"
            },
            "scope": 1166,
            "src": "1092:69:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1110,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "findAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1106,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1103,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1110,
                  "src": "1189:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1102,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1189:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1105,
                  "name": "_offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1110,
                  "src": "1206:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1104,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1206:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1188:34:3"
            },
            "returnParameters": {
              "id": 1109,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1108,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1110,
                  "src": "1246:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1107,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1246:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1245:9:3"
            },
            "scope": 1166,
            "src": "1167:88:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1121,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "isAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1117,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1112,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1281:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1111,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1281:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1114,
                  "name": "_descendant",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1300:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1113,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1300:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1116,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1321:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1115,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1321:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1280:56:3"
            },
            "returnParameters": {
              "id": 1120,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1119,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1360:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1118,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1360:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1359:6:3"
            },
            "scope": 1166,
            "src": "1261:105:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1132,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "heaviestFromAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1128,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1123,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1411:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1122,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1411:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1125,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1438:20:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1124,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1438:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1127,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1468:21:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1126,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1468:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1401:94:3"
            },
            "returnParameters": {
              "id": 1131,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1130,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1519:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1129,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1519:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1518:9:3"
            },
            "scope": 1166,
            "src": "1372:156:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1141,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "addHeaders",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1137,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1134,
                  "name": "_anchor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1141,
                  "src": "1554:22:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1133,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1554:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1136,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1141,
                  "src": "1578:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1135,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1578:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1553:49:3"
            },
            "returnParameters": {
              "id": 1140,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1139,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1141,
                  "src": "1621:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1138,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1621:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1620:6:3"
            },
            "scope": 1166,
            "src": "1534:93:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1152,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "addHeadersWithRetarget",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1148,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1143,
                  "name": "_oldPeriodStartHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1674:36:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1142,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1674:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1145,
                  "name": "_oldPeriodEndHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1720:34:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1144,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1720:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1147,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1764:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1146,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1764:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1664:129:3"
            },
            "returnParameters": {
              "id": 1151,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1150,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1812:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1149,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1812:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1811:6:3"
            },
            "scope": 1166,
            "src": "1633:185:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1165,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "markNewHeaviest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1161,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1154,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1858:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1153,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1858:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1156,
                  "name": "_currentBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1885:27:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1155,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1885:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1158,
                  "name": "_newBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1922:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1157,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1922:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1160,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1955:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1159,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1955:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1848:127:3"
            },
            "returnParameters": {
              "id": 1164,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1163,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1994:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1162,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1994:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1993:6:3"
            },
            "scope": 1166,
            "src": "1824:176:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          }
        ],
        "scope": 2253,
        "src": "395:1607:3"
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 1167,
              "name": "IRelay",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1166,
              "src": "2022:6:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_IRelay_$1166",
                "typeString": "contract IRelay"
              }
            },
            "id": 1168,
            "nodeType": "InheritanceSpecifier",
            "src": "2022:6:3"
          }
        ],
        "contractDependencies": [
          1166
        ],
        "contractKind": "contract",
        "documentation": null,
        "fullyImplemented": true,
        "id": 2252,
        "linearizedBaseContracts": [
          2252,
          1166
        ],
        "name": "Relay",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 1171,
            "libraryName": {
              "contractScope": null,
              "id": 1169,
              "name": "SafeMath",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4366,
              "src": "2041:8:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SafeMath_$4366",
                "typeString": "library SafeMath"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2035:27:3",
            "typeName": {
              "id": 1170,
              "name": "uint256",
              "nodeType": "ElementaryTypeName",
              "src": "2054:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            }
          },
          {
            "id": 1174,
            "libraryName": {
              "contractScope": null,
              "id": 1172,
              "name": "BytesLib",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4269,
              "src": "2073:8:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_BytesLib_$4269",
                "typeString": "library BytesLib"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2067:25:3",
            "typeName": {
              "id": 1173,
              "name": "bytes",
              "nodeType": "ElementaryTypeName",
              "src": "2086:5:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes_storage_ptr",
                "typeString": "bytes"
              }
            }
          },
          {
            "id": 1177,
            "libraryName": {
              "contractScope": null,
              "id": 1175,
              "name": "BTCUtils",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4082,
              "src": "2103:8:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_BTCUtils_$4082",
                "typeString": "library BTCUtils"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2097:25:3",
            "typeName": {
              "id": 1176,
              "name": "bytes",
              "nodeType": "ElementaryTypeName",
              "src": "2116:5:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes_storage_ptr",
                "typeString": "bytes"
              }
            }
          },
          {
            "id": 1180,
            "libraryName": {
              "contractScope": null,
              "id": 1178,
              "name": "ValidateSPV",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 5008,
              "src": "2133:11:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_ValidateSPV_$5008",
                "typeString": "library ValidateSPV"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2127:28:3",
            "typeName": {
              "id": 1179,
              "name": "bytes",
              "nodeType": "ElementaryTypeName",
              "src": "2149:5:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes_storage_ptr",
                "typeString": "bytes"
              }
            }
          },
          {
            "constant": true,
            "id": 1183,
            "name": "HEIGHT_INTERVAL",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2272:42:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint32",
              "typeString": "uint32"
            },
            "typeName": {
              "id": 1181,
              "name": "uint32",
              "nodeType": "ElementaryTypeName",
              "src": "2272:6:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint32",
                "typeString": "uint32"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "34",
              "id": 1182,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "2313:1:3",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_4_by_1",
                "typeString": "int_const 4"
              },
              "value": "4"
            },
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 1185,
            "name": "relayGenesis",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2321:29:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 1184,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "2321:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1187,
            "name": "bestKnownDigest",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2356:32:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 1186,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "2356:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1189,
            "name": "lastReorgCommonAncestor",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2394:40:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 1188,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "2394:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1193,
            "name": "previousBlock",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2440:51:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
              "typeString": "mapping(bytes32 => bytes32)"
            },
            "typeName": {
              "id": 1192,
              "keyType": {
                "id": 1190,
                "name": "bytes32",
                "nodeType": "ElementaryTypeName",
                "src": "2449:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes32",
                  "typeString": "bytes32"
                }
              },
              "nodeType": "Mapping",
              "src": "2440:28:3",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                "typeString": "mapping(bytes32 => bytes32)"
              },
              "valueType": {
                "id": 1191,
                "name": "bytes32",
                "nodeType": "ElementaryTypeName",
                "src": "2460:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes32",
                  "typeString": "bytes32"
                }
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1197,
            "name": "blockHeight",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2497:49:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
              "typeString": "mapping(bytes32 => uint256)"
            },
            "typeName": {
              "id": 1196,
              "keyType": {
                "id": 1194,
                "name": "bytes32",
                "nodeType": "ElementaryTypeName",
                "src": "2506:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes32",
                  "typeString": "bytes32"
                }
              },
              "nodeType": "Mapping",
              "src": "2497:28:3",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                "typeString": "mapping(bytes32 => uint256)"
              },
              "valueType": {
                "id": 1195,
                "name": "uint256",
                "nodeType": "ElementaryTypeName",
                "src": "2517:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                }
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1199,
            "name": "currentEpochDiff",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2553:33:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 1198,
              "name": "uint256",
              "nodeType": "ElementaryTypeName",
              "src": "2553:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1201,
            "name": "prevEpochDiff",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2592:30:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 1200,
              "name": "uint256",
              "nodeType": "ElementaryTypeName",
              "src": "2592:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1272,
              "nodeType": "Block",
              "src": "3083:653:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1214,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1211,
                            "name": "_genesisHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1203,
                            "src": "3101:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1212,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3101:21:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "3830",
                          "id": 1213,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3126:2:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_80_by_1",
                            "typeString": "int_const 80"
                          },
                          "value": "80"
                        },
                        "src": "3101:27:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "53746f70206265696e672064756d62",
                        "id": 1215,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3130:17:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_54f9a5f9e9dfa58d8856435ba6e7418b795ac217ba9b784a12213c7ba6375b05",
                          "typeString": "literal_string \"Stop being dumb\""
                        },
                        "value": "Stop being dumb"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_54f9a5f9e9dfa58d8856435ba6e7418b795ac217ba9b784a12213c7ba6375b05",
                          "typeString": "literal_string \"Stop being dumb\""
                        }
                      ],
                      "id": 1210,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "3093:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1216,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3093:55:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1217,
                  "nodeType": "ExpressionStatement",
                  "src": "3093:55:3"
                },
                {
                  "assignments": [
                    1219
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1219,
                      "name": "_genesisDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1272,
                      "src": "3158:22:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1218,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "3158:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1223,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1220,
                        "name": "_genesisHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1203,
                        "src": "3183:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1221,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "3183:22:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1222,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3183:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3158:49:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1233,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1229,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1225,
                            "name": "_periodStart",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1207,
                            "src": "3239:12:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "&",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "hexValue": "307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030666666666666",
                                "id": 1227,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3262:66:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_16777215_by_1",
                                  "typeString": "int_const 16777215"
                                },
                                "value": "0x0000000000000000000000000000000000000000000000000000000000ffffff"
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_rational_16777215_by_1",
                                  "typeString": "int_const 16777215"
                                }
                              ],
                              "id": 1226,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "3254:7:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_bytes32_$",
                                "typeString": "type(bytes32)"
                              },
                              "typeName": "bytes32"
                            },
                            "id": 1228,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "3254:75:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "3239:90:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 1231,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3341:1:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 1230,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3333:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_bytes32_$",
                              "typeString": "type(bytes32)"
                            },
                            "typeName": "bytes32"
                          },
                          "id": 1232,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3333:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "3239:104:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "506572696f64207374617274206861736820646f6573206e6f74206861766520776f726b2e2048696e743a2077726f6e672062797465206f726465723f",
                        "id": 1234,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3357:63:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c63e0adf63c0728a57e27fbecf3408104165ff577e498d3d8684c7fbae01d26d",
                          "typeString": "literal_string \"Period start hash does not have work. Hint: wrong byte order?\""
                        },
                        "value": "Period start hash does not have work. Hint: wrong byte order?"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c63e0adf63c0728a57e27fbecf3408104165ff577e498d3d8684c7fbae01d26d",
                          "typeString": "literal_string \"Period start hash does not have work. Hint: wrong byte order?\""
                        }
                      ],
                      "id": 1224,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "3218:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1235,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3218:203:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1236,
                  "nodeType": "ExpressionStatement",
                  "src": "3218:203:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1239,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1237,
                      "name": "relayGenesis",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1185,
                      "src": "3432:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1238,
                      "name": "_genesisDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1219,
                      "src": "3447:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "3432:29:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1240,
                  "nodeType": "ExpressionStatement",
                  "src": "3432:29:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1243,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1241,
                      "name": "bestKnownDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1187,
                      "src": "3471:15:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1242,
                      "name": "_genesisDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1219,
                      "src": "3489:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "3471:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1244,
                  "nodeType": "ExpressionStatement",
                  "src": "3471:32:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1247,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1245,
                      "name": "lastReorgCommonAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1189,
                      "src": "3513:23:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1246,
                      "name": "_genesisDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1219,
                      "src": "3539:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "3513:40:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1248,
                  "nodeType": "ExpressionStatement",
                  "src": "3513:40:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1253,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1249,
                        "name": "blockHeight",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1197,
                        "src": "3563:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                          "typeString": "mapping(bytes32 => uint256)"
                        }
                      },
                      "id": 1251,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1250,
                        "name": "_genesisDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1219,
                        "src": "3575:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3563:27:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1252,
                      "name": "_height",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1205,
                      "src": "3593:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3563:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1254,
                  "nodeType": "ExpressionStatement",
                  "src": "3563:37:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1264,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1255,
                        "name": "blockHeight",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1197,
                        "src": "3610:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                          "typeString": "mapping(bytes32 => uint256)"
                        }
                      },
                      "id": 1257,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1256,
                        "name": "_periodStart",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1207,
                        "src": "3622:12:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3610:25:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1262,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1260,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1205,
                            "src": "3650:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "%",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 1261,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3660:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          },
                          "src": "3650:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1258,
                          "name": "_height",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1205,
                          "src": "3638:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1259,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4340,
                        "src": "3638:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 1263,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3638:27:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3610:55:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1265,
                  "nodeType": "ExpressionStatement",
                  "src": "3610:55:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1270,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1266,
                      "name": "currentEpochDiff",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1199,
                      "src": "3676:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [],
                      "expression": {
                        "argumentTypes": [],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1267,
                          "name": "_genesisHeader",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1203,
                          "src": "3695:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1268,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "extractDifficulty",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3864,
                        "src": "3695:32:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                          "typeString": "function (bytes memory) pure returns (uint256)"
                        }
                      },
                      "id": 1269,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3695:34:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3676:53:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1271,
                  "nodeType": "ExpressionStatement",
                  "src": "3676:53:3"
                }
              ]
            },
            "documentation": "@notice                   Gives a starting point for the relay\n @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n @param  _genesisHeader    The starting header\n @param  _height           The starting height\n @param  _periodStart      The hash of the first header in the genesis epoch",
            "id": 1273,
            "implemented": true,
            "kind": "constructor",
            "modifiers": [],
            "name": "",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1208,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1203,
                  "name": "_genesisHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1273,
                  "src": "3008:27:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1202,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "3008:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1205,
                  "name": "_height",
                  "nodeType": "VariableDeclaration",
                  "scope": 1273,
                  "src": "3037:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1204,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "3037:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1207,
                  "name": "_periodStart",
                  "nodeType": "VariableDeclaration",
                  "scope": 1273,
                  "src": "3054:20:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1206,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "3054:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "3007:68:3"
            },
            "returnParameters": {
              "id": 1209,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "3083:0:3"
            },
            "scope": 2252,
            "src": "2996:740:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1453,
              "nodeType": "Block",
              "src": "4340:2176:3",
              "statements": [
                {
                  "assignments": [
                    1285
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1285,
                      "name": "_height",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4350:15:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1284,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4350:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1286,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4350:15:3"
                },
                {
                  "assignments": [
                    1288
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1288,
                      "name": "_header",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4375:20:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 1287,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "4375:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1289,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4375:20:3"
                },
                {
                  "assignments": [
                    1291
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1291,
                      "name": "_currentDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4405:22:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1290,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "4405:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1292,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4405:22:3"
                },
                {
                  "assignments": [
                    1294
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1294,
                      "name": "_previousDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4437:23:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1293,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "4437:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1298,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1295,
                        "name": "_anchor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1275,
                        "src": "4463:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1296,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "4463:15:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1297,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4463:17:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4437:43:3"
                },
                {
                  "assignments": [
                    1300
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1300,
                      "name": "_target",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4491:15:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1299,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4491:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1308,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1303,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "4524:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          {
                            "argumentTypes": null,
                            "hexValue": "3830",
                            "id": 1304,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "4527:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_80_by_1",
                              "typeString": "int_const 80"
                            },
                            "value": "80"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            {
                              "typeIdentifier": "t_rational_80_by_1",
                              "typeString": "int_const 80"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1301,
                            "name": "_headers",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1277,
                            "src": "4509:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1302,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "slice",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4133,
                          "src": "4509:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory,uint256,uint256) pure returns (bytes memory)"
                          }
                        },
                        "id": 1305,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "4509:21:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1306,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractTarget",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3777,
                      "src": "4509:35:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1307,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4509:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4491:55:3"
                },
                {
                  "assignments": [
                    1310
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1310,
                      "name": "_anchorHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4556:21:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1309,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4556:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1314,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1312,
                        "name": "_previousDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1294,
                        "src": "4592:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1311,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "4580:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1313,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4580:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4556:52:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 1322,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1316,
                          "name": "_internal",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1279,
                          "src": "4669:9:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "||",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1321,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1317,
                                "name": "_anchor",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1275,
                                "src": "4682:7:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 1318,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "extractTarget",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 3777,
                              "src": "4682:21:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (uint256)"
                              }
                            },
                            "id": 1319,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4682:23:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1320,
                            "name": "_target",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1300,
                            "src": "4709:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4682:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "4669:47:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "556e6578706563746564207265746172676574206f6e2065787465726e616c2063616c6c",
                        "id": 1323,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "4730:38:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c33296853216f4d74abe3a6fbf840e018f81995cd8c40108858eaa3d5148cebc",
                          "typeString": "literal_string \"Unexpected retarget on external call\""
                        },
                        "value": "Unexpected retarget on external call"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c33296853216f4d74abe3a6fbf840e018f81995cd8c40108858eaa3d5148cebc",
                          "typeString": "literal_string \"Unexpected retarget on external call\""
                        }
                      ],
                      "id": 1315,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "4648:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1324,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4648:121:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1325,
                  "nodeType": "ExpressionStatement",
                  "src": "4648:121:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1332,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1330,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "expression": {
                              "argumentTypes": null,
                              "id": 1327,
                              "name": "_headers",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1277,
                              "src": "4787:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 1328,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "length",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": null,
                            "src": "4787:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "%",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "3830",
                            "id": 1329,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "4805:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_80_by_1",
                              "typeString": "int_const 80"
                            },
                            "value": "80"
                          },
                          "src": "4787:20:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1331,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4811:1:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "4787:25:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "486561646572206172726179206c656e677468206d75737420626520646976697369626c65206279203830",
                        "id": 1333,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "4814:45:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_64951f0822ebc61755f01c687a3aabd90c37a5b5a62d0764ef2ec9edb60caca4",
                          "typeString": "literal_string \"Header array length must be divisible by 80\""
                        },
                        "value": "Header array length must be divisible by 80"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_64951f0822ebc61755f01c687a3aabd90c37a5b5a62d0764ef2ec9edb60caca4",
                          "typeString": "literal_string \"Header array length must be divisible by 80\""
                        }
                      ],
                      "id": 1326,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "4779:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1334,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4779:81:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1335,
                  "nodeType": "ExpressionStatement",
                  "src": "4779:81:3"
                },
                {
                  "body": {
                    "id": 1442,
                    "nodeType": "Block",
                    "src": "5170:1234:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1362,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1353,
                            "name": "_header",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1288,
                            "src": "5184:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "hexValue": "3830",
                                    "id": 1358,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "5215:2:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_80_by_1",
                                      "typeString": "int_const 80"
                                    },
                                    "value": "80"
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_rational_80_by_1",
                                      "typeString": "int_const 80"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1356,
                                    "name": "i",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1337,
                                    "src": "5209:1:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "id": 1357,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4305,
                                  "src": "5209:5:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 1359,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5209:9:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "hexValue": "3830",
                                "id": 1360,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5220:2:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_80_by_1",
                                  "typeString": "int_const 80"
                                },
                                "value": "80"
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                {
                                  "typeIdentifier": "t_rational_80_by_1",
                                  "typeString": "int_const 80"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1354,
                                "name": "_headers",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1277,
                                "src": "5194:8:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 1355,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "slice",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4133,
                              "src": "5194:14:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory,uint256,uint256) pure returns (bytes memory)"
                              }
                            },
                            "id": 1361,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5194:29:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "src": "5184:39:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1363,
                        "nodeType": "ExpressionStatement",
                        "src": "5184:39:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1371,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1364,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1285,
                            "src": "5237:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "commonType": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                "id": 1369,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftExpression": {
                                  "argumentTypes": null,
                                  "id": 1367,
                                  "name": "i",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1337,
                                  "src": "5265:1:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                },
                                "nodeType": "BinaryOperation",
                                "operator": "+",
                                "rightExpression": {
                                  "argumentTypes": null,
                                  "hexValue": "31",
                                  "id": 1368,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "kind": "number",
                                  "lValueRequested": false,
                                  "nodeType": "Literal",
                                  "src": "5269:1:3",
                                  "subdenomination": null,
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_rational_1_by_1",
                                    "typeString": "int_const 1"
                                  },
                                  "value": "1"
                                },
                                "src": "5265:5:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1365,
                                "name": "_anchorHeight",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1310,
                                "src": "5247:13:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 1366,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4365,
                              "src": "5247:17:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 1370,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5247:24:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "5237:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1372,
                        "nodeType": "ExpressionStatement",
                        "src": "5237:34:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1377,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1373,
                            "name": "_currentDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1291,
                            "src": "5285:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1374,
                                "name": "_header",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1288,
                                "src": "5302:7:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 1375,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "hash256",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2792,
                              "src": "5302:15:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (bytes32)"
                              }
                            },
                            "id": 1376,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5302:17:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "5285:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1378,
                        "nodeType": "ExpressionStatement",
                        "src": "5285:34:3"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1385,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1379,
                              "name": "previousBlock",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1193,
                              "src": "5520:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                "typeString": "mapping(bytes32 => bytes32)"
                              }
                            },
                            "id": 1381,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1380,
                              "name": "_currentDigest",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1291,
                              "src": "5534:14:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "5520:29:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "hexValue": "30",
                                "id": 1383,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5561:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_0_by_1",
                                  "typeString": "int_const 0"
                                },
                                "value": "0"
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_rational_0_by_1",
                                  "typeString": "int_const 0"
                                }
                              ],
                              "id": 1382,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "5553:7:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_bytes32_$",
                                "typeString": "type(bytes32)"
                              },
                              "typeName": "bytes32"
                            },
                            "id": 1384,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5553:10:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "5520:43:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 1420,
                        "nodeType": "IfStatement",
                        "src": "5516:560:3",
                        "trueBody": {
                          "id": 1419,
                          "nodeType": "Block",
                          "src": "5565:511:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 1396,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "arguments": [],
                                      "expression": {
                                        "argumentTypes": [],
                                        "expression": {
                                          "argumentTypes": null,
                                          "arguments": [],
                                          "expression": {
                                            "argumentTypes": [],
                                            "expression": {
                                              "argumentTypes": null,
                                              "arguments": [
                                                {
                                                  "argumentTypes": null,
                                                  "id": 1389,
                                                  "name": "_currentDigest",
                                                  "nodeType": "Identifier",
                                                  "overloadedDeclarations": [],
                                                  "referencedDeclaration": 1291,
                                                  "src": "5629:14:3",
                                                  "typeDescriptions": {
                                                    "typeIdentifier": "t_bytes32",
                                                    "typeString": "bytes32"
                                                  }
                                                }
                                              ],
                                              "expression": {
                                                "argumentTypes": [
                                                  {
                                                    "typeIdentifier": "t_bytes32",
                                                    "typeString": "bytes32"
                                                  }
                                                ],
                                                "expression": {
                                                  "argumentTypes": null,
                                                  "id": 1387,
                                                  "name": "abi",
                                                  "nodeType": "Identifier",
                                                  "overloadedDeclarations": [],
                                                  "referencedDeclaration": 5010,
                                                  "src": "5612:3:3",
                                                  "typeDescriptions": {
                                                    "typeIdentifier": "t_magic_abi",
                                                    "typeString": "abi"
                                                  }
                                                },
                                                "id": 1388,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "lValueRequested": false,
                                                "memberName": "encodePacked",
                                                "nodeType": "MemberAccess",
                                                "referencedDeclaration": null,
                                                "src": "5612:16:3",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
                                                  "typeString": "function () pure returns (bytes memory)"
                                                }
                                              },
                                              "id": 1390,
                                              "isConstant": false,
                                              "isLValue": false,
                                              "isPure": false,
                                              "kind": "functionCall",
                                              "lValueRequested": false,
                                              "names": [],
                                              "nodeType": "FunctionCall",
                                              "src": "5612:32:3",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_bytes_memory_ptr",
                                                "typeString": "bytes memory"
                                              }
                                            },
                                            "id": 1391,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "reverseEndianness",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 2579,
                                            "src": "5612:50:3",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                                              "typeString": "function (bytes memory) pure returns (bytes memory)"
                                            }
                                          },
                                          "id": 1392,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "5612:52:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_bytes_memory_ptr",
                                            "typeString": "bytes memory"
                                          }
                                        },
                                        "id": 1393,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "memberName": "bytesToUint",
                                        "nodeType": "MemberAccess",
                                        "referencedDeclaration": 2726,
                                        "src": "5612:64:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                          "typeString": "function (bytes memory) pure returns (uint256)"
                                        }
                                      },
                                      "id": 1394,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "kind": "functionCall",
                                      "lValueRequested": false,
                                      "names": [],
                                      "nodeType": "FunctionCall",
                                      "src": "5612:66:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "<=",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 1395,
                                      "name": "_target",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1300,
                                      "src": "5682:7:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "5612:77:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bool",
                                      "typeString": "bool"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "hexValue": "48656164657220776f726b20697320696e73756666696369656e74",
                                    "id": 1397,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "string",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "5711:29:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_stringliteral_577a884d824749cadf11f1d13d4dc4655ad406f62456ad5e910541517ce4d497",
                                      "typeString": "literal_string \"Header work is insufficient\""
                                    },
                                    "value": "Header work is insufficient"
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_bool",
                                      "typeString": "bool"
                                    },
                                    {
                                      "typeIdentifier": "t_stringliteral_577a884d824749cadf11f1d13d4dc4655ad406f62456ad5e910541517ce4d497",
                                      "typeString": "literal_string \"Header work is insufficient\""
                                    }
                                  ],
                                  "id": 1386,
                                  "name": "require",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [
                                    5026,
                                    5027
                                  ],
                                  "referencedDeclaration": 5027,
                                  "src": "5583:7:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                                    "typeString": "function (bool,string memory) pure"
                                  }
                                },
                                "id": 1398,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5583:158:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_tuple$__$",
                                  "typeString": "tuple()"
                                }
                              },
                              "id": 1399,
                              "nodeType": "ExpressionStatement",
                              "src": "5583:158:3"
                            },
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1404,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 1400,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "5759:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 1402,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 1401,
                                    "name": "_currentDigest",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1291,
                                    "src": "5773:14:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": true,
                                  "nodeType": "IndexAccess",
                                  "src": "5759:29:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "id": 1403,
                                  "name": "_previousDigest",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1294,
                                  "src": "5791:15:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "5759:47:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1405,
                              "nodeType": "ExpressionStatement",
                              "src": "5759:47:3"
                            },
                            {
                              "condition": {
                                "argumentTypes": null,
                                "commonType": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                "id": 1410,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftExpression": {
                                  "argumentTypes": null,
                                  "commonType": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "id": 1408,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "id": 1406,
                                    "name": "_height",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1285,
                                    "src": "5828:7:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "%",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "id": 1407,
                                    "name": "HEIGHT_INTERVAL",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1183,
                                    "src": "5838:15:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint32",
                                      "typeString": "uint32"
                                    }
                                  },
                                  "src": "5828:25:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                },
                                "nodeType": "BinaryOperation",
                                "operator": "==",
                                "rightExpression": {
                                  "argumentTypes": null,
                                  "hexValue": "30",
                                  "id": 1409,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "kind": "number",
                                  "lValueRequested": false,
                                  "nodeType": "Literal",
                                  "src": "5857:1:3",
                                  "subdenomination": null,
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_rational_0_by_1",
                                    "typeString": "int_const 0"
                                  },
                                  "value": "0"
                                },
                                "src": "5828:30:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              },
                              "falseBody": null,
                              "id": 1418,
                              "nodeType": "IfStatement",
                              "src": "5824:238:3",
                              "trueBody": {
                                "id": 1417,
                                "nodeType": "Block",
                                "src": "5860:202:3",
                                "statements": [
                                  {
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 1415,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "leftHandSide": {
                                        "argumentTypes": null,
                                        "baseExpression": {
                                          "argumentTypes": null,
                                          "id": 1411,
                                          "name": "blockHeight",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 1197,
                                          "src": "6006:11:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                                            "typeString": "mapping(bytes32 => uint256)"
                                          }
                                        },
                                        "id": 1413,
                                        "indexExpression": {
                                          "argumentTypes": null,
                                          "id": 1412,
                                          "name": "_currentDigest",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 1291,
                                          "src": "6018:14:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_bytes32",
                                            "typeString": "bytes32"
                                          }
                                        },
                                        "isConstant": false,
                                        "isLValue": true,
                                        "isPure": false,
                                        "lValueRequested": true,
                                        "nodeType": "IndexAccess",
                                        "src": "6006:27:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "nodeType": "Assignment",
                                      "operator": "=",
                                      "rightHandSide": {
                                        "argumentTypes": null,
                                        "id": 1414,
                                        "name": "_height",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 1285,
                                        "src": "6036:7:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "src": "6006:37:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "id": 1416,
                                    "nodeType": "ExpressionStatement",
                                    "src": "6006:37:3"
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 1426,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1422,
                                    "name": "_header",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1288,
                                    "src": "6168:7:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 1423,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "extractTarget",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3777,
                                  "src": "6168:21:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (uint256)"
                                  }
                                },
                                "id": 1424,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "6168:23:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "==",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 1425,
                                "name": "_target",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1300,
                                "src": "6195:7:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "src": "6168:34:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "hexValue": "546172676574206368616e67656420756e65787065637465646c79",
                              "id": 1427,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "string",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "6204:29:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_stringliteral_7512beb8d719892f726a7e4249334e5ee85f327ca3e7b9c917a97c9e30ad0aa4",
                                "typeString": "literal_string \"Target changed unexpectedly\""
                              },
                              "value": "Target changed unexpectedly"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              },
                              {
                                "typeIdentifier": "t_stringliteral_7512beb8d719892f726a7e4249334e5ee85f327ca3e7b9c917a97c9e30ad0aa4",
                                "typeString": "literal_string \"Target changed unexpectedly\""
                              }
                            ],
                            "id": 1421,
                            "name": "require",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [
                              5026,
                              5027
                            ],
                            "referencedDeclaration": 5027,
                            "src": "6160:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                              "typeString": "function (bool,string memory) pure"
                            }
                          },
                          "id": 1428,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "6160:74:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 1429,
                        "nodeType": "ExpressionStatement",
                        "src": "6160:74:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 1433,
                                  "name": "_previousDigest",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1294,
                                  "src": "6287:15:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1431,
                                  "name": "_header",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1288,
                                  "src": "6256:7:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes_memory_ptr",
                                    "typeString": "bytes memory"
                                  }
                                },
                                "id": 1432,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "validateHeaderPrevHash",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 5007,
                                "src": "6256:30:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_bytes32_$returns$_t_bool_$bound_to$_t_bytes_memory_ptr_$",
                                  "typeString": "function (bytes memory,bytes32) pure returns (bool)"
                                }
                              },
                              "id": 1434,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "6256:47:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "hexValue": "4865616465727320646f206e6f7420666f726d206120636f6e73697374656e7420636861696e",
                              "id": 1435,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "string",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "6305:40:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_stringliteral_09edac151df9e4894b9dc57d4b428f162596747b62bb7347fd3851a717f60df7",
                                "typeString": "literal_string \"Headers do not form a consistent chain\""
                              },
                              "value": "Headers do not form a consistent chain"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              },
                              {
                                "typeIdentifier": "t_stringliteral_09edac151df9e4894b9dc57d4b428f162596747b62bb7347fd3851a717f60df7",
                                "typeString": "literal_string \"Headers do not form a consistent chain\""
                              }
                            ],
                            "id": 1430,
                            "name": "require",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [
                              5026,
                              5027
                            ],
                            "referencedDeclaration": 5027,
                            "src": "6248:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                              "typeString": "function (bool,string memory) pure"
                            }
                          },
                          "id": 1436,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "6248:98:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 1437,
                        "nodeType": "ExpressionStatement",
                        "src": "6248:98:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1440,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1438,
                            "name": "_previousDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1294,
                            "src": "6361:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 1439,
                            "name": "_currentDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1291,
                            "src": "6379:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "6361:32:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1441,
                        "nodeType": "ExpressionStatement",
                        "src": "6361:32:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1345,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1340,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1337,
                      "src": "5130:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1344,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 1341,
                          "name": "_headers",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1277,
                          "src": "5134:8:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1342,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5134:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "3830",
                        "id": 1343,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "5152:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_80_by_1",
                          "typeString": "int_const 80"
                        },
                        "value": "80"
                      },
                      "src": "5134:20:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5130:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1443,
                  "initializationExpression": {
                    "assignments": [
                      1337
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1337,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1443,
                        "src": "5115:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1336,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "5115:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1339,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1338,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "5127:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "5115:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1351,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1346,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1337,
                        "src": "5156:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1349,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "5166:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1347,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1337,
                            "src": "5160:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1348,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "5160:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1350,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "5160:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "5156:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1352,
                    "nodeType": "ExpressionStatement",
                    "src": "5156:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "5110:1294:3"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1445,
                            "name": "_anchor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1275,
                            "src": "6442:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1446,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "6442:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 1447,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "6442:17:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1448,
                        "name": "_currentDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1291,
                        "src": "6473:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1444,
                      "name": "Extension",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1048,
                      "src": "6419:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$returns$__$",
                        "typeString": "function (bytes32,bytes32)"
                      }
                    },
                    "id": 1449,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6419:69:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1450,
                  "nodeType": "EmitStatement",
                  "src": "6414:74:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "74727565",
                    "id": 1451,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "6505:4:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "true"
                  },
                  "functionReturnParameters": 1283,
                  "id": 1452,
                  "nodeType": "Return",
                  "src": "6498:11:3"
                }
              ]
            },
            "documentation": "@notice             Adds headers to storage after validating\n @dev                We check integrity and consistency of the header chain\n @param  _anchor     The header immediately preceeding the new chain\n @param  _headers    A tightly-packed list of new 80-byte Bitcoin headers to record\n @param  _internal   True if called internally from addHeadersWithRetarget, false otherwise\n @return             True if successfully written, error otherwise",
            "id": 1454,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_addHeaders",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1280,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1275,
                  "name": "_anchor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4255:20:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1274,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4255:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1277,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4277:21:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1276,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4277:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1279,
                  "name": "_internal",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4300:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1278,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "4300:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4254:61:3"
            },
            "returnParameters": {
              "id": 1283,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1282,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4334:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1281,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "4334:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4333:6:3"
            },
            "scope": 2252,
            "src": "4234:2282:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1469,
              "nodeType": "Block",
              "src": "6994:61:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1464,
                        "name": "_anchor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1456,
                        "src": "7023:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1465,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1458,
                        "src": "7032:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "66616c7365",
                        "id": 1466,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "bool",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "7042:5:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "value": "false"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1463,
                      "name": "_addHeaders",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1454,
                      "src": "7011:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_bool_$returns$_t_bool_$",
                        "typeString": "function (bytes memory,bytes memory,bool) returns (bool)"
                      }
                    },
                    "id": 1467,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7011:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1462,
                  "id": 1468,
                  "nodeType": "Return",
                  "src": "7004:44:3"
                }
              ]
            },
            "documentation": "@notice             Adds headers to storage after validating\n @dev                We check integrity and consistency of the header chain\n @param  _anchor     The header immediately preceeding the new chain\n @param  _headers    A tightly-packed list of 80-byte Bitcoin headers\n @return             True if successfully written, error otherwise",
            "id": 1470,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "addHeaders",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1459,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1456,
                  "name": "_anchor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1470,
                  "src": "6921:22:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1455,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "6921:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1458,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1470,
                  "src": "6945:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1457,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "6945:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6920:49:3"
            },
            "returnParameters": {
              "id": 1462,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1461,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1470,
                  "src": "6988:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1460,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "6988:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6987:6:3"
            },
            "scope": 2252,
            "src": "6901:154:3",
            "stateMutability": "nonpayable",
            "superFunction": 1141,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1487,
              "nodeType": "Block",
              "src": "7796:101:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1482,
                        "name": "_oldPeriodStartHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1472,
                        "src": "7837:21:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1483,
                        "name": "_oldPeriodEndHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1474,
                        "src": "7860:19:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1484,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1476,
                        "src": "7881:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      ],
                      "id": 1481,
                      "name": "_addHeadersWithRetarget",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1615,
                      "src": "7813:23:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bool_$",
                        "typeString": "function (bytes memory,bytes memory,bytes memory) returns (bool)"
                      }
                    },
                    "id": 1485,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7813:77:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1480,
                  "id": 1486,
                  "nodeType": "Return",
                  "src": "7806:84:3"
                }
              ]
            },
            "documentation": "@notice                       Adds headers to storage, performs additional validation of retarget\n @dev                          Checks the retarget, the heights, and the linkage\n @param  _oldPeriodStartHeader The first header in the difficulty period being closed\n @param  _oldPeriodEndHeader   The last header in the difficulty period being closed\n @param  _headers              A tightly-packed list of 80-byte Bitcoin headers\n @return                       True if successfully written, error otherwise",
            "id": 1488,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "addHeadersWithRetarget",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1477,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1472,
                  "name": "_oldPeriodStartHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7652:36:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1471,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "7652:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1474,
                  "name": "_oldPeriodEndHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7698:34:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1473,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "7698:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1476,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7742:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1475,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "7742:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7642:129:3"
            },
            "returnParameters": {
              "id": 1480,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1479,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7790:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1478,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "7790:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7789:6:3"
            },
            "scope": 2252,
            "src": "7611:286:3",
            "stateMutability": "nonpayable",
            "superFunction": 1152,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1614,
              "nodeType": "Block",
              "src": "8633:1813:3",
              "statements": [
                {
                  "assignments": [
                    1500
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1500,
                      "name": "_startHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "8697:20:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1499,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "8697:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1506,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1502,
                            "name": "_oldPeriodStartHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1490,
                            "src": "8732:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1503,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "8732:29:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 1504,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8732:31:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1501,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "8720:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1505,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8720:44:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8697:67:3"
                },
                {
                  "assignments": [
                    1508
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1508,
                      "name": "_endHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "8774:18:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1507,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "8774:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1514,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1510,
                            "name": "_oldPeriodEndHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1492,
                            "src": "8807:19:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1511,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "8807:27:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 1512,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8807:29:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1509,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "8795:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1513,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8795:42:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8774:63:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1520,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1518,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1516,
                            "name": "_endHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1508,
                            "src": "8935:10:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "%",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 1517,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "8948:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          },
                          "src": "8935:17:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "32303135",
                          "id": 1519,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "8956:4:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_2015_by_1",
                            "typeString": "int_const 2015"
                          },
                          "value": "2015"
                        },
                        "src": "8935:25:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4d7573742070726f7669646520746865206c61737420686561646572206f662074686520636c6f73696e6720646966666963756c747920706572696f64",
                        "id": 1521,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8974:63:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_7bce8283552532854aff5aeca68cfd1afcae4f19a96f4f0f9a36c4ae487d1db8",
                          "typeString": "literal_string \"Must provide the last header of the closing difficulty period\""
                        },
                        "value": "Must provide the last header of the closing difficulty period"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_7bce8283552532854aff5aeca68cfd1afcae4f19a96f4f0f9a36c4ae487d1db8",
                          "typeString": "literal_string \"Must provide the last header of the closing difficulty period\""
                        }
                      ],
                      "id": 1515,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "8914:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1522,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8914:124:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1523,
                  "nodeType": "ExpressionStatement",
                  "src": "8914:124:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1530,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1525,
                          "name": "_endHeight",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1508,
                          "src": "9069:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "32303135",
                              "id": 1528,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "9100:4:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_2015_by_1",
                                "typeString": "int_const 2015"
                              },
                              "value": "2015"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_2015_by_1",
                                "typeString": "int_const 2015"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "id": 1526,
                              "name": "_startHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1500,
                              "src": "9083:12:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "id": 1527,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "add",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 4365,
                            "src": "9083:16:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                              "typeString": "function (uint256,uint256) pure returns (uint256)"
                            }
                          },
                          "id": 1529,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9083:22:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "9069:36:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4d7573742070726f766964652065786163746c79203120646966666963756c747920706572696f64",
                        "id": 1531,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9119:42:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_67c7c738a8cf54313c844b3267d6767c493dfc5af7d7c931a36a94b2d81f8e3e",
                          "typeString": "literal_string \"Must provide exactly 1 difficulty period\""
                        },
                        "value": "Must provide exactly 1 difficulty period"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_67c7c738a8cf54313c844b3267d6767c493dfc5af7d7c931a36a94b2d81f8e3e",
                          "typeString": "literal_string \"Must provide exactly 1 difficulty period\""
                        }
                      ],
                      "id": 1524,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "9048:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1532,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9048:114:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1533,
                  "nodeType": "ExpressionStatement",
                  "src": "9048:114:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1541,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 1535,
                              "name": "_oldPeriodStartHeader",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1490,
                              "src": "9193:21:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 1536,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "extractDifficulty",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 3864,
                            "src": "9193:39:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (uint256)"
                            }
                          },
                          "id": 1537,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9193:41:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 1538,
                              "name": "_oldPeriodEndHeader",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1492,
                              "src": "9238:19:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 1539,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "extractDifficulty",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 3864,
                            "src": "9238:37:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (uint256)"
                            }
                          },
                          "id": 1540,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9238:39:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "9193:84:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "506572696f642068656164657220646966666963756c7469657320646f206e6f74206d61746368",
                        "id": 1542,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9291:41:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c6456ff224d25c664f0efff0894b66e1bf05b6cd6fdb6e7d6c08db546c000032",
                          "typeString": "literal_string \"Period header difficulties do not match\""
                        },
                        "value": "Period header difficulties do not match"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c6456ff224d25c664f0efff0894b66e1bf05b6cd6fdb6e7d6c08db546c000032",
                          "typeString": "literal_string \"Period header difficulties do not match\""
                        }
                      ],
                      "id": 1534,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "9172:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1543,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9172:161:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1544,
                  "nodeType": "ExpressionStatement",
                  "src": "9172:161:3"
                },
                {
                  "assignments": [
                    1546
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1546,
                      "name": "_newPeriodStart",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "9438:28:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 1545,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "9438:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1552,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 1549,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9484:1:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3830",
                        "id": 1550,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9487:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_80_by_1",
                          "typeString": "int_const 80"
                        },
                        "value": "80"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        {
                          "typeIdentifier": "t_rational_80_by_1",
                          "typeString": "int_const 80"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1547,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1494,
                        "src": "9469:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1548,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "slice",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4133,
                      "src": "9469:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory,uint256,uint256) pure returns (bytes memory)"
                      }
                    },
                    "id": 1551,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9469:21:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory_ptr",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9438:52:3"
                },
                {
                  "assignments": [
                    1554
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1554,
                      "name": "_actualTarget",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "9500:21:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1553,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "9500:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1558,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1555,
                        "name": "_newPeriodStart",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1546,
                        "src": "9524:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1556,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractTarget",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3777,
                      "src": "9524:29:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1557,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9524:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9500:55:3"
                },
                {
                  "assignments": [
                    1560
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1560,
                      "name": "_expectedTarget",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "9565:23:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1559,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "9565:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1573,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1563,
                            "name": "_oldPeriodStartHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1490,
                            "src": "9631:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1564,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "extractTarget",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3777,
                          "src": "9631:35:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (uint256)"
                          }
                        },
                        "id": 1565,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9631:37:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1566,
                            "name": "_oldPeriodStartHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1490,
                            "src": "9682:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1567,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "extractTimestamp",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3850,
                          "src": "9682:38:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (uint32)"
                          }
                        },
                        "id": 1568,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9682:40:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1569,
                            "name": "_oldPeriodEndHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1492,
                            "src": "9736:19:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1570,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "extractTimestamp",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3850,
                          "src": "9736:36:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (uint32)"
                          }
                        },
                        "id": 1571,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9736:38:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        },
                        {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1561,
                        "name": "BTCUtils",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4082,
                        "src": "9591:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_BTCUtils_$4082_$",
                          "typeString": "type(library BTCUtils)"
                        }
                      },
                      "id": 1562,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "retargetAlgorithm",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4081,
                      "src": "9591:26:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 1572,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9591:193:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9565:219:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1580,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "components": [
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 1577,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "id": 1575,
                                "name": "_actualTarget",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1554,
                                "src": "9816:13:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "&",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 1576,
                                "name": "_expectedTarget",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1560,
                                "src": "9832:15:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "src": "9816:31:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "id": 1578,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "9815:33:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1579,
                          "name": "_actualTarget",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1554,
                          "src": "9852:13:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "9815:50:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "496e76616c69642072657461726765742070726f7669646564",
                        "id": 1581,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9879:27:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_88fb068d9d9bb4cb430555f47426ce90db05a008971325835664896da5946718",
                          "typeString": "literal_string \"Invalid retarget provided\""
                        },
                        "value": "Invalid retarget provided"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_88fb068d9d9bb4cb430555f47426ce90db05a008971325835664896da5946718",
                          "typeString": "literal_string \"Invalid retarget provided\""
                        }
                      ],
                      "id": 1574,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "9794:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1582,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9794:113:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1583,
                  "nodeType": "ExpressionStatement",
                  "src": "9794:113:3"
                },
                {
                  "assignments": [
                    1585
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1585,
                      "name": "_oldDiff",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "10117:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1584,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "10117:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1589,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1586,
                        "name": "_oldPeriodStartHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1490,
                        "src": "10136:21:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1587,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractDifficulty",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3864,
                      "src": "10136:39:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1588,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10136:41:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10117:60:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 1601,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1592,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1590,
                        "name": "prevEpochDiff",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1201,
                        "src": "10191:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "!=",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1591,
                        "name": "_oldDiff",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1585,
                        "src": "10208:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "10191:25:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1600,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1593,
                        "name": "_endHeight",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1508,
                        "src": "10220:10:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": ">",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 1598,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10266:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1595,
                                "name": "bestKnownDigest",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1187,
                                "src": "10245:15:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              ],
                              "id": 1594,
                              "name": "_findHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1676,
                              "src": "10233:11:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                                "typeString": "function (bytes32) view returns (uint256)"
                              }
                            },
                            "id": 1596,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10233:28:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1597,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "sub",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4340,
                          "src": "10233:32:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1599,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10233:38:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "10220:51:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "10191:80:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1607,
                  "nodeType": "IfStatement",
                  "src": "10187:133:3",
                  "trueBody": {
                    "id": 1606,
                    "nodeType": "Block",
                    "src": "10273:47:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1604,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1602,
                            "name": "prevEpochDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1201,
                            "src": "10285:13:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 1603,
                            "name": "_oldDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1585,
                            "src": "10301:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10285:24:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1605,
                        "nodeType": "ExpressionStatement",
                        "src": "10285:24:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1609,
                        "name": "_oldPeriodEndHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1492,
                        "src": "10403:19:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1610,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1494,
                        "src": "10424:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "74727565",
                        "id": 1611,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "bool",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10434:4:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "value": "true"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1608,
                      "name": "_addHeaders",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1454,
                      "src": "10391:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_bool_$returns$_t_bool_$",
                        "typeString": "function (bytes memory,bytes memory,bool) returns (bool)"
                      }
                    },
                    "id": 1612,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10391:48:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1498,
                  "id": 1613,
                  "nodeType": "Return",
                  "src": "10384:55:3"
                }
              ]
            },
            "documentation": "@notice                       Adds headers to storage, performs additional validation of retarget\n @dev                          Checks the retarget, the heights, and the linkage\n @param  _oldPeriodStartHeader The first header in the difficulty period being closed\n @param  _oldPeriodEndHeader   The last header in the difficulty period being closed\n @param  _headers              A tightly-packed list of 80-byte Bitcoin headers\n @return                       True if successfully written, error otherwise",
            "id": 1615,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_addHeadersWithRetarget",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1495,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1490,
                  "name": "_oldPeriodStartHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8495:34:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1489,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "8495:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1492,
                  "name": "_oldPeriodEndHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8539:32:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1491,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "8539:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1494,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8581:21:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1493,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "8581:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8485:123:3"
            },
            "returnParameters": {
              "id": 1498,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1497,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8627:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1496,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "8627:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8626:6:3"
            },
            "scope": 2252,
            "src": "8453:1993:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1675,
              "nodeType": "Block",
              "src": "10753:387:3",
              "statements": [
                {
                  "assignments": [
                    1623
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1623,
                      "name": "_height",
                      "nodeType": "VariableDeclaration",
                      "scope": 1675,
                      "src": "10763:15:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1622,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "10763:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1625,
                  "initialValue": {
                    "argumentTypes": null,
                    "hexValue": "30",
                    "id": 1624,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "number",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "10781:1:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_rational_0_by_1",
                      "typeString": "int_const 0"
                    },
                    "value": "0"
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10763:19:3"
                },
                {
                  "assignments": [
                    1627
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1627,
                      "name": "_current",
                      "nodeType": "VariableDeclaration",
                      "scope": 1675,
                      "src": "10792:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1626,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "10792:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1629,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1628,
                    "name": "_digest",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1617,
                    "src": "10811:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10792:26:3"
                },
                {
                  "body": {
                    "id": 1669,
                    "nodeType": "Block",
                    "src": "10887:214:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1650,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1646,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1623,
                            "src": "10901:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1647,
                              "name": "blockHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1197,
                              "src": "10911:11:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                                "typeString": "mapping(bytes32 => uint256)"
                              }
                            },
                            "id": 1649,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1648,
                              "name": "_current",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1627,
                              "src": "10923:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "10911:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10901:31:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1651,
                        "nodeType": "ExpressionStatement",
                        "src": "10901:31:3"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1654,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1652,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1623,
                            "src": "10950:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1653,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10961:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "10950:12:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": {
                          "id": 1667,
                          "nodeType": "Block",
                          "src": "11037:54:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 1664,
                                    "name": "i",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1631,
                                    "src": "11074:1:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1662,
                                    "name": "_height",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1623,
                                    "src": "11062:7:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "id": 1663,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "add",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4365,
                                  "src": "11062:11:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 1665,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "11062:14:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "functionReturnParameters": 1621,
                              "id": 1666,
                              "nodeType": "Return",
                              "src": "11055:21:3"
                            }
                          ]
                        },
                        "id": 1668,
                        "nodeType": "IfStatement",
                        "src": "10946:145:3",
                        "trueBody": {
                          "id": 1661,
                          "nodeType": "Block",
                          "src": "10964:67:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1659,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 1655,
                                  "name": "_current",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1627,
                                  "src": "10982:8:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 1656,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "10993:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 1658,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 1657,
                                    "name": "_current",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1627,
                                    "src": "11007:8:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "nodeType": "IndexAccess",
                                  "src": "10993:23:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "10982:34:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1660,
                              "nodeType": "ExpressionStatement",
                              "src": "10982:34:3"
                            }
                          ]
                        }
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1638,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1634,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1631,
                      "src": "10848:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint32",
                        "typeString": "uint32"
                      },
                      "id": 1637,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1635,
                        "name": "HEIGHT_INTERVAL",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1183,
                        "src": "10852:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "31",
                        "id": 1636,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10870:1:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_1_by_1",
                          "typeString": "int_const 1"
                        },
                        "value": "1"
                      },
                      "src": "10852:19:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint32",
                        "typeString": "uint32"
                      }
                    },
                    "src": "10848:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1670,
                  "initializationExpression": {
                    "assignments": [
                      1631
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1631,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1670,
                        "src": "10833:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1630,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "10833:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1633,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1632,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "10845:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "10833:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1644,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1639,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1631,
                        "src": "10873:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1642,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10883:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1640,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1631,
                            "src": "10877:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1641,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "10877:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1643,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10877:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "10873:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1645,
                    "nodeType": "ExpressionStatement",
                    "src": "10873:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "10828:273:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "556e6b6e6f776e20626c6f636b",
                        "id": 1672,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "11117:15:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_2fe269f479def214aa4213fc5a3676b42da06f3fe6bec66494b82d7cb74589b0",
                          "typeString": "literal_string \"Unknown block\""
                        },
                        "value": "Unknown block"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_stringliteral_2fe269f479def214aa4213fc5a3676b42da06f3fe6bec66494b82d7cb74589b0",
                          "typeString": "literal_string \"Unknown block\""
                        }
                      ],
                      "id": 1671,
                      "name": "revert",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5028,
                        5029
                      ],
                      "referencedDeclaration": 5029,
                      "src": "11110:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (string memory) pure"
                      }
                    },
                    "id": 1673,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "11110:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1674,
                  "nodeType": "ExpressionStatement",
                  "src": "11110:23:3"
                }
              ]
            },
            "documentation": "@notice         Finds the height of a header by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header",
            "id": 1676,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_findHeight",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1618,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1617,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1676,
                  "src": "10704:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1616,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "10704:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10703:17:3"
            },
            "returnParameters": {
              "id": 1621,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1620,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1676,
                  "src": "10744:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1619,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "10744:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10743:9:3"
            },
            "scope": 2252,
            "src": "10683:457:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1687,
              "nodeType": "Block",
              "src": "11467:44:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1684,
                        "name": "_digest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1678,
                        "src": "11496:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1683,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "11484:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1685,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "11484:20:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 1682,
                  "id": 1686,
                  "nodeType": "Return",
                  "src": "11477:27:3"
                }
              ]
            },
            "documentation": "@notice         Finds the height of a header by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header, or error if unknown",
            "id": 1688,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "findHeight",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1679,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1678,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1688,
                  "src": "11418:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1677,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "11418:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11417:17:3"
            },
            "returnParameters": {
              "id": 1682,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1681,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1688,
                  "src": "11458:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1680,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "11458:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11457:9:3"
            },
            "scope": 2252,
            "src": "11398:113:3",
            "stateMutability": "view",
            "superFunction": 1101,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1734,
              "nodeType": "Block",
              "src": "11859:244:3",
              "statements": [
                {
                  "assignments": [
                    1698
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1698,
                      "name": "_current",
                      "nodeType": "VariableDeclaration",
                      "scope": 1734,
                      "src": "11869:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1697,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "11869:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1700,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1699,
                    "name": "_digest",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1690,
                    "src": "11888:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "11869:26:3"
                },
                {
                  "body": {
                    "id": 1721,
                    "nodeType": "Block",
                    "src": "11952:59:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1719,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1715,
                            "name": "_current",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1698,
                            "src": "11966:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1716,
                              "name": "previousBlock",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1193,
                              "src": "11977:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                "typeString": "mapping(bytes32 => bytes32)"
                              }
                            },
                            "id": 1718,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1717,
                              "name": "_current",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1698,
                              "src": "11991:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "11977:23:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "11966:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1720,
                        "nodeType": "ExpressionStatement",
                        "src": "11966:34:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1707,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1705,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1702,
                      "src": "11925:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1706,
                      "name": "_offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1692,
                      "src": "11929:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "11925:11:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1722,
                  "initializationExpression": {
                    "assignments": [
                      1702
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1702,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1722,
                        "src": "11910:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1701,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "11910:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1704,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1703,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "11922:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "11910:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1713,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1708,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1702,
                        "src": "11938:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1711,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "11948:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1709,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1702,
                            "src": "11942:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1710,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "11942:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1712,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "11942:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "11938:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1714,
                    "nodeType": "ExpressionStatement",
                    "src": "11938:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "11905:106:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1728,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1724,
                          "name": "_current",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1698,
                          "src": "12028:8:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 1726,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "12048:1:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 1725,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "12040:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_bytes32_$",
                              "typeString": "type(bytes32)"
                            },
                            "typeName": "bytes32"
                          },
                          "id": 1727,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "12040:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "12028:22:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "556e6b6e6f776e20616e636573746f72",
                        "id": 1729,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "12052:18:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c461b76bf1480a8b20105a19184a1758b87ce3c97e130df422cacaf91904c3a2",
                          "typeString": "literal_string \"Unknown ancestor\""
                        },
                        "value": "Unknown ancestor"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c461b76bf1480a8b20105a19184a1758b87ce3c97e130df422cacaf91904c3a2",
                          "typeString": "literal_string \"Unknown ancestor\""
                        }
                      ],
                      "id": 1723,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "12020:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1730,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "12020:51:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1731,
                  "nodeType": "ExpressionStatement",
                  "src": "12020:51:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1732,
                    "name": "_current",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1698,
                    "src": "12088:8:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 1696,
                  "id": 1733,
                  "nodeType": "Return",
                  "src": "12081:15:3"
                }
              ]
            },
            "documentation": "@notice         Finds an ancestor for a block by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header, or error if unknown",
            "id": 1735,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_findAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1693,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1690,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1735,
                  "src": "11793:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1689,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "11793:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1692,
                  "name": "_offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1735,
                  "src": "11810:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1691,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "11810:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11792:34:3"
            },
            "returnParameters": {
              "id": 1696,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1695,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1735,
                  "src": "11850:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1694,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "11850:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11849:9:3"
            },
            "scope": 2252,
            "src": "11770:333:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1749,
              "nodeType": "Block",
              "src": "12450:55:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1745,
                        "name": "_digest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1737,
                        "src": "12481:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1746,
                        "name": "_offset",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1739,
                        "src": "12490:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 1744,
                      "name": "_findAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1735,
                      "src": "12467:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_bytes32_$",
                        "typeString": "function (bytes32,uint256) view returns (bytes32)"
                      }
                    },
                    "id": 1747,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "12467:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 1743,
                  "id": 1748,
                  "nodeType": "Return",
                  "src": "12460:38:3"
                }
              ]
            },
            "documentation": "@notice         Finds an ancestor for a block by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header, or error if unknown",
            "id": 1750,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "findAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1740,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1737,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1750,
                  "src": "12384:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1736,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "12384:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1739,
                  "name": "_offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1750,
                  "src": "12401:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1738,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "12401:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "12383:34:3"
            },
            "returnParameters": {
              "id": 1743,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1742,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1750,
                  "src": "12441:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1741,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "12441:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "12440:9:3"
            },
            "scope": 2252,
            "src": "12362:143:3",
            "stateMutability": "view",
            "superFunction": 1110,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1796,
              "nodeType": "Block",
              "src": "13066:332:3",
              "statements": [
                {
                  "assignments": [
                    1762
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1762,
                      "name": "_current",
                      "nodeType": "VariableDeclaration",
                      "scope": 1796,
                      "src": "13076:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1761,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "13076:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1764,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1763,
                    "name": "_descendant",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1754,
                    "src": "13095:11:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "13076:30:3"
                },
                {
                  "body": {
                    "id": 1792,
                    "nodeType": "Block",
                    "src": "13227:143:3",
                    "statements": [
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1781,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1779,
                            "name": "_current",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1762,
                            "src": "13245:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1780,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1752,
                            "src": "13257:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "13245:21:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 1785,
                        "nodeType": "IfStatement",
                        "src": "13241:71:3",
                        "trueBody": {
                          "id": 1784,
                          "nodeType": "Block",
                          "src": "13268:44:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "hexValue": "74727565",
                                "id": 1782,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "bool",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "13293:4:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                },
                                "value": "true"
                              },
                              "functionReturnParameters": 1760,
                              "id": 1783,
                              "nodeType": "Return",
                              "src": "13286:11:3"
                            }
                          ]
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1790,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1786,
                            "name": "_current",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1762,
                            "src": "13325:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1787,
                              "name": "previousBlock",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1193,
                              "src": "13336:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                "typeString": "mapping(bytes32 => bytes32)"
                              }
                            },
                            "id": 1789,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1788,
                              "name": "_current",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1762,
                              "src": "13350:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "13336:23:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "13325:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1791,
                        "nodeType": "ExpressionStatement",
                        "src": "13325:34:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1771,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1769,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1766,
                      "src": "13201:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1770,
                      "name": "_limit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1756,
                      "src": "13205:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "13201:10:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1793,
                  "initializationExpression": {
                    "assignments": [
                      1766
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1766,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1793,
                        "src": "13186:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1765,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "13186:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1768,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1767,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "13198:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "13186:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1777,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1772,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1766,
                        "src": "13213:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1775,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "13223:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1773,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1766,
                            "src": "13217:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1774,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "13217:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1776,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "13217:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "13213:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1778,
                    "nodeType": "ExpressionStatement",
                    "src": "13213:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "13181:189:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "66616c7365",
                    "id": 1794,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "13386:5:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "false"
                  },
                  "functionReturnParameters": 1760,
                  "id": 1795,
                  "nodeType": "Return",
                  "src": "13379:12:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective ancestor\n @param _descendant  The descendant to check\n @param _limit       The maximum number of blocks to check\n @return             true if ancestor is at most limit blocks lower than descendant, otherwise false",
            "id": 1797,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_isAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1757,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1752,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "12981:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1751,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "12981:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1754,
                  "name": "_descendant",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "13000:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1753,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "13000:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1756,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "13021:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1755,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "13021:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "12980:56:3"
            },
            "returnParameters": {
              "id": 1760,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1759,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "13060:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1758,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "13060:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "13059:6:3"
            },
            "scope": 2252,
            "src": "12960:438:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1814,
              "nodeType": "Block",
              "src": "13958:67:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1809,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1799,
                        "src": "13987:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1810,
                        "name": "_descendant",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1801,
                        "src": "13998:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1811,
                        "name": "_limit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1803,
                        "src": "14011:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 1808,
                      "name": "_isAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1797,
                      "src": "13975:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes32_$_t_uint256_$returns$_t_bool_$",
                        "typeString": "function (bytes32,bytes32,uint256) view returns (bool)"
                      }
                    },
                    "id": 1812,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "13975:43:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1807,
                  "id": 1813,
                  "nodeType": "Return",
                  "src": "13968:50:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective ancestor\n @param _descendant  The descendant to check\n @param _limit       The maximum number of blocks to check\n @return             true if ancestor is at most limit blocks lower than descendant, otherwise false",
            "id": 1815,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "isAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1804,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1799,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13873:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1798,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "13873:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1801,
                  "name": "_descendant",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13892:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1800,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "13892:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1803,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13913:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1802,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "13913:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "13872:56:3"
            },
            "returnParameters": {
              "id": 1807,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1806,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13952:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1805,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "13952:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "13951:6:3"
            },
            "scope": 2252,
            "src": "13853:172:3",
            "stateMutability": "view",
            "superFunction": 1121,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1910,
              "nodeType": "Block",
              "src": "14791:1023:3",
              "statements": [
                {
                  "assignments": [
                    1829
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1829,
                      "name": "_newBestDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1910,
                      "src": "14801:22:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1828,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "14801:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1833,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1830,
                        "name": "_newBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1821,
                        "src": "14826:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1831,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "14826:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1832,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "14826:18:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "14801:43:3"
                },
                {
                  "assignments": [
                    1835
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1835,
                      "name": "_currentBestDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1910,
                      "src": "14854:26:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1834,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "14854:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1839,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1836,
                        "name": "_currentBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1819,
                        "src": "14883:12:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1837,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "14883:20:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1838,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "14883:22:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "14854:51:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1843,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1841,
                          "name": "_currentBestDigest",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1835,
                          "src": "14923:18:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1842,
                          "name": "bestKnownDigest",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1187,
                          "src": "14945:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "14923:37:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "50617373656420696e2062657374206973206e6f742062657374206b6e6f776e",
                        "id": 1844,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "14962:34:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_08d40782ec860529d1a49d4deccf329d686c48a4affb967e8f3fe896477d9012",
                          "typeString": "literal_string \"Passed in best is not best known\""
                        },
                        "value": "Passed in best is not best known"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_08d40782ec860529d1a49d4deccf329d686c48a4affb967e8f3fe896477d9012",
                          "typeString": "literal_string \"Passed in best is not best known\""
                        }
                      ],
                      "id": 1840,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "14915:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1845,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "14915:82:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1846,
                  "nodeType": "ExpressionStatement",
                  "src": "14915:82:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1854,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1848,
                            "name": "previousBlock",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1193,
                            "src": "15028:13:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                              "typeString": "mapping(bytes32 => bytes32)"
                            }
                          },
                          "id": 1850,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1849,
                            "name": "_newBestDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1829,
                            "src": "15042:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "15028:29:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 1852,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "15069:1:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 1851,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "15061:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_bytes32_$",
                              "typeString": "type(bytes32)"
                            },
                            "typeName": "bytes32"
                          },
                          "id": 1853,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "15061:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "15028:43:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4e6577206265737420697320756e6b6e6f776e",
                        "id": 1855,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "15085:21:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_21175d40c2ebef79a732817277d464b099ad41722534bb4c1a81ec30c878b42d",
                          "typeString": "literal_string \"New best is unknown\""
                        },
                        "value": "New best is unknown"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_21175d40c2ebef79a732817277d464b099ad41722534bb4c1a81ec30c878b42d",
                          "typeString": "literal_string \"New best is unknown\""
                        }
                      ],
                      "id": 1847,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "15007:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1856,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15007:100:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1857,
                  "nodeType": "ExpressionStatement",
                  "src": "15007:100:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1860,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1817,
                            "src": "15160:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          {
                            "argumentTypes": null,
                            "id": 1861,
                            "name": "bestKnownDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1187,
                            "src": "15171:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          {
                            "argumentTypes": null,
                            "id": 1862,
                            "name": "_newBestDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1829,
                            "src": "15188:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          {
                            "argumentTypes": null,
                            "id": 1863,
                            "name": "_limit",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1823,
                            "src": "15204:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            },
                            {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            },
                            {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            },
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 1859,
                          "name": "_isMostRecentAncestor",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2035,
                          "src": "15138:21:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes32_$_t_bytes32_$_t_uint256_$returns$_t_bool_$",
                            "typeString": "function (bytes32,bytes32,bytes32,uint256) view returns (bool)"
                          }
                        },
                        "id": 1864,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "15138:73:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "416e636573746f72206d75737420626520686561766965737420636f6d6d6f6e20616e636573746f72",
                        "id": 1865,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "15225:43:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_fcaf5361cb1b11aa6567d172fd21d0d1e008d17e89623abf194305ef538c3052",
                          "typeString": "literal_string \"Ancestor must be heaviest common ancestor\""
                        },
                        "value": "Ancestor must be heaviest common ancestor"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_fcaf5361cb1b11aa6567d172fd21d0d1e008d17e89623abf194305ef538c3052",
                          "typeString": "literal_string \"Ancestor must be heaviest common ancestor\""
                        }
                      ],
                      "id": 1858,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "15117:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1866,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15117:152:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1867,
                  "nodeType": "ExpressionStatement",
                  "src": "15117:152:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1875,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1870,
                              "name": "_ancestor",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1817,
                              "src": "15322:9:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 1871,
                              "name": "_currentBest",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1819,
                              "src": "15333:12:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 1872,
                              "name": "_newBest",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1821,
                              "src": "15347:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              },
                              {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              },
                              {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            ],
                            "id": 1869,
                            "name": "_heaviestFromAncestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2193,
                            "src": "15300:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
                              "typeString": "function (bytes32,bytes memory,bytes memory) view returns (bytes32)"
                            }
                          },
                          "id": 1873,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "15300:56:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1874,
                          "name": "_newBestDigest",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1829,
                          "src": "15360:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "15300:74:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4e65772062657374206861736820646f6573206e6f742068617665206d6f726520776f726b207468616e2070726576696f7573",
                        "id": 1876,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "15388:53:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_9fd7a9403f83332e39cd942cb934228aad1aa94f9f120f93fcbad363acc5034e",
                          "typeString": "literal_string \"New best hash does not have more work than previous\""
                        },
                        "value": "New best hash does not have more work than previous"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_9fd7a9403f83332e39cd942cb934228aad1aa94f9f120f93fcbad363acc5034e",
                          "typeString": "literal_string \"New best hash does not have more work than previous\""
                        }
                      ],
                      "id": 1868,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "15279:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1877,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15279:163:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1878,
                  "nodeType": "ExpressionStatement",
                  "src": "15279:163:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1881,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1879,
                      "name": "bestKnownDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1187,
                      "src": "15453:15:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1880,
                      "name": "_newBestDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1829,
                      "src": "15471:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "15453:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1882,
                  "nodeType": "ExpressionStatement",
                  "src": "15453:32:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1885,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1883,
                      "name": "lastReorgCommonAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1189,
                      "src": "15495:23:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1884,
                      "name": "_ancestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1817,
                      "src": "15521:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "15495:35:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1886,
                  "nodeType": "ExpressionStatement",
                  "src": "15495:35:3"
                },
                {
                  "assignments": [
                    1888
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1888,
                      "name": "_newDiff",
                      "nodeType": "VariableDeclaration",
                      "scope": 1910,
                      "src": "15541:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1887,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "15541:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1892,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1889,
                        "name": "_newBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1821,
                        "src": "15560:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1890,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractDifficulty",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3864,
                      "src": "15560:26:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1891,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15560:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "15541:47:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1895,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1893,
                      "name": "_newDiff",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1888,
                      "src": "15602:8:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1894,
                      "name": "currentEpochDiff",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1199,
                      "src": "15614:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "15602:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1901,
                  "nodeType": "IfStatement",
                  "src": "15598:84:3",
                  "trueBody": {
                    "id": 1900,
                    "nodeType": "Block",
                    "src": "15632:50:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1898,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1896,
                            "name": "currentEpochDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1199,
                            "src": "15644:16:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 1897,
                            "name": "_newDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1888,
                            "src": "15663:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "15644:27:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1899,
                        "nodeType": "ExpressionStatement",
                        "src": "15644:27:3"
                      }
                    ]
                  }
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1903,
                        "name": "_currentBestDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1835,
                        "src": "15716:18:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1904,
                        "name": "_newBestDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1829,
                        "src": "15748:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1905,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1817,
                        "src": "15776:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1902,
                      "name": "Reorg",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1056,
                      "src": "15697:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$_t_bytes32_$returns$__$",
                        "typeString": "function (bytes32,bytes32,bytes32)"
                      }
                    },
                    "id": 1906,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15697:89:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1907,
                  "nodeType": "EmitStatement",
                  "src": "15692:94:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "74727565",
                    "id": 1908,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "15803:4:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "true"
                  },
                  "functionReturnParameters": 1827,
                  "id": 1909,
                  "nodeType": "Return",
                  "src": "15796:11:3"
                }
              ]
            },
            "documentation": "@notice                   Gives a starting point for the relay\n @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n @param  _ancestor         The digest of the most recent common ancestor\n @param  _currentBest      The 80-byte header referenced by bestKnownDigest\n @param  _newBest          The 80-byte header to mark as the new best\n @param  _limit            Limit the amount of traversal of the chain\n @return                   True if successfully updates bestKnownDigest, error otherwise",
            "id": 1911,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_markNewHeaviest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1824,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1817,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14653:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1816,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "14653:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1819,
                  "name": "_currentBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14680:25:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1818,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "14680:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1821,
                  "name": "_newBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14715:21:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1820,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "14715:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1823,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14746:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1822,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "14746:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "14643:123:3"
            },
            "returnParameters": {
              "id": 1827,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1826,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14785:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1825,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "14785:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "14784:6:3"
            },
            "scope": 2252,
            "src": "14618:1196:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1931,
              "nodeType": "Block",
              "src": "16583:83:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1925,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1913,
                        "src": "16617:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1926,
                        "name": "_currentBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1915,
                        "src": "16628:12:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1927,
                        "name": "_newBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1917,
                        "src": "16642:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1928,
                        "name": "_limit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1919,
                        "src": "16652:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 1924,
                      "name": "_markNewHeaviest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1911,
                      "src": "16600:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bool_$",
                        "typeString": "function (bytes32,bytes memory,bytes memory,uint256) returns (bool)"
                      }
                    },
                    "id": 1929,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "16600:59:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1923,
                  "id": 1930,
                  "nodeType": "Return",
                  "src": "16593:66:3"
                }
              ]
            },
            "documentation": "@notice                   Gives a starting point for the relay\n @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n @param  _ancestor         The digest of the most recent common ancestor\n @param  _currentBest      The 80-byte header referenced by bestKnownDigest\n @param  _newBest          The 80-byte header to mark as the new best\n @param  _limit            Limit the amount of traversal of the chain\n @return                   True if successfully updates bestKnownDigest, error otherwise",
            "id": 1932,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "markNewHeaviest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1920,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1913,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16441:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1912,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "16441:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1915,
                  "name": "_currentBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16468:27:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1914,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "16468:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1917,
                  "name": "_newBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16505:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1916,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "16505:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1919,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16538:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1918,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "16538:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "16431:127:3"
            },
            "returnParameters": {
              "id": 1923,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1922,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16577:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1921,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "16577:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "16576:6:3"
            },
            "scope": 2252,
            "src": "16407:259:3",
            "stateMutability": "nonpayable",
            "superFunction": 1165,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2034,
              "nodeType": "Block",
              "src": "17317:918:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 1951,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 1947,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1945,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1934,
                        "src": "17362:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "==",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1946,
                        "name": "_left",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1936,
                        "src": "17375:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "src": "17362:18:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 1950,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1948,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1934,
                        "src": "17384:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "==",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1949,
                        "name": "_right",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1938,
                        "src": "17397:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "src": "17384:19:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "17362:41:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1955,
                  "nodeType": "IfStatement",
                  "src": "17358:83:3",
                  "trueBody": {
                    "id": 1954,
                    "nodeType": "Block",
                    "src": "17405:36:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "hexValue": "74727565",
                          "id": 1952,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "bool",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "17426:4:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "value": "true"
                        },
                        "functionReturnParameters": 1944,
                        "id": 1953,
                        "nodeType": "Return",
                        "src": "17419:11:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    1957
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1957,
                      "name": "_leftCurrent",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17451:20:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1956,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17451:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1959,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1958,
                    "name": "_left",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1936,
                    "src": "17474:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17451:28:3"
                },
                {
                  "assignments": [
                    1961
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1961,
                      "name": "_rightCurrent",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17489:21:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1960,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17489:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1963,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1962,
                    "name": "_right",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1938,
                    "src": "17513:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17489:30:3"
                },
                {
                  "assignments": [
                    1965
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1965,
                      "name": "_leftPrev",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17529:17:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1964,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17529:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1967,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1966,
                    "name": "_left",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1936,
                    "src": "17549:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17529:25:3"
                },
                {
                  "assignments": [
                    1969
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1969,
                      "name": "_rightPrev",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17564:18:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1968,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17564:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1971,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1970,
                    "name": "_right",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1938,
                    "src": "17585:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17564:27:3"
                },
                {
                  "body": {
                    "id": 2016,
                    "nodeType": "Block",
                    "src": "17647:368:3",
                    "statements": [
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1988,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1986,
                            "name": "_leftPrev",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1965,
                            "src": "17665:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "!=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1987,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1934,
                            "src": "17678:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "17665:22:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 2000,
                        "nodeType": "IfStatement",
                        "src": "17661:163:3",
                        "trueBody": {
                          "id": 1999,
                          "nodeType": "Block",
                          "src": "17689:135:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1991,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 1989,
                                  "name": "_leftCurrent",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1957,
                                  "src": "17707:12:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "id": 1990,
                                  "name": "_leftPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1965,
                                  "src": "17722:9:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17707:24:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1992,
                              "nodeType": "ExpressionStatement",
                              "src": "17707:24:3"
                            },
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1997,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 1993,
                                  "name": "_leftPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1965,
                                  "src": "17759:9:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 1994,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "17771:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 1996,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 1995,
                                    "name": "_leftPrev",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1965,
                                    "src": "17785:9:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "nodeType": "IndexAccess",
                                  "src": "17771:24:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17759:36:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1998,
                              "nodeType": "ExpressionStatement",
                              "src": "17759:36:3"
                            }
                          ]
                        }
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 2003,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2001,
                            "name": "_rightPrev",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1969,
                            "src": "17841:10:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "!=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2002,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1934,
                            "src": "17855:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "17841:23:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 2015,
                        "nodeType": "IfStatement",
                        "src": "17837:168:3",
                        "trueBody": {
                          "id": 2014,
                          "nodeType": "Block",
                          "src": "17866:139:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 2006,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 2004,
                                  "name": "_rightCurrent",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1961,
                                  "src": "17884:13:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "id": 2005,
                                  "name": "_rightPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1969,
                                  "src": "17900:10:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17884:26:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 2007,
                              "nodeType": "ExpressionStatement",
                              "src": "17884:26:3"
                            },
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 2012,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 2008,
                                  "name": "_rightPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1969,
                                  "src": "17938:10:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 2009,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "17951:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 2011,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 2010,
                                    "name": "_rightPrev",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1969,
                                    "src": "17965:10:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "nodeType": "IndexAccess",
                                  "src": "17951:25:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17938:38:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 2013,
                              "nodeType": "ExpressionStatement",
                              "src": "17938:38:3"
                            }
                          ]
                        }
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1978,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1976,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1973,
                      "src": "17621:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1977,
                      "name": "_limit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1940,
                      "src": "17625:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "17621:10:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 2017,
                  "initializationExpression": {
                    "assignments": [
                      1973
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1973,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 2017,
                        "src": "17606:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1972,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "17606:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1975,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1974,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "17618:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "17606:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1984,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1979,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1973,
                        "src": "17633:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1982,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "17643:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1980,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1973,
                            "src": "17637:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1981,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "17637:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1983,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "17637:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "17633:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1985,
                    "nodeType": "ExpressionStatement",
                    "src": "17633:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "17602:413:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    },
                    "id": 2020,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2018,
                      "name": "_leftCurrent",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1957,
                      "src": "18028:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2019,
                      "name": "_rightCurrent",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1961,
                      "src": "18044:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "18028:29:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2024,
                  "nodeType": "IfStatement",
                  "src": "18024:50:3",
                  "trueBody": {
                    "id": 2023,
                    "nodeType": "Block",
                    "src": "18059:15:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "hexValue": "66616c7365",
                          "id": 2021,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "bool",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "18067:5:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "value": "false"
                        },
                        "functionReturnParameters": 1944,
                        "id": 2022,
                        "nodeType": "Return",
                        "src": "18060:12:3"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    },
                    "id": 2027,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2025,
                      "name": "_leftPrev",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1965,
                      "src": "18136:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2026,
                      "name": "_rightPrev",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1969,
                      "src": "18149:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "18136:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2031,
                  "nodeType": "IfStatement",
                  "src": "18132:44:3",
                  "trueBody": {
                    "id": 2030,
                    "nodeType": "Block",
                    "src": "18161:15:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "hexValue": "66616c7365",
                          "id": 2028,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "bool",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "18169:5:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "value": "false"
                        },
                        "functionReturnParameters": 1944,
                        "id": 2029,
                        "nodeType": "Return",
                        "src": "18162:12:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "74727565",
                    "id": 2032,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "18224:4:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "true"
                  },
                  "functionReturnParameters": 1944,
                  "id": 2033,
                  "nodeType": "Return",
                  "src": "18217:11:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @param _limit       The maximum number of blocks to check\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2035,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_isMostRecentAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1941,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1934,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17193:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1933,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "17193:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1936,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17220:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1935,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "17220:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1938,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17243:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1937,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "17243:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1940,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17267:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1939,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "17267:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "17183:104:3"
            },
            "returnParameters": {
              "id": 1944,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1943,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17311:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1942,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "17311:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "17310:6:3"
            },
            "scope": 2252,
            "src": "17153:1082:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 2055,
              "nodeType": "Block",
              "src": "18885:79:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2049,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2037,
                        "src": "18924:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2050,
                        "name": "_left",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2039,
                        "src": "18935:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2051,
                        "name": "_right",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2041,
                        "src": "18942:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2052,
                        "name": "_limit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2043,
                        "src": "18950:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 2048,
                      "name": "_isMostRecentAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2035,
                      "src": "18902:21:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes32_$_t_bytes32_$_t_uint256_$returns$_t_bool_$",
                        "typeString": "function (bytes32,bytes32,bytes32,uint256) view returns (bool)"
                      }
                    },
                    "id": 2053,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "18902:55:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 2047,
                  "id": 2054,
                  "nodeType": "Return",
                  "src": "18895:62:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @param _limit       The maximum number of blocks to check\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2056,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "isMostRecentAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2044,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2037,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18761:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2036,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "18761:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2039,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18788:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2038,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "18788:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2041,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18811:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2040,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "18811:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2043,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18835:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2042,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "18835:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "18751:104:3"
            },
            "returnParameters": {
              "id": 2047,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2046,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18879:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 2045,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "18879:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "18878:6:3"
            },
            "scope": 2252,
            "src": "18722:242:3",
            "stateMutability": "view",
            "superFunction": 1069,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2192,
              "nodeType": "Block",
              "src": "19520:1615:3",
              "statements": [
                {
                  "assignments": [
                    2068
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2068,
                      "name": "_ancestorHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19530:23:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2067,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19530:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2072,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2070,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2058,
                        "src": "19568:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 2069,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "19556:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 2071,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19556:22:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19530:48:3"
                },
                {
                  "assignments": [
                    2074
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2074,
                      "name": "_leftHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19588:19:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2073,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19588:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2080,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2076,
                            "name": "_left",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2060,
                            "src": "19622:5:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 2077,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "19622:13:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 2078,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "19622:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 2075,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "19610:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 2079,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19610:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19588:50:3"
                },
                {
                  "assignments": [
                    2082
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2082,
                      "name": "_rightHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19648:20:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2081,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19648:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2088,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2084,
                            "name": "_right",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2062,
                            "src": "19683:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 2085,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "19683:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 2086,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "19683:16:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 2083,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "19671:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 2087,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19671:29:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19648:52:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 2096,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2092,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2090,
                            "name": "_leftHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2074,
                            "src": "19732:11:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2091,
                            "name": "_ancestorHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2068,
                            "src": "19747:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "19732:30:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2095,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2093,
                            "name": "_rightHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2082,
                            "src": "19766:12:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2094,
                            "name": "_ancestorHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2068,
                            "src": "19782:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "19766:31:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "19732:65:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "412064657363656e64616e74206865696768742069732062656c6f772074686520616e636573746f7220686569676874",
                        "id": 2097,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "19811:50:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_b58061f6326ff3d0324de253af04d745211e5ff4898fed03b468cbd3387ef7f2",
                          "typeString": "literal_string \"A descendant height is below the ancestor height\""
                        },
                        "value": "A descendant height is below the ancestor height"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_b58061f6326ff3d0324de253af04d745211e5ff4898fed03b468cbd3387ef7f2",
                          "typeString": "literal_string \"A descendant height is below the ancestor height\""
                        }
                      ],
                      "id": 2089,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "19711:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 2098,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19711:151:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 2099,
                  "nodeType": "ExpressionStatement",
                  "src": "19711:151:3"
                },
                {
                  "assignments": [
                    2101
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2101,
                      "name": "_nextPeriodStartHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19970:30:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2100,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19970:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2111,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 2109,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 2107,
                          "name": "_ancestorHeight",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2068,
                          "src": "20033:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "%",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "32303136",
                          "id": 2108,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "20051:4:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_2016_by_1",
                            "typeString": "int_const 2016"
                          },
                          "value": "2016"
                        },
                        "src": "20033:22:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 2104,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "20023:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2102,
                            "name": "_ancestorHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2068,
                            "src": "20003:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 2103,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "20003:19:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 2105,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "20003:25:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "id": 2106,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "sub",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4340,
                      "src": "20003:29:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                        "typeString": "function (uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 2110,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "20003:53:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19970:86:3"
                },
                {
                  "assignments": [
                    2113
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2113,
                      "name": "_leftInPeriod",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "20066:18:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      },
                      "typeName": {
                        "id": 2112,
                        "name": "bool",
                        "nodeType": "ElementaryTypeName",
                        "src": "20066:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2117,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2116,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2114,
                      "name": "_leftHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2074,
                      "src": "20087:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2115,
                      "name": "_nextPeriodStartHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2101,
                      "src": "20101:22:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "20087:36:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "20066:57:3"
                },
                {
                  "assignments": [
                    2119
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2119,
                      "name": "_rightInPeriod",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "20133:19:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      },
                      "typeName": {
                        "id": 2118,
                        "name": "bool",
                        "nodeType": "ElementaryTypeName",
                        "src": "20133:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2123,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2122,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2120,
                      "name": "_rightHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2082,
                      "src": "20155:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2121,
                      "name": "_nextPeriodStartHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2101,
                      "src": "20170:22:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "20155:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "20133:59:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 2127,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2125,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "!",
                      "prefix": true,
                      "src": "20532:14:3",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2124,
                        "name": "_leftInPeriod",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2113,
                        "src": "20533:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2126,
                      "name": "_rightInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2119,
                      "src": "20550:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "20532:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2133,
                  "nodeType": "IfStatement",
                  "src": "20528:63:3",
                  "trueBody": {
                    "id": 2132,
                    "nodeType": "Block",
                    "src": "20566:25:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 2128,
                              "name": "_left",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2060,
                              "src": "20574:5:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 2129,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "hash256",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2792,
                            "src": "20574:13:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (bytes32)"
                            }
                          },
                          "id": 2130,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "20574:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "functionReturnParameters": 2066,
                        "id": 2131,
                        "nodeType": "Return",
                        "src": "20567:22:3"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 2137,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2134,
                      "name": "_leftInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2113,
                      "src": "20604:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2136,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "!",
                      "prefix": true,
                      "src": "20621:15:3",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2135,
                        "name": "_rightInPeriod",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2119,
                        "src": "20622:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "20604:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2143,
                  "nodeType": "IfStatement",
                  "src": "20600:64:3",
                  "trueBody": {
                    "id": 2142,
                    "nodeType": "Block",
                    "src": "20638:26:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 2138,
                              "name": "_right",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2062,
                              "src": "20646:6:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 2139,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "hash256",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2792,
                            "src": "20646:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (bytes32)"
                            }
                          },
                          "id": 2140,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "20646:16:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "functionReturnParameters": 2066,
                        "id": 2141,
                        "nodeType": "Return",
                        "src": "20639:23:3"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 2146,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2144,
                      "name": "_leftInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2113,
                      "src": "20677:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2145,
                      "name": "_rightInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2119,
                      "src": "20694:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "20677:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 2190,
                    "nodeType": "Block",
                    "src": "20812:317:3",
                    "statements": [
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2178,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "components": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [],
                                    "expression": {
                                      "argumentTypes": [],
                                      "expression": {
                                        "argumentTypes": null,
                                        "id": 2164,
                                        "name": "_left",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 2060,
                                        "src": "20901:5:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_bytes_memory_ptr",
                                          "typeString": "bytes memory"
                                        }
                                      },
                                      "id": 2165,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "memberName": "extractDifficulty",
                                      "nodeType": "MemberAccess",
                                      "referencedDeclaration": 3864,
                                      "src": "20901:23:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                        "typeString": "function (bytes memory) pure returns (uint256)"
                                      }
                                    },
                                    "id": 2166,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "kind": "functionCall",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "20901:25:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "components": [
                                      {
                                        "argumentTypes": null,
                                        "commonType": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        },
                                        "id": 2161,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "id": 2159,
                                          "name": "_leftHeight",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 2074,
                                          "src": "20877:11:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "%",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "hexValue": "32303136",
                                          "id": 2160,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": true,
                                          "kind": "number",
                                          "lValueRequested": false,
                                          "nodeType": "Literal",
                                          "src": "20891:4:3",
                                          "subdenomination": null,
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_rational_2016_by_1",
                                            "typeString": "int_const 2016"
                                          },
                                          "value": "2016"
                                        },
                                        "src": "20877:18:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "id": 2162,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "20876:20:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "id": 2163,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4305,
                                  "src": "20876:24:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 2167,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "20876:51:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "id": 2168,
                            "isConstant": false,
                            "isInlineArray": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "TupleExpression",
                            "src": "20875:53:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "<",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2174,
                                    "name": "_right",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2062,
                                    "src": "20973:6:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 2175,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "extractDifficulty",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3864,
                                  "src": "20973:24:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (uint256)"
                                  }
                                },
                                "id": 2176,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "20973:26:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "components": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 2171,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 2169,
                                      "name": "_rightHeight",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 2082,
                                      "src": "20948:12:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "%",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "hexValue": "32303136",
                                      "id": 2170,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "kind": "number",
                                      "lValueRequested": false,
                                      "nodeType": "Literal",
                                      "src": "20963:4:3",
                                      "subdenomination": null,
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_rational_2016_by_1",
                                        "typeString": "int_const 2016"
                                      },
                                      "value": "2016"
                                    },
                                    "src": "20948:19:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "id": 2172,
                                "isConstant": false,
                                "isInlineArray": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "TupleExpression",
                                "src": "20947:21:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 2173,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "mul",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4305,
                              "src": "20947:25:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 2177,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "20947:53:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "20875:125:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": {
                          "id": 2188,
                          "nodeType": "Block",
                          "src": "21064:55:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2184,
                                    "name": "_left",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2060,
                                    "src": "21089:5:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 2185,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "hash256",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 2792,
                                  "src": "21089:13:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (bytes32)"
                                  }
                                },
                                "id": 2186,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "21089:15:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "functionReturnParameters": 2066,
                              "id": 2187,
                              "nodeType": "Return",
                              "src": "21082:22:3"
                            }
                          ]
                        },
                        "id": 2189,
                        "nodeType": "IfStatement",
                        "src": "20871:248:3",
                        "trueBody": {
                          "id": 2183,
                          "nodeType": "Block",
                          "src": "21002:56:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2179,
                                    "name": "_right",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2062,
                                    "src": "21027:6:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 2180,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "hash256",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 2792,
                                  "src": "21027:14:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (bytes32)"
                                  }
                                },
                                "id": 2181,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "21027:16:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "functionReturnParameters": 2066,
                              "id": 2182,
                              "nodeType": "Return",
                              "src": "21020:23:3"
                            }
                          ]
                        }
                      }
                    ]
                  },
                  "id": 2191,
                  "nodeType": "IfStatement",
                  "src": "20673:456:3",
                  "trueBody": {
                    "id": 2158,
                    "nodeType": "Block",
                    "src": "20710:96:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "condition": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 2149,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 2147,
                              "name": "_leftHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2074,
                              "src": "20731:11:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": ">=",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 2148,
                              "name": "_rightHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2082,
                              "src": "20746:12:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "20731:27:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "falseExpression": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2153,
                                "name": "_right",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2062,
                                "src": "20779:6:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 2154,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "hash256",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2792,
                              "src": "20779:14:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (bytes32)"
                              }
                            },
                            "id": 2155,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "20779:16:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "id": 2156,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "Conditional",
                          "src": "20731:64:3",
                          "trueExpression": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2150,
                                "name": "_left",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2060,
                                "src": "20761:5:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 2151,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "hash256",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2792,
                              "src": "20761:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (bytes32)"
                              }
                            },
                            "id": 2152,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "20761:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "functionReturnParameters": 2066,
                        "id": 2157,
                        "nodeType": "Return",
                        "src": "20724:71:3"
                      }
                    ]
                  }
                }
              ]
            },
            "documentation": "@notice             Decides which header is heaviest from the ancestor\n @dev                Does not support reorgs above 2017 blocks (:\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2193,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_heaviestFromAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2063,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2058,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19407:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2057,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "19407:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2060,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19434:18:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2059,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "19434:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2062,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19462:19:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2061,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "19462:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "19397:90:3"
            },
            "returnParameters": {
              "id": 2066,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2065,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19511:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2064,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "19511:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "19510:9:3"
            },
            "scope": 2252,
            "src": "19367:1768:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 2210,
              "nodeType": "Block",
              "src": "21694:71:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2205,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2195,
                        "src": "21733:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2206,
                        "name": "_left",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2197,
                        "src": "21744:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2207,
                        "name": "_right",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2199,
                        "src": "21751:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      ],
                      "id": 2204,
                      "name": "_heaviestFromAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2193,
                      "src": "21711:21:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
                        "typeString": "function (bytes32,bytes memory,bytes memory) view returns (bytes32)"
                      }
                    },
                    "id": 2208,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "21711:47:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2203,
                  "id": 2209,
                  "nodeType": "Return",
                  "src": "21704:54:3"
                }
              ]
            },
            "documentation": "@notice             Decides which header is heaviest from the ancestor\n @dev                Does not support reorgs above 2017 blocks (:\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2211,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "heaviestFromAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2200,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2195,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21577:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2194,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "21577:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2197,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21604:20:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2196,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "21604:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2199,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21634:21:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2198,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "21634:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "21567:94:3"
            },
            "returnParameters": {
              "id": 2203,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2202,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21685:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2201,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "21685:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "21684:9:3"
            },
            "scope": 2252,
            "src": "21538:227:3",
            "stateMutability": "view",
            "superFunction": 1132,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2218,
              "nodeType": "Block",
              "src": "22023:38:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2216,
                    "name": "currentEpochDiff",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1199,
                    "src": "22038:16:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 2215,
                  "id": 2217,
                  "nodeType": "Return",
                  "src": "22031:23:3"
                }
              ]
            },
            "documentation": "@notice     Getter for currentEpochDiff\n @dev        This is updated when a new heavist header has a new diff\n @return     The difficulty of the bestKnownDigest",
            "id": 2219,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getCurrentEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2212,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "21988:2:3"
            },
            "returnParameters": {
              "id": 2215,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2214,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2219,
                  "src": "22014:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2213,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "22014:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22013:9:3"
            },
            "scope": 2252,
            "src": "21954:107:3",
            "stateMutability": "view",
            "superFunction": 1074,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2226,
              "nodeType": "Block",
              "src": "22307:35:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2224,
                    "name": "prevEpochDiff",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1201,
                    "src": "22322:13:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 2223,
                  "id": 2225,
                  "nodeType": "Return",
                  "src": "22315:20:3"
                }
              ]
            },
            "documentation": "@notice     Getter for prevEpochDiff\n @dev        This is updated when a difficulty change is accepted\n @return     The difficulty of the previous epoch",
            "id": 2227,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getPrevEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2220,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "22272:2:3"
            },
            "returnParameters": {
              "id": 2223,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2222,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2227,
                  "src": "22298:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2221,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "22298:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22297:9:3"
            },
            "scope": 2252,
            "src": "22241:101:3",
            "stateMutability": "view",
            "superFunction": 1079,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2234,
              "nodeType": "Block",
              "src": "22566:36:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2232,
                    "name": "relayGenesis",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1185,
                    "src": "22583:12:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2231,
                  "id": 2233,
                  "nodeType": "Return",
                  "src": "22576:19:3"
                }
              ]
            },
            "documentation": "@notice     Getter for relayGenesis\n @dev        This is an initialization parameter\n @return     The hash of the first block of the relay",
            "id": 2235,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getRelayGenesis",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2228,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "22533:2:3"
            },
            "returnParameters": {
              "id": 2231,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2230,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2235,
                  "src": "22557:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2229,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "22557:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22556:9:3"
            },
            "scope": 2252,
            "src": "22509:93:3",
            "stateMutability": "view",
            "superFunction": 1084,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2242,
              "nodeType": "Block",
              "src": "22838:39:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2240,
                    "name": "bestKnownDigest",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1187,
                    "src": "22855:15:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2239,
                  "id": 2241,
                  "nodeType": "Return",
                  "src": "22848:22:3"
                }
              ]
            },
            "documentation": "@notice     Getter for bestKnownDigest\n @dev        This updated only by calling markNewHeaviest\n @return     The hash of the best marked chain tip",
            "id": 2243,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getBestKnownDigest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2236,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "22805:2:3"
            },
            "returnParameters": {
              "id": 2239,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2238,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2243,
                  "src": "22829:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2237,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "22829:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22828:9:3"
            },
            "scope": 2252,
            "src": "22778:99:3",
            "stateMutability": "view",
            "superFunction": 1089,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2250,
              "nodeType": "Block",
              "src": "23139:47:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2248,
                    "name": "lastReorgCommonAncestor",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1189,
                    "src": "23156:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2247,
                  "id": 2249,
                  "nodeType": "Return",
                  "src": "23149:30:3"
                }
              ]
            },
            "documentation": "@notice     Getter for relayGenesis\n @dev        This is updated only by calling markNewHeaviest\n @return     The hash of the shared ancestor of the most recent fork",
            "id": 2251,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getLastReorgCommonAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2244,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "23106:2:3"
            },
            "returnParameters": {
              "id": 2247,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2246,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2251,
                  "src": "23130:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2245,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "23130:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "23129:9:3"
            },
            "scope": 2252,
            "src": "23071:115:3",
            "stateMutability": "view",
            "superFunction": 1094,
            "visibility": "public"
          }
        ],
        "scope": 2253,
        "src": "2004:21184:3"
      }
    ],
    "src": "0:23189:3"
  },
  "legacyAST": {
    "absolutePath": "/home/james/devel/relays/solidity/contracts/Relay.sol",
    "exportedSymbols": {
      "IRelay": [
        1166
      ],
      "Relay": [
        2252
      ]
    },
    "id": 2253,
    "nodeType": "SourceUnit",
    "nodes": [
      {
        "id": 1034,
        "literals": [
          "solidity",
          "^",
          "0.5",
          ".10"
        ],
        "nodeType": "PragmaDirective",
        "src": "0:24:3"
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/SafeMath.sol",
        "id": 1036,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 4367,
        "src": "88:74:3",
        "symbolAliases": [
          {
            "foreign": 1035,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/BytesLib.sol",
        "id": 1038,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 4270,
        "src": "163:74:3",
        "symbolAliases": [
          {
            "foreign": 1037,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/BTCUtils.sol",
        "id": 1040,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 4083,
        "src": "238:74:3",
        "symbolAliases": [
          {
            "foreign": 1039,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "absolutePath": "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol",
        "file": "@summa-tx/bitcoin-spv-sol/contracts/ValidateSPV.sol",
        "id": 1042,
        "nodeType": "ImportDirective",
        "scope": 2253,
        "sourceUnit": 5009,
        "src": "313:80:3",
        "symbolAliases": [
          {
            "foreign": 1041,
            "local": null
          }
        ],
        "unitAlias": ""
      },
      {
        "baseContracts": [],
        "contractDependencies": [],
        "contractKind": "interface",
        "documentation": null,
        "fullyImplemented": false,
        "id": 1166,
        "linearizedBaseContracts": [
          1166
        ],
        "name": "IRelay",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "anonymous": false,
            "documentation": null,
            "id": 1048,
            "name": "Extension",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 1047,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1044,
                  "indexed": true,
                  "name": "_first",
                  "nodeType": "VariableDeclaration",
                  "scope": 1048,
                  "src": "435:22:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1043,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "435:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1046,
                  "indexed": true,
                  "name": "_last",
                  "nodeType": "VariableDeclaration",
                  "scope": 1048,
                  "src": "459:21:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1045,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "459:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "434:47:3"
            },
            "src": "419:63:3"
          },
          {
            "anonymous": false,
            "documentation": null,
            "id": 1056,
            "name": "Reorg",
            "nodeType": "EventDefinition",
            "parameters": {
              "id": 1055,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1050,
                  "indexed": true,
                  "name": "_from",
                  "nodeType": "VariableDeclaration",
                  "scope": 1056,
                  "src": "499:21:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1049,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "499:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1052,
                  "indexed": true,
                  "name": "_to",
                  "nodeType": "VariableDeclaration",
                  "scope": 1056,
                  "src": "522:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1051,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "522:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1054,
                  "indexed": true,
                  "name": "_gcd",
                  "nodeType": "VariableDeclaration",
                  "scope": 1056,
                  "src": "543:20:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1053,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "543:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "498:66:3"
            },
            "src": "487:78:3"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1069,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "isMostRecentAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1065,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1058,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "610:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1057,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "610:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1060,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "637:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1059,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "637:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1062,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "660:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1061,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "660:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1064,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "684:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1063,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "684:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "600:104:3"
            },
            "returnParameters": {
              "id": 1068,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1067,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1069,
                  "src": "728:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1066,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "728:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "727:6:3"
            },
            "scope": 1166,
            "src": "571:163:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1074,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getCurrentEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1070,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "774:2:3"
            },
            "returnParameters": {
              "id": 1073,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1072,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1074,
                  "src": "800:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1071,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "800:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "799:9:3"
            },
            "scope": 1166,
            "src": "740:69:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1079,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getPrevEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1075,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "845:2:3"
            },
            "returnParameters": {
              "id": 1078,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1077,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1079,
                  "src": "871:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1076,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "871:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "870:9:3"
            },
            "scope": 1166,
            "src": "814:66:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1084,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getRelayGenesis",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1080,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "909:2:3"
            },
            "returnParameters": {
              "id": 1083,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1082,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1084,
                  "src": "935:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1081,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "935:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "934:9:3"
            },
            "scope": 1166,
            "src": "885:59:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1089,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getBestKnownDigest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1085,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "976:2:3"
            },
            "returnParameters": {
              "id": 1088,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1087,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1089,
                  "src": "1002:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1086,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1002:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1001:9:3"
            },
            "scope": 1166,
            "src": "949:62:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1094,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "getLastReorgCommonAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1090,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "1051:2:3"
            },
            "returnParameters": {
              "id": 1093,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1092,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1094,
                  "src": "1077:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1091,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1077:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1076:9:3"
            },
            "scope": 1166,
            "src": "1016:70:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1101,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "findHeight",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1097,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1096,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1101,
                  "src": "1112:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1095,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1112:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1111:17:3"
            },
            "returnParameters": {
              "id": 1100,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1099,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1101,
                  "src": "1152:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1098,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1152:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1151:9:3"
            },
            "scope": 1166,
            "src": "1092:69:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1110,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "findAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1106,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1103,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1110,
                  "src": "1189:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1102,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1189:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1105,
                  "name": "_offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1110,
                  "src": "1206:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1104,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1206:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1188:34:3"
            },
            "returnParameters": {
              "id": 1109,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1108,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1110,
                  "src": "1246:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1107,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1246:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1245:9:3"
            },
            "scope": 1166,
            "src": "1167:88:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1121,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "isAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1117,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1112,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1281:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1111,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1281:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1114,
                  "name": "_descendant",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1300:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1113,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1300:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1116,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1321:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1115,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1321:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1280:56:3"
            },
            "returnParameters": {
              "id": 1120,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1119,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1121,
                  "src": "1360:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1118,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1360:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1359:6:3"
            },
            "scope": 1166,
            "src": "1261:105:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1132,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "heaviestFromAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1128,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1123,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1411:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1122,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1411:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1125,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1438:20:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1124,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1438:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1127,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1468:21:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1126,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1468:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1401:94:3"
            },
            "returnParameters": {
              "id": 1131,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1130,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1132,
                  "src": "1519:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1129,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1519:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1518:9:3"
            },
            "scope": 1166,
            "src": "1372:156:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1141,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "addHeaders",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1137,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1134,
                  "name": "_anchor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1141,
                  "src": "1554:22:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1133,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1554:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1136,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1141,
                  "src": "1578:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1135,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1578:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1553:49:3"
            },
            "returnParameters": {
              "id": 1140,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1139,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1141,
                  "src": "1621:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1138,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1621:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1620:6:3"
            },
            "scope": 1166,
            "src": "1534:93:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1152,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "addHeadersWithRetarget",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1148,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1143,
                  "name": "_oldPeriodStartHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1674:36:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1142,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1674:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1145,
                  "name": "_oldPeriodEndHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1720:34:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1144,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1720:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1147,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1764:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1146,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1764:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1664:129:3"
            },
            "returnParameters": {
              "id": 1151,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1150,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1152,
                  "src": "1812:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1149,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1812:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1811:6:3"
            },
            "scope": 1166,
            "src": "1633:185:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          },
          {
            "body": null,
            "documentation": null,
            "id": 1165,
            "implemented": false,
            "kind": "function",
            "modifiers": [],
            "name": "markNewHeaviest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1161,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1154,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1858:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1153,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "1858:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1156,
                  "name": "_currentBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1885:27:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1155,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1885:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1158,
                  "name": "_newBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1922:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1157,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "1922:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1160,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1955:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1159,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "1955:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1848:127:3"
            },
            "returnParameters": {
              "id": 1164,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1163,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1165,
                  "src": "1994:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1162,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "1994:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "1993:6:3"
            },
            "scope": 1166,
            "src": "1824:176:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "external"
          }
        ],
        "scope": 2253,
        "src": "395:1607:3"
      },
      {
        "baseContracts": [
          {
            "arguments": null,
            "baseName": {
              "contractScope": null,
              "id": 1167,
              "name": "IRelay",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 1166,
              "src": "2022:6:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_IRelay_$1166",
                "typeString": "contract IRelay"
              }
            },
            "id": 1168,
            "nodeType": "InheritanceSpecifier",
            "src": "2022:6:3"
          }
        ],
        "contractDependencies": [
          1166
        ],
        "contractKind": "contract",
        "documentation": null,
        "fullyImplemented": true,
        "id": 2252,
        "linearizedBaseContracts": [
          2252,
          1166
        ],
        "name": "Relay",
        "nodeType": "ContractDefinition",
        "nodes": [
          {
            "id": 1171,
            "libraryName": {
              "contractScope": null,
              "id": 1169,
              "name": "SafeMath",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4366,
              "src": "2041:8:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_SafeMath_$4366",
                "typeString": "library SafeMath"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2035:27:3",
            "typeName": {
              "id": 1170,
              "name": "uint256",
              "nodeType": "ElementaryTypeName",
              "src": "2054:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            }
          },
          {
            "id": 1174,
            "libraryName": {
              "contractScope": null,
              "id": 1172,
              "name": "BytesLib",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4269,
              "src": "2073:8:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_BytesLib_$4269",
                "typeString": "library BytesLib"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2067:25:3",
            "typeName": {
              "id": 1173,
              "name": "bytes",
              "nodeType": "ElementaryTypeName",
              "src": "2086:5:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes_storage_ptr",
                "typeString": "bytes"
              }
            }
          },
          {
            "id": 1177,
            "libraryName": {
              "contractScope": null,
              "id": 1175,
              "name": "BTCUtils",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 4082,
              "src": "2103:8:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_BTCUtils_$4082",
                "typeString": "library BTCUtils"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2097:25:3",
            "typeName": {
              "id": 1176,
              "name": "bytes",
              "nodeType": "ElementaryTypeName",
              "src": "2116:5:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes_storage_ptr",
                "typeString": "bytes"
              }
            }
          },
          {
            "id": 1180,
            "libraryName": {
              "contractScope": null,
              "id": 1178,
              "name": "ValidateSPV",
              "nodeType": "UserDefinedTypeName",
              "referencedDeclaration": 5008,
              "src": "2133:11:3",
              "typeDescriptions": {
                "typeIdentifier": "t_contract$_ValidateSPV_$5008",
                "typeString": "library ValidateSPV"
              }
            },
            "nodeType": "UsingForDirective",
            "src": "2127:28:3",
            "typeName": {
              "id": 1179,
              "name": "bytes",
              "nodeType": "ElementaryTypeName",
              "src": "2149:5:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes_storage_ptr",
                "typeString": "bytes"
              }
            }
          },
          {
            "constant": true,
            "id": 1183,
            "name": "HEIGHT_INTERVAL",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2272:42:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint32",
              "typeString": "uint32"
            },
            "typeName": {
              "id": 1181,
              "name": "uint32",
              "nodeType": "ElementaryTypeName",
              "src": "2272:6:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint32",
                "typeString": "uint32"
              }
            },
            "value": {
              "argumentTypes": null,
              "hexValue": "34",
              "id": 1182,
              "isConstant": false,
              "isLValue": false,
              "isPure": true,
              "kind": "number",
              "lValueRequested": false,
              "nodeType": "Literal",
              "src": "2313:1:3",
              "subdenomination": null,
              "typeDescriptions": {
                "typeIdentifier": "t_rational_4_by_1",
                "typeString": "int_const 4"
              },
              "value": "4"
            },
            "visibility": "public"
          },
          {
            "constant": false,
            "id": 1185,
            "name": "relayGenesis",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2321:29:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 1184,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "2321:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1187,
            "name": "bestKnownDigest",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2356:32:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 1186,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "2356:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1189,
            "name": "lastReorgCommonAncestor",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2394:40:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_bytes32",
              "typeString": "bytes32"
            },
            "typeName": {
              "id": 1188,
              "name": "bytes32",
              "nodeType": "ElementaryTypeName",
              "src": "2394:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_bytes32",
                "typeString": "bytes32"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1193,
            "name": "previousBlock",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2440:51:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
              "typeString": "mapping(bytes32 => bytes32)"
            },
            "typeName": {
              "id": 1192,
              "keyType": {
                "id": 1190,
                "name": "bytes32",
                "nodeType": "ElementaryTypeName",
                "src": "2449:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes32",
                  "typeString": "bytes32"
                }
              },
              "nodeType": "Mapping",
              "src": "2440:28:3",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                "typeString": "mapping(bytes32 => bytes32)"
              },
              "valueType": {
                "id": 1191,
                "name": "bytes32",
                "nodeType": "ElementaryTypeName",
                "src": "2460:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes32",
                  "typeString": "bytes32"
                }
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1197,
            "name": "blockHeight",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2497:49:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
              "typeString": "mapping(bytes32 => uint256)"
            },
            "typeName": {
              "id": 1196,
              "keyType": {
                "id": 1194,
                "name": "bytes32",
                "nodeType": "ElementaryTypeName",
                "src": "2506:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_bytes32",
                  "typeString": "bytes32"
                }
              },
              "nodeType": "Mapping",
              "src": "2497:28:3",
              "typeDescriptions": {
                "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                "typeString": "mapping(bytes32 => uint256)"
              },
              "valueType": {
                "id": 1195,
                "name": "uint256",
                "nodeType": "ElementaryTypeName",
                "src": "2517:7:3",
                "typeDescriptions": {
                  "typeIdentifier": "t_uint256",
                  "typeString": "uint256"
                }
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1199,
            "name": "currentEpochDiff",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2553:33:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 1198,
              "name": "uint256",
              "nodeType": "ElementaryTypeName",
              "src": "2553:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "constant": false,
            "id": 1201,
            "name": "prevEpochDiff",
            "nodeType": "VariableDeclaration",
            "scope": 2252,
            "src": "2592:30:3",
            "stateVariable": true,
            "storageLocation": "default",
            "typeDescriptions": {
              "typeIdentifier": "t_uint256",
              "typeString": "uint256"
            },
            "typeName": {
              "id": 1200,
              "name": "uint256",
              "nodeType": "ElementaryTypeName",
              "src": "2592:7:3",
              "typeDescriptions": {
                "typeIdentifier": "t_uint256",
                "typeString": "uint256"
              }
            },
            "value": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1272,
              "nodeType": "Block",
              "src": "3083:653:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1214,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "expression": {
                            "argumentTypes": null,
                            "id": 1211,
                            "name": "_genesisHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1203,
                            "src": "3101:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1212,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "length",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": null,
                          "src": "3101:21:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "3830",
                          "id": 1213,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "3126:2:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_80_by_1",
                            "typeString": "int_const 80"
                          },
                          "value": "80"
                        },
                        "src": "3101:27:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "53746f70206265696e672064756d62",
                        "id": 1215,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3130:17:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_54f9a5f9e9dfa58d8856435ba6e7418b795ac217ba9b784a12213c7ba6375b05",
                          "typeString": "literal_string \"Stop being dumb\""
                        },
                        "value": "Stop being dumb"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_54f9a5f9e9dfa58d8856435ba6e7418b795ac217ba9b784a12213c7ba6375b05",
                          "typeString": "literal_string \"Stop being dumb\""
                        }
                      ],
                      "id": 1210,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "3093:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1216,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3093:55:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1217,
                  "nodeType": "ExpressionStatement",
                  "src": "3093:55:3"
                },
                {
                  "assignments": [
                    1219
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1219,
                      "name": "_genesisDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1272,
                      "src": "3158:22:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1218,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "3158:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1223,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1220,
                        "name": "_genesisHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1203,
                        "src": "3183:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1221,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "3183:22:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1222,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3183:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "3158:49:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1233,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1229,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1225,
                            "name": "_periodStart",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1207,
                            "src": "3239:12:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "&",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "hexValue": "307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030666666666666",
                                "id": 1227,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "3262:66:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_16777215_by_1",
                                  "typeString": "int_const 16777215"
                                },
                                "value": "0x0000000000000000000000000000000000000000000000000000000000ffffff"
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_rational_16777215_by_1",
                                  "typeString": "int_const 16777215"
                                }
                              ],
                              "id": 1226,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "3254:7:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_bytes32_$",
                                "typeString": "type(bytes32)"
                              },
                              "typeName": "bytes32"
                            },
                            "id": 1228,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "3254:75:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "3239:90:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 1231,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "3341:1:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 1230,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "3333:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_bytes32_$",
                              "typeString": "type(bytes32)"
                            },
                            "typeName": "bytes32"
                          },
                          "id": 1232,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "3333:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "3239:104:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "506572696f64207374617274206861736820646f6573206e6f74206861766520776f726b2e2048696e743a2077726f6e672062797465206f726465723f",
                        "id": 1234,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "3357:63:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c63e0adf63c0728a57e27fbecf3408104165ff577e498d3d8684c7fbae01d26d",
                          "typeString": "literal_string \"Period start hash does not have work. Hint: wrong byte order?\""
                        },
                        "value": "Period start hash does not have work. Hint: wrong byte order?"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c63e0adf63c0728a57e27fbecf3408104165ff577e498d3d8684c7fbae01d26d",
                          "typeString": "literal_string \"Period start hash does not have work. Hint: wrong byte order?\""
                        }
                      ],
                      "id": 1224,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "3218:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1235,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "3218:203:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1236,
                  "nodeType": "ExpressionStatement",
                  "src": "3218:203:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1239,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1237,
                      "name": "relayGenesis",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1185,
                      "src": "3432:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1238,
                      "name": "_genesisDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1219,
                      "src": "3447:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "3432:29:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1240,
                  "nodeType": "ExpressionStatement",
                  "src": "3432:29:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1243,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1241,
                      "name": "bestKnownDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1187,
                      "src": "3471:15:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1242,
                      "name": "_genesisDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1219,
                      "src": "3489:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "3471:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1244,
                  "nodeType": "ExpressionStatement",
                  "src": "3471:32:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1247,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1245,
                      "name": "lastReorgCommonAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1189,
                      "src": "3513:23:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1246,
                      "name": "_genesisDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1219,
                      "src": "3539:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "3513:40:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1248,
                  "nodeType": "ExpressionStatement",
                  "src": "3513:40:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1253,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1249,
                        "name": "blockHeight",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1197,
                        "src": "3563:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                          "typeString": "mapping(bytes32 => uint256)"
                        }
                      },
                      "id": 1251,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1250,
                        "name": "_genesisDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1219,
                        "src": "3575:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3563:27:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1252,
                      "name": "_height",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1205,
                      "src": "3593:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3563:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1254,
                  "nodeType": "ExpressionStatement",
                  "src": "3563:37:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1264,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "baseExpression": {
                        "argumentTypes": null,
                        "id": 1255,
                        "name": "blockHeight",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1197,
                        "src": "3610:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                          "typeString": "mapping(bytes32 => uint256)"
                        }
                      },
                      "id": 1257,
                      "indexExpression": {
                        "argumentTypes": null,
                        "id": 1256,
                        "name": "_periodStart",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1207,
                        "src": "3622:12:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "isConstant": false,
                      "isLValue": true,
                      "isPure": false,
                      "lValueRequested": true,
                      "nodeType": "IndexAccess",
                      "src": "3610:25:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [
                        {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1262,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1260,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1205,
                            "src": "3650:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "%",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 1261,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "3660:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          },
                          "src": "3650:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        }
                      ],
                      "expression": {
                        "argumentTypes": [
                          {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        ],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1258,
                          "name": "_height",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1205,
                          "src": "3638:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1259,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "sub",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 4340,
                        "src": "3638:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                          "typeString": "function (uint256,uint256) pure returns (uint256)"
                        }
                      },
                      "id": 1263,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3638:27:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3610:55:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1265,
                  "nodeType": "ExpressionStatement",
                  "src": "3610:55:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1270,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1266,
                      "name": "currentEpochDiff",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1199,
                      "src": "3676:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "arguments": [],
                      "expression": {
                        "argumentTypes": [],
                        "expression": {
                          "argumentTypes": null,
                          "id": 1267,
                          "name": "_genesisHeader",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1203,
                          "src": "3695:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1268,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "extractDifficulty",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": 3864,
                        "src": "3695:32:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                          "typeString": "function (bytes memory) pure returns (uint256)"
                        }
                      },
                      "id": 1269,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "kind": "functionCall",
                      "lValueRequested": false,
                      "names": [],
                      "nodeType": "FunctionCall",
                      "src": "3695:34:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "3676:53:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "id": 1271,
                  "nodeType": "ExpressionStatement",
                  "src": "3676:53:3"
                }
              ]
            },
            "documentation": "@notice                   Gives a starting point for the relay\n @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n @param  _genesisHeader    The starting header\n @param  _height           The starting height\n @param  _periodStart      The hash of the first header in the genesis epoch",
            "id": 1273,
            "implemented": true,
            "kind": "constructor",
            "modifiers": [],
            "name": "",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1208,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1203,
                  "name": "_genesisHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1273,
                  "src": "3008:27:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1202,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "3008:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1205,
                  "name": "_height",
                  "nodeType": "VariableDeclaration",
                  "scope": 1273,
                  "src": "3037:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1204,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "3037:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1207,
                  "name": "_periodStart",
                  "nodeType": "VariableDeclaration",
                  "scope": 1273,
                  "src": "3054:20:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1206,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "3054:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "3007:68:3"
            },
            "returnParameters": {
              "id": 1209,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "3083:0:3"
            },
            "scope": 2252,
            "src": "2996:740:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "public"
          },
          {
            "body": {
              "id": 1453,
              "nodeType": "Block",
              "src": "4340:2176:3",
              "statements": [
                {
                  "assignments": [
                    1285
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1285,
                      "name": "_height",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4350:15:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1284,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4350:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1286,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4350:15:3"
                },
                {
                  "assignments": [
                    1288
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1288,
                      "name": "_header",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4375:20:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 1287,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "4375:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1289,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4375:20:3"
                },
                {
                  "assignments": [
                    1291
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1291,
                      "name": "_currentDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4405:22:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1290,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "4405:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1292,
                  "initialValue": null,
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4405:22:3"
                },
                {
                  "assignments": [
                    1294
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1294,
                      "name": "_previousDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4437:23:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1293,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "4437:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1298,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1295,
                        "name": "_anchor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1275,
                        "src": "4463:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1296,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "4463:15:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1297,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4463:17:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4437:43:3"
                },
                {
                  "assignments": [
                    1300
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1300,
                      "name": "_target",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4491:15:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1299,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4491:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1308,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1303,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "4524:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          {
                            "argumentTypes": null,
                            "hexValue": "3830",
                            "id": 1304,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "4527:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_80_by_1",
                              "typeString": "int_const 80"
                            },
                            "value": "80"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            {
                              "typeIdentifier": "t_rational_80_by_1",
                              "typeString": "int_const 80"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1301,
                            "name": "_headers",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1277,
                            "src": "4509:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1302,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "slice",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4133,
                          "src": "4509:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory,uint256,uint256) pure returns (bytes memory)"
                          }
                        },
                        "id": 1305,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "4509:21:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1306,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractTarget",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3777,
                      "src": "4509:35:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1307,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4509:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4491:55:3"
                },
                {
                  "assignments": [
                    1310
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1310,
                      "name": "_anchorHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 1453,
                      "src": "4556:21:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1309,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "4556:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1314,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1312,
                        "name": "_previousDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1294,
                        "src": "4592:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1311,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "4580:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1313,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4580:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "4556:52:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 1322,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1316,
                          "name": "_internal",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1279,
                          "src": "4669:9:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "||",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1321,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1317,
                                "name": "_anchor",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1275,
                                "src": "4682:7:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 1318,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "extractTarget",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 3777,
                              "src": "4682:21:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (uint256)"
                              }
                            },
                            "id": 1319,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "4682:23:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1320,
                            "name": "_target",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1300,
                            "src": "4709:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "4682:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "4669:47:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "556e6578706563746564207265746172676574206f6e2065787465726e616c2063616c6c",
                        "id": 1323,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "4730:38:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c33296853216f4d74abe3a6fbf840e018f81995cd8c40108858eaa3d5148cebc",
                          "typeString": "literal_string \"Unexpected retarget on external call\""
                        },
                        "value": "Unexpected retarget on external call"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c33296853216f4d74abe3a6fbf840e018f81995cd8c40108858eaa3d5148cebc",
                          "typeString": "literal_string \"Unexpected retarget on external call\""
                        }
                      ],
                      "id": 1315,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "4648:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1324,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4648:121:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1325,
                  "nodeType": "ExpressionStatement",
                  "src": "4648:121:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1332,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1330,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "expression": {
                              "argumentTypes": null,
                              "id": 1327,
                              "name": "_headers",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1277,
                              "src": "4787:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 1328,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "length",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": null,
                            "src": "4787:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "%",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "3830",
                            "id": 1329,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "4805:2:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_80_by_1",
                              "typeString": "int_const 80"
                            },
                            "value": "80"
                          },
                          "src": "4787:20:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "30",
                          "id": 1331,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "4811:1:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_0_by_1",
                            "typeString": "int_const 0"
                          },
                          "value": "0"
                        },
                        "src": "4787:25:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "486561646572206172726179206c656e677468206d75737420626520646976697369626c65206279203830",
                        "id": 1333,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "4814:45:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_64951f0822ebc61755f01c687a3aabd90c37a5b5a62d0764ef2ec9edb60caca4",
                          "typeString": "literal_string \"Header array length must be divisible by 80\""
                        },
                        "value": "Header array length must be divisible by 80"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_64951f0822ebc61755f01c687a3aabd90c37a5b5a62d0764ef2ec9edb60caca4",
                          "typeString": "literal_string \"Header array length must be divisible by 80\""
                        }
                      ],
                      "id": 1326,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "4779:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1334,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "4779:81:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1335,
                  "nodeType": "ExpressionStatement",
                  "src": "4779:81:3"
                },
                {
                  "body": {
                    "id": 1442,
                    "nodeType": "Block",
                    "src": "5170:1234:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1362,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1353,
                            "name": "_header",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1288,
                            "src": "5184:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "hexValue": "3830",
                                    "id": 1358,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "number",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "5215:2:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_rational_80_by_1",
                                      "typeString": "int_const 80"
                                    },
                                    "value": "80"
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_rational_80_by_1",
                                      "typeString": "int_const 80"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1356,
                                    "name": "i",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1337,
                                    "src": "5209:1:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "id": 1357,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4305,
                                  "src": "5209:5:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 1359,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5209:9:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              {
                                "argumentTypes": null,
                                "hexValue": "3830",
                                "id": 1360,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5220:2:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_80_by_1",
                                  "typeString": "int_const 80"
                                },
                                "value": "80"
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                {
                                  "typeIdentifier": "t_rational_80_by_1",
                                  "typeString": "int_const 80"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1354,
                                "name": "_headers",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1277,
                                "src": "5194:8:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 1355,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "slice",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4133,
                              "src": "5194:14:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory,uint256,uint256) pure returns (bytes memory)"
                              }
                            },
                            "id": 1361,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5194:29:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "src": "5184:39:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1363,
                        "nodeType": "ExpressionStatement",
                        "src": "5184:39:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1371,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1364,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1285,
                            "src": "5237:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "commonType": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                "id": 1369,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftExpression": {
                                  "argumentTypes": null,
                                  "id": 1367,
                                  "name": "i",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1337,
                                  "src": "5265:1:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                },
                                "nodeType": "BinaryOperation",
                                "operator": "+",
                                "rightExpression": {
                                  "argumentTypes": null,
                                  "hexValue": "31",
                                  "id": 1368,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "kind": "number",
                                  "lValueRequested": false,
                                  "nodeType": "Literal",
                                  "src": "5269:1:3",
                                  "subdenomination": null,
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_rational_1_by_1",
                                    "typeString": "int_const 1"
                                  },
                                  "value": "1"
                                },
                                "src": "5265:5:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1365,
                                "name": "_anchorHeight",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1310,
                                "src": "5247:13:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 1366,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "add",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4365,
                              "src": "5247:17:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 1370,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5247:24:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "5237:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1372,
                        "nodeType": "ExpressionStatement",
                        "src": "5237:34:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1377,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1373,
                            "name": "_currentDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1291,
                            "src": "5285:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 1374,
                                "name": "_header",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1288,
                                "src": "5302:7:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 1375,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "hash256",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2792,
                              "src": "5302:15:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (bytes32)"
                              }
                            },
                            "id": 1376,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5302:17:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "5285:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1378,
                        "nodeType": "ExpressionStatement",
                        "src": "5285:34:3"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1385,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1379,
                              "name": "previousBlock",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1193,
                              "src": "5520:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                "typeString": "mapping(bytes32 => bytes32)"
                              }
                            },
                            "id": 1381,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1380,
                              "name": "_currentDigest",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1291,
                              "src": "5534:14:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "5520:29:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "hexValue": "30",
                                "id": 1383,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "number",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "5561:1:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_rational_0_by_1",
                                  "typeString": "int_const 0"
                                },
                                "value": "0"
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_rational_0_by_1",
                                  "typeString": "int_const 0"
                                }
                              ],
                              "id": 1382,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "lValueRequested": false,
                              "nodeType": "ElementaryTypeNameExpression",
                              "src": "5553:7:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_type$_t_bytes32_$",
                                "typeString": "type(bytes32)"
                              },
                              "typeName": "bytes32"
                            },
                            "id": 1384,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "typeConversion",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "5553:10:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "5520:43:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 1420,
                        "nodeType": "IfStatement",
                        "src": "5516:560:3",
                        "trueBody": {
                          "id": 1419,
                          "nodeType": "Block",
                          "src": "5565:511:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 1396,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "arguments": [],
                                      "expression": {
                                        "argumentTypes": [],
                                        "expression": {
                                          "argumentTypes": null,
                                          "arguments": [],
                                          "expression": {
                                            "argumentTypes": [],
                                            "expression": {
                                              "argumentTypes": null,
                                              "arguments": [
                                                {
                                                  "argumentTypes": null,
                                                  "id": 1389,
                                                  "name": "_currentDigest",
                                                  "nodeType": "Identifier",
                                                  "overloadedDeclarations": [],
                                                  "referencedDeclaration": 1291,
                                                  "src": "5629:14:3",
                                                  "typeDescriptions": {
                                                    "typeIdentifier": "t_bytes32",
                                                    "typeString": "bytes32"
                                                  }
                                                }
                                              ],
                                              "expression": {
                                                "argumentTypes": [
                                                  {
                                                    "typeIdentifier": "t_bytes32",
                                                    "typeString": "bytes32"
                                                  }
                                                ],
                                                "expression": {
                                                  "argumentTypes": null,
                                                  "id": 1387,
                                                  "name": "abi",
                                                  "nodeType": "Identifier",
                                                  "overloadedDeclarations": [],
                                                  "referencedDeclaration": 5010,
                                                  "src": "5612:3:3",
                                                  "typeDescriptions": {
                                                    "typeIdentifier": "t_magic_abi",
                                                    "typeString": "abi"
                                                  }
                                                },
                                                "id": 1388,
                                                "isConstant": false,
                                                "isLValue": false,
                                                "isPure": true,
                                                "lValueRequested": false,
                                                "memberName": "encodePacked",
                                                "nodeType": "MemberAccess",
                                                "referencedDeclaration": null,
                                                "src": "5612:16:3",
                                                "typeDescriptions": {
                                                  "typeIdentifier": "t_function_abiencodepacked_pure$__$returns$_t_bytes_memory_ptr_$",
                                                  "typeString": "function () pure returns (bytes memory)"
                                                }
                                              },
                                              "id": 1390,
                                              "isConstant": false,
                                              "isLValue": false,
                                              "isPure": false,
                                              "kind": "functionCall",
                                              "lValueRequested": false,
                                              "names": [],
                                              "nodeType": "FunctionCall",
                                              "src": "5612:32:3",
                                              "typeDescriptions": {
                                                "typeIdentifier": "t_bytes_memory_ptr",
                                                "typeString": "bytes memory"
                                              }
                                            },
                                            "id": 1391,
                                            "isConstant": false,
                                            "isLValue": false,
                                            "isPure": false,
                                            "lValueRequested": false,
                                            "memberName": "reverseEndianness",
                                            "nodeType": "MemberAccess",
                                            "referencedDeclaration": 2579,
                                            "src": "5612:50:3",
                                            "typeDescriptions": {
                                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                                              "typeString": "function (bytes memory) pure returns (bytes memory)"
                                            }
                                          },
                                          "id": 1392,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": false,
                                          "kind": "functionCall",
                                          "lValueRequested": false,
                                          "names": [],
                                          "nodeType": "FunctionCall",
                                          "src": "5612:52:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_bytes_memory_ptr",
                                            "typeString": "bytes memory"
                                          }
                                        },
                                        "id": 1393,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "memberName": "bytesToUint",
                                        "nodeType": "MemberAccess",
                                        "referencedDeclaration": 2726,
                                        "src": "5612:64:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                          "typeString": "function (bytes memory) pure returns (uint256)"
                                        }
                                      },
                                      "id": 1394,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "kind": "functionCall",
                                      "lValueRequested": false,
                                      "names": [],
                                      "nodeType": "FunctionCall",
                                      "src": "5612:66:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "<=",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "id": 1395,
                                      "name": "_target",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 1300,
                                      "src": "5682:7:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "src": "5612:77:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bool",
                                      "typeString": "bool"
                                    }
                                  },
                                  {
                                    "argumentTypes": null,
                                    "hexValue": "48656164657220776f726b20697320696e73756666696369656e74",
                                    "id": 1397,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": true,
                                    "kind": "string",
                                    "lValueRequested": false,
                                    "nodeType": "Literal",
                                    "src": "5711:29:3",
                                    "subdenomination": null,
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_stringliteral_577a884d824749cadf11f1d13d4dc4655ad406f62456ad5e910541517ce4d497",
                                      "typeString": "literal_string \"Header work is insufficient\""
                                    },
                                    "value": "Header work is insufficient"
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_bool",
                                      "typeString": "bool"
                                    },
                                    {
                                      "typeIdentifier": "t_stringliteral_577a884d824749cadf11f1d13d4dc4655ad406f62456ad5e910541517ce4d497",
                                      "typeString": "literal_string \"Header work is insufficient\""
                                    }
                                  ],
                                  "id": 1386,
                                  "name": "require",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [
                                    5026,
                                    5027
                                  ],
                                  "referencedDeclaration": 5027,
                                  "src": "5583:7:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                                    "typeString": "function (bool,string memory) pure"
                                  }
                                },
                                "id": 1398,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "5583:158:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_tuple$__$",
                                  "typeString": "tuple()"
                                }
                              },
                              "id": 1399,
                              "nodeType": "ExpressionStatement",
                              "src": "5583:158:3"
                            },
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1404,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 1400,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "5759:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 1402,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 1401,
                                    "name": "_currentDigest",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1291,
                                    "src": "5773:14:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": true,
                                  "nodeType": "IndexAccess",
                                  "src": "5759:29:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "id": 1403,
                                  "name": "_previousDigest",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1294,
                                  "src": "5791:15:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "5759:47:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1405,
                              "nodeType": "ExpressionStatement",
                              "src": "5759:47:3"
                            },
                            {
                              "condition": {
                                "argumentTypes": null,
                                "commonType": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                },
                                "id": 1410,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftExpression": {
                                  "argumentTypes": null,
                                  "commonType": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  },
                                  "id": 1408,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "leftExpression": {
                                    "argumentTypes": null,
                                    "id": 1406,
                                    "name": "_height",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1285,
                                    "src": "5828:7:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "nodeType": "BinaryOperation",
                                  "operator": "%",
                                  "rightExpression": {
                                    "argumentTypes": null,
                                    "id": 1407,
                                    "name": "HEIGHT_INTERVAL",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1183,
                                    "src": "5838:15:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint32",
                                      "typeString": "uint32"
                                    }
                                  },
                                  "src": "5828:25:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_uint256",
                                    "typeString": "uint256"
                                  }
                                },
                                "nodeType": "BinaryOperation",
                                "operator": "==",
                                "rightExpression": {
                                  "argumentTypes": null,
                                  "hexValue": "30",
                                  "id": 1409,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": true,
                                  "kind": "number",
                                  "lValueRequested": false,
                                  "nodeType": "Literal",
                                  "src": "5857:1:3",
                                  "subdenomination": null,
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_rational_0_by_1",
                                    "typeString": "int_const 0"
                                  },
                                  "value": "0"
                                },
                                "src": "5828:30:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                }
                              },
                              "falseBody": null,
                              "id": 1418,
                              "nodeType": "IfStatement",
                              "src": "5824:238:3",
                              "trueBody": {
                                "id": 1417,
                                "nodeType": "Block",
                                "src": "5860:202:3",
                                "statements": [
                                  {
                                    "expression": {
                                      "argumentTypes": null,
                                      "id": 1415,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "leftHandSide": {
                                        "argumentTypes": null,
                                        "baseExpression": {
                                          "argumentTypes": null,
                                          "id": 1411,
                                          "name": "blockHeight",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 1197,
                                          "src": "6006:11:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                                            "typeString": "mapping(bytes32 => uint256)"
                                          }
                                        },
                                        "id": 1413,
                                        "indexExpression": {
                                          "argumentTypes": null,
                                          "id": 1412,
                                          "name": "_currentDigest",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 1291,
                                          "src": "6018:14:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_bytes32",
                                            "typeString": "bytes32"
                                          }
                                        },
                                        "isConstant": false,
                                        "isLValue": true,
                                        "isPure": false,
                                        "lValueRequested": true,
                                        "nodeType": "IndexAccess",
                                        "src": "6006:27:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "nodeType": "Assignment",
                                      "operator": "=",
                                      "rightHandSide": {
                                        "argumentTypes": null,
                                        "id": 1414,
                                        "name": "_height",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 1285,
                                        "src": "6036:7:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      },
                                      "src": "6006:37:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "id": 1416,
                                    "nodeType": "ExpressionStatement",
                                    "src": "6006:37:3"
                                  }
                                ]
                              }
                            }
                          ]
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 1426,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1422,
                                    "name": "_header",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1288,
                                    "src": "6168:7:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 1423,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "extractTarget",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3777,
                                  "src": "6168:21:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (uint256)"
                                  }
                                },
                                "id": 1424,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "6168:23:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "==",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 1425,
                                "name": "_target",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1300,
                                "src": "6195:7:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "src": "6168:34:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "hexValue": "546172676574206368616e67656420756e65787065637465646c79",
                              "id": 1427,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "string",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "6204:29:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_stringliteral_7512beb8d719892f726a7e4249334e5ee85f327ca3e7b9c917a97c9e30ad0aa4",
                                "typeString": "literal_string \"Target changed unexpectedly\""
                              },
                              "value": "Target changed unexpectedly"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              },
                              {
                                "typeIdentifier": "t_stringliteral_7512beb8d719892f726a7e4249334e5ee85f327ca3e7b9c917a97c9e30ad0aa4",
                                "typeString": "literal_string \"Target changed unexpectedly\""
                              }
                            ],
                            "id": 1421,
                            "name": "require",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [
                              5026,
                              5027
                            ],
                            "referencedDeclaration": 5027,
                            "src": "6160:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                              "typeString": "function (bool,string memory) pure"
                            }
                          },
                          "id": 1428,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "6160:74:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 1429,
                        "nodeType": "ExpressionStatement",
                        "src": "6160:74:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "arguments": [
                                {
                                  "argumentTypes": null,
                                  "id": 1433,
                                  "name": "_previousDigest",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1294,
                                  "src": "6287:15:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                }
                              ],
                              "expression": {
                                "argumentTypes": [
                                  {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": null,
                                  "id": 1431,
                                  "name": "_header",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1288,
                                  "src": "6256:7:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes_memory_ptr",
                                    "typeString": "bytes memory"
                                  }
                                },
                                "id": 1432,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "memberName": "validateHeaderPrevHash",
                                "nodeType": "MemberAccess",
                                "referencedDeclaration": 5007,
                                "src": "6256:30:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_bytes32_$returns$_t_bool_$bound_to$_t_bytes_memory_ptr_$",
                                  "typeString": "function (bytes memory,bytes32) pure returns (bool)"
                                }
                              },
                              "id": 1434,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "kind": "functionCall",
                              "lValueRequested": false,
                              "names": [],
                              "nodeType": "FunctionCall",
                              "src": "6256:47:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "hexValue": "4865616465727320646f206e6f7420666f726d206120636f6e73697374656e7420636861696e",
                              "id": 1435,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "string",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "6305:40:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_stringliteral_09edac151df9e4894b9dc57d4b428f162596747b62bb7347fd3851a717f60df7",
                                "typeString": "literal_string \"Headers do not form a consistent chain\""
                              },
                              "value": "Headers do not form a consistent chain"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_bool",
                                "typeString": "bool"
                              },
                              {
                                "typeIdentifier": "t_stringliteral_09edac151df9e4894b9dc57d4b428f162596747b62bb7347fd3851a717f60df7",
                                "typeString": "literal_string \"Headers do not form a consistent chain\""
                              }
                            ],
                            "id": 1430,
                            "name": "require",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [
                              5026,
                              5027
                            ],
                            "referencedDeclaration": 5027,
                            "src": "6248:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                              "typeString": "function (bool,string memory) pure"
                            }
                          },
                          "id": 1436,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "6248:98:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_tuple$__$",
                            "typeString": "tuple()"
                          }
                        },
                        "id": 1437,
                        "nodeType": "ExpressionStatement",
                        "src": "6248:98:3"
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1440,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1438,
                            "name": "_previousDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1294,
                            "src": "6361:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 1439,
                            "name": "_currentDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1291,
                            "src": "6379:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "6361:32:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1441,
                        "nodeType": "ExpressionStatement",
                        "src": "6361:32:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1345,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1340,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1337,
                      "src": "5130:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1344,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "expression": {
                          "argumentTypes": null,
                          "id": 1341,
                          "name": "_headers",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1277,
                          "src": "5134:8:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes_memory_ptr",
                            "typeString": "bytes memory"
                          }
                        },
                        "id": 1342,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "memberName": "length",
                        "nodeType": "MemberAccess",
                        "referencedDeclaration": null,
                        "src": "5134:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "/",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "3830",
                        "id": 1343,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "5152:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_80_by_1",
                          "typeString": "int_const 80"
                        },
                        "value": "80"
                      },
                      "src": "5134:20:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "5130:24:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1443,
                  "initializationExpression": {
                    "assignments": [
                      1337
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1337,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1443,
                        "src": "5115:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1336,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "5115:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1339,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1338,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "5127:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "5115:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1351,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1346,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1337,
                        "src": "5156:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1349,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "5166:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1347,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1337,
                            "src": "5160:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1348,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "5160:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1350,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "5160:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "5156:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1352,
                    "nodeType": "ExpressionStatement",
                    "src": "5156:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "5110:1294:3"
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1445,
                            "name": "_anchor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1275,
                            "src": "6442:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1446,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "6442:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 1447,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "6442:17:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1448,
                        "name": "_currentDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1291,
                        "src": "6473:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1444,
                      "name": "Extension",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1048,
                      "src": "6419:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$returns$__$",
                        "typeString": "function (bytes32,bytes32)"
                      }
                    },
                    "id": 1449,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "6419:69:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1450,
                  "nodeType": "EmitStatement",
                  "src": "6414:74:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "74727565",
                    "id": 1451,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "6505:4:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "true"
                  },
                  "functionReturnParameters": 1283,
                  "id": 1452,
                  "nodeType": "Return",
                  "src": "6498:11:3"
                }
              ]
            },
            "documentation": "@notice             Adds headers to storage after validating\n @dev                We check integrity and consistency of the header chain\n @param  _anchor     The header immediately preceeding the new chain\n @param  _headers    A tightly-packed list of new 80-byte Bitcoin headers to record\n @param  _internal   True if called internally from addHeadersWithRetarget, false otherwise\n @return             True if successfully written, error otherwise",
            "id": 1454,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_addHeaders",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1280,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1275,
                  "name": "_anchor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4255:20:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1274,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4255:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1277,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4277:21:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1276,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "4277:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1279,
                  "name": "_internal",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4300:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1278,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "4300:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4254:61:3"
            },
            "returnParameters": {
              "id": 1283,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1282,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1454,
                  "src": "4334:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1281,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "4334:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "4333:6:3"
            },
            "scope": 2252,
            "src": "4234:2282:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1469,
              "nodeType": "Block",
              "src": "6994:61:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1464,
                        "name": "_anchor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1456,
                        "src": "7023:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1465,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1458,
                        "src": "7032:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "66616c7365",
                        "id": 1466,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "bool",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "7042:5:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "value": "false"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1463,
                      "name": "_addHeaders",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1454,
                      "src": "7011:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_bool_$returns$_t_bool_$",
                        "typeString": "function (bytes memory,bytes memory,bool) returns (bool)"
                      }
                    },
                    "id": 1467,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7011:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1462,
                  "id": 1468,
                  "nodeType": "Return",
                  "src": "7004:44:3"
                }
              ]
            },
            "documentation": "@notice             Adds headers to storage after validating\n @dev                We check integrity and consistency of the header chain\n @param  _anchor     The header immediately preceeding the new chain\n @param  _headers    A tightly-packed list of 80-byte Bitcoin headers\n @return             True if successfully written, error otherwise",
            "id": 1470,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "addHeaders",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1459,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1456,
                  "name": "_anchor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1470,
                  "src": "6921:22:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1455,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "6921:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1458,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1470,
                  "src": "6945:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1457,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "6945:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6920:49:3"
            },
            "returnParameters": {
              "id": 1462,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1461,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1470,
                  "src": "6988:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1460,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "6988:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "6987:6:3"
            },
            "scope": 2252,
            "src": "6901:154:3",
            "stateMutability": "nonpayable",
            "superFunction": 1141,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1487,
              "nodeType": "Block",
              "src": "7796:101:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1482,
                        "name": "_oldPeriodStartHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1472,
                        "src": "7837:21:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1483,
                        "name": "_oldPeriodEndHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1474,
                        "src": "7860:19:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1484,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1476,
                        "src": "7881:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      ],
                      "id": 1481,
                      "name": "_addHeadersWithRetarget",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1615,
                      "src": "7813:23:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bool_$",
                        "typeString": "function (bytes memory,bytes memory,bytes memory) returns (bool)"
                      }
                    },
                    "id": 1485,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "7813:77:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1480,
                  "id": 1486,
                  "nodeType": "Return",
                  "src": "7806:84:3"
                }
              ]
            },
            "documentation": "@notice                       Adds headers to storage, performs additional validation of retarget\n @dev                          Checks the retarget, the heights, and the linkage\n @param  _oldPeriodStartHeader The first header in the difficulty period being closed\n @param  _oldPeriodEndHeader   The last header in the difficulty period being closed\n @param  _headers              A tightly-packed list of 80-byte Bitcoin headers\n @return                       True if successfully written, error otherwise",
            "id": 1488,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "addHeadersWithRetarget",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1477,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1472,
                  "name": "_oldPeriodStartHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7652:36:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1471,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "7652:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1474,
                  "name": "_oldPeriodEndHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7698:34:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1473,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "7698:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1476,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7742:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1475,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "7742:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7642:129:3"
            },
            "returnParameters": {
              "id": 1480,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1479,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1488,
                  "src": "7790:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1478,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "7790:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "7789:6:3"
            },
            "scope": 2252,
            "src": "7611:286:3",
            "stateMutability": "nonpayable",
            "superFunction": 1152,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1614,
              "nodeType": "Block",
              "src": "8633:1813:3",
              "statements": [
                {
                  "assignments": [
                    1500
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1500,
                      "name": "_startHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "8697:20:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1499,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "8697:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1506,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1502,
                            "name": "_oldPeriodStartHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1490,
                            "src": "8732:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1503,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "8732:29:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 1504,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8732:31:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1501,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "8720:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1505,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8720:44:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8697:67:3"
                },
                {
                  "assignments": [
                    1508
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1508,
                      "name": "_endHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "8774:18:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1507,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "8774:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1514,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1510,
                            "name": "_oldPeriodEndHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1492,
                            "src": "8807:19:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1511,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "8807:27:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 1512,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "8807:29:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1509,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "8795:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1513,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8795:42:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "8774:63:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1520,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1518,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1516,
                            "name": "_endHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1508,
                            "src": "8935:10:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "%",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 1517,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "8948:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          },
                          "src": "8935:17:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "32303135",
                          "id": 1519,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "8956:4:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_2015_by_1",
                            "typeString": "int_const 2015"
                          },
                          "value": "2015"
                        },
                        "src": "8935:25:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4d7573742070726f7669646520746865206c61737420686561646572206f662074686520636c6f73696e6720646966666963756c747920706572696f64",
                        "id": 1521,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "8974:63:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_7bce8283552532854aff5aeca68cfd1afcae4f19a96f4f0f9a36c4ae487d1db8",
                          "typeString": "literal_string \"Must provide the last header of the closing difficulty period\""
                        },
                        "value": "Must provide the last header of the closing difficulty period"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_7bce8283552532854aff5aeca68cfd1afcae4f19a96f4f0f9a36c4ae487d1db8",
                          "typeString": "literal_string \"Must provide the last header of the closing difficulty period\""
                        }
                      ],
                      "id": 1515,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "8914:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1522,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "8914:124:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1523,
                  "nodeType": "ExpressionStatement",
                  "src": "8914:124:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1530,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1525,
                          "name": "_endHeight",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1508,
                          "src": "9069:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "32303135",
                              "id": 1528,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "9100:4:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_2015_by_1",
                                "typeString": "int_const 2015"
                              },
                              "value": "2015"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_2015_by_1",
                                "typeString": "int_const 2015"
                              }
                            ],
                            "expression": {
                              "argumentTypes": null,
                              "id": 1526,
                              "name": "_startHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1500,
                              "src": "9083:12:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "id": 1527,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "add",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 4365,
                            "src": "9083:16:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                              "typeString": "function (uint256,uint256) pure returns (uint256)"
                            }
                          },
                          "id": 1529,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9083:22:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "9069:36:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4d7573742070726f766964652065786163746c79203120646966666963756c747920706572696f64",
                        "id": 1531,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9119:42:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_67c7c738a8cf54313c844b3267d6767c493dfc5af7d7c931a36a94b2d81f8e3e",
                          "typeString": "literal_string \"Must provide exactly 1 difficulty period\""
                        },
                        "value": "Must provide exactly 1 difficulty period"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_67c7c738a8cf54313c844b3267d6767c493dfc5af7d7c931a36a94b2d81f8e3e",
                          "typeString": "literal_string \"Must provide exactly 1 difficulty period\""
                        }
                      ],
                      "id": 1524,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "9048:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1532,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9048:114:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1533,
                  "nodeType": "ExpressionStatement",
                  "src": "9048:114:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1541,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 1535,
                              "name": "_oldPeriodStartHeader",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1490,
                              "src": "9193:21:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 1536,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "extractDifficulty",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 3864,
                            "src": "9193:39:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (uint256)"
                            }
                          },
                          "id": 1537,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9193:41:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 1538,
                              "name": "_oldPeriodEndHeader",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1492,
                              "src": "9238:19:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 1539,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "extractDifficulty",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 3864,
                            "src": "9238:37:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (uint256)"
                            }
                          },
                          "id": 1540,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "9238:39:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "9193:84:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "506572696f642068656164657220646966666963756c7469657320646f206e6f74206d61746368",
                        "id": 1542,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9291:41:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c6456ff224d25c664f0efff0894b66e1bf05b6cd6fdb6e7d6c08db546c000032",
                          "typeString": "literal_string \"Period header difficulties do not match\""
                        },
                        "value": "Period header difficulties do not match"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c6456ff224d25c664f0efff0894b66e1bf05b6cd6fdb6e7d6c08db546c000032",
                          "typeString": "literal_string \"Period header difficulties do not match\""
                        }
                      ],
                      "id": 1534,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "9172:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1543,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9172:161:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1544,
                  "nodeType": "ExpressionStatement",
                  "src": "9172:161:3"
                },
                {
                  "assignments": [
                    1546
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1546,
                      "name": "_newPeriodStart",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "9438:28:3",
                      "stateVariable": false,
                      "storageLocation": "memory",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes_memory_ptr",
                        "typeString": "bytes"
                      },
                      "typeName": {
                        "id": 1545,
                        "name": "bytes",
                        "nodeType": "ElementaryTypeName",
                        "src": "9438:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_storage_ptr",
                          "typeString": "bytes"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1552,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "30",
                        "id": 1549,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9484:1:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        "value": "0"
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "3830",
                        "id": 1550,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9487:2:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_80_by_1",
                          "typeString": "int_const 80"
                        },
                        "value": "80"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_rational_0_by_1",
                          "typeString": "int_const 0"
                        },
                        {
                          "typeIdentifier": "t_rational_80_by_1",
                          "typeString": "int_const 80"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1547,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1494,
                        "src": "9469:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1548,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "slice",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4133,
                      "src": "9469:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$_t_uint256_$_t_uint256_$returns$_t_bytes_memory_ptr_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory,uint256,uint256) pure returns (bytes memory)"
                      }
                    },
                    "id": 1551,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9469:21:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_memory_ptr",
                      "typeString": "bytes memory"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9438:52:3"
                },
                {
                  "assignments": [
                    1554
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1554,
                      "name": "_actualTarget",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "9500:21:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1553,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "9500:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1558,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1555,
                        "name": "_newPeriodStart",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1546,
                        "src": "9524:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1556,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractTarget",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3777,
                      "src": "9524:29:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1557,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9524:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9500:55:3"
                },
                {
                  "assignments": [
                    1560
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1560,
                      "name": "_expectedTarget",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "9565:23:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1559,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "9565:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1573,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1563,
                            "name": "_oldPeriodStartHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1490,
                            "src": "9631:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1564,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "extractTarget",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3777,
                          "src": "9631:35:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (uint256)"
                          }
                        },
                        "id": 1565,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9631:37:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1566,
                            "name": "_oldPeriodStartHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1490,
                            "src": "9682:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1567,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "extractTimestamp",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3850,
                          "src": "9682:38:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (uint32)"
                          }
                        },
                        "id": 1568,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9682:40:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1569,
                            "name": "_oldPeriodEndHeader",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1492,
                            "src": "9736:19:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 1570,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "extractTimestamp",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 3850,
                          "src": "9736:36:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (uint32)"
                          }
                        },
                        "id": 1571,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "9736:38:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        },
                        {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1561,
                        "name": "BTCUtils",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 4082,
                        "src": "9591:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_type$_t_contract$_BTCUtils_$4082_$",
                          "typeString": "type(library BTCUtils)"
                        }
                      },
                      "id": 1562,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "retargetAlgorithm",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4081,
                      "src": "9591:26:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
                        "typeString": "function (uint256,uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 1572,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9591:193:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "9565:219:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 1580,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "components": [
                            {
                              "argumentTypes": null,
                              "commonType": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              },
                              "id": 1577,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "leftExpression": {
                                "argumentTypes": null,
                                "id": 1575,
                                "name": "_actualTarget",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1554,
                                "src": "9816:13:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "nodeType": "BinaryOperation",
                              "operator": "&",
                              "rightExpression": {
                                "argumentTypes": null,
                                "id": 1576,
                                "name": "_expectedTarget",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1560,
                                "src": "9832:15:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "src": "9816:31:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            }
                          ],
                          "id": 1578,
                          "isConstant": false,
                          "isInlineArray": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "TupleExpression",
                          "src": "9815:33:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1579,
                          "name": "_actualTarget",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1554,
                          "src": "9852:13:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "src": "9815:50:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "496e76616c69642072657461726765742070726f7669646564",
                        "id": 1581,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "9879:27:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_88fb068d9d9bb4cb430555f47426ce90db05a008971325835664896da5946718",
                          "typeString": "literal_string \"Invalid retarget provided\""
                        },
                        "value": "Invalid retarget provided"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_88fb068d9d9bb4cb430555f47426ce90db05a008971325835664896da5946718",
                          "typeString": "literal_string \"Invalid retarget provided\""
                        }
                      ],
                      "id": 1574,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "9794:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1582,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "9794:113:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1583,
                  "nodeType": "ExpressionStatement",
                  "src": "9794:113:3"
                },
                {
                  "assignments": [
                    1585
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1585,
                      "name": "_oldDiff",
                      "nodeType": "VariableDeclaration",
                      "scope": 1614,
                      "src": "10117:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1584,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "10117:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1589,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1586,
                        "name": "_oldPeriodStartHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1490,
                        "src": "10136:21:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1587,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractDifficulty",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3864,
                      "src": "10136:39:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1588,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10136:41:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10117:60:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 1601,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1592,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1590,
                        "name": "prevEpochDiff",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1201,
                        "src": "10191:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "!=",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1591,
                        "name": "_oldDiff",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1585,
                        "src": "10208:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "10191:25:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "id": 1600,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1593,
                        "name": "_endHeight",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1508,
                        "src": "10220:10:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": ">",
                      "rightExpression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 1598,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10266:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "id": 1595,
                                "name": "bestKnownDigest",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 1187,
                                "src": "10245:15:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              ],
                              "id": 1594,
                              "name": "_findHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1676,
                              "src": "10233:11:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                                "typeString": "function (bytes32) view returns (uint256)"
                              }
                            },
                            "id": 1596,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "10233:28:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1597,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "sub",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4340,
                          "src": "10233:32:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1599,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10233:38:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "10220:51:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "10191:80:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1607,
                  "nodeType": "IfStatement",
                  "src": "10187:133:3",
                  "trueBody": {
                    "id": 1606,
                    "nodeType": "Block",
                    "src": "10273:47:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1604,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1602,
                            "name": "prevEpochDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1201,
                            "src": "10285:13:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 1603,
                            "name": "_oldDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1585,
                            "src": "10301:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10285:24:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1605,
                        "nodeType": "ExpressionStatement",
                        "src": "10285:24:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1609,
                        "name": "_oldPeriodEndHeader",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1492,
                        "src": "10403:19:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1610,
                        "name": "_headers",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1494,
                        "src": "10424:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "74727565",
                        "id": 1611,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "bool",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10434:4:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "value": "true"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        },
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      ],
                      "id": 1608,
                      "name": "_addHeaders",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1454,
                      "src": "10391:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_bool_$returns$_t_bool_$",
                        "typeString": "function (bytes memory,bytes memory,bool) returns (bool)"
                      }
                    },
                    "id": 1612,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "10391:48:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1498,
                  "id": 1613,
                  "nodeType": "Return",
                  "src": "10384:55:3"
                }
              ]
            },
            "documentation": "@notice                       Adds headers to storage, performs additional validation of retarget\n @dev                          Checks the retarget, the heights, and the linkage\n @param  _oldPeriodStartHeader The first header in the difficulty period being closed\n @param  _oldPeriodEndHeader   The last header in the difficulty period being closed\n @param  _headers              A tightly-packed list of 80-byte Bitcoin headers\n @return                       True if successfully written, error otherwise",
            "id": 1615,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_addHeadersWithRetarget",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1495,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1490,
                  "name": "_oldPeriodStartHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8495:34:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1489,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "8495:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1492,
                  "name": "_oldPeriodEndHeader",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8539:32:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1491,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "8539:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1494,
                  "name": "_headers",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8581:21:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1493,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "8581:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8485:123:3"
            },
            "returnParameters": {
              "id": 1498,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1497,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1615,
                  "src": "8627:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1496,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "8627:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "8626:6:3"
            },
            "scope": 2252,
            "src": "8453:1993:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1675,
              "nodeType": "Block",
              "src": "10753:387:3",
              "statements": [
                {
                  "assignments": [
                    1623
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1623,
                      "name": "_height",
                      "nodeType": "VariableDeclaration",
                      "scope": 1675,
                      "src": "10763:15:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1622,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "10763:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1625,
                  "initialValue": {
                    "argumentTypes": null,
                    "hexValue": "30",
                    "id": 1624,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "number",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "10781:1:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_rational_0_by_1",
                      "typeString": "int_const 0"
                    },
                    "value": "0"
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10763:19:3"
                },
                {
                  "assignments": [
                    1627
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1627,
                      "name": "_current",
                      "nodeType": "VariableDeclaration",
                      "scope": 1675,
                      "src": "10792:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1626,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "10792:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1629,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1628,
                    "name": "_digest",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1617,
                    "src": "10811:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "10792:26:3"
                },
                {
                  "body": {
                    "id": 1669,
                    "nodeType": "Block",
                    "src": "10887:214:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1650,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1646,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1623,
                            "src": "10901:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1647,
                              "name": "blockHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1197,
                              "src": "10911:11:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_uint256_$",
                                "typeString": "mapping(bytes32 => uint256)"
                              }
                            },
                            "id": 1649,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1648,
                              "name": "_current",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1627,
                              "src": "10923:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "10911:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "10901:31:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1651,
                        "nodeType": "ExpressionStatement",
                        "src": "10901:31:3"
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 1654,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1652,
                            "name": "_height",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1623,
                            "src": "10950:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "hexValue": "30",
                            "id": 1653,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10961:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_0_by_1",
                              "typeString": "int_const 0"
                            },
                            "value": "0"
                          },
                          "src": "10950:12:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": {
                          "id": 1667,
                          "nodeType": "Block",
                          "src": "11037:54:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "id": 1664,
                                    "name": "i",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1631,
                                    "src": "11074:1:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 1662,
                                    "name": "_height",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1623,
                                    "src": "11062:7:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "id": 1663,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "add",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4365,
                                  "src": "11062:11:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 1665,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "11062:14:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "functionReturnParameters": 1621,
                              "id": 1666,
                              "nodeType": "Return",
                              "src": "11055:21:3"
                            }
                          ]
                        },
                        "id": 1668,
                        "nodeType": "IfStatement",
                        "src": "10946:145:3",
                        "trueBody": {
                          "id": 1661,
                          "nodeType": "Block",
                          "src": "10964:67:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1659,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 1655,
                                  "name": "_current",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1627,
                                  "src": "10982:8:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 1656,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "10993:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 1658,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 1657,
                                    "name": "_current",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1627,
                                    "src": "11007:8:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "nodeType": "IndexAccess",
                                  "src": "10993:23:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "10982:34:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1660,
                              "nodeType": "ExpressionStatement",
                              "src": "10982:34:3"
                            }
                          ]
                        }
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1638,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1634,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1631,
                      "src": "10848:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_uint32",
                        "typeString": "uint32"
                      },
                      "id": 1637,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1635,
                        "name": "HEIGHT_INTERVAL",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1183,
                        "src": "10852:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint32",
                          "typeString": "uint32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "+",
                      "rightExpression": {
                        "argumentTypes": null,
                        "hexValue": "31",
                        "id": 1636,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "number",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "10870:1:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_rational_1_by_1",
                          "typeString": "int_const 1"
                        },
                        "value": "1"
                      },
                      "src": "10852:19:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint32",
                        "typeString": "uint32"
                      }
                    },
                    "src": "10848:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1670,
                  "initializationExpression": {
                    "assignments": [
                      1631
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1631,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1670,
                        "src": "10833:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1630,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "10833:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1633,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1632,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "10845:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "10833:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1644,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1639,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1631,
                        "src": "10873:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1642,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "10883:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1640,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1631,
                            "src": "10877:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1641,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "10877:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1643,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "10877:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "10873:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1645,
                    "nodeType": "ExpressionStatement",
                    "src": "10873:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "10828:273:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "hexValue": "556e6b6e6f776e20626c6f636b",
                        "id": 1672,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "11117:15:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_2fe269f479def214aa4213fc5a3676b42da06f3fe6bec66494b82d7cb74589b0",
                          "typeString": "literal_string \"Unknown block\""
                        },
                        "value": "Unknown block"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_stringliteral_2fe269f479def214aa4213fc5a3676b42da06f3fe6bec66494b82d7cb74589b0",
                          "typeString": "literal_string \"Unknown block\""
                        }
                      ],
                      "id": 1671,
                      "name": "revert",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5028,
                        5029
                      ],
                      "referencedDeclaration": 5029,
                      "src": "11110:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (string memory) pure"
                      }
                    },
                    "id": 1673,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "11110:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1674,
                  "nodeType": "ExpressionStatement",
                  "src": "11110:23:3"
                }
              ]
            },
            "documentation": "@notice         Finds the height of a header by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header",
            "id": 1676,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_findHeight",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1618,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1617,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1676,
                  "src": "10704:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1616,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "10704:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10703:17:3"
            },
            "returnParameters": {
              "id": 1621,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1620,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1676,
                  "src": "10744:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1619,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "10744:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "10743:9:3"
            },
            "scope": 2252,
            "src": "10683:457:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1687,
              "nodeType": "Block",
              "src": "11467:44:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1684,
                        "name": "_digest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1678,
                        "src": "11496:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1683,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "11484:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 1685,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "11484:20:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 1682,
                  "id": 1686,
                  "nodeType": "Return",
                  "src": "11477:27:3"
                }
              ]
            },
            "documentation": "@notice         Finds the height of a header by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header, or error if unknown",
            "id": 1688,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "findHeight",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1679,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1678,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1688,
                  "src": "11418:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1677,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "11418:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11417:17:3"
            },
            "returnParameters": {
              "id": 1682,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1681,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1688,
                  "src": "11458:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1680,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "11458:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11457:9:3"
            },
            "scope": 2252,
            "src": "11398:113:3",
            "stateMutability": "view",
            "superFunction": 1101,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1734,
              "nodeType": "Block",
              "src": "11859:244:3",
              "statements": [
                {
                  "assignments": [
                    1698
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1698,
                      "name": "_current",
                      "nodeType": "VariableDeclaration",
                      "scope": 1734,
                      "src": "11869:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1697,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "11869:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1700,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1699,
                    "name": "_digest",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1690,
                    "src": "11888:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "11869:26:3"
                },
                {
                  "body": {
                    "id": 1721,
                    "nodeType": "Block",
                    "src": "11952:59:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1719,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1715,
                            "name": "_current",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1698,
                            "src": "11966:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1716,
                              "name": "previousBlock",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1193,
                              "src": "11977:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                "typeString": "mapping(bytes32 => bytes32)"
                              }
                            },
                            "id": 1718,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1717,
                              "name": "_current",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1698,
                              "src": "11991:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "11977:23:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "11966:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1720,
                        "nodeType": "ExpressionStatement",
                        "src": "11966:34:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1707,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1705,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1702,
                      "src": "11925:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1706,
                      "name": "_offset",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1692,
                      "src": "11929:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "11925:11:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1722,
                  "initializationExpression": {
                    "assignments": [
                      1702
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1702,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1722,
                        "src": "11910:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1701,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "11910:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1704,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1703,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "11922:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "11910:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1713,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1708,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1702,
                        "src": "11938:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1711,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "11948:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1709,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1702,
                            "src": "11942:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1710,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "11942:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1712,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "11942:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "11938:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1714,
                    "nodeType": "ExpressionStatement",
                    "src": "11938:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "11905:106:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1728,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1724,
                          "name": "_current",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1698,
                          "src": "12028:8:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 1726,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "12048:1:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 1725,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "12040:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_bytes32_$",
                              "typeString": "type(bytes32)"
                            },
                            "typeName": "bytes32"
                          },
                          "id": 1727,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "12040:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "12028:22:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "556e6b6e6f776e20616e636573746f72",
                        "id": 1729,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "12052:18:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_c461b76bf1480a8b20105a19184a1758b87ce3c97e130df422cacaf91904c3a2",
                          "typeString": "literal_string \"Unknown ancestor\""
                        },
                        "value": "Unknown ancestor"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_c461b76bf1480a8b20105a19184a1758b87ce3c97e130df422cacaf91904c3a2",
                          "typeString": "literal_string \"Unknown ancestor\""
                        }
                      ],
                      "id": 1723,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "12020:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1730,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "12020:51:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1731,
                  "nodeType": "ExpressionStatement",
                  "src": "12020:51:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1732,
                    "name": "_current",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1698,
                    "src": "12088:8:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 1696,
                  "id": 1733,
                  "nodeType": "Return",
                  "src": "12081:15:3"
                }
              ]
            },
            "documentation": "@notice         Finds an ancestor for a block by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header, or error if unknown",
            "id": 1735,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_findAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1693,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1690,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1735,
                  "src": "11793:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1689,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "11793:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1692,
                  "name": "_offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1735,
                  "src": "11810:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1691,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "11810:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11792:34:3"
            },
            "returnParameters": {
              "id": 1696,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1695,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1735,
                  "src": "11850:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1694,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "11850:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "11849:9:3"
            },
            "scope": 2252,
            "src": "11770:333:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1749,
              "nodeType": "Block",
              "src": "12450:55:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1745,
                        "name": "_digest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1737,
                        "src": "12481:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1746,
                        "name": "_offset",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1739,
                        "src": "12490:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 1744,
                      "name": "_findAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1735,
                      "src": "12467:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_uint256_$returns$_t_bytes32_$",
                        "typeString": "function (bytes32,uint256) view returns (bytes32)"
                      }
                    },
                    "id": 1747,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "12467:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 1743,
                  "id": 1748,
                  "nodeType": "Return",
                  "src": "12460:38:3"
                }
              ]
            },
            "documentation": "@notice         Finds an ancestor for a block by its digest\n @dev            Will fail if the header is unknown\n @param _digest  The header digest to search for\n @return         The height of the header, or error if unknown",
            "id": 1750,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "findAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1740,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1737,
                  "name": "_digest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1750,
                  "src": "12384:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1736,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "12384:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1739,
                  "name": "_offset",
                  "nodeType": "VariableDeclaration",
                  "scope": 1750,
                  "src": "12401:15:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1738,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "12401:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "12383:34:3"
            },
            "returnParameters": {
              "id": 1743,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1742,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1750,
                  "src": "12441:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1741,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "12441:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "12440:9:3"
            },
            "scope": 2252,
            "src": "12362:143:3",
            "stateMutability": "view",
            "superFunction": 1110,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1796,
              "nodeType": "Block",
              "src": "13066:332:3",
              "statements": [
                {
                  "assignments": [
                    1762
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1762,
                      "name": "_current",
                      "nodeType": "VariableDeclaration",
                      "scope": 1796,
                      "src": "13076:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1761,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "13076:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1764,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1763,
                    "name": "_descendant",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1754,
                    "src": "13095:11:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "13076:30:3"
                },
                {
                  "body": {
                    "id": 1792,
                    "nodeType": "Block",
                    "src": "13227:143:3",
                    "statements": [
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1781,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1779,
                            "name": "_current",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1762,
                            "src": "13245:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "==",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1780,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1752,
                            "src": "13257:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "13245:21:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 1785,
                        "nodeType": "IfStatement",
                        "src": "13241:71:3",
                        "trueBody": {
                          "id": 1784,
                          "nodeType": "Block",
                          "src": "13268:44:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "hexValue": "74727565",
                                "id": 1782,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": true,
                                "kind": "bool",
                                "lValueRequested": false,
                                "nodeType": "Literal",
                                "src": "13293:4:3",
                                "subdenomination": null,
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bool",
                                  "typeString": "bool"
                                },
                                "value": "true"
                              },
                              "functionReturnParameters": 1760,
                              "id": 1783,
                              "nodeType": "Return",
                              "src": "13286:11:3"
                            }
                          ]
                        }
                      },
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1790,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1786,
                            "name": "_current",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1762,
                            "src": "13325:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "baseExpression": {
                              "argumentTypes": null,
                              "id": 1787,
                              "name": "previousBlock",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1193,
                              "src": "13336:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                "typeString": "mapping(bytes32 => bytes32)"
                              }
                            },
                            "id": 1789,
                            "indexExpression": {
                              "argumentTypes": null,
                              "id": 1788,
                              "name": "_current",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1762,
                              "src": "13350:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            "isConstant": false,
                            "isLValue": true,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "IndexAccess",
                            "src": "13336:23:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "13325:34:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "id": 1791,
                        "nodeType": "ExpressionStatement",
                        "src": "13325:34:3"
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1771,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1769,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1766,
                      "src": "13201:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1770,
                      "name": "_limit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1756,
                      "src": "13205:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "13201:10:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 1793,
                  "initializationExpression": {
                    "assignments": [
                      1766
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1766,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 1793,
                        "src": "13186:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1765,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "13186:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1768,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1767,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "13198:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "13186:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1777,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1772,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1766,
                        "src": "13213:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1775,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "13223:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1773,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1766,
                            "src": "13217:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1774,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "13217:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1776,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "13217:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "13213:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1778,
                    "nodeType": "ExpressionStatement",
                    "src": "13213:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "13181:189:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "66616c7365",
                    "id": 1794,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "13386:5:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "false"
                  },
                  "functionReturnParameters": 1760,
                  "id": 1795,
                  "nodeType": "Return",
                  "src": "13379:12:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective ancestor\n @param _descendant  The descendant to check\n @param _limit       The maximum number of blocks to check\n @return             true if ancestor is at most limit blocks lower than descendant, otherwise false",
            "id": 1797,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_isAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1757,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1752,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "12981:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1751,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "12981:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1754,
                  "name": "_descendant",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "13000:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1753,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "13000:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1756,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "13021:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1755,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "13021:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "12980:56:3"
            },
            "returnParameters": {
              "id": 1760,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1759,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1797,
                  "src": "13060:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1758,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "13060:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "13059:6:3"
            },
            "scope": 2252,
            "src": "12960:438:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1814,
              "nodeType": "Block",
              "src": "13958:67:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1809,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1799,
                        "src": "13987:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1810,
                        "name": "_descendant",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1801,
                        "src": "13998:11:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1811,
                        "name": "_limit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1803,
                        "src": "14011:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 1808,
                      "name": "_isAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1797,
                      "src": "13975:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes32_$_t_uint256_$returns$_t_bool_$",
                        "typeString": "function (bytes32,bytes32,uint256) view returns (bool)"
                      }
                    },
                    "id": 1812,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "13975:43:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1807,
                  "id": 1813,
                  "nodeType": "Return",
                  "src": "13968:50:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective ancestor\n @param _descendant  The descendant to check\n @param _limit       The maximum number of blocks to check\n @return             true if ancestor is at most limit blocks lower than descendant, otherwise false",
            "id": 1815,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "isAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1804,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1799,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13873:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1798,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "13873:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1801,
                  "name": "_descendant",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13892:19:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1800,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "13892:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1803,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13913:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1802,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "13913:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "13872:56:3"
            },
            "returnParameters": {
              "id": 1807,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1806,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1815,
                  "src": "13952:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1805,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "13952:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "13951:6:3"
            },
            "scope": 2252,
            "src": "13853:172:3",
            "stateMutability": "view",
            "superFunction": 1121,
            "visibility": "external"
          },
          {
            "body": {
              "id": 1910,
              "nodeType": "Block",
              "src": "14791:1023:3",
              "statements": [
                {
                  "assignments": [
                    1829
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1829,
                      "name": "_newBestDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1910,
                      "src": "14801:22:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1828,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "14801:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1833,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1830,
                        "name": "_newBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1821,
                        "src": "14826:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1831,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "14826:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1832,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "14826:18:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "14801:43:3"
                },
                {
                  "assignments": [
                    1835
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1835,
                      "name": "_currentBestDigest",
                      "nodeType": "VariableDeclaration",
                      "scope": 1910,
                      "src": "14854:26:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1834,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "14854:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1839,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1836,
                        "name": "_currentBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1819,
                        "src": "14883:12:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1837,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "hash256",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 2792,
                      "src": "14883:20:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (bytes32)"
                      }
                    },
                    "id": 1838,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "14883:22:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "14854:51:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1843,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 1841,
                          "name": "_currentBestDigest",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1835,
                          "src": "14923:18:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1842,
                          "name": "bestKnownDigest",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1187,
                          "src": "14945:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "14923:37:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "50617373656420696e2062657374206973206e6f742062657374206b6e6f776e",
                        "id": 1844,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "14962:34:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_08d40782ec860529d1a49d4deccf329d686c48a4affb967e8f3fe896477d9012",
                          "typeString": "literal_string \"Passed in best is not best known\""
                        },
                        "value": "Passed in best is not best known"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_08d40782ec860529d1a49d4deccf329d686c48a4affb967e8f3fe896477d9012",
                          "typeString": "literal_string \"Passed in best is not best known\""
                        }
                      ],
                      "id": 1840,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "14915:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1845,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "14915:82:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1846,
                  "nodeType": "ExpressionStatement",
                  "src": "14915:82:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1854,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "baseExpression": {
                            "argumentTypes": null,
                            "id": 1848,
                            "name": "previousBlock",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1193,
                            "src": "15028:13:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                              "typeString": "mapping(bytes32 => bytes32)"
                            }
                          },
                          "id": 1850,
                          "indexExpression": {
                            "argumentTypes": null,
                            "id": 1849,
                            "name": "_newBestDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1829,
                            "src": "15042:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "isConstant": false,
                          "isLValue": true,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "IndexAccess",
                          "src": "15028:29:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "!=",
                        "rightExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "hexValue": "30",
                              "id": 1852,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": true,
                              "kind": "number",
                              "lValueRequested": false,
                              "nodeType": "Literal",
                              "src": "15069:1:3",
                              "subdenomination": null,
                              "typeDescriptions": {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              },
                              "value": "0"
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_rational_0_by_1",
                                "typeString": "int_const 0"
                              }
                            ],
                            "id": 1851,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "lValueRequested": false,
                            "nodeType": "ElementaryTypeNameExpression",
                            "src": "15061:7:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_type$_t_bytes32_$",
                              "typeString": "type(bytes32)"
                            },
                            "typeName": "bytes32"
                          },
                          "id": 1853,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "typeConversion",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "15061:10:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "15028:43:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4e6577206265737420697320756e6b6e6f776e",
                        "id": 1855,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "15085:21:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_21175d40c2ebef79a732817277d464b099ad41722534bb4c1a81ec30c878b42d",
                          "typeString": "literal_string \"New best is unknown\""
                        },
                        "value": "New best is unknown"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_21175d40c2ebef79a732817277d464b099ad41722534bb4c1a81ec30c878b42d",
                          "typeString": "literal_string \"New best is unknown\""
                        }
                      ],
                      "id": 1847,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "15007:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1856,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15007:100:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1857,
                  "nodeType": "ExpressionStatement",
                  "src": "15007:100:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "id": 1860,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1817,
                            "src": "15160:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          {
                            "argumentTypes": null,
                            "id": 1861,
                            "name": "bestKnownDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1187,
                            "src": "15171:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          {
                            "argumentTypes": null,
                            "id": 1862,
                            "name": "_newBestDigest",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1829,
                            "src": "15188:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          {
                            "argumentTypes": null,
                            "id": 1863,
                            "name": "_limit",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1823,
                            "src": "15204:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            },
                            {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            },
                            {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            },
                            {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          ],
                          "id": 1859,
                          "name": "_isMostRecentAncestor",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2035,
                          "src": "15138:21:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes32_$_t_bytes32_$_t_uint256_$returns$_t_bool_$",
                            "typeString": "function (bytes32,bytes32,bytes32,uint256) view returns (bool)"
                          }
                        },
                        "id": 1864,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "15138:73:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "416e636573746f72206d75737420626520686561766965737420636f6d6d6f6e20616e636573746f72",
                        "id": 1865,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "15225:43:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_fcaf5361cb1b11aa6567d172fd21d0d1e008d17e89623abf194305ef538c3052",
                          "typeString": "literal_string \"Ancestor must be heaviest common ancestor\""
                        },
                        "value": "Ancestor must be heaviest common ancestor"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_fcaf5361cb1b11aa6567d172fd21d0d1e008d17e89623abf194305ef538c3052",
                          "typeString": "literal_string \"Ancestor must be heaviest common ancestor\""
                        }
                      ],
                      "id": 1858,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "15117:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1866,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15117:152:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1867,
                  "nodeType": "ExpressionStatement",
                  "src": "15117:152:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        "id": 1875,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "arguments": [
                            {
                              "argumentTypes": null,
                              "id": 1870,
                              "name": "_ancestor",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1817,
                              "src": "15322:9:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 1871,
                              "name": "_currentBest",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1819,
                              "src": "15333:12:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            {
                              "argumentTypes": null,
                              "id": 1872,
                              "name": "_newBest",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 1821,
                              "src": "15347:8:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            }
                          ],
                          "expression": {
                            "argumentTypes": [
                              {
                                "typeIdentifier": "t_bytes32",
                                "typeString": "bytes32"
                              },
                              {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              },
                              {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            ],
                            "id": 1869,
                            "name": "_heaviestFromAncestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2193,
                            "src": "15300:21:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
                              "typeString": "function (bytes32,bytes memory,bytes memory) view returns (bytes32)"
                            }
                          },
                          "id": 1873,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "15300:56:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "==",
                        "rightExpression": {
                          "argumentTypes": null,
                          "id": 1874,
                          "name": "_newBestDigest",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 1829,
                          "src": "15360:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "src": "15300:74:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "4e65772062657374206861736820646f6573206e6f742068617665206d6f726520776f726b207468616e2070726576696f7573",
                        "id": 1876,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "15388:53:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_9fd7a9403f83332e39cd942cb934228aad1aa94f9f120f93fcbad363acc5034e",
                          "typeString": "literal_string \"New best hash does not have more work than previous\""
                        },
                        "value": "New best hash does not have more work than previous"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_9fd7a9403f83332e39cd942cb934228aad1aa94f9f120f93fcbad363acc5034e",
                          "typeString": "literal_string \"New best hash does not have more work than previous\""
                        }
                      ],
                      "id": 1868,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "15279:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 1877,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15279:163:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1878,
                  "nodeType": "ExpressionStatement",
                  "src": "15279:163:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1881,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1879,
                      "name": "bestKnownDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1187,
                      "src": "15453:15:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1880,
                      "name": "_newBestDigest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1829,
                      "src": "15471:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "15453:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1882,
                  "nodeType": "ExpressionStatement",
                  "src": "15453:32:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 1885,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftHandSide": {
                      "argumentTypes": null,
                      "id": 1883,
                      "name": "lastReorgCommonAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1189,
                      "src": "15495:23:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "Assignment",
                    "operator": "=",
                    "rightHandSide": {
                      "argumentTypes": null,
                      "id": 1884,
                      "name": "_ancestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1817,
                      "src": "15521:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "15495:35:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "id": 1886,
                  "nodeType": "ExpressionStatement",
                  "src": "15495:35:3"
                },
                {
                  "assignments": [
                    1888
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1888,
                      "name": "_newDiff",
                      "nodeType": "VariableDeclaration",
                      "scope": 1910,
                      "src": "15541:16:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 1887,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "15541:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1892,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [],
                    "expression": {
                      "argumentTypes": [],
                      "expression": {
                        "argumentTypes": null,
                        "id": 1889,
                        "name": "_newBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1821,
                        "src": "15560:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_memory_ptr",
                          "typeString": "bytes memory"
                        }
                      },
                      "id": 1890,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "extractDifficulty",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 3864,
                      "src": "15560:26:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                        "typeString": "function (bytes memory) pure returns (uint256)"
                      }
                    },
                    "id": 1891,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15560:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "15541:47:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1895,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1893,
                      "name": "_newDiff",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1888,
                      "src": "15602:8:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1894,
                      "name": "currentEpochDiff",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1199,
                      "src": "15614:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "15602:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1901,
                  "nodeType": "IfStatement",
                  "src": "15598:84:3",
                  "trueBody": {
                    "id": 1900,
                    "nodeType": "Block",
                    "src": "15632:50:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "id": 1898,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftHandSide": {
                            "argumentTypes": null,
                            "id": 1896,
                            "name": "currentEpochDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1199,
                            "src": "15644:16:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "Assignment",
                          "operator": "=",
                          "rightHandSide": {
                            "argumentTypes": null,
                            "id": 1897,
                            "name": "_newDiff",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1888,
                            "src": "15663:8:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "15644:27:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "id": 1899,
                        "nodeType": "ExpressionStatement",
                        "src": "15644:27:3"
                      }
                    ]
                  }
                },
                {
                  "eventCall": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1903,
                        "name": "_currentBestDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1835,
                        "src": "15716:18:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1904,
                        "name": "_newBestDigest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1829,
                        "src": "15748:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1905,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1817,
                        "src": "15776:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 1902,
                      "name": "Reorg",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1056,
                      "src": "15697:5:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_event_nonpayable$_t_bytes32_$_t_bytes32_$_t_bytes32_$returns$__$",
                        "typeString": "function (bytes32,bytes32,bytes32)"
                      }
                    },
                    "id": 1906,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "15697:89:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 1907,
                  "nodeType": "EmitStatement",
                  "src": "15692:94:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "74727565",
                    "id": 1908,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "15803:4:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "true"
                  },
                  "functionReturnParameters": 1827,
                  "id": 1909,
                  "nodeType": "Return",
                  "src": "15796:11:3"
                }
              ]
            },
            "documentation": "@notice                   Gives a starting point for the relay\n @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n @param  _ancestor         The digest of the most recent common ancestor\n @param  _currentBest      The 80-byte header referenced by bestKnownDigest\n @param  _newBest          The 80-byte header to mark as the new best\n @param  _limit            Limit the amount of traversal of the chain\n @return                   True if successfully updates bestKnownDigest, error otherwise",
            "id": 1911,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_markNewHeaviest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1824,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1817,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14653:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1816,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "14653:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1819,
                  "name": "_currentBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14680:25:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1818,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "14680:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1821,
                  "name": "_newBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14715:21:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1820,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "14715:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1823,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14746:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1822,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "14746:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "14643:123:3"
            },
            "returnParameters": {
              "id": 1827,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1826,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1911,
                  "src": "14785:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1825,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "14785:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "14784:6:3"
            },
            "scope": 2252,
            "src": "14618:1196:3",
            "stateMutability": "nonpayable",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 1931,
              "nodeType": "Block",
              "src": "16583:83:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 1925,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1913,
                        "src": "16617:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1926,
                        "name": "_currentBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1915,
                        "src": "16628:12:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1927,
                        "name": "_newBest",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1917,
                        "src": "16642:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 1928,
                        "name": "_limit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1919,
                        "src": "16652:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 1924,
                      "name": "_markNewHeaviest",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1911,
                      "src": "16600:16:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_nonpayable$_t_bytes32_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$_t_uint256_$returns$_t_bool_$",
                        "typeString": "function (bytes32,bytes memory,bytes memory,uint256) returns (bool)"
                      }
                    },
                    "id": 1929,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "16600:59:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 1923,
                  "id": 1930,
                  "nodeType": "Return",
                  "src": "16593:66:3"
                }
              ]
            },
            "documentation": "@notice                   Gives a starting point for the relay\n @dev                      We don't check this AT ALL really. Don't use relays with bad genesis\n @param  _ancestor         The digest of the most recent common ancestor\n @param  _currentBest      The 80-byte header referenced by bestKnownDigest\n @param  _newBest          The 80-byte header to mark as the new best\n @param  _limit            Limit the amount of traversal of the chain\n @return                   True if successfully updates bestKnownDigest, error otherwise",
            "id": 1932,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "markNewHeaviest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1920,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1913,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16441:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1912,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "16441:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1915,
                  "name": "_currentBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16468:27:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1914,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "16468:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1917,
                  "name": "_newBest",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16505:23:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 1916,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "16505:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1919,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16538:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1918,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "16538:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "16431:127:3"
            },
            "returnParameters": {
              "id": 1923,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1922,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 1932,
                  "src": "16577:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1921,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "16577:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "16576:6:3"
            },
            "scope": 2252,
            "src": "16407:259:3",
            "stateMutability": "nonpayable",
            "superFunction": 1165,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2034,
              "nodeType": "Block",
              "src": "17317:918:3",
              "statements": [
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 1951,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 1947,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1945,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1934,
                        "src": "17362:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "==",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1946,
                        "name": "_left",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1936,
                        "src": "17375:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "src": "17362:18:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "commonType": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "id": 1950,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftExpression": {
                        "argumentTypes": null,
                        "id": 1948,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1934,
                        "src": "17384:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "nodeType": "BinaryOperation",
                      "operator": "==",
                      "rightExpression": {
                        "argumentTypes": null,
                        "id": 1949,
                        "name": "_right",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1938,
                        "src": "17397:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "src": "17384:19:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "17362:41:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 1955,
                  "nodeType": "IfStatement",
                  "src": "17358:83:3",
                  "trueBody": {
                    "id": 1954,
                    "nodeType": "Block",
                    "src": "17405:36:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "hexValue": "74727565",
                          "id": 1952,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "bool",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "17426:4:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "value": "true"
                        },
                        "functionReturnParameters": 1944,
                        "id": 1953,
                        "nodeType": "Return",
                        "src": "17419:11:3"
                      }
                    ]
                  }
                },
                {
                  "assignments": [
                    1957
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1957,
                      "name": "_leftCurrent",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17451:20:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1956,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17451:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1959,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1958,
                    "name": "_left",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1936,
                    "src": "17474:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17451:28:3"
                },
                {
                  "assignments": [
                    1961
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1961,
                      "name": "_rightCurrent",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17489:21:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1960,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17489:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1963,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1962,
                    "name": "_right",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1938,
                    "src": "17513:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17489:30:3"
                },
                {
                  "assignments": [
                    1965
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1965,
                      "name": "_leftPrev",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17529:17:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1964,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17529:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1967,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1966,
                    "name": "_left",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1936,
                    "src": "17549:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17529:25:3"
                },
                {
                  "assignments": [
                    1969
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 1969,
                      "name": "_rightPrev",
                      "nodeType": "VariableDeclaration",
                      "scope": 2034,
                      "src": "17564:18:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      },
                      "typeName": {
                        "id": 1968,
                        "name": "bytes32",
                        "nodeType": "ElementaryTypeName",
                        "src": "17564:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 1971,
                  "initialValue": {
                    "argumentTypes": null,
                    "id": 1970,
                    "name": "_right",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1938,
                    "src": "17585:6:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "17564:27:3"
                },
                {
                  "body": {
                    "id": 2016,
                    "nodeType": "Block",
                    "src": "17647:368:3",
                    "statements": [
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 1988,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 1986,
                            "name": "_leftPrev",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1965,
                            "src": "17665:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "!=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 1987,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1934,
                            "src": "17678:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "17665:22:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 2000,
                        "nodeType": "IfStatement",
                        "src": "17661:163:3",
                        "trueBody": {
                          "id": 1999,
                          "nodeType": "Block",
                          "src": "17689:135:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1991,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 1989,
                                  "name": "_leftCurrent",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1957,
                                  "src": "17707:12:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "id": 1990,
                                  "name": "_leftPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1965,
                                  "src": "17722:9:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17707:24:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1992,
                              "nodeType": "ExpressionStatement",
                              "src": "17707:24:3"
                            },
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 1997,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 1993,
                                  "name": "_leftPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1965,
                                  "src": "17759:9:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 1994,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "17771:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 1996,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 1995,
                                    "name": "_leftPrev",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1965,
                                    "src": "17785:9:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "nodeType": "IndexAccess",
                                  "src": "17771:24:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17759:36:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 1998,
                              "nodeType": "ExpressionStatement",
                              "src": "17759:36:3"
                            }
                          ]
                        }
                      },
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          },
                          "id": 2003,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2001,
                            "name": "_rightPrev",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1969,
                            "src": "17841:10:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "!=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2002,
                            "name": "_ancestor",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1934,
                            "src": "17855:9:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "src": "17841:23:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": null,
                        "id": 2015,
                        "nodeType": "IfStatement",
                        "src": "17837:168:3",
                        "trueBody": {
                          "id": 2014,
                          "nodeType": "Block",
                          "src": "17866:139:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 2006,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 2004,
                                  "name": "_rightCurrent",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1961,
                                  "src": "17884:13:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "id": 2005,
                                  "name": "_rightPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1969,
                                  "src": "17900:10:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17884:26:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 2007,
                              "nodeType": "ExpressionStatement",
                              "src": "17884:26:3"
                            },
                            {
                              "expression": {
                                "argumentTypes": null,
                                "id": 2012,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "leftHandSide": {
                                  "argumentTypes": null,
                                  "id": 2008,
                                  "name": "_rightPrev",
                                  "nodeType": "Identifier",
                                  "overloadedDeclarations": [],
                                  "referencedDeclaration": 1969,
                                  "src": "17938:10:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "nodeType": "Assignment",
                                "operator": "=",
                                "rightHandSide": {
                                  "argumentTypes": null,
                                  "baseExpression": {
                                    "argumentTypes": null,
                                    "id": 2009,
                                    "name": "previousBlock",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1193,
                                    "src": "17951:13:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_mapping$_t_bytes32_$_t_bytes32_$",
                                      "typeString": "mapping(bytes32 => bytes32)"
                                    }
                                  },
                                  "id": 2011,
                                  "indexExpression": {
                                    "argumentTypes": null,
                                    "id": 2010,
                                    "name": "_rightPrev",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 1969,
                                    "src": "17965:10:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes32",
                                      "typeString": "bytes32"
                                    }
                                  },
                                  "isConstant": false,
                                  "isLValue": true,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "nodeType": "IndexAccess",
                                  "src": "17951:25:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_bytes32",
                                    "typeString": "bytes32"
                                  }
                                },
                                "src": "17938:38:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "id": 2013,
                              "nodeType": "ExpressionStatement",
                              "src": "17938:38:3"
                            }
                          ]
                        }
                      }
                    ]
                  },
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 1978,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 1976,
                      "name": "i",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1973,
                      "src": "17621:1:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 1977,
                      "name": "_limit",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1940,
                      "src": "17625:6:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "17621:10:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "id": 2017,
                  "initializationExpression": {
                    "assignments": [
                      1973
                    ],
                    "declarations": [
                      {
                        "constant": false,
                        "id": 1973,
                        "name": "i",
                        "nodeType": "VariableDeclaration",
                        "scope": 2017,
                        "src": "17606:9:3",
                        "stateVariable": false,
                        "storageLocation": "default",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "typeName": {
                          "id": 1972,
                          "name": "uint256",
                          "nodeType": "ElementaryTypeName",
                          "src": "17606:7:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "value": null,
                        "visibility": "internal"
                      }
                    ],
                    "id": 1975,
                    "initialValue": {
                      "argumentTypes": null,
                      "hexValue": "30",
                      "id": 1974,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": true,
                      "kind": "number",
                      "lValueRequested": false,
                      "nodeType": "Literal",
                      "src": "17618:1:3",
                      "subdenomination": null,
                      "typeDescriptions": {
                        "typeIdentifier": "t_rational_0_by_1",
                        "typeString": "int_const 0"
                      },
                      "value": "0"
                    },
                    "nodeType": "VariableDeclarationStatement",
                    "src": "17606:13:3"
                  },
                  "loopExpression": {
                    "expression": {
                      "argumentTypes": null,
                      "id": 1984,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "leftHandSide": {
                        "argumentTypes": null,
                        "id": 1979,
                        "name": "i",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 1973,
                        "src": "17633:1:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "nodeType": "Assignment",
                      "operator": "=",
                      "rightHandSide": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "31",
                            "id": 1982,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "17643:1:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            },
                            "value": "1"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_1_by_1",
                              "typeString": "int_const 1"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 1980,
                            "name": "i",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 1973,
                            "src": "17637:1:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 1981,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "17637:5:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 1983,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "17637:8:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "src": "17633:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "id": 1985,
                    "nodeType": "ExpressionStatement",
                    "src": "17633:12:3"
                  },
                  "nodeType": "ForStatement",
                  "src": "17602:413:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    },
                    "id": 2020,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2018,
                      "name": "_leftCurrent",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1957,
                      "src": "18028:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "==",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2019,
                      "name": "_rightCurrent",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1961,
                      "src": "18044:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "18028:29:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2024,
                  "nodeType": "IfStatement",
                  "src": "18024:50:3",
                  "trueBody": {
                    "id": 2023,
                    "nodeType": "Block",
                    "src": "18059:15:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "hexValue": "66616c7365",
                          "id": 2021,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "bool",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "18067:5:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "value": "false"
                        },
                        "functionReturnParameters": 1944,
                        "id": 2022,
                        "nodeType": "Return",
                        "src": "18060:12:3"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    },
                    "id": 2027,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2025,
                      "name": "_leftPrev",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1965,
                      "src": "18136:9:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "!=",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2026,
                      "name": "_rightPrev",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1969,
                      "src": "18149:10:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bytes32",
                        "typeString": "bytes32"
                      }
                    },
                    "src": "18136:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2031,
                  "nodeType": "IfStatement",
                  "src": "18132:44:3",
                  "trueBody": {
                    "id": 2030,
                    "nodeType": "Block",
                    "src": "18161:15:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "hexValue": "66616c7365",
                          "id": 2028,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "bool",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "18169:5:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          },
                          "value": "false"
                        },
                        "functionReturnParameters": 1944,
                        "id": 2029,
                        "nodeType": "Return",
                        "src": "18162:12:3"
                      }
                    ]
                  }
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "hexValue": "74727565",
                    "id": 2032,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": true,
                    "kind": "bool",
                    "lValueRequested": false,
                    "nodeType": "Literal",
                    "src": "18224:4:3",
                    "subdenomination": null,
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "value": "true"
                  },
                  "functionReturnParameters": 1944,
                  "id": 2033,
                  "nodeType": "Return",
                  "src": "18217:11:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @param _limit       The maximum number of blocks to check\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2035,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_isMostRecentAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 1941,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1934,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17193:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1933,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "17193:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1936,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17220:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1935,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "17220:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1938,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17243:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 1937,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "17243:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 1940,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17267:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 1939,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "17267:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "17183:104:3"
            },
            "returnParameters": {
              "id": 1944,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 1943,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2035,
                  "src": "17311:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 1942,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "17311:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "17310:6:3"
            },
            "scope": 2252,
            "src": "17153:1082:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 2055,
              "nodeType": "Block",
              "src": "18885:79:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2049,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2037,
                        "src": "18924:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2050,
                        "name": "_left",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2039,
                        "src": "18935:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2051,
                        "name": "_right",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2041,
                        "src": "18942:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2052,
                        "name": "_limit",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2043,
                        "src": "18950:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "id": 2048,
                      "name": "_isMostRecentAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2035,
                      "src": "18902:21:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes32_$_t_bytes32_$_t_uint256_$returns$_t_bool_$",
                        "typeString": "function (bytes32,bytes32,bytes32,uint256) view returns (bool)"
                      }
                    },
                    "id": 2053,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "18902:55:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "functionReturnParameters": 2047,
                  "id": 2054,
                  "nodeType": "Return",
                  "src": "18895:62:3"
                }
              ]
            },
            "documentation": "@notice             Checks if a digest is an ancestor of the current one\n @dev                Limit the amount of lookups (and thus gas usage) with _limit\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @param _limit       The maximum number of blocks to check\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2056,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "isMostRecentAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2044,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2037,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18761:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2036,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "18761:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2039,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18788:13:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2038,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "18788:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2041,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18811:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2040,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "18811:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2043,
                  "name": "_limit",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18835:14:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2042,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "18835:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "18751:104:3"
            },
            "returnParameters": {
              "id": 2047,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2046,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2056,
                  "src": "18879:4:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bool",
                    "typeString": "bool"
                  },
                  "typeName": {
                    "id": 2045,
                    "name": "bool",
                    "nodeType": "ElementaryTypeName",
                    "src": "18879:4:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "18878:6:3"
            },
            "scope": 2252,
            "src": "18722:242:3",
            "stateMutability": "view",
            "superFunction": 1069,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2192,
              "nodeType": "Block",
              "src": "19520:1615:3",
              "statements": [
                {
                  "assignments": [
                    2068
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2068,
                      "name": "_ancestorHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19530:23:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2067,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19530:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2072,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2070,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2058,
                        "src": "19568:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 2069,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "19556:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 2071,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19556:22:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19530:48:3"
                },
                {
                  "assignments": [
                    2074
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2074,
                      "name": "_leftHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19588:19:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2073,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19588:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2080,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2076,
                            "name": "_left",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2060,
                            "src": "19622:5:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 2077,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "19622:13:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 2078,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "19622:15:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 2075,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "19610:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 2079,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19610:28:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19588:50:3"
                },
                {
                  "assignments": [
                    2082
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2082,
                      "name": "_rightHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19648:20:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2081,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19648:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2088,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "arguments": [],
                        "expression": {
                          "argumentTypes": [],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2084,
                            "name": "_right",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2062,
                            "src": "19683:6:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes_memory_ptr",
                              "typeString": "bytes memory"
                            }
                          },
                          "id": 2085,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "hash256",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 2792,
                          "src": "19683:14:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                            "typeString": "function (bytes memory) pure returns (bytes32)"
                          }
                        },
                        "id": 2086,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "19683:16:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      ],
                      "id": 2083,
                      "name": "_findHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 1676,
                      "src": "19671:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$returns$_t_uint256_$",
                        "typeString": "function (bytes32) view returns (uint256)"
                      }
                    },
                    "id": 2087,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19671:29:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19648:52:3"
                },
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        "id": 2096,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2092,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2090,
                            "name": "_leftHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2074,
                            "src": "19732:11:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2091,
                            "name": "_ancestorHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2068,
                            "src": "19747:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "19732:30:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "&&",
                        "rightExpression": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2095,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "id": 2093,
                            "name": "_rightHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2082,
                            "src": "19766:12:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": ">=",
                          "rightExpression": {
                            "argumentTypes": null,
                            "id": 2094,
                            "name": "_ancestorHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2068,
                            "src": "19782:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "19766:31:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "src": "19732:65:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "hexValue": "412064657363656e64616e74206865696768742069732062656c6f772074686520616e636573746f7220686569676874",
                        "id": 2097,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": true,
                        "kind": "string",
                        "lValueRequested": false,
                        "nodeType": "Literal",
                        "src": "19811:50:3",
                        "subdenomination": null,
                        "typeDescriptions": {
                          "typeIdentifier": "t_stringliteral_b58061f6326ff3d0324de253af04d745211e5ff4898fed03b468cbd3387ef7f2",
                          "typeString": "literal_string \"A descendant height is below the ancestor height\""
                        },
                        "value": "A descendant height is below the ancestor height"
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        },
                        {
                          "typeIdentifier": "t_stringliteral_b58061f6326ff3d0324de253af04d745211e5ff4898fed03b468cbd3387ef7f2",
                          "typeString": "literal_string \"A descendant height is below the ancestor height\""
                        }
                      ],
                      "id": 2089,
                      "name": "require",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [
                        5026,
                        5027
                      ],
                      "referencedDeclaration": 5027,
                      "src": "19711:7:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
                        "typeString": "function (bool,string memory) pure"
                      }
                    },
                    "id": 2098,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "19711:151:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_tuple$__$",
                      "typeString": "tuple()"
                    }
                  },
                  "id": 2099,
                  "nodeType": "ExpressionStatement",
                  "src": "19711:151:3"
                },
                {
                  "assignments": [
                    2101
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2101,
                      "name": "_nextPeriodStartHeight",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "19970:30:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      },
                      "typeName": {
                        "id": 2100,
                        "name": "uint256",
                        "nodeType": "ElementaryTypeName",
                        "src": "19970:7:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2111,
                  "initialValue": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "commonType": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        },
                        "id": 2109,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "lValueRequested": false,
                        "leftExpression": {
                          "argumentTypes": null,
                          "id": 2107,
                          "name": "_ancestorHeight",
                          "nodeType": "Identifier",
                          "overloadedDeclarations": [],
                          "referencedDeclaration": 2068,
                          "src": "20033:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          }
                        },
                        "nodeType": "BinaryOperation",
                        "operator": "%",
                        "rightExpression": {
                          "argumentTypes": null,
                          "hexValue": "32303136",
                          "id": 2108,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": true,
                          "kind": "number",
                          "lValueRequested": false,
                          "nodeType": "Literal",
                          "src": "20051:4:3",
                          "subdenomination": null,
                          "typeDescriptions": {
                            "typeIdentifier": "t_rational_2016_by_1",
                            "typeString": "int_const 2016"
                          },
                          "value": "2016"
                        },
                        "src": "20033:22:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      ],
                      "expression": {
                        "argumentTypes": null,
                        "arguments": [
                          {
                            "argumentTypes": null,
                            "hexValue": "32303136",
                            "id": 2104,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": true,
                            "kind": "number",
                            "lValueRequested": false,
                            "nodeType": "Literal",
                            "src": "20023:4:3",
                            "subdenomination": null,
                            "typeDescriptions": {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            },
                            "value": "2016"
                          }
                        ],
                        "expression": {
                          "argumentTypes": [
                            {
                              "typeIdentifier": "t_rational_2016_by_1",
                              "typeString": "int_const 2016"
                            }
                          ],
                          "expression": {
                            "argumentTypes": null,
                            "id": 2102,
                            "name": "_ancestorHeight",
                            "nodeType": "Identifier",
                            "overloadedDeclarations": [],
                            "referencedDeclaration": 2068,
                            "src": "20003:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "id": 2103,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "memberName": "add",
                          "nodeType": "MemberAccess",
                          "referencedDeclaration": 4365,
                          "src": "20003:19:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                            "typeString": "function (uint256,uint256) pure returns (uint256)"
                          }
                        },
                        "id": 2105,
                        "isConstant": false,
                        "isLValue": false,
                        "isPure": false,
                        "kind": "functionCall",
                        "lValueRequested": false,
                        "names": [],
                        "nodeType": "FunctionCall",
                        "src": "20003:25:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_uint256",
                          "typeString": "uint256"
                        }
                      },
                      "id": 2106,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "memberName": "sub",
                      "nodeType": "MemberAccess",
                      "referencedDeclaration": 4340,
                      "src": "20003:29:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                        "typeString": "function (uint256,uint256) pure returns (uint256)"
                      }
                    },
                    "id": 2110,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "20003:53:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "19970:86:3"
                },
                {
                  "assignments": [
                    2113
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2113,
                      "name": "_leftInPeriod",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "20066:18:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      },
                      "typeName": {
                        "id": 2112,
                        "name": "bool",
                        "nodeType": "ElementaryTypeName",
                        "src": "20066:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2117,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2116,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2114,
                      "name": "_leftHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2074,
                      "src": "20087:11:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2115,
                      "name": "_nextPeriodStartHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2101,
                      "src": "20101:22:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "20087:36:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "20066:57:3"
                },
                {
                  "assignments": [
                    2119
                  ],
                  "declarations": [
                    {
                      "constant": false,
                      "id": 2119,
                      "name": "_rightInPeriod",
                      "nodeType": "VariableDeclaration",
                      "scope": 2192,
                      "src": "20133:19:3",
                      "stateVariable": false,
                      "storageLocation": "default",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      },
                      "typeName": {
                        "id": 2118,
                        "name": "bool",
                        "nodeType": "ElementaryTypeName",
                        "src": "20133:4:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "value": null,
                      "visibility": "internal"
                    }
                  ],
                  "id": 2123,
                  "initialValue": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    },
                    "id": 2122,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2120,
                      "name": "_rightHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2082,
                      "src": "20155:12:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "<",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2121,
                      "name": "_nextPeriodStartHeight",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2101,
                      "src": "20170:22:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_uint256",
                        "typeString": "uint256"
                      }
                    },
                    "src": "20155:37:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "nodeType": "VariableDeclarationStatement",
                  "src": "20133:59:3"
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 2127,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2125,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "!",
                      "prefix": true,
                      "src": "20532:14:3",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2124,
                        "name": "_leftInPeriod",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2113,
                        "src": "20533:13:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2126,
                      "name": "_rightInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2119,
                      "src": "20550:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "20532:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2133,
                  "nodeType": "IfStatement",
                  "src": "20528:63:3",
                  "trueBody": {
                    "id": 2132,
                    "nodeType": "Block",
                    "src": "20566:25:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 2128,
                              "name": "_left",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2060,
                              "src": "20574:5:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 2129,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "hash256",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2792,
                            "src": "20574:13:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (bytes32)"
                            }
                          },
                          "id": 2130,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "20574:15:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "functionReturnParameters": 2066,
                        "id": 2131,
                        "nodeType": "Return",
                        "src": "20567:22:3"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 2137,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2134,
                      "name": "_leftInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2113,
                      "src": "20604:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2136,
                      "isConstant": false,
                      "isLValue": false,
                      "isPure": false,
                      "lValueRequested": false,
                      "nodeType": "UnaryOperation",
                      "operator": "!",
                      "prefix": true,
                      "src": "20621:15:3",
                      "subExpression": {
                        "argumentTypes": null,
                        "id": 2135,
                        "name": "_rightInPeriod",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2119,
                        "src": "20622:14:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bool",
                          "typeString": "bool"
                        }
                      },
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "20604:32:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": null,
                  "id": 2143,
                  "nodeType": "IfStatement",
                  "src": "20600:64:3",
                  "trueBody": {
                    "id": 2142,
                    "nodeType": "Block",
                    "src": "20638:26:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "arguments": [],
                          "expression": {
                            "argumentTypes": [],
                            "expression": {
                              "argumentTypes": null,
                              "id": 2138,
                              "name": "_right",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2062,
                              "src": "20646:6:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_bytes_memory_ptr",
                                "typeString": "bytes memory"
                              }
                            },
                            "id": 2139,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "memberName": "hash256",
                            "nodeType": "MemberAccess",
                            "referencedDeclaration": 2792,
                            "src": "20646:14:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                              "typeString": "function (bytes memory) pure returns (bytes32)"
                            }
                          },
                          "id": 2140,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "kind": "functionCall",
                          "lValueRequested": false,
                          "names": [],
                          "nodeType": "FunctionCall",
                          "src": "20646:16:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "functionReturnParameters": 2066,
                        "id": 2141,
                        "nodeType": "Return",
                        "src": "20639:23:3"
                      }
                    ]
                  }
                },
                {
                  "condition": {
                    "argumentTypes": null,
                    "commonType": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    },
                    "id": 2146,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "lValueRequested": false,
                    "leftExpression": {
                      "argumentTypes": null,
                      "id": 2144,
                      "name": "_leftInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2113,
                      "src": "20677:13:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "nodeType": "BinaryOperation",
                    "operator": "&&",
                    "rightExpression": {
                      "argumentTypes": null,
                      "id": 2145,
                      "name": "_rightInPeriod",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2119,
                      "src": "20694:14:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_bool",
                        "typeString": "bool"
                      }
                    },
                    "src": "20677:31:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bool",
                      "typeString": "bool"
                    }
                  },
                  "falseBody": {
                    "id": 2190,
                    "nodeType": "Block",
                    "src": "20812:317:3",
                    "statements": [
                      {
                        "condition": {
                          "argumentTypes": null,
                          "commonType": {
                            "typeIdentifier": "t_uint256",
                            "typeString": "uint256"
                          },
                          "id": 2178,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "leftExpression": {
                            "argumentTypes": null,
                            "components": [
                              {
                                "argumentTypes": null,
                                "arguments": [
                                  {
                                    "argumentTypes": null,
                                    "arguments": [],
                                    "expression": {
                                      "argumentTypes": [],
                                      "expression": {
                                        "argumentTypes": null,
                                        "id": 2164,
                                        "name": "_left",
                                        "nodeType": "Identifier",
                                        "overloadedDeclarations": [],
                                        "referencedDeclaration": 2060,
                                        "src": "20901:5:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_bytes_memory_ptr",
                                          "typeString": "bytes memory"
                                        }
                                      },
                                      "id": 2165,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": false,
                                      "lValueRequested": false,
                                      "memberName": "extractDifficulty",
                                      "nodeType": "MemberAccess",
                                      "referencedDeclaration": 3864,
                                      "src": "20901:23:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                        "typeString": "function (bytes memory) pure returns (uint256)"
                                      }
                                    },
                                    "id": 2166,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "kind": "functionCall",
                                    "lValueRequested": false,
                                    "names": [],
                                    "nodeType": "FunctionCall",
                                    "src": "20901:25:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "expression": {
                                  "argumentTypes": [
                                    {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  ],
                                  "expression": {
                                    "argumentTypes": null,
                                    "components": [
                                      {
                                        "argumentTypes": null,
                                        "commonType": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        },
                                        "id": 2161,
                                        "isConstant": false,
                                        "isLValue": false,
                                        "isPure": false,
                                        "lValueRequested": false,
                                        "leftExpression": {
                                          "argumentTypes": null,
                                          "id": 2159,
                                          "name": "_leftHeight",
                                          "nodeType": "Identifier",
                                          "overloadedDeclarations": [],
                                          "referencedDeclaration": 2074,
                                          "src": "20877:11:3",
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_uint256",
                                            "typeString": "uint256"
                                          }
                                        },
                                        "nodeType": "BinaryOperation",
                                        "operator": "%",
                                        "rightExpression": {
                                          "argumentTypes": null,
                                          "hexValue": "32303136",
                                          "id": 2160,
                                          "isConstant": false,
                                          "isLValue": false,
                                          "isPure": true,
                                          "kind": "number",
                                          "lValueRequested": false,
                                          "nodeType": "Literal",
                                          "src": "20891:4:3",
                                          "subdenomination": null,
                                          "typeDescriptions": {
                                            "typeIdentifier": "t_rational_2016_by_1",
                                            "typeString": "int_const 2016"
                                          },
                                          "value": "2016"
                                        },
                                        "src": "20877:18:3",
                                        "typeDescriptions": {
                                          "typeIdentifier": "t_uint256",
                                          "typeString": "uint256"
                                        }
                                      }
                                    ],
                                    "id": 2162,
                                    "isConstant": false,
                                    "isInlineArray": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "nodeType": "TupleExpression",
                                    "src": "20876:20:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  },
                                  "id": 2163,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "mul",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 4305,
                                  "src": "20876:24:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                    "typeString": "function (uint256,uint256) pure returns (uint256)"
                                  }
                                },
                                "id": 2167,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "20876:51:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "id": 2168,
                            "isConstant": false,
                            "isInlineArray": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "nodeType": "TupleExpression",
                            "src": "20875:53:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "nodeType": "BinaryOperation",
                          "operator": "<",
                          "rightExpression": {
                            "argumentTypes": null,
                            "arguments": [
                              {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2174,
                                    "name": "_right",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2062,
                                    "src": "20973:6:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 2175,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "extractDifficulty",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 3864,
                                  "src": "20973:24:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_uint256_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (uint256)"
                                  }
                                },
                                "id": 2176,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "20973:26:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              }
                            ],
                            "expression": {
                              "argumentTypes": [
                                {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              ],
                              "expression": {
                                "argumentTypes": null,
                                "components": [
                                  {
                                    "argumentTypes": null,
                                    "commonType": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    },
                                    "id": 2171,
                                    "isConstant": false,
                                    "isLValue": false,
                                    "isPure": false,
                                    "lValueRequested": false,
                                    "leftExpression": {
                                      "argumentTypes": null,
                                      "id": 2169,
                                      "name": "_rightHeight",
                                      "nodeType": "Identifier",
                                      "overloadedDeclarations": [],
                                      "referencedDeclaration": 2082,
                                      "src": "20948:12:3",
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_uint256",
                                        "typeString": "uint256"
                                      }
                                    },
                                    "nodeType": "BinaryOperation",
                                    "operator": "%",
                                    "rightExpression": {
                                      "argumentTypes": null,
                                      "hexValue": "32303136",
                                      "id": 2170,
                                      "isConstant": false,
                                      "isLValue": false,
                                      "isPure": true,
                                      "kind": "number",
                                      "lValueRequested": false,
                                      "nodeType": "Literal",
                                      "src": "20963:4:3",
                                      "subdenomination": null,
                                      "typeDescriptions": {
                                        "typeIdentifier": "t_rational_2016_by_1",
                                        "typeString": "int_const 2016"
                                      },
                                      "value": "2016"
                                    },
                                    "src": "20948:19:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_uint256",
                                      "typeString": "uint256"
                                    }
                                  }
                                ],
                                "id": 2172,
                                "isConstant": false,
                                "isInlineArray": false,
                                "isLValue": false,
                                "isPure": false,
                                "lValueRequested": false,
                                "nodeType": "TupleExpression",
                                "src": "20947:21:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_uint256",
                                  "typeString": "uint256"
                                }
                              },
                              "id": 2173,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "mul",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 4305,
                              "src": "20947:25:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
                                "typeString": "function (uint256,uint256) pure returns (uint256)"
                              }
                            },
                            "id": 2177,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "20947:53:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            }
                          },
                          "src": "20875:125:3",
                          "typeDescriptions": {
                            "typeIdentifier": "t_bool",
                            "typeString": "bool"
                          }
                        },
                        "falseBody": {
                          "id": 2188,
                          "nodeType": "Block",
                          "src": "21064:55:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2184,
                                    "name": "_left",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2060,
                                    "src": "21089:5:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 2185,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "hash256",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 2792,
                                  "src": "21089:13:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (bytes32)"
                                  }
                                },
                                "id": 2186,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "21089:15:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "functionReturnParameters": 2066,
                              "id": 2187,
                              "nodeType": "Return",
                              "src": "21082:22:3"
                            }
                          ]
                        },
                        "id": 2189,
                        "nodeType": "IfStatement",
                        "src": "20871:248:3",
                        "trueBody": {
                          "id": 2183,
                          "nodeType": "Block",
                          "src": "21002:56:3",
                          "statements": [
                            {
                              "expression": {
                                "argumentTypes": null,
                                "arguments": [],
                                "expression": {
                                  "argumentTypes": [],
                                  "expression": {
                                    "argumentTypes": null,
                                    "id": 2179,
                                    "name": "_right",
                                    "nodeType": "Identifier",
                                    "overloadedDeclarations": [],
                                    "referencedDeclaration": 2062,
                                    "src": "21027:6:3",
                                    "typeDescriptions": {
                                      "typeIdentifier": "t_bytes_memory_ptr",
                                      "typeString": "bytes memory"
                                    }
                                  },
                                  "id": 2180,
                                  "isConstant": false,
                                  "isLValue": false,
                                  "isPure": false,
                                  "lValueRequested": false,
                                  "memberName": "hash256",
                                  "nodeType": "MemberAccess",
                                  "referencedDeclaration": 2792,
                                  "src": "21027:14:3",
                                  "typeDescriptions": {
                                    "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                    "typeString": "function (bytes memory) pure returns (bytes32)"
                                  }
                                },
                                "id": 2181,
                                "isConstant": false,
                                "isLValue": false,
                                "isPure": false,
                                "kind": "functionCall",
                                "lValueRequested": false,
                                "names": [],
                                "nodeType": "FunctionCall",
                                "src": "21027:16:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes32",
                                  "typeString": "bytes32"
                                }
                              },
                              "functionReturnParameters": 2066,
                              "id": 2182,
                              "nodeType": "Return",
                              "src": "21020:23:3"
                            }
                          ]
                        }
                      }
                    ]
                  },
                  "id": 2191,
                  "nodeType": "IfStatement",
                  "src": "20673:456:3",
                  "trueBody": {
                    "id": 2158,
                    "nodeType": "Block",
                    "src": "20710:96:3",
                    "statements": [
                      {
                        "expression": {
                          "argumentTypes": null,
                          "condition": {
                            "argumentTypes": null,
                            "commonType": {
                              "typeIdentifier": "t_uint256",
                              "typeString": "uint256"
                            },
                            "id": 2149,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "lValueRequested": false,
                            "leftExpression": {
                              "argumentTypes": null,
                              "id": 2147,
                              "name": "_leftHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2074,
                              "src": "20731:11:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "nodeType": "BinaryOperation",
                            "operator": ">=",
                            "rightExpression": {
                              "argumentTypes": null,
                              "id": 2148,
                              "name": "_rightHeight",
                              "nodeType": "Identifier",
                              "overloadedDeclarations": [],
                              "referencedDeclaration": 2082,
                              "src": "20746:12:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_uint256",
                                "typeString": "uint256"
                              }
                            },
                            "src": "20731:27:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bool",
                              "typeString": "bool"
                            }
                          },
                          "falseExpression": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2153,
                                "name": "_right",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2062,
                                "src": "20779:6:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 2154,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "hash256",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2792,
                              "src": "20779:14:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (bytes32)"
                              }
                            },
                            "id": 2155,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "20779:16:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "id": 2156,
                          "isConstant": false,
                          "isLValue": false,
                          "isPure": false,
                          "lValueRequested": false,
                          "nodeType": "Conditional",
                          "src": "20731:64:3",
                          "trueExpression": {
                            "argumentTypes": null,
                            "arguments": [],
                            "expression": {
                              "argumentTypes": [],
                              "expression": {
                                "argumentTypes": null,
                                "id": 2150,
                                "name": "_left",
                                "nodeType": "Identifier",
                                "overloadedDeclarations": [],
                                "referencedDeclaration": 2060,
                                "src": "20761:5:3",
                                "typeDescriptions": {
                                  "typeIdentifier": "t_bytes_memory_ptr",
                                  "typeString": "bytes memory"
                                }
                              },
                              "id": 2151,
                              "isConstant": false,
                              "isLValue": false,
                              "isPure": false,
                              "lValueRequested": false,
                              "memberName": "hash256",
                              "nodeType": "MemberAccess",
                              "referencedDeclaration": 2792,
                              "src": "20761:13:3",
                              "typeDescriptions": {
                                "typeIdentifier": "t_function_internal_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$bound_to$_t_bytes_memory_ptr_$",
                                "typeString": "function (bytes memory) pure returns (bytes32)"
                              }
                            },
                            "id": 2152,
                            "isConstant": false,
                            "isLValue": false,
                            "isPure": false,
                            "kind": "functionCall",
                            "lValueRequested": false,
                            "names": [],
                            "nodeType": "FunctionCall",
                            "src": "20761:15:3",
                            "typeDescriptions": {
                              "typeIdentifier": "t_bytes32",
                              "typeString": "bytes32"
                            }
                          },
                          "typeDescriptions": {
                            "typeIdentifier": "t_bytes32",
                            "typeString": "bytes32"
                          }
                        },
                        "functionReturnParameters": 2066,
                        "id": 2157,
                        "nodeType": "Return",
                        "src": "20724:71:3"
                      }
                    ]
                  }
                }
              ]
            },
            "documentation": "@notice             Decides which header is heaviest from the ancestor\n @dev                Does not support reorgs above 2017 blocks (:\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2193,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "_heaviestFromAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2063,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2058,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19407:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2057,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "19407:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2060,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19434:18:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2059,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "19434:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2062,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19462:19:3",
                  "stateVariable": false,
                  "storageLocation": "memory",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_memory_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2061,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "19462:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "19397:90:3"
            },
            "returnParameters": {
              "id": 2066,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2065,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2193,
                  "src": "19511:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2064,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "19511:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "19510:9:3"
            },
            "scope": 2252,
            "src": "19367:1768:3",
            "stateMutability": "view",
            "superFunction": null,
            "visibility": "internal"
          },
          {
            "body": {
              "id": 2210,
              "nodeType": "Block",
              "src": "21694:71:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "arguments": [
                      {
                        "argumentTypes": null,
                        "id": 2205,
                        "name": "_ancestor",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2195,
                        "src": "21733:9:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2206,
                        "name": "_left",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2197,
                        "src": "21744:5:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      },
                      {
                        "argumentTypes": null,
                        "id": 2207,
                        "name": "_right",
                        "nodeType": "Identifier",
                        "overloadedDeclarations": [],
                        "referencedDeclaration": 2199,
                        "src": "21751:6:3",
                        "typeDescriptions": {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      }
                    ],
                    "expression": {
                      "argumentTypes": [
                        {
                          "typeIdentifier": "t_bytes32",
                          "typeString": "bytes32"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        },
                        {
                          "typeIdentifier": "t_bytes_calldata_ptr",
                          "typeString": "bytes calldata"
                        }
                      ],
                      "id": 2204,
                      "name": "_heaviestFromAncestor",
                      "nodeType": "Identifier",
                      "overloadedDeclarations": [],
                      "referencedDeclaration": 2193,
                      "src": "21711:21:3",
                      "typeDescriptions": {
                        "typeIdentifier": "t_function_internal_view$_t_bytes32_$_t_bytes_memory_ptr_$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
                        "typeString": "function (bytes32,bytes memory,bytes memory) view returns (bytes32)"
                      }
                    },
                    "id": 2208,
                    "isConstant": false,
                    "isLValue": false,
                    "isPure": false,
                    "kind": "functionCall",
                    "lValueRequested": false,
                    "names": [],
                    "nodeType": "FunctionCall",
                    "src": "21711:47:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2203,
                  "id": 2209,
                  "nodeType": "Return",
                  "src": "21704:54:3"
                }
              ]
            },
            "documentation": "@notice             Decides which header is heaviest from the ancestor\n @dev                Does not support reorgs above 2017 blocks (:\n @param _ancestor    The prospective shared ancestor\n @param _left        A chain tip\n @param _right       A chain tip\n @return             true if it is the most recent common ancestor within _limit, false otherwise",
            "id": 2211,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "heaviestFromAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2200,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2195,
                  "name": "_ancestor",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21577:17:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2194,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "21577:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2197,
                  "name": "_left",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21604:20:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2196,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "21604:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                },
                {
                  "constant": false,
                  "id": 2199,
                  "name": "_right",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21634:21:3",
                  "stateVariable": false,
                  "storageLocation": "calldata",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes_calldata_ptr",
                    "typeString": "bytes"
                  },
                  "typeName": {
                    "id": 2198,
                    "name": "bytes",
                    "nodeType": "ElementaryTypeName",
                    "src": "21634:5:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes_storage_ptr",
                      "typeString": "bytes"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "21567:94:3"
            },
            "returnParameters": {
              "id": 2203,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2202,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2211,
                  "src": "21685:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2201,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "21685:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "21684:9:3"
            },
            "scope": 2252,
            "src": "21538:227:3",
            "stateMutability": "view",
            "superFunction": 1132,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2218,
              "nodeType": "Block",
              "src": "22023:38:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2216,
                    "name": "currentEpochDiff",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1199,
                    "src": "22038:16:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 2215,
                  "id": 2217,
                  "nodeType": "Return",
                  "src": "22031:23:3"
                }
              ]
            },
            "documentation": "@notice     Getter for currentEpochDiff\n @dev        This is updated when a new heavist header has a new diff\n @return     The difficulty of the bestKnownDigest",
            "id": 2219,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getCurrentEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2212,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "21988:2:3"
            },
            "returnParameters": {
              "id": 2215,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2214,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2219,
                  "src": "22014:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2213,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "22014:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22013:9:3"
            },
            "scope": 2252,
            "src": "21954:107:3",
            "stateMutability": "view",
            "superFunction": 1074,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2226,
              "nodeType": "Block",
              "src": "22307:35:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2224,
                    "name": "prevEpochDiff",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1201,
                    "src": "22322:13:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "functionReturnParameters": 2223,
                  "id": 2225,
                  "nodeType": "Return",
                  "src": "22315:20:3"
                }
              ]
            },
            "documentation": "@notice     Getter for prevEpochDiff\n @dev        This is updated when a difficulty change is accepted\n @return     The difficulty of the previous epoch",
            "id": 2227,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getPrevEpochDifficulty",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2220,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "22272:2:3"
            },
            "returnParameters": {
              "id": 2223,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2222,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2227,
                  "src": "22298:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_uint256",
                    "typeString": "uint256"
                  },
                  "typeName": {
                    "id": 2221,
                    "name": "uint256",
                    "nodeType": "ElementaryTypeName",
                    "src": "22298:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_uint256",
                      "typeString": "uint256"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22297:9:3"
            },
            "scope": 2252,
            "src": "22241:101:3",
            "stateMutability": "view",
            "superFunction": 1079,
            "visibility": "external"
          },
          {
            "body": {
              "id": 2234,
              "nodeType": "Block",
              "src": "22566:36:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2232,
                    "name": "relayGenesis",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1185,
                    "src": "22583:12:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2231,
                  "id": 2233,
                  "nodeType": "Return",
                  "src": "22576:19:3"
                }
              ]
            },
            "documentation": "@notice     Getter for relayGenesis\n @dev        This is an initialization parameter\n @return     The hash of the first block of the relay",
            "id": 2235,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getRelayGenesis",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2228,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "22533:2:3"
            },
            "returnParameters": {
              "id": 2231,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2230,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2235,
                  "src": "22557:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2229,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "22557:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22556:9:3"
            },
            "scope": 2252,
            "src": "22509:93:3",
            "stateMutability": "view",
            "superFunction": 1084,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2242,
              "nodeType": "Block",
              "src": "22838:39:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2240,
                    "name": "bestKnownDigest",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1187,
                    "src": "22855:15:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2239,
                  "id": 2241,
                  "nodeType": "Return",
                  "src": "22848:22:3"
                }
              ]
            },
            "documentation": "@notice     Getter for bestKnownDigest\n @dev        This updated only by calling markNewHeaviest\n @return     The hash of the best marked chain tip",
            "id": 2243,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getBestKnownDigest",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2236,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "22805:2:3"
            },
            "returnParameters": {
              "id": 2239,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2238,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2243,
                  "src": "22829:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2237,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "22829:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "22828:9:3"
            },
            "scope": 2252,
            "src": "22778:99:3",
            "stateMutability": "view",
            "superFunction": 1089,
            "visibility": "public"
          },
          {
            "body": {
              "id": 2250,
              "nodeType": "Block",
              "src": "23139:47:3",
              "statements": [
                {
                  "expression": {
                    "argumentTypes": null,
                    "id": 2248,
                    "name": "lastReorgCommonAncestor",
                    "nodeType": "Identifier",
                    "overloadedDeclarations": [],
                    "referencedDeclaration": 1189,
                    "src": "23156:23:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "functionReturnParameters": 2247,
                  "id": 2249,
                  "nodeType": "Return",
                  "src": "23149:30:3"
                }
              ]
            },
            "documentation": "@notice     Getter for relayGenesis\n @dev        This is updated only by calling markNewHeaviest\n @return     The hash of the shared ancestor of the most recent fork",
            "id": 2251,
            "implemented": true,
            "kind": "function",
            "modifiers": [],
            "name": "getLastReorgCommonAncestor",
            "nodeType": "FunctionDefinition",
            "parameters": {
              "id": 2244,
              "nodeType": "ParameterList",
              "parameters": [],
              "src": "23106:2:3"
            },
            "returnParameters": {
              "id": 2247,
              "nodeType": "ParameterList",
              "parameters": [
                {
                  "constant": false,
                  "id": 2246,
                  "name": "",
                  "nodeType": "VariableDeclaration",
                  "scope": 2251,
                  "src": "23130:7:3",
                  "stateVariable": false,
                  "storageLocation": "default",
                  "typeDescriptions": {
                    "typeIdentifier": "t_bytes32",
                    "typeString": "bytes32"
                  },
                  "typeName": {
                    "id": 2245,
                    "name": "bytes32",
                    "nodeType": "ElementaryTypeName",
                    "src": "23130:7:3",
                    "typeDescriptions": {
                      "typeIdentifier": "t_bytes32",
                      "typeString": "bytes32"
                    }
                  },
                  "value": null,
                  "visibility": "internal"
                }
              ],
              "src": "23129:9:3"
            },
            "scope": 2252,
            "src": "23071:115:3",
            "stateMutability": "view",
            "superFunction": 1094,
            "visibility": "public"
          }
        ],
        "scope": 2253,
        "src": "2004:21184:3"
      }
    ],
    "src": "0:23189:3"
  },
  "compiler": {
    "name": "solc",
    "version": "0.5.10+commit.5a6ea5b1.Emscripten.clang"
  },
  "networks": {},
  "schemaVersion": "3.0.23",
  "updatedAt": "2020-04-10T19:37:05.770Z",
  "devdoc": {
    "methods": {
      "addHeaders(bytes,bytes)": {
        "details": "We check integrity and consistency of the header chain",
        "params": {
          "_anchor": "The header immediately preceeding the new chain",
          "_headers": "A tightly-packed list of 80-byte Bitcoin headers"
        },
        "return": "True if successfully written, error otherwise"
      },
      "addHeadersWithRetarget(bytes,bytes,bytes)": {
        "details": "Checks the retarget, the heights, and the linkage",
        "params": {
          "_headers": "A tightly-packed list of 80-byte Bitcoin headers",
          "_oldPeriodEndHeader": "The last header in the difficulty period being closed",
          "_oldPeriodStartHeader": "The first header in the difficulty period being closed"
        },
        "return": "True if successfully written, error otherwise"
      },
      "constructor": {
        "details": "We don't check this AT ALL really. Don't use relays with bad genesis",
        "params": {
          "_genesisHeader": "The starting header",
          "_height": "The starting height",
          "_periodStart": "The hash of the first header in the genesis epoch"
        }
      },
      "findAncestor(bytes32,uint256)": {
        "details": "Will fail if the header is unknown",
        "params": {
          "_digest": "The header digest to search for"
        },
        "return": "The height of the header, or error if unknown"
      },
      "findHeight(bytes32)": {
        "details": "Will fail if the header is unknown",
        "params": {
          "_digest": "The header digest to search for"
        },
        "return": "The height of the header, or error if unknown"
      },
      "getBestKnownDigest()": {
        "details": "This updated only by calling markNewHeaviest",
        "return": "The hash of the best marked chain tip"
      },
      "getCurrentEpochDifficulty()": {
        "details": "This is updated when a new heavist header has a new diff",
        "return": "The difficulty of the bestKnownDigest"
      },
      "getLastReorgCommonAncestor()": {
        "details": "This is updated only by calling markNewHeaviest",
        "return": "The hash of the shared ancestor of the most recent fork"
      },
      "getPrevEpochDifficulty()": {
        "details": "This is updated when a difficulty change is accepted",
        "return": "The difficulty of the previous epoch"
      },
      "getRelayGenesis()": {
        "details": "This is an initialization parameter",
        "return": "The hash of the first block of the relay"
      },
      "heaviestFromAncestor(bytes32,bytes,bytes)": {
        "details": "Does not support reorgs above 2017 blocks (:",
        "params": {
          "_ancestor": "The prospective shared ancestor",
          "_left": "A chain tip",
          "_right": "A chain tip"
        },
        "return": "true if it is the most recent common ancestor within _limit, false otherwise"
      },
      "isAncestor(bytes32,bytes32,uint256)": {
        "details": "Limit the amount of lookups (and thus gas usage) with _limit",
        "params": {
          "_ancestor": "The prospective ancestor",
          "_descendant": "The descendant to check",
          "_limit": "The maximum number of blocks to check"
        },
        "return": "true if ancestor is at most limit blocks lower than descendant, otherwise false"
      },
      "isMostRecentAncestor(bytes32,bytes32,bytes32,uint256)": {
        "details": "Limit the amount of lookups (and thus gas usage) with _limit",
        "params": {
          "_ancestor": "The prospective shared ancestor",
          "_left": "A chain tip",
          "_limit": "The maximum number of blocks to check",
          "_right": "A chain tip"
        },
        "return": "true if it is the most recent common ancestor within _limit, false otherwise"
      },
      "markNewHeaviest(bytes32,bytes,bytes,uint256)": {
        "details": "We don't check this AT ALL really. Don't use relays with bad genesis",
        "params": {
          "_ancestor": "The digest of the most recent common ancestor",
          "_currentBest": "The 80-byte header referenced by bestKnownDigest",
          "_limit": "Limit the amount of traversal of the chain",
          "_newBest": "The 80-byte header to mark as the new best"
        },
        "return": "True if successfully updates bestKnownDigest, error otherwise"
      }
    }
  },
  "userdoc": {
    "methods": {
      "addHeaders(bytes,bytes)": {
        "notice": "Adds headers to storage after validating"
      },
      "addHeadersWithRetarget(bytes,bytes,bytes)": {
        "notice": "Adds headers to storage, performs additional validation of retarget"
      },
      "constructor": "Gives a starting point for the relay",
      "findAncestor(bytes32,uint256)": {
        "notice": "Finds an ancestor for a block by its digest"
      },
      "findHeight(bytes32)": {
        "notice": "Finds the height of a header by its digest"
      },
      "getBestKnownDigest()": {
        "notice": "Getter for bestKnownDigest"
      },
      "getCurrentEpochDifficulty()": {
        "notice": "Getter for currentEpochDiff"
      },
      "getLastReorgCommonAncestor()": {
        "notice": "Getter for relayGenesis"
      },
      "getPrevEpochDifficulty()": {
        "notice": "Getter for prevEpochDiff"
      },
      "getRelayGenesis()": {
        "notice": "Getter for relayGenesis"
      },
      "heaviestFromAncestor(bytes32,bytes,bytes)": {
        "notice": "Decides which header is heaviest from the ancestor"
      },
      "isAncestor(bytes32,bytes32,uint256)": {
        "notice": "Checks if a digest is an ancestor of the current one"
      },
      "isMostRecentAncestor(bytes32,bytes32,bytes32,uint256)": {
        "notice": "Checks if a digest is an ancestor of the current one"
      },
      "markNewHeaviest(bytes32,bytes,bytes,uint256)": {
        "notice": "Gives a starting point for the relay"
      }
    }
  }
}