From f8b4a7a9a5cbd8dbffa0667efd2640902a6fa449 Mon Sep 17 00:00:00 2001 From: DC Date: Fri, 4 Nov 2022 17:45:21 -0700 Subject: [PATCH] Ring buffer for gas efficiency --- .../out/BtcMirror.sol/BtcMirror.json | 5428 ++++++++++------- packages/contracts/src/BtcMirror.sol | 55 +- packages/contracts/test/BtcTxVerifier.t.sol | 2 +- 3 files changed, 3152 insertions(+), 2333 deletions(-) diff --git a/packages/contracts/out/BtcMirror.sol/BtcMirror.json b/packages/contracts/out/BtcMirror.sol/BtcMirror.json index 7c41e6a..0e95f26 100644 --- a/packages/contracts/out/BtcMirror.sol/BtcMirror.json +++ b/packages/contracts/out/BtcMirror.sol/BtcMirror.json @@ -110,7 +110,26 @@ "inputs": [ { "internalType": "uint256", - "name": "number", + "name": "", + "type": "uint256" + } + ], + "name": "blockHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNum", "type": "uint256" } ], @@ -183,6 +202,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "latestBlockIx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "longestReorg", @@ -235,42 +267,44 @@ } ], "bytecode": { - "object": "0x60a060405234801561001057600080fd5b50604051610f91380380610f9183398101604081905261002f91610079565b6000858152600260205260408120859055858155600184905582906003906100596107e0896100cb565b81526020810191909152604001600020551515608052506100ed92505050565b600080600080600060a0868803121561009157600080fd5b85519450602086015193506040860151925060608601519150608086015180151581146100bd57600080fd5b809150509295509295909350565b6000826100e857634e487b7160e01b600052601260045260246000fd5b500490565b608051610e7c6101156000396000818160d601528181610aef0152610b7e0152610e7c6000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c8063a9c2d7ab1161005b578063a9c2d7ab14610108578063d1a2eab21461011b578063e875aa5d14610130578063ee82ac5e1461013857600080fd5b80630d2b28601461008d57806332c25832146100c057806376e92c84146100c857806392108c86146100d1575b600080fd5b6100ad61009b366004610c04565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b6001546100ad565b6100ad60045481565b6100f87f000000000000000000000000000000000000000000000000000000000000000081565b60405190151581526020016100b7565b6100ad610116366004610c04565b610158565b61012e610129366004610c1d565b61019a565b005b6000546100ad565b6100ad610146366004610c04565b60009081526002602052604090205490565b6000600382811a90600284901a600890811b600186901a17901b84841a179083906101839084610caf565b61018e906008610cc6565b9190911b949350505050565b60006101a7605083610cfb565b9050816101b5826050610cc6565b146101fd5760405162461bcd60e51b81526020600482015260136024820152720eee4dedcce40d0cac2c8cae440d8cadccee8d606b1b60448201526064015b60405180910390fd5b6000811161024d5760405162461bcd60e51b815260206004820152601e60248201527f6d757374207375626d6974206174206c65617374206f6e6520626c6f636b000060448201526064016101f4565b60006107e060005461025f9190610cfb565b90506000600161026f8488610d0f565b6102799190610caf565b905060006102896107e083610cfb565b9050828110156102d35760405162461bcd60e51b81526020600482015260156024820152741bdb1908191a59999a58dd5b1d1e481c195c9a5bd9605a1b60448201526064016101f4565b60006107e06102e360018a610caf565b6102ed9190610cfb565b905060008183111561033b57610304826001610d0f565b831461031257610312610d27565b84830361032c57610325856000546106a7565b905061033b565b81851461033b5761033b610d27565b6000805481526002602052604081205490805b888110156103be576000610362828e610d0f565b905061039e818d8d610375866050610cc6565b90610381876001610d0f565b61038c906050610cc6565b9261039993929190610d3d565b61071f565b6103a89084610d0f565b92505080806103b690610d67565b91505061034e565b508385111561051c573660008b8b6103d760018d610caf565b6103e2906050610cc6565b6103ed928290610d3d565b90925090506000610434610405604c60488587610d3d565b61040e91610d80565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b90506000610442898b6106a7565b90508681116104935760405162461bcd60e51b815260206004820152601d60248201527f696e73756666696369656e7420746f74616c20646966666963756c747900000060448201526064016101f4565b60006104a08b6001610d0f565b90505b60005481116104cd57600081815260026020526040812055806104c581610d67565b9150506104a3565b50604080518b81526020810183905263ffffffff84168183015290517f452ea9c9e4985cb8cc7199131fd292d600dae30f407e749b6ca7e7f4c7690cf79181900360600190a15050505061058b565b86851461052b5761052b610d27565b83851461053a5761053a610d27565b600054861161058b5760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e7420636861696e206c656e6774680000000000000060448201526064016101f4565b600086815561059b600c8b610caf565b905060008b828c6105ad826004610d0f565b926105ba93929190610d3d565b6105c391610d80565b60e01c90506105f081600881811c62ff00ff1663ff00ff009290911b9190911617601081811c91901b1790565b63ffffffff16600155600088815260026020526040812054600154604080518c8152602081019290925281018290529091507f11cedc7f83a9a6f5228b8fcd3c3c0ae686a51e2e04ea46923e3491a32a4bbaa89060600160405180910390a183156106975760408051858152602081018790529081018290527fea952b3dfe43a8e680ea58302c72429cd78ef0537abeaf75797ef9bb0496cefc9060600160405180910390a15b5050505050505050505050505050565b600082815260036020526040812054816106c382600019610cfb565b905060006106d3866107e0610cc6565b6106dd9086610caf565b6106e8906001610d0f565b9050600181101580156106fd57506107e08111155b61070957610709610d27565b6107138282610cc6565b93505050505b92915050565b60006050821461073157610731610d27565b60006109336002808686604051610749929190610db0565b602060405180830381855afa158015610766573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906107899190610dc0565b60405160200161079b91815260200190565b60408051601f19818403018152908290526107b591610dd9565b602060405180830381855afa1580156107d2573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906107f59190610dc0565b7bffffffff000000000000000000000000ffffffff00000000000000007eff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000600883811c9182167fff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000009490911b93841617601090811c7cff000000ff000000ff000000ff000000ff000000ff000000ff000000ff9092167dff000000ff000000ff000000ff000000ff000000ff000000ff000000ff009094169390931790921b91909117602081811c9283167fffffffff000000000000000000000000ffffffff0000000000000000000000009290911b91821617604090811c73ffffffff000000000000000000000000ffffffff90931677ffffffff000000000000000000000000ffffffff0000000090921691909117901b17608081811c91901b1790565b6000868152600260205260409020549091508181158015906109555750808214155b1561095f57600193505b600087815260026020526040812082905561098a61098160246004898b610d3d565b6107f591610e14565b90506002600061099b60018b610caf565b81526020019081526020016000205481146109e55760405162461bcd60e51b815260206004820152600a602482015269189859081c185c995b9d60b21b60448201526064016101f4565b80610a325760405162461bcd60e51b815260206004820152601e60248201527f706172656e7420626c6f636b206e6f7420796574207375626d6974746564000060448201526064016101f4565b6000610a42604c6048898b610d3d565b610a4b91610e14565b90506000610a5882610158565b9050808610610aa95760405162461bcd60e51b815260206004820152601760248201527f626c6f636b20686173682061626f76652074617267657400000000000000000060448201526064016101f4565b6000610ab76107e08c610cfb565b9050610ac56107e08c610e32565b600003610b7c576000600381610adc600185610caf565b81526020019081526020016000205490507f0000000000000000000000000000000000000000000000000000000000000000610b655780600284901c10610b655760405162461bcd60e51b815260206004820152601860248201527f3c32352520646966666963756c7479207265746172676574000000000000000060448201526064016101f4565b506000818152600360205260409020829055610bf6565b7f0000000000000000000000000000000000000000000000000000000000000000610bf6576000818152600360205260409020548214610bf65760405162461bcd60e51b815260206004820152601560248201527477726f6e6720646966666963756c7479206269747360581b60448201526064016101f4565b505050505050509392505050565b600060208284031215610c1657600080fd5b5035919050565b600080600060408486031215610c3257600080fd5b83359250602084013567ffffffffffffffff80821115610c5157600080fd5b818601915086601f830112610c6557600080fd5b813581811115610c7457600080fd5b876020828501011115610c8657600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052601160045260246000fd5b600082821015610cc157610cc1610c99565b500390565b6000816000190483118215151615610ce057610ce0610c99565b500290565b634e487b7160e01b600052601260045260246000fd5b600082610d0a57610d0a610ce5565b500490565b60008219821115610d2257610d22610c99565b500190565b634e487b7160e01b600052600160045260246000fd5b60008085851115610d4d57600080fd5b83861115610d5a57600080fd5b5050820193919092039150565b600060018201610d7957610d79610c99565b5060010190565b6001600160e01b03198135818116916004851015610da85780818660040360031b1b83161692505b505092915050565b8183823760009101908152919050565b600060208284031215610dd257600080fd5b5051919050565b6000825160005b81811015610dfa5760208186018101518583015201610de0565b81811115610e09576000828501525b509190910192915050565b8035602083101561071957600019602084900360031b1b1692915050565b600082610e4157610e41610ce5565b50069056fea2646970667358221220b66b6dd387a064b7403d8cfaa09097da2d512f2591c04e24193b016210ad9cc864736f6c634300080f0033", - "sourceMap": "1462:9452:8:-:0;;;2883:398;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3055:31;;;;:17;:31;;;;;:44;;;3109:32;;;3151:15;:28;;;3227:15;;3189:14;;3204:19;3219:4;3073:12;3204:19;:::i;:::-;3189:35;;;;;;;;;;;-1:-1:-1;3189:35:8;:53;3252:22;;;;-1:-1:-1;1462:9452:8;;-1:-1:-1;;;1462:9452:8;14:523:17;117:6;125;133;141;149;202:3;190:9;181:7;177:23;173:33;170:53;;;219:1;216;209:12;170:53;248:9;242:16;232:26;;298:2;287:9;283:18;277:25;267:35;;342:2;331:9;327:18;321:25;311:35;;386:2;375:9;371:18;365:25;355:35;;433:3;422:9;418:19;412:26;481:5;474:13;467:21;460:5;457:32;447:60;;503:1;500;493:12;447:60;526:5;516:15;;;14:523;;;;;;;;:::o;542:217::-;582:1;608;598:132;;652:10;647:3;643:20;640:1;633:31;687:4;684:1;677:15;715:4;712:1;705:15;598:132;-1:-1:-1;744:9:17;;542:217::o;:::-;1462:9452:8;;;;;;;;;;;;;;;;;;;;;;", + "object": "0x60a060405234801561001057600080fd5b5060405161112d38038061112d83398101604081905261002f91610070565b60028490556000858155600184905582906103eb906100506107e0896100c2565b81526020810191909152604001600020551515608052506100e492505050565b600080600080600060a0868803121561008857600080fd5b85519450602086015193506040860151925060608601519150608086015180151581146100b457600080fd5b809150509295509295909350565b6000826100df57634e487b7160e01b600052601260045260246000fd5b500490565b60805161102061010d6000396000818161010101528181610c2d0152610cbd01526110206000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063a9c2d7ab11610066578063a9c2d7ab14610133578063d1a2eab214610146578063e870c9141461015b578063e875aa5d14610165578063ee82ac5e1461016d57600080fd5b80630d2b2860146100a357806332c25832146100d757806334cdf78d146100df57806376e92c84146100f257806392108c86146100fc575b600080fd5b6100c46100b1366004610d92565b6103eb6020526000908152604090205481565b6040519081526020015b60405180910390f35b6001546100c4565b6100c46100ed366004610d92565b610180565b6100c46103ec5481565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b60405190151581526020016100ce565b6100c4610141366004610d92565b610198565b610159610154366004610dab565b6101da565b005b6100c46103ea5481565b6000546100c4565b6100c461017b366004610d92565b6106fb565b6002816103e8811061019157600080fd5b0154905081565b6000600382811a90600284901a600890811b600186901a17901b84841a179083906101c39084610e53565b6101ce906008610e6a565b9190911b949350505050565b60006101e7605083610e9f565b9050816101f5826050610e6a565b1461023d5760405162461bcd60e51b81526020600482015260136024820152720eee4dedcce40d0cac2c8cae440d8cadccee8d606b1b60448201526064015b60405180910390fd5b6000811161028d5760405162461bcd60e51b815260206004820152601e60248201527f6d757374207375626d6974206174206c65617374206f6e6520626c6f636b00006044820152606401610234565b6101f460005461029d9190610e53565b84116102d35760405162461bcd60e51b815260206004820152600560248201526472656f726760d81b6044820152606401610234565b60006107e06000546102e59190610e9f565b9050600060016102f58488610eb3565b6102ff9190610e53565b9050600061030f6107e083610e9f565b9050828110156103595760405162461bcd60e51b81526020600482015260156024820152741bdb1908191a59999a58dd5b1d1e481c195c9a5bd9605a1b6044820152606401610234565b60006107e061036960018a610e53565b6103739190610e9f565b90506000818311156103c15761038a826001610eb3565b831461039857610398610ecb565b8483036103b2576103ab85600054610791565b90506103c1565b8185146103c1576103c1610ecb565b60006103ce6000546106fb565b90506000805b888110156104445760006103e8828e610eb3565b9050610424818d8d6103fb866050610e6a565b90610407876001610eb3565b610412906050610e6a565b9261041f93929190610ee1565b61080a565b61042e9084610eb3565b925050808061043c90610f0b565b9150506103d4565b5083851115610567573660008b8b61045d60018d610e53565b610468906050610e6a565b610473928290610ee1565b909250905060006104ba61048b604c60488587610ee1565b61049491610f24565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b905060006104c8898b610791565b90508681116105195760405162461bcd60e51b815260206004820152601d60248201527f696e73756666696369656e7420746f74616c20646966666963756c74790000006044820152606401610234565b604080518b81526020810183905263ffffffff84168183015290517f452ea9c9e4985cb8cc7199131fd292d600dae30f407e749b6ca7e7f4c7690cf79181900360600190a1505050506105d6565b86851461057657610576610ecb565b83851461058557610585610ecb565b60005486116105d65760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e7420636861696e206c656e677468000000000000006044820152606401610234565b6105df86610d45565b6103ea5560008681556105f3600c8b610e53565b905060008b828c610605826004610eb3565b9261061293929190610ee1565b61061b91610f24565b60e01c905061064881600881811c62ff00ff1663ff00ff009290911b9190911617601081811c91901b1790565b63ffffffff16600155600061065c896106fb565b600154604080518c8152602081019290925281018290529091507f11cedc7f83a9a6f5228b8fcd3c3c0ae686a51e2e04ea46923e3491a32a4bbaa89060600160405180910390a183156106eb5760408051858152602081018790529081018290527fea952b3dfe43a8e680ea58302c72429cd78ef0537abeaf75797ef9bb0496cefc9060600160405180910390a15b5050505050505050505050505050565b6000805482111561074e5760405162461bcd60e51b815260206004820152601760248201527f426c6f636b206e6f7420796574207375626d69747465640000000000000000006044820152606401610234565b6101f460005461075e9190610e53565b82101561076d57506000919050565b600261077883610d45565b6103e8811061078957610789610e27565b015492915050565b60008281526103eb6020526040812054816107ae82600019610e9f565b905060006107be866107e0610e6a565b6107c89086610e53565b6107d3906001610eb3565b9050600181101580156107e857506107e08111155b6107f4576107f4610ecb565b6107fe8282610e6a565b93505050505b92915050565b60006050821461081c5761081c610ecb565b6000610a1e6002808686604051610834929190610f54565b602060405180830381855afa158015610851573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906108749190610f64565b60405160200161088691815260200190565b60408051601f19818403018152908290526108a091610f7d565b602060405180830381855afa1580156108bd573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906108e09190610f64565b7bffffffff000000000000000000000000ffffffff00000000000000007eff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000600883811c9182167fff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000009490911b93841617601090811c7cff000000ff000000ff000000ff000000ff000000ff000000ff000000ff9092167dff000000ff000000ff000000ff000000ff000000ff000000ff000000ff009094169390931790921b91909117602081811c9283167fffffffff000000000000000000000000ffffffff0000000000000000000000009290911b91821617604090811c73ffffffff000000000000000000000000ffffffff90931677ffffffff000000000000000000000000ffffffff0000000090921691909117901b17608081811c91901b1790565b9050806000610a2c87610d45565b90506000548711158015610a555750816002826103e88110610a5057610a50610e27565b015414155b15610a5f57600193505b816002826103e88110610a7457610a74610e27565b01556000610a92610a8960246004898b610ee1565b6108e091610fb8565b905060006002610aa46101f482610e6a565b6001610ab36101f46002610e6a565b610abd9087610eb3565b610ac79190610e53565b610ad19190610fd6565b6103e88110610ae257610ae2610e27565b0154905080610b335760405162461bcd60e51b815260206004820152601e60248201527f706172656e7420626c6f636b206e6f7420796574207375626d697474656400006044820152606401610234565b808214610b6f5760405162461bcd60e51b815260206004820152600a602482015269189859081c185c995b9d60b21b6044820152606401610234565b6000610b7f604c60488a8c610ee1565b610b8891610fb8565b90506000610b9582610198565b9050808710610be65760405162461bcd60e51b815260206004820152601760248201527f626c6f636b20686173682061626f7665207461726765740000000000000000006044820152606401610234565b6000610bf46107e08d610e9f565b9050610c026107e08d610fd6565b600003610cbb5760006103eb81610c1a600185610e53565b81526020019081526020016000205490507f0000000000000000000000000000000000000000000000000000000000000000610ca35780600284901c10610ca35760405162461bcd60e51b815260206004820152601860248201527f3c32352520646966666963756c747920726574617267657400000000000000006044820152606401610234565b5060008181526103eb60205260409020829055610d36565b7f0000000000000000000000000000000000000000000000000000000000000000610d365760008181526103eb60205260409020548214610d365760405162461bcd60e51b815260206004820152601560248201527477726f6e6720646966666963756c7479206269747360581b6044820152606401610234565b50505050505050509392505050565b6000610d546101f46002610e6a565b6000546103ea548490610d6a6101f46002610e6a565b610d749190610eb3565b610d7e9190610eb3565b610d889190610e53565b6108049190610fd6565b600060208284031215610da457600080fd5b5035919050565b600080600060408486031215610dc057600080fd5b83359250602084013567ffffffffffffffff80821115610ddf57600080fd5b818601915086601f830112610df357600080fd5b813581811115610e0257600080fd5b876020828501011115610e1457600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015610e6557610e65610e3d565b500390565b6000816000190483118215151615610e8457610e84610e3d565b500290565b634e487b7160e01b600052601260045260246000fd5b600082610eae57610eae610e89565b500490565b60008219821115610ec657610ec6610e3d565b500190565b634e487b7160e01b600052600160045260246000fd5b60008085851115610ef157600080fd5b83861115610efe57600080fd5b5050820193919092039150565b600060018201610f1d57610f1d610e3d565b5060010190565b6001600160e01b03198135818116916004851015610f4c5780818660040360031b1b83161692505b505092915050565b8183823760009101908152919050565b600060208284031215610f7657600080fd5b5051919050565b6000825160005b81811015610f9e5760208186018101518583015201610f84565b81811115610fad576000828501525b509190910192915050565b8035602083101561080457600019602084900360031b1b1692915050565b600082610fe557610fe5610e89565b50069056fea2646970667358221220ef9c6e5b5e473273dde476098fccf851c2623232968c21458acccd4b0876cc7264736f6c634300080f0033", + "sourceMap": "1430:10318:8:-:0;;;3294:381;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3466:11;:27;;;3478:1;3503:32;;;3545:15;:28;;;3621:15;;3583:14;;3598:19;3613:4;3503:32;3598:19;:::i;:::-;3583:35;;;;;;;;;;;-1:-1:-1;3583:35:8;:53;3646:22;;;;-1:-1:-1;1430:10318:8;;-1:-1:-1;;;1430:10318:8;14:523:17;117:6;125;133;141;149;202:3;190:9;181:7;177:23;173:33;170:53;;;219:1;216;209:12;170:53;248:9;242:16;232:26;;298:2;287:9;283:18;277:25;267:35;;342:2;331:9;327:18;321:25;311:35;;386:2;375:9;371:18;365:25;355:35;;433:3;422:9;418:19;412:26;481:5;474:13;467:21;460:5;457:32;447:60;;503:1;500;493:12;447:60;526:5;516:15;;;14:523;;;;;;;;:::o;674:217::-;714:1;740;730:132;;784:10;779:3;775:20;772:1;765:31;819:4;816:1;809:15;847:4;844:1;837:15;730:132;-1:-1:-1;876:9:17;;674:217::o;:::-;1430:10318:8;;;;;;;;;;;;;;;;;;;;;;", "linkReferences": {} }, "deployedBytecode": { - "object": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063a9c2d7ab1161005b578063a9c2d7ab14610108578063d1a2eab21461011b578063e875aa5d14610130578063ee82ac5e1461013857600080fd5b80630d2b28601461008d57806332c25832146100c057806376e92c84146100c857806392108c86146100d1575b600080fd5b6100ad61009b366004610c04565b60036020526000908152604090205481565b6040519081526020015b60405180910390f35b6001546100ad565b6100ad60045481565b6100f87f000000000000000000000000000000000000000000000000000000000000000081565b60405190151581526020016100b7565b6100ad610116366004610c04565b610158565b61012e610129366004610c1d565b61019a565b005b6000546100ad565b6100ad610146366004610c04565b60009081526002602052604090205490565b6000600382811a90600284901a600890811b600186901a17901b84841a179083906101839084610caf565b61018e906008610cc6565b9190911b949350505050565b60006101a7605083610cfb565b9050816101b5826050610cc6565b146101fd5760405162461bcd60e51b81526020600482015260136024820152720eee4dedcce40d0cac2c8cae440d8cadccee8d606b1b60448201526064015b60405180910390fd5b6000811161024d5760405162461bcd60e51b815260206004820152601e60248201527f6d757374207375626d6974206174206c65617374206f6e6520626c6f636b000060448201526064016101f4565b60006107e060005461025f9190610cfb565b90506000600161026f8488610d0f565b6102799190610caf565b905060006102896107e083610cfb565b9050828110156102d35760405162461bcd60e51b81526020600482015260156024820152741bdb1908191a59999a58dd5b1d1e481c195c9a5bd9605a1b60448201526064016101f4565b60006107e06102e360018a610caf565b6102ed9190610cfb565b905060008183111561033b57610304826001610d0f565b831461031257610312610d27565b84830361032c57610325856000546106a7565b905061033b565b81851461033b5761033b610d27565b6000805481526002602052604081205490805b888110156103be576000610362828e610d0f565b905061039e818d8d610375866050610cc6565b90610381876001610d0f565b61038c906050610cc6565b9261039993929190610d3d565b61071f565b6103a89084610d0f565b92505080806103b690610d67565b91505061034e565b508385111561051c573660008b8b6103d760018d610caf565b6103e2906050610cc6565b6103ed928290610d3d565b90925090506000610434610405604c60488587610d3d565b61040e91610d80565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b90506000610442898b6106a7565b90508681116104935760405162461bcd60e51b815260206004820152601d60248201527f696e73756666696369656e7420746f74616c20646966666963756c747900000060448201526064016101f4565b60006104a08b6001610d0f565b90505b60005481116104cd57600081815260026020526040812055806104c581610d67565b9150506104a3565b50604080518b81526020810183905263ffffffff84168183015290517f452ea9c9e4985cb8cc7199131fd292d600dae30f407e749b6ca7e7f4c7690cf79181900360600190a15050505061058b565b86851461052b5761052b610d27565b83851461053a5761053a610d27565b600054861161058b5760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e7420636861696e206c656e6774680000000000000060448201526064016101f4565b600086815561059b600c8b610caf565b905060008b828c6105ad826004610d0f565b926105ba93929190610d3d565b6105c391610d80565b60e01c90506105f081600881811c62ff00ff1663ff00ff009290911b9190911617601081811c91901b1790565b63ffffffff16600155600088815260026020526040812054600154604080518c8152602081019290925281018290529091507f11cedc7f83a9a6f5228b8fcd3c3c0ae686a51e2e04ea46923e3491a32a4bbaa89060600160405180910390a183156106975760408051858152602081018790529081018290527fea952b3dfe43a8e680ea58302c72429cd78ef0537abeaf75797ef9bb0496cefc9060600160405180910390a15b5050505050505050505050505050565b600082815260036020526040812054816106c382600019610cfb565b905060006106d3866107e0610cc6565b6106dd9086610caf565b6106e8906001610d0f565b9050600181101580156106fd57506107e08111155b61070957610709610d27565b6107138282610cc6565b93505050505b92915050565b60006050821461073157610731610d27565b60006109336002808686604051610749929190610db0565b602060405180830381855afa158015610766573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906107899190610dc0565b60405160200161079b91815260200190565b60408051601f19818403018152908290526107b591610dd9565b602060405180830381855afa1580156107d2573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906107f59190610dc0565b7bffffffff000000000000000000000000ffffffff00000000000000007eff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000600883811c9182167fff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000009490911b93841617601090811c7cff000000ff000000ff000000ff000000ff000000ff000000ff000000ff9092167dff000000ff000000ff000000ff000000ff000000ff000000ff000000ff009094169390931790921b91909117602081811c9283167fffffffff000000000000000000000000ffffffff0000000000000000000000009290911b91821617604090811c73ffffffff000000000000000000000000ffffffff90931677ffffffff000000000000000000000000ffffffff0000000090921691909117901b17608081811c91901b1790565b6000868152600260205260409020549091508181158015906109555750808214155b1561095f57600193505b600087815260026020526040812082905561098a61098160246004898b610d3d565b6107f591610e14565b90506002600061099b60018b610caf565b81526020019081526020016000205481146109e55760405162461bcd60e51b815260206004820152600a602482015269189859081c185c995b9d60b21b60448201526064016101f4565b80610a325760405162461bcd60e51b815260206004820152601e60248201527f706172656e7420626c6f636b206e6f7420796574207375626d6974746564000060448201526064016101f4565b6000610a42604c6048898b610d3d565b610a4b91610e14565b90506000610a5882610158565b9050808610610aa95760405162461bcd60e51b815260206004820152601760248201527f626c6f636b20686173682061626f76652074617267657400000000000000000060448201526064016101f4565b6000610ab76107e08c610cfb565b9050610ac56107e08c610e32565b600003610b7c576000600381610adc600185610caf565b81526020019081526020016000205490507f0000000000000000000000000000000000000000000000000000000000000000610b655780600284901c10610b655760405162461bcd60e51b815260206004820152601860248201527f3c32352520646966666963756c7479207265746172676574000000000000000060448201526064016101f4565b506000818152600360205260409020829055610bf6565b7f0000000000000000000000000000000000000000000000000000000000000000610bf6576000818152600360205260409020548214610bf65760405162461bcd60e51b815260206004820152601560248201527477726f6e6720646966666963756c7479206269747360581b60448201526064016101f4565b505050505050509392505050565b600060208284031215610c1657600080fd5b5035919050565b600080600060408486031215610c3257600080fd5b83359250602084013567ffffffffffffffff80821115610c5157600080fd5b818601915086601f830112610c6557600080fd5b813581811115610c7457600080fd5b876020828501011115610c8657600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052601160045260246000fd5b600082821015610cc157610cc1610c99565b500390565b6000816000190483118215151615610ce057610ce0610c99565b500290565b634e487b7160e01b600052601260045260246000fd5b600082610d0a57610d0a610ce5565b500490565b60008219821115610d2257610d22610c99565b500190565b634e487b7160e01b600052600160045260246000fd5b60008085851115610d4d57600080fd5b83861115610d5a57600080fd5b5050820193919092039150565b600060018201610d7957610d79610c99565b5060010190565b6001600160e01b03198135818116916004851015610da85780818660040360031b1b83161692505b505092915050565b8183823760009101908152919050565b600060208284031215610dd257600080fd5b5051919050565b6000825160005b81811015610dfa5760208186018101518583015201610de0565b81811115610e09576000828501525b509190910192915050565b8035602083101561071957600019602084900360031b1b1692915050565b600082610e4157610e41610ce5565b50069056fea2646970667358221220b66b6dd387a064b7403d8cfaa09097da2d512f2591c04e24193b016210ad9cc864736f6c634300080f0033", - "sourceMap": "1462:9452:8:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2326:49;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;345:25:17;;;333:2;318:18;2326:49:8;;;;;;;;3758:99;3835:15;;3758:99;;2462:27;;;;;;2566:31;;;;;;;;546:14:17;;539:22;521:41;;509:2;494:18;2566:31:8;381:187:17;10294:618:8;;;;;;:::i;:::-;;:::i;4034:3541::-;;;;;;:::i;:::-;;:::i;:::-;;3570:103;3623:7;3649:17;3570:103;;3371:117;;;;;;:::i;:::-;3430:7;3456:25;;;:17;:25;;;;;;;3371:117;10294:618;10348:7;10676:1;10671:7;;;;10719:1;10714:7;;;10756:1;10744:13;;;10772:1;10767:7;;;10743:32;10797:13;;10820:7;;;10796:32;;10348:7;;10873;;10671;10873;:::i;:::-;10868:13;;:1;:13;:::i;:::-;10855:27;;;;;10294:618;-1:-1:-1;;;;10294:618:8:o;4034:3541::-;4117:18;4138:24;4160:2;4138:12;:24;:::i;:::-;4117:45;-1:-1:-1;4199:12:8;4180:15;4117:45;4193:2;4180:15;:::i;:::-;:38;4172:70;;;;-1:-1:-1;;;4172:70:8;;2630:2:17;4172:70:8;;;2612:21:17;2669:2;2649:18;;;2642:30;-1:-1:-1;;;2688:18:17;;;2681:49;2747:18;;4172:70:8;;;;;;;;;4273:1;4260:10;:14;4252:57;;;;-1:-1:-1;;;4252:57:8;;2978:2:17;4252:57:8;;;2960:21:17;3017:2;2997:18;;;2990:30;3056:32;3036:18;;;3029:60;3106:18;;4252:57:8;2776:354:17;4252:57:8;4455:17;4495:4;4475:17;;:24;;;;:::i;:::-;4455:44;-1:-1:-1;4509:17:8;4556:1;4529:24;4543:10;4529:11;:24;:::i;:::-;:28;;;;:::i;:::-;4509:48;-1:-1:-1;4567:17:8;4587:16;4599:4;4509:48;4587:16;:::i;:::-;4567:36;;4634:9;4621;:22;;4613:56;;;;-1:-1:-1;;;4613:56:8;;3470:2:17;4613:56:8;;;3452:21:17;3509:2;3489:18;;;3482:30;-1:-1:-1;;;3528:18:17;;;3521:51;3589:18;;4613:56:8;3268:345:17;4613:56:8;4755:20;4798:4;4779:15;4793:1;4779:11;:15;:::i;:::-;4778:24;;;;:::i;:::-;4755:47;;4812:15;4857:12;4845:9;:24;4841:570;;;4905:16;:12;4920:1;4905:16;:::i;:::-;4892:9;:29;4885:37;;;;:::i;:::-;5028:9;5015;:22;5011:390;;5203:45;5219:9;5230:17;;5203:15;:45::i;:::-;5193:55;;5011:390;;;5373:12;5360:9;:25;5353:33;;;;:::i;:::-;5460:14;5490:17;;3456:25;;:17;:25;;;;;;;5460:14;5546:180;5570:10;5566:1;:14;5546:180;;;5601:16;5620:15;5634:1;5620:11;:15;:::i;:::-;5601:34;-1:-1:-1;5659:56:8;5601:34;5681:12;;5694:6;5699:1;5694:2;:6;:::i;:::-;5681:33;5707:5;:1;5711;5707:5;:::i;:::-;5701:12;;:2;:12;:::i;:::-;5681:33;;;;;;;:::i;:::-;5659:11;:56::i;:::-;5649:66;;;;:::i;:::-;;;5587:139;5582:3;;;;;:::i;:::-;;;;5546:180;;;;5803:12;5791:9;:24;5787:1300;;;5981:25;;6009:12;;6028:14;6041:1;6028:10;:14;:::i;:::-;6022:21;;:2;:21;:::i;:::-;6009:36;;;;;:::i;:::-;5981:64;;-1:-1:-1;5981:64:8;-1:-1:-1;6059:24:8;6086:81;6134:17;6148:2;6145;5981:64;;6134:17;:::i;:::-;6127:25;;;:::i;:::-;1634:21:11;;;;;;1639:10;1608:21;;;;;;;;;1607:49;1723:2;1718:7;;;1706;;;1705:21;;1485:248;6086:81:8;6059:108;;6182:15;6200:37;6216:9;6227;6200:15;:37::i;:::-;6182:55;;6269:7;6259;:17;6251:59;;;;-1:-1:-1;;;6251:59:8;;4756:2:17;6251:59:8;;;4738:21:17;4795:2;4775:18;;;4768:30;4834:31;4814:18;;;4807:59;4883:18;;6251:59:8;4554:353:17;6251:59:8;6470:9;6482:13;:9;6494:1;6482:13;:::i;:::-;6470:25;;6465:118;6502:17;;6497:1;:22;6465:118;;6567:1;6544:20;;;:17;:20;;;;;:24;6562:1;6521:3;6562:1;6521:3;:::i;:::-;;;;6465:118;;;-1:-1:-1;6602:132:8;;;5112:25:17;;;5168:2;5153:18;;5146:34;;;5228:10;5216:23;;5196:18;;;5189:51;6602:132:8;;;;;;;5100:2:17;6602:132:8;;;5817:928;;;;5787:1300;;;6938:9;6925;:22;6918:30;;;;:::i;:::-;6982:12;6969:9;:25;6962:33;;;;:::i;:::-;7029:17;;7017:9;:29;7009:67;;;;-1:-1:-1;;;7009:67:8;;5453:2:17;7009:67:8;;;5435:21:17;5492:2;5472:18;;;5465:30;5531:27;5511:18;;;5504:55;5576:18;;7009:67:8;5251:349:17;7009:67:8;7148:17;:29;;;7201:24;7223:2;7201:12;:24;:::i;:::-;7187:38;-1:-1:-1;7235:11:8;7263:12;7187:38;7263:12;7280:7;7187:38;7286:1;7280:7;:::i;:::-;7263:25;;;;;;;:::i;:::-;7256:33;;;:::i;:::-;7249:41;;7235:55;;7318:22;7335:4;1654:1:11;1608:21;;;1639:10;1608:21;1634;;;;;;;;;1607:49;1723:2;1706:7;;;1718;;;1705:21;;1485:248;7318:22:8;7300:40;;:15;:40;7387:14;3456:25;;;:17;:25;;;;;;7460:15;;7442:42;;;5807:25:17;;;5863:2;5848:18;;5841:34;;;;5891:18;;5884:34;;;7387:40:8;;-1:-1:-1;7442:42:8;;5795:2:17;5780:18;7442:42:8;;;;;;;7498:10;;7494:75;;7529:29;;;5807:25:17;;;5863:2;5848:18;;5841:34;;;5891:18;;;5884:34;;;7529:29:8;;5795:2:17;5780:18;7529:29:8;;;;;;;7494:75;4107:3468;;;;;;;;;;;4034:3541;;;:::o;7581:380::-;7684:7;7724:22;;;:14;:22;;;;;;7684:7;7779:21;7724:22;-1:-1:-1;;7779:21:8;:::i;:::-;7756:44;-1:-1:-1;7811:17:8;7841:13;:6;7850:4;7841:13;:::i;:::-;7831:24;;:6;:24;:::i;:::-;:28;;7858:1;7831:28;:::i;:::-;7811:48;;7889:1;7876:9;:14;;:35;;;;;7907:4;7894:9;:17;;7876:35;7869:43;;;;:::i;:::-;7930:24;7942:12;7930:9;:24;:::i;:::-;7923:31;;;;;7581:380;;;;;:::o;7967:2321::-;8070:18;8167:2;8145:24;;8138:32;;;;:::i;:::-;8180:20;8203:89;8242:39;8260:19;8267:11;;8260:19;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8249:31;;;;;;345:25:17;;333:2;318:18;;199:177;8249:31:8;;;;-1:-1:-1;;8249:31:8;;;;;;;;;;8242:39;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;975:8:11;615;471:1;436:15;;;615:8;;;;456:16;;;;615:8;;;;650:2;614:16;;;636:9;;;;;;;;;;;;635:17;;;613:40;;;;830:2;794:16;;;975:8;;;;815:17;;;;975:8;;;;1010:2;974:16;;;996:9;;;;;;;;;;;;995:17;;973:40;1082:3;1064:8;;;1077;;;1063:23;;219:874;8203:89:8;8411:15;8429:30;;;:17;:30;;;;;;8180:112;;-1:-1:-1;8180:112:8;8522:21;;;;;:43;;;8558:7;8547;:18;;8522:43;8518:169;;;8675:1;8662:14;;8518:169;8777:30;;;;:17;:30;;;;;:40;;;8900:54;8934:17;8948:2;8946:1;8934:11;;:17;:::i;:::-;8926:26;;;:::i;8900:54::-;8879:85;-1:-1:-1;8994:17:8;8879:85;9012:15;9026:1;9012:11;:15;:::i;:::-;8994:34;;;;;;;;;;;;8982:8;:46;8974:69;;;;-1:-1:-1;;;8974:69:8;;7611:2:17;8974:69:8;;;7593:21:17;7650:2;7630:18;;;7623:30;-1:-1:-1;;;7669:18:17;;;7662:40;7719:18;;8974:69:8;7409:334:17;8974:69:8;9061:8;9053:65;;;;-1:-1:-1;;;9053:65:8;;7950:2:17;9053:65:8;;;7932:21:17;7989:2;7969:18;;;7962:30;8028:32;8008:18;;;8001:60;8078:18;;9053:65:8;7748:354:17;9053:65:8;9161:12;9184:18;9199:2;9196;9184:11;;:18;:::i;:::-;9176:27;;;:::i;:::-;9161:42;;9213:14;9230:15;9240:4;9230:9;:15::i;:::-;9213:32;;9278:6;9263:12;:21;9255:57;;;;-1:-1:-1;;;9255:57:8;;8309:2:17;9255:57:8;;;8291:21:17;8348:2;8328:18;;;8321:30;8387:25;8367:18;;;8360:53;8430:18;;9255:57:8;8107:347:17;9255:57:8;9377:14;9394:18;9408:4;9394:11;:18;:::i;:::-;9377:35;-1:-1:-1;9426:18:8;9440:4;9426:11;:18;:::i;:::-;9448:1;9426:23;9422:860;;9699:18;9720:14;9699:18;9735:10;9744:1;9735:6;:10;:::i;:::-;9720:26;;;;;;;;;;;;9699:47;;9976:9;9971:110;;10027:10;10023:1;10013:6;:11;;:24;10005:61;;;;-1:-1:-1;;;10005:61:8;;8778:2:17;10005:61:8;;;8760:21:17;8817:2;8797:18;;;8790:30;8856:26;8836:18;;;8829:54;8900:18;;10005:61:8;8576:348:17;10005:61:8;-1:-1:-1;10094:22:8;;;;:14;:22;;;;;:31;;;9422:860;;;10147:9;10142:140;;10223:22;;;;:14;:22;;;;;;10213:32;;10205:66;;;;-1:-1:-1;;;10205:66:8;;9131:2:17;10205:66:8;;;9113:21:17;9170:2;9150:18;;;9143:30;-1:-1:-1;;;9189:18:17;;;9182:51;9250:18;;10205:66:8;8929:345:17;10205:66:8;8094:2194;;;;;;;7967:2321;;;;;:::o;14:180:17:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:17;;14:180;-1:-1:-1;14:180:17:o;758:659::-;837:6;845;853;906:2;894:9;885:7;881:23;877:32;874:52;;;922:1;919;912:12;874:52;958:9;945:23;935:33;;1019:2;1008:9;1004:18;991:32;1042:18;1083:2;1075:6;1072:14;1069:34;;;1099:1;1096;1089:12;1069:34;1137:6;1126:9;1122:22;1112:32;;1182:7;1175:4;1171:2;1167:13;1163:27;1153:55;;1204:1;1201;1194:12;1153:55;1244:2;1231:16;1270:2;1262:6;1259:14;1256:34;;;1286:1;1283;1276:12;1256:34;1331:7;1326:2;1317:6;1313:2;1309:15;1305:24;1302:37;1299:57;;;1352:1;1349;1342:12;1299:57;1383:2;1379;1375:11;1365:21;;1405:6;1395:16;;;;;758:659;;;;;:::o;1736:127::-;1797:10;1792:3;1788:20;1785:1;1778:31;1828:4;1825:1;1818:15;1852:4;1849:1;1842:15;1868:125;1908:4;1936:1;1933;1930:8;1927:34;;;1941:18;;:::i;:::-;-1:-1:-1;1978:9:17;;1868:125::o;1998:168::-;2038:7;2104:1;2100;2096:6;2092:14;2089:1;2086:21;2081:1;2074:9;2067:17;2063:45;2060:71;;;2111:18;;:::i;:::-;-1:-1:-1;2151:9:17;;1998:168::o;2171:127::-;2232:10;2227:3;2223:20;2220:1;2213:31;2263:4;2260:1;2253:15;2287:4;2284:1;2277:15;2303:120;2343:1;2369;2359:35;;2374:18;;:::i;:::-;-1:-1:-1;2408:9:17;;2303:120::o;3135:128::-;3175:3;3206:1;3202:6;3199:1;3196:13;3193:39;;;3212:18;;:::i;:::-;-1:-1:-1;3248:9:17;;3135:128::o;3618:127::-;3679:10;3674:3;3670:20;3667:1;3660:31;3710:4;3707:1;3700:15;3734:4;3731:1;3724:15;3750:331;3855:9;3866;3908:8;3896:10;3893:24;3890:44;;;3930:1;3927;3920:12;3890:44;3959:6;3949:8;3946:20;3943:40;;;3979:1;3976;3969:12;3943:40;-1:-1:-1;;4005:23:17;;;4050:25;;;;;-1:-1:-1;3750:331:17:o;4086:135::-;4125:3;4146:17;;;4143:43;;4166:18;;:::i;:::-;-1:-1:-1;4213:1:17;4202:13;;4086:135::o;4226:323::-;-1:-1:-1;;;;;;4346:19:17;;4422:11;;;;4453:1;4445:10;;4442:101;;;4530:2;4524;4517:3;4514:1;4510:11;4507:1;4503:19;4499:28;4495:2;4491:37;4487:46;4478:55;;4442:101;;;4226:323;;;;:::o;6253:271::-;6436:6;6428;6423:3;6410:33;6392:3;6462:16;;6487:13;;;6462:16;6253:271;-1:-1:-1;6253:271:17:o;6529:184::-;6599:6;6652:2;6640:9;6631:7;6627:23;6623:32;6620:52;;;6668:1;6665;6658:12;6620:52;-1:-1:-1;6691:16:17;;6529:184;-1:-1:-1;6529:184:17:o;6718:426::-;6847:3;6885:6;6879:13;6910:1;6920:129;6934:6;6931:1;6928:13;6920:129;;;7032:4;7016:14;;;7012:25;;7006:32;6993:11;;;6986:53;6949:12;6920:129;;;7067:6;7064:1;7061:13;7058:48;;;7102:1;7093:6;7088:3;7084:16;7077:27;7058:48;-1:-1:-1;7122:16:17;;;;;6718:426;-1:-1:-1;;6718:426:17:o;7149:255::-;7269:19;;7308:2;7300:11;;7297:101;;;-1:-1:-1;;7369:2:17;7365:12;;;7362:1;7358:20;7354:33;7343:45;7149:255;;;;:::o;8459:112::-;8491:1;8517;8507:35;;8522:18;;:::i;:::-;-1:-1:-1;8556:9:17;;8459:112::o", + "object": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063a9c2d7ab11610066578063a9c2d7ab14610133578063d1a2eab214610146578063e870c9141461015b578063e875aa5d14610165578063ee82ac5e1461016d57600080fd5b80630d2b2860146100a357806332c25832146100d757806334cdf78d146100df57806376e92c84146100f257806392108c86146100fc575b600080fd5b6100c46100b1366004610d92565b6103eb6020526000908152604090205481565b6040519081526020015b60405180910390f35b6001546100c4565b6100c46100ed366004610d92565b610180565b6100c46103ec5481565b6101237f000000000000000000000000000000000000000000000000000000000000000081565b60405190151581526020016100ce565b6100c4610141366004610d92565b610198565b610159610154366004610dab565b6101da565b005b6100c46103ea5481565b6000546100c4565b6100c461017b366004610d92565b6106fb565b6002816103e8811061019157600080fd5b0154905081565b6000600382811a90600284901a600890811b600186901a17901b84841a179083906101c39084610e53565b6101ce906008610e6a565b9190911b949350505050565b60006101e7605083610e9f565b9050816101f5826050610e6a565b1461023d5760405162461bcd60e51b81526020600482015260136024820152720eee4dedcce40d0cac2c8cae440d8cadccee8d606b1b60448201526064015b60405180910390fd5b6000811161028d5760405162461bcd60e51b815260206004820152601e60248201527f6d757374207375626d6974206174206c65617374206f6e6520626c6f636b00006044820152606401610234565b6101f460005461029d9190610e53565b84116102d35760405162461bcd60e51b815260206004820152600560248201526472656f726760d81b6044820152606401610234565b60006107e06000546102e59190610e9f565b9050600060016102f58488610eb3565b6102ff9190610e53565b9050600061030f6107e083610e9f565b9050828110156103595760405162461bcd60e51b81526020600482015260156024820152741bdb1908191a59999a58dd5b1d1e481c195c9a5bd9605a1b6044820152606401610234565b60006107e061036960018a610e53565b6103739190610e9f565b90506000818311156103c15761038a826001610eb3565b831461039857610398610ecb565b8483036103b2576103ab85600054610791565b90506103c1565b8185146103c1576103c1610ecb565b60006103ce6000546106fb565b90506000805b888110156104445760006103e8828e610eb3565b9050610424818d8d6103fb866050610e6a565b90610407876001610eb3565b610412906050610e6a565b9261041f93929190610ee1565b61080a565b61042e9084610eb3565b925050808061043c90610f0b565b9150506103d4565b5083851115610567573660008b8b61045d60018d610e53565b610468906050610e6a565b610473928290610ee1565b909250905060006104ba61048b604c60488587610ee1565b61049491610f24565b60d881901c63ff00ff001662ff00ff60e89290921c9190911617601081811b91901c1790565b905060006104c8898b610791565b90508681116105195760405162461bcd60e51b815260206004820152601d60248201527f696e73756666696369656e7420746f74616c20646966666963756c74790000006044820152606401610234565b604080518b81526020810183905263ffffffff84168183015290517f452ea9c9e4985cb8cc7199131fd292d600dae30f407e749b6ca7e7f4c7690cf79181900360600190a1505050506105d6565b86851461057657610576610ecb565b83851461058557610585610ecb565b60005486116105d65760405162461bcd60e51b815260206004820152601960248201527f696e73756666696369656e7420636861696e206c656e677468000000000000006044820152606401610234565b6105df86610d45565b6103ea5560008681556105f3600c8b610e53565b905060008b828c610605826004610eb3565b9261061293929190610ee1565b61061b91610f24565b60e01c905061064881600881811c62ff00ff1663ff00ff009290911b9190911617601081811c91901b1790565b63ffffffff16600155600061065c896106fb565b600154604080518c8152602081019290925281018290529091507f11cedc7f83a9a6f5228b8fcd3c3c0ae686a51e2e04ea46923e3491a32a4bbaa89060600160405180910390a183156106eb5760408051858152602081018790529081018290527fea952b3dfe43a8e680ea58302c72429cd78ef0537abeaf75797ef9bb0496cefc9060600160405180910390a15b5050505050505050505050505050565b6000805482111561074e5760405162461bcd60e51b815260206004820152601760248201527f426c6f636b206e6f7420796574207375626d69747465640000000000000000006044820152606401610234565b6101f460005461075e9190610e53565b82101561076d57506000919050565b600261077883610d45565b6103e8811061078957610789610e27565b015492915050565b60008281526103eb6020526040812054816107ae82600019610e9f565b905060006107be866107e0610e6a565b6107c89086610e53565b6107d3906001610eb3565b9050600181101580156107e857506107e08111155b6107f4576107f4610ecb565b6107fe8282610e6a565b93505050505b92915050565b60006050821461081c5761081c610ecb565b6000610a1e6002808686604051610834929190610f54565b602060405180830381855afa158015610851573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906108749190610f64565b60405160200161088691815260200190565b60408051601f19818403018152908290526108a091610f7d565b602060405180830381855afa1580156108bd573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906108e09190610f64565b7bffffffff000000000000000000000000ffffffff00000000000000007eff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000600883811c9182167fff000000ff000000ff000000ff000000ff000000ff000000ff000000ff0000009490911b93841617601090811c7cff000000ff000000ff000000ff000000ff000000ff000000ff000000ff9092167dff000000ff000000ff000000ff000000ff000000ff000000ff000000ff009094169390931790921b91909117602081811c9283167fffffffff000000000000000000000000ffffffff0000000000000000000000009290911b91821617604090811c73ffffffff000000000000000000000000ffffffff90931677ffffffff000000000000000000000000ffffffff0000000090921691909117901b17608081811c91901b1790565b9050806000610a2c87610d45565b90506000548711158015610a555750816002826103e88110610a5057610a50610e27565b015414155b15610a5f57600193505b816002826103e88110610a7457610a74610e27565b01556000610a92610a8960246004898b610ee1565b6108e091610fb8565b905060006002610aa46101f482610e6a565b6001610ab36101f46002610e6a565b610abd9087610eb3565b610ac79190610e53565b610ad19190610fd6565b6103e88110610ae257610ae2610e27565b0154905080610b335760405162461bcd60e51b815260206004820152601e60248201527f706172656e7420626c6f636b206e6f7420796574207375626d697474656400006044820152606401610234565b808214610b6f5760405162461bcd60e51b815260206004820152600a602482015269189859081c185c995b9d60b21b6044820152606401610234565b6000610b7f604c60488a8c610ee1565b610b8891610fb8565b90506000610b9582610198565b9050808710610be65760405162461bcd60e51b815260206004820152601760248201527f626c6f636b20686173682061626f7665207461726765740000000000000000006044820152606401610234565b6000610bf46107e08d610e9f565b9050610c026107e08d610fd6565b600003610cbb5760006103eb81610c1a600185610e53565b81526020019081526020016000205490507f0000000000000000000000000000000000000000000000000000000000000000610ca35780600284901c10610ca35760405162461bcd60e51b815260206004820152601860248201527f3c32352520646966666963756c747920726574617267657400000000000000006044820152606401610234565b5060008181526103eb60205260409020829055610d36565b7f0000000000000000000000000000000000000000000000000000000000000000610d365760008181526103eb60205260409020548214610d365760405162461bcd60e51b815260206004820152601560248201527477726f6e6720646966666963756c7479206269747360581b6044820152606401610234565b50505050505050509392505050565b6000610d546101f46002610e6a565b6000546103ea548490610d6a6101f46002610e6a565b610d749190610eb3565b610d7e9190610eb3565b610d889190610e53565b6108049190610fd6565b600060208284031215610da457600080fd5b5035919050565b600080600060408486031215610dc057600080fd5b83359250602084013567ffffffffffffffff80821115610ddf57600080fd5b818601915086601f830112610df357600080fd5b813581811115610e0257600080fd5b876020828501011115610e1457600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082821015610e6557610e65610e3d565b500390565b6000816000190483118215151615610e8457610e84610e3d565b500290565b634e487b7160e01b600052601260045260246000fd5b600082610eae57610eae610e89565b500490565b60008219821115610ec657610ec6610e3d565b500190565b634e487b7160e01b600052600160045260246000fd5b60008085851115610ef157600080fd5b83861115610efe57600080fd5b5050820193919092039150565b600060018201610f1d57610f1d610e3d565b5060010190565b6001600160e01b03198135818116916004851015610f4c5780818660040360031b1b83161692505b505092915050565b8183823760009101908152919050565b600060208284031215610f7657600080fd5b5051919050565b6000825160005b81811015610f9e5760208186018101518583015201610f84565b81811115610fad576000828501525b509190910192915050565b8035602083101561080457600019602084900360031b1b1692915050565b600082610fe557610fe5610e89565b50069056fea2646970667358221220ef9c6e5b5e473273dde476098fccf851c2623232968c21458acccd4b0876cc7264736f6c634300080f0033", + "sourceMap": "1430:10318:8:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2737:49;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;345:25:17;;;333:2;318:18;2737:49:8;;;;;;;;4675:99;4752:15;;4675:99;;2592:38;;;;;;:::i;:::-;;:::i;2873:27::-;;;;;;2977:31;;;;;;;;728:14:17;;721:22;703:41;;691:2;676:18;2977:31:8;563:187:17;11128:618:8;;;;;;:::i;:::-;;:::i;4951:3340::-;;;;;;:::i;:::-;;:::i;:::-;;2636:28;;;;;;4487:103;4540:7;4566:17;4487:103;;3912:298;;;;;;:::i;:::-;;:::i;2592:38::-;;;;;;;;;;;;;;;-1:-1:-1;2592:38:8;:::o;11128:618::-;11182:7;11510:1;11505:7;;;;11553:1;11548:7;;;11590:1;11578:13;;;11606:1;11601:7;;;11577:32;11631:13;;11654:7;;;11630:32;;11182:7;;11707;;11505;11707;:::i;:::-;11702:13;;:1;:13;:::i;:::-;11689:27;;;;;11128:618;-1:-1:-1;;;;11128:618:8:o;4951:3340::-;5034:18;5055:24;5077:2;5055:12;:24;:::i;:::-;5034:45;-1:-1:-1;5116:12:8;5097:15;5034:45;5110:2;5097:15;:::i;:::-;:38;5089:70;;;;-1:-1:-1;;;5089:70:8;;2630:2:17;5089:70:8;;;2612:21:17;2669:2;2649:18;;;2642:30;-1:-1:-1;;;2688:18:17;;;2681:49;2747:18;;5089:70:8;;;;;;;;;5190:1;5177:10;:14;5169:57;;;;-1:-1:-1;;;5169:57:8;;2978:2:17;5169:57:8;;;2960:21:17;3017:2;2997:18;;;2990:30;3056:32;3036:18;;;3029:60;3106:18;;5169:57:8;2776:354:17;5169:57:8;2526:3;5258:17;;:37;;;;:::i;:::-;5244:11;:51;5236:69;;;;-1:-1:-1;;;5236:69:8;;3337:2:17;5236:69:8;;;3319:21:17;3376:1;3356:18;;;3349:29;-1:-1:-1;;;3394:18:17;;;3387:35;3439:18;;5236:69:8;3135:328:17;5236:69:8;5396:17;5436:4;5416:17;;:24;;;;:::i;:::-;5396:44;-1:-1:-1;5450:17:8;5497:1;5470:24;5484:10;5470:11;:24;:::i;:::-;:28;;;;:::i;:::-;5450:48;-1:-1:-1;5508:17:8;5528:16;5540:4;5450:48;5528:16;:::i;:::-;5508:36;;5575:9;5562;:22;;5554:56;;;;-1:-1:-1;;;5554:56:8;;3803:2:17;5554:56:8;;;3785:21:17;3842:2;3822:18;;;3815:30;-1:-1:-1;;;3861:18:17;;;3854:51;3922:18;;5554:56:8;3601:345:17;5554:56:8;5696:20;5739:4;5720:15;5734:1;5720:11;:15;:::i;:::-;5719:24;;;;:::i;:::-;5696:47;;5753:15;5798:12;5786:9;:24;5782:570;;;5846:16;:12;5861:1;5846:16;:::i;:::-;5833:9;:29;5826:37;;;;:::i;:::-;5969:9;5956;:22;5952:390;;6144:45;6160:9;6171:17;;6144:15;:45::i;:::-;6134:55;;5952:390;;;6314:12;6301:9;:25;6294:33;;;;:::i;:::-;6401:14;6418:31;6431:17;;6418:12;:31::i;:::-;6401:48;;6459:14;6492:9;6487:180;6511:10;6507:1;:14;6487:180;;;6542:16;6561:15;6575:1;6561:11;:15;:::i;:::-;6542:34;-1:-1:-1;6600:56:8;6542:34;6622:12;;6635:6;6640:1;6635:2;:6;:::i;:::-;6622:33;6648:5;:1;6652;6648:5;:::i;:::-;6642:12;;:2;:12;:::i;:::-;6622:33;;;;;;;:::i;:::-;6600:11;:56::i;:::-;6590:66;;;;:::i;:::-;;;6528:139;6523:3;;;;;:::i;:::-;;;;6487:180;;;;6744:12;6732:9;:24;6728:1028;;;6922:25;;6950:12;;6969:14;6982:1;6969:10;:14;:::i;:::-;6963:21;;:2;:21;:::i;:::-;6950:36;;;;;:::i;:::-;6922:64;;-1:-1:-1;6922:64:8;-1:-1:-1;7000:24:8;7027:81;7075:17;7089:2;7086;6922:64;;7075:17;:::i;:::-;7068:25;;;:::i;:::-;1634:21:11;;;;;;1639:10;1608:21;;;;;;;;;1607:49;1723:2;1718:7;;;1706;;;1705:21;;1485:248;7027:81:8;7000:108;;7123:15;7141:37;7157:9;7168;7141:15;:37::i;:::-;7123:55;;7210:7;7200;:17;7192:59;;;;-1:-1:-1;;;7192:59:8;;5089:2:17;7192:59:8;;;5071:21:17;5128:2;5108:18;;;5101:30;5167:31;5147:18;;;5140:59;5216:18;;7192:59:8;4887:353:17;7192:59:8;7271:132;;;5445:25:17;;;5501:2;5486:18;;5479:34;;;5561:10;5549:23;;5529:18;;;5522:51;7271:132:8;;;;;;;5433:2:17;7271:132:8;;;6758:656;;;;6728:1028;;;7607:9;7594;:22;7587:30;;;;:::i;:::-;7651:12;7638:9;:25;7631:33;;;;:::i;:::-;7698:17;;7686:9;:29;7678:67;;;;-1:-1:-1;;;7678:67:8;;5786:2:17;7678:67:8;;;5768:21:17;5825:2;5805:18;;;5798:30;5864:27;5844:18;;;5837:55;5909:18;;7678:67:8;5584:349:17;7678:67:8;7833:21;7844:9;7833:10;:21::i;:::-;7817:13;:37;7864:17;:29;;;7917:24;7939:2;7917:12;:24;:::i;:::-;7903:38;-1:-1:-1;7951:11:8;7979:12;7903:38;7979:12;7996:7;7903:38;8002:1;7996:7;:::i;:::-;7979:25;;;;;;;:::i;:::-;7972:33;;;:::i;:::-;7965:41;;7951:55;;8034:22;8051:4;1654:1:11;1608:21;;;1639:10;1608:21;1634;;;;;;;;;1607:49;1723:2;1706:7;;;1718;;;1705:21;;1485:248;8034:22:8;8016:40;;:15;:40;8103:14;8120:23;8133:9;8120:12;:23::i;:::-;8176:15;;8158:42;;;6140:25:17;;;6196:2;6181:18;;6174:34;;;;6224:18;;6217:34;;;8103:40:8;;-1:-1:-1;8158:42:8;;6128:2:17;6113:18;8158:42:8;;;;;;;8214:10;;8210:75;;8245:29;;;6140:25:17;;;6196:2;6181:18;;6174:34;;;6224:18;;;6217:34;;;8245:29:8;;6128:2:17;6113:18;8245:29:8;;;;;;;8210:75;5024:3267;;;;;;;;;;;4951:3340;;;:::o;3912:298::-;3973:7;4012:17;;4000:8;:29;;3992:65;;;;-1:-1:-1;;;3992:65:8;;6788:2:17;3992:65:8;;;6770:21:17;6827:2;6807:18;;;6800:30;6866:25;6846:18;;;6839:53;6909:18;;3992:65:8;6586:347:17;3992:65:8;2526:3;4082:17;;:37;;;;:::i;:::-;4071:8;:48;4067:87;;;-1:-1:-1;4142:1:8;;3912:298;-1:-1:-1;3912:298:8:o;4067:87::-;4170:11;4182:20;4193:8;4182:10;:20::i;:::-;4170:33;;;;;;;:::i;:::-;;;;3912:298;-1:-1:-1;;3912:298:8:o;8297:380::-;8400:7;8440:22;;;:14;:22;;;;;;8400:7;8495:21;8440:22;-1:-1:-1;;8495:21:8;:::i;:::-;8472:44;-1:-1:-1;8527:17:8;8557:13;:6;8566:4;8557:13;:::i;:::-;8547:24;;:6;:24;:::i;:::-;:28;;8574:1;8547:28;:::i;:::-;8527:48;;8605:1;8592:9;:14;;:35;;;;;8623:4;8610:9;:17;;8592:35;8585:43;;;;:::i;:::-;8646:24;8658:12;8646:9;:24;:::i;:::-;8639:31;;;;;8297:380;;;;;:::o;8683:2439::-;8786:18;8883:2;8861:24;;8854:32;;;;:::i;:::-;8896:20;8919:89;8958:39;8976:19;8983:11;;8976:19;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;8965:31;;;;;;345:25:17;;333:2;318:18;;199:177;8965:31:8;;;;-1:-1:-1;;8965:31:8;;;;;;;;;;8958:39;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;975:8:11;615;471:1;436:15;;;615:8;;;;456:16;;;;615:8;;;;650:2;614:16;;;636:9;;;;;;;;;;;;635:17;;;613:40;;;;830:2;794:16;;;975:8;;;;815:17;;;;975:8;;;;1010:2;974:16;;;996:9;;;;;;;;;;;;995:17;;973:40;1082:3;1064:8;;;1077;;;1063:23;;219:874;8919:89:8;8896:112;-1:-1:-1;8896:112:8;9127:15;9194:23;9205:11;9194:10;:23::i;:::-;9176:41;;9259:17;;9244:11;:32;;:67;;;;;9304:7;9280:11;9292:7;9280:20;;;;;;;:::i;:::-;;;:31;;9244:67;9227:215;;;9430:1;9417:14;;9227:215;9595:7;9572:11;9584:7;9572:20;;;;;;;:::i;:::-;;:30;9645:16;9685:54;9719:17;9733:2;9731:1;9719:11;;:17;:::i;:::-;9711:26;;;:::i;9685:54::-;9664:85;-1:-1:-1;9664:85:8;9776:11;2565:21;2526:3;9776:11;2565:21;:::i;:::-;9812:1;2565:21;2526:3;2585:1;2565:21;:::i;:::-;9789:20;;:7;:20;:::i;:::-;:24;;;;:::i;:::-;9788:39;;;;:::i;:::-;9776:52;;;;;;;:::i;:::-;;;;-1:-1:-1;9776:52:8;9838:63;;;;-1:-1:-1;;;9838:63:8;;8413:2:17;9838:63:8;;;8395:21:17;8452:2;8432:18;;;8425:30;8491:32;8471:18;;;8464:60;8541:18;;9838:63:8;8211:354:17;9838:63:8;9931:6;9919:8;:18;9911:41;;;;-1:-1:-1;;;9911:41:8;;8772:2:17;9911:41:8;;;8754:21:17;8811:2;8791:18;;;8784:30;-1:-1:-1;;;8830:18:17;;;8823:40;8880:18;;9911:41:8;8570:334:17;9911:41:8;9995:12;10018:18;10033:2;10030;10018:11;;:18;:::i;:::-;10010:27;;;:::i;:::-;9995:42;;10047:14;10064:15;10074:4;10064:9;:15::i;:::-;10047:32;;10112:6;10097:12;:21;10089:57;;;;-1:-1:-1;;;10089:57:8;;9111:2:17;10089:57:8;;;9093:21:17;9150:2;9130:18;;;9123:30;9189:25;9169:18;;;9162:53;9232:18;;10089:57:8;8909:347:17;10089:57:8;10211:14;10228:18;10242:4;10228:11;:18;:::i;:::-;10211:35;-1:-1:-1;10260:18:8;10274:4;10260:11;:18;:::i;:::-;10282:1;10260:23;10256:860;;10533:18;10554:14;10533:18;10569:10;10578:1;10569:6;:10;:::i;:::-;10554:26;;;;;;;;;;;;10533:47;;10810:9;10805:110;;10861:10;10857:1;10847:6;:11;;:24;10839:61;;;;-1:-1:-1;;;10839:61:8;;9463:2:17;10839:61:8;;;9445:21:17;9502:2;9482:18;;;9475:30;9541:26;9521:18;;;9514:54;9585:18;;10839:61:8;9261:348:17;10839:61:8;-1:-1:-1;10928:22:8;;;;:14;:22;;;;;:31;;;10256:860;;;10981:9;10976:140;;11057:22;;;;:14;:22;;;;;;11047:32;;11039:66;;;;-1:-1:-1;;;11039:66:8;;9816:2:17;11039:66:8;;;9798:21:17;9855:2;9835:18;;;9828:30;-1:-1:-1;;;9874:18:17;;;9867:51;9935:18;;11039:66:8;9614:345:17;11039:66:8;8810:2312;;;;;;;;8683:2439;;;;;:::o;4216:189::-;4276:7;2565:21;2526:3;2585:1;2565:21;:::i;:::-;4355:17;;4328:13;;4344:8;;2565:21;2526:3;2585:1;2565:21;:::i;:::-;4315:26;;;;:::i;:::-;:37;;;;:::i;:::-;:57;;;;:::i;:::-;4314:84;;;;:::i;14:180:17:-;73:6;126:2;114:9;105:7;101:23;97:32;94:52;;;142:1;139;132:12;94:52;-1:-1:-1;165:23:17;;14:180;-1:-1:-1;14:180:17:o;940:659::-;1019:6;1027;1035;1088:2;1076:9;1067:7;1063:23;1059:32;1056:52;;;1104:1;1101;1094:12;1056:52;1140:9;1127:23;1117:33;;1201:2;1190:9;1186:18;1173:32;1224:18;1265:2;1257:6;1254:14;1251:34;;;1281:1;1278;1271:12;1251:34;1319:6;1308:9;1304:22;1294:32;;1364:7;1357:4;1353:2;1349:13;1345:27;1335:55;;1386:1;1383;1376:12;1335:55;1426:2;1413:16;1452:2;1444:6;1441:14;1438:34;;;1468:1;1465;1458:12;1438:34;1513:7;1508:2;1499:6;1495:2;1491:15;1487:24;1484:37;1481:57;;;1534:1;1531;1524:12;1481:57;1565:2;1561;1557:11;1547:21;;1587:6;1577:16;;;;;940:659;;;;;:::o;1604:127::-;1665:10;1660:3;1656:20;1653:1;1646:31;1696:4;1693:1;1686:15;1720:4;1717:1;1710:15;1736:127;1797:10;1792:3;1788:20;1785:1;1778:31;1828:4;1825:1;1818:15;1852:4;1849:1;1842:15;1868:125;1908:4;1936:1;1933;1930:8;1927:34;;;1941:18;;:::i;:::-;-1:-1:-1;1978:9:17;;1868:125::o;1998:168::-;2038:7;2104:1;2100;2096:6;2092:14;2089:1;2086:21;2081:1;2074:9;2067:17;2063:45;2060:71;;;2111:18;;:::i;:::-;-1:-1:-1;2151:9:17;;1998:168::o;2171:127::-;2232:10;2227:3;2223:20;2220:1;2213:31;2263:4;2260:1;2253:15;2287:4;2284:1;2277:15;2303:120;2343:1;2369;2359:35;;2374:18;;:::i;:::-;-1:-1:-1;2408:9:17;;2303:120::o;3468:128::-;3508:3;3539:1;3535:6;3532:1;3529:13;3526:39;;;3545:18;;:::i;:::-;-1:-1:-1;3581:9:17;;3468:128::o;3951:127::-;4012:10;4007:3;4003:20;4000:1;3993:31;4043:4;4040:1;4033:15;4067:4;4064:1;4057:15;4083:331;4188:9;4199;4241:8;4229:10;4226:24;4223:44;;;4263:1;4260;4253:12;4223:44;4292:6;4282:8;4279:20;4276:40;;;4312:1;4309;4302:12;4276:40;-1:-1:-1;;4338:23:17;;;4383:25;;;;;-1:-1:-1;4083:331:17:o;4419:135::-;4458:3;4479:17;;;4476:43;;4499:18;;:::i;:::-;-1:-1:-1;4546:1:17;4535:13;;4419:135::o;4559:323::-;-1:-1:-1;;;;;;4679:19:17;;4755:11;;;;4786:1;4778:10;;4775:101;;;4863:2;4857;4850:3;4847:1;4843:11;4840:1;4836:19;4832:28;4828:2;4824:37;4820:46;4811:55;;4775:101;;;4559:323;;;;:::o;6938:271::-;7121:6;7113;7108:3;7095:33;7077:3;7147:16;;7172:13;;;7147:16;6938:271;-1:-1:-1;6938:271:17:o;7214:184::-;7284:6;7337:2;7325:9;7316:7;7312:23;7308:32;7305:52;;;7353:1;7350;7343:12;7305:52;-1:-1:-1;7376:16:17;;7214:184;-1:-1:-1;7214:184:17:o;7403:426::-;7532:3;7570:6;7564:13;7595:1;7605:129;7619:6;7616:1;7613:13;7605:129;;;7717:4;7701:14;;;7697:25;;7691:32;7678:11;;;7671:53;7634:12;7605:129;;;7752:6;7749:1;7746:13;7743:48;;;7787:1;7778:6;7773:3;7769:16;7762:27;7743:48;-1:-1:-1;7807:16:17;;;;;7403:426;-1:-1:-1;;7403:426:17:o;7834:255::-;7954:19;;7993:2;7985:11;;7982:101;;;-1:-1:-1;;8054:2:17;8050:12;;;8047:1;8043:20;8039:33;8028:45;7834:255;;;;:::o;8094:112::-;8126:1;8152;8142:35;;8157:18;;:::i;:::-;-1:-1:-1;8191:9:17;;8094:112::o", "linkReferences": {}, "immutableReferences": { - "23310": [ + "23321": [ { - "start": 214, + "start": 257, "length": 32 }, { - "start": 2799, + "start": 3117, "length": 32 }, { - "start": 2942, + "start": 3261, "length": 32 } ] } }, "methodIdentifiers": { + "blockHashes(uint256)": "34cdf78d", "getBlockHash(uint256)": "ee82ac5e", "getLatestBlockHeight()": "e875aa5d", "getLatestBlockTime()": "32c25832", "getTarget(bytes32)": "a9c2d7ab", "isTestnet()": "92108c86", + "latestBlockIx()": "e870c914", "longestReorg()": "76e92c84", "periodToTarget(uint256)": "0d2b2860", "submit(uint256,bytes)": "d1a2eab2" }, - "rawMetadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_blockHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_blockTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_expectedTarget\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_isTestnet\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"blockTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"NewTip\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalDifficulty\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newDifficultyBits\",\"type\":\"uint32\"}],\"name\":\"NewTotalDifficultySinceRetarget\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"oldTip\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newTip\",\"type\":\"bytes32\"}],\"name\":\"Reorg\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestBlockHeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestBlockTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"bits\",\"type\":\"bytes32\"}],\"name\":\"getTarget\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isTestnet\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"longestReorg\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"periodToTarget\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"blockHeaders\",\"type\":\"bytes\"}],\"name\":\"submit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"events\":{\"NewTip(uint256,uint256,bytes32)\":{\"notice\":\"Emitted whenever the contract accepts a new heaviest chain.\"},\"NewTotalDifficultySinceRetarget(uint256,uint256,uint32)\":{\"notice\":\"Emitted only after a difficulty retarget, when the contract accepts a new heaviest chain with updated difficulty.\"},\"Reorg(uint256,bytes32,bytes32)\":{\"notice\":\"Emitted when we reorg out a portion of the chain.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Tracks Bitcoin starting from a given block. The isTestnet argument is necessary because the Bitcoin testnet does not respect the difficulty rules, so we disable block difficulty checks in order to track it.\"},\"getBlockHash(uint256)\":{\"notice\":\"Returns the Bitcoin block hash at a specific height.\"},\"getLatestBlockHeight()\":{\"notice\":\"Returns the height of the current chain tip.\"},\"getLatestBlockTime()\":{\"notice\":\"Returns the timestamp of the current chain tip.\"},\"isTestnet()\":{\"notice\":\"Whether we're tracking testnet or mainnet Bitcoin. \"},\"longestReorg()\":{\"notice\":\"The longest reorg that this BtcMirror instance has observed. \"},\"periodToTarget(uint256)\":{\"notice\":\"Difficulty targets in each retargeting period. \"},\"submit(uint256,bytes)\":{\"notice\":\"Submits a new Bitcoin chain segment. Must be heavier (not necessarily longer) than the chain rooted at getBlockHash(getLatestBlockHeight()).\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/BtcMirror.sol\":\"BtcMirror\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/BtcMirror.sol\":{\"keccak256\":\"0x305f7a973496cfea129855bf8b7f163678c3bd0fe59f1271ce38be39e35ff4a2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b575b256dc86b82db8eb128e17051ee43a254f7fa28d5d85b236157896d226e\",\"dweb:/ipfs/QmZiNYRboAcTyhosUUpXkmQPsivPhcZqLimFTWYvLv74TT\"]},\"src/Endian.sol\":{\"keccak256\":\"0xcdbed7912bc20116a17d74af00eccfb24abfb0368482c345daa8bfdcfa66039c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a011026a0893bd505404a67d83afd0b53e4bba2c0b2cff3d2122cacb801cb82d\",\"dweb:/ipfs/QmaRTMtfw9xNSY3waWAsNbe5F2FVsnqeungcibovJkNF9C\"]},\"src/interfaces/IBtcMirror.sol\":{\"keccak256\":\"0xde8f7e89c799a17bd43762a56fd06b4e7daf6008c32adc88b3f7c75bc473e39f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8967647534b4d038315253b79a18f3c1e5878664b463ff97ab78f223b6eb1d39\",\"dweb:/ipfs/QmP4rFFxCw3T7Znw9wMiprdggquJM29vDDFn2jWF9BgjmJ\"]}},\"version\":1}", + "rawMetadata": "{\"compiler\":{\"version\":\"0.8.15+commit.e14f2714\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_blockHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_blockTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_expectedTarget\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"_isTestnet\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"blockTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"NewTip\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"totalDifficulty\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"newDifficultyBits\",\"type\":\"uint32\"}],\"name\":\"NewTotalDifficultySinceRetarget\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"count\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"oldTip\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newTip\",\"type\":\"bytes32\"}],\"name\":\"Reorg\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"blockHashes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNum\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestBlockHeight\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestBlockTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"bits\",\"type\":\"bytes32\"}],\"name\":\"getTarget\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isTestnet\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestBlockIx\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"longestReorg\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"periodToTarget\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"blockHeaders\",\"type\":\"bytes\"}],\"name\":\"submit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"events\":{\"NewTip(uint256,uint256,bytes32)\":{\"notice\":\"Emitted whenever the contract accepts a new heaviest chain.\"},\"NewTotalDifficultySinceRetarget(uint256,uint256,uint32)\":{\"notice\":\"Emitted only after a difficulty retarget, when the contract accepts a new heaviest chain with updated difficulty.\"},\"Reorg(uint256,bytes32,bytes32)\":{\"notice\":\"Emitted when we reorg out a portion of the chain.\"}},\"kind\":\"user\",\"methods\":{\"constructor\":{\"notice\":\"Tracks Bitcoin starting from a given block. The isTestnet argument is necessary because the Bitcoin testnet does not respect the difficulty rules, so we disable block difficulty checks in order to track it.\"},\"getBlockHash(uint256)\":{\"notice\":\"Returns the Bitcoin block hash at a specific height. The block number must not be higher than getLatestBlockHeight(). Returns 0 if the block is too old, and we no longer store its hash.\"},\"getLatestBlockHeight()\":{\"notice\":\"Returns the height of the current chain tip.\"},\"getLatestBlockTime()\":{\"notice\":\"Returns the timestamp of the current chain tip.\"},\"isTestnet()\":{\"notice\":\"Whether we're tracking testnet or mainnet Bitcoin. \"},\"longestReorg()\":{\"notice\":\"The longest reorg that this BtcMirror instance has observed. \"},\"periodToTarget(uint256)\":{\"notice\":\"Difficulty targets in each retargeting period. \"},\"submit(uint256,bytes)\":{\"notice\":\"Submits a new Bitcoin chain segment. Must be heavier (not necessarily longer) than the chain rooted at getBlockHash(getLatestBlockHeight()).\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/BtcMirror.sol\":\"BtcMirror\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":forge-std/=lib/forge-std/src/\"]},\"sources\":{\"src/BtcMirror.sol\":{\"keccak256\":\"0x80e622cf18a52d75000e7eba0a0377e920900767014c5c8f43c1dbeaa8d0f94f\",\"urls\":[\"bzz-raw://db29044877a7073f57c4f12199f9591d11c8b62d47d2f6d9c8aa14c9ed20320b\",\"dweb:/ipfs/QmS9kNHaJ7f8b6wZKVD6jiNCydATGTWNseuP3fGNVZ5vGU\"]},\"src/Endian.sol\":{\"keccak256\":\"0xcdbed7912bc20116a17d74af00eccfb24abfb0368482c345daa8bfdcfa66039c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://a011026a0893bd505404a67d83afd0b53e4bba2c0b2cff3d2122cacb801cb82d\",\"dweb:/ipfs/QmaRTMtfw9xNSY3waWAsNbe5F2FVsnqeungcibovJkNF9C\"]},\"src/interfaces/IBtcMirror.sol\":{\"keccak256\":\"0xde8f7e89c799a17bd43762a56fd06b4e7daf6008c32adc88b3f7c75bc473e39f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8967647534b4d038315253b79a18f3c1e5878664b463ff97ab78f223b6eb1d39\",\"dweb:/ipfs/QmP4rFFxCw3T7Znw9wMiprdggquJM29vDDFn2jWF9BgjmJ\"]}},\"version\":1}", "metadata": { "compiler": { "version": "0.8.15+commit.e14f2714" @@ -388,7 +422,26 @@ "inputs": [ { "internalType": "uint256", - "name": "number", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function", + "name": "blockHashes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ] + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNum", "type": "uint256" } ], @@ -461,6 +514,19 @@ } ] }, + { + "inputs": [], + "stateMutability": "view", + "type": "function", + "name": "latestBlockIx", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ] + }, { "inputs": [], "stateMutability": "view", @@ -523,7 +589,7 @@ "notice": "Tracks Bitcoin starting from a given block. The isTestnet argument is necessary because the Bitcoin testnet does not respect the difficulty rules, so we disable block difficulty checks in order to track it." }, "getBlockHash(uint256)": { - "notice": "Returns the Bitcoin block hash at a specific height." + "notice": "Returns the Bitcoin block hash at a specific height. The block number must not be higher than getLatestBlockHeight(). Returns 0 if the block is too old, and we no longer store its hash." }, "getLatestBlockHeight()": { "notice": "Returns the height of the current chain tip." @@ -566,12 +632,12 @@ }, "sources": { "src/BtcMirror.sol": { - "keccak256": "0x305f7a973496cfea129855bf8b7f163678c3bd0fe59f1271ce38be39e35ff4a2", + "keccak256": "0x80e622cf18a52d75000e7eba0a0377e920900767014c5c8f43c1dbeaa8d0f94f", "urls": [ - "bzz-raw://5b575b256dc86b82db8eb128e17051ee43a254f7fa28d5d85b236157896d226e", - "dweb:/ipfs/QmZiNYRboAcTyhosUUpXkmQPsivPhcZqLimFTWYvLv74TT" + "bzz-raw://db29044877a7073f57c4f12199f9591d11c8b62d47d2f6d9c8aa14c9ed20320b", + "dweb:/ipfs/QmS9kNHaJ7f8b6wZKVD6jiNCydATGTWNseuP3fGNVZ5vGU" ], - "license": "MIT" + "license": null }, "src/Endian.sol": { "keccak256": "0xcdbed7912bc20116a17d74af00eccfb24abfb0368482c345daa8bfdcfa66039c", @@ -594,25 +660,25 @@ }, "ast": { "absolutePath": "src/BtcMirror.sol", - "id": 23987, + "id": 24038, "exportedSymbols": { "BtcMirror": [ - 23986 + 24037 ], "Endian": [ - 25240 + 25291 ], "IBtcMirror": [ - 25290 + 25341 ] }, "nodeType": "SourceUnit", - "src": "32:10883:8", + "src": "0:11749:8", "nodes": [ { "id": 23260, "nodeType": "PragmaDirective", - "src": "32:24:8", + "src": "0:24:8", "literals": [ "solidity", ">=", @@ -623,46 +689,46 @@ { "id": 23261, "nodeType": "ImportDirective", - "src": "58:22:8", + "src": "26:22:8", "absolutePath": "src/Endian.sol", "file": "./Endian.sol", "nameLocation": "-1:-1:-1", - "scope": 23987, - "sourceUnit": 25241, + "scope": 24038, + "sourceUnit": 25292, "symbolAliases": [], "unitAlias": "" }, { "id": 23262, "nodeType": "ImportDirective", - "src": "81:37:8", + "src": "49:37:8", "absolutePath": "src/interfaces/IBtcMirror.sol", "file": "./interfaces/IBtcMirror.sol", "nameLocation": "-1:-1:-1", - "scope": 23987, - "sourceUnit": 25291, + "scope": 24038, + "sourceUnit": 25342, "symbolAliases": [], "unitAlias": "" }, { - "id": 23986, + "id": 24037, "nodeType": "ContractDefinition", - "src": "1462:9452:8", + "src": "1430:10318:8", "nodes": [ { "id": 23273, "nodeType": "EventDefinition", - "src": "1592:72:8", + "src": "1560:72:8", "anonymous": false, "documentation": { "id": 23265, "nodeType": "StructuredDocumentation", - "src": "1501:86:8", + "src": "1469:86:8", "text": " @notice Emitted whenever the contract accepts a new heaviest chain." }, "eventSelector": "11cedc7f83a9a6f5228b8fcd3c3c0ae686a51e2e04ea46923e3491a32a4bbaa8", "name": "NewTip", - "nameLocation": "1598:6:8", + "nameLocation": "1566:6:8", "parameters": { "id": 23272, "nodeType": "ParameterList", @@ -673,10 +739,10 @@ "indexed": false, "mutability": "mutable", "name": "blockHeight", - "nameLocation": "1613:11:8", + "nameLocation": "1581:11:8", "nodeType": "VariableDeclaration", "scope": 23273, - "src": "1605:19:8", + "src": "1573:19:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -687,7 +753,7 @@ "id": 23266, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1605:7:8", + "src": "1573:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -701,10 +767,10 @@ "indexed": false, "mutability": "mutable", "name": "blockTime", - "nameLocation": "1634:9:8", + "nameLocation": "1602:9:8", "nodeType": "VariableDeclaration", "scope": 23273, - "src": "1626:17:8", + "src": "1594:17:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -715,7 +781,7 @@ "id": 23268, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1626:7:8", + "src": "1594:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -729,10 +795,10 @@ "indexed": false, "mutability": "mutable", "name": "blockHash", - "nameLocation": "1653:9:8", + "nameLocation": "1621:9:8", "nodeType": "VariableDeclaration", "scope": 23273, - "src": "1645:17:8", + "src": "1613:17:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -743,7 +809,7 @@ "id": 23270, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "1645:7:8", + "src": "1613:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -752,23 +818,23 @@ "visibility": "internal" } ], - "src": "1604:59:8" + "src": "1572:59:8" } }, { "id": 23282, "nodeType": "EventDefinition", - "src": "1830:140:8", + "src": "1798:140:8", "anonymous": false, "documentation": { "id": 23274, "nodeType": "StructuredDocumentation", - "src": "1670:155:8", + "src": "1638:155:8", "text": " @notice Emitted only after a difficulty retarget, when the contract\n accepts a new heaviest chain with updated difficulty." }, "eventSelector": "452ea9c9e4985cb8cc7199131fd292d600dae30f407e749b6ca7e7f4c7690cf7", "name": "NewTotalDifficultySinceRetarget", - "nameLocation": "1836:31:8", + "nameLocation": "1804:31:8", "parameters": { "id": 23281, "nodeType": "ParameterList", @@ -779,10 +845,10 @@ "indexed": false, "mutability": "mutable", "name": "blockHeight", - "nameLocation": "1885:11:8", + "nameLocation": "1853:11:8", "nodeType": "VariableDeclaration", "scope": 23282, - "src": "1877:19:8", + "src": "1845:19:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -793,7 +859,7 @@ "id": 23275, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1877:7:8", + "src": "1845:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -807,10 +873,10 @@ "indexed": false, "mutability": "mutable", "name": "totalDifficulty", - "nameLocation": "1914:15:8", + "nameLocation": "1882:15:8", "nodeType": "VariableDeclaration", "scope": 23282, - "src": "1906:23:8", + "src": "1874:23:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -821,7 +887,7 @@ "id": 23277, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "1906:7:8", + "src": "1874:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -835,10 +901,10 @@ "indexed": false, "mutability": "mutable", "name": "newDifficultyBits", - "nameLocation": "1946:17:8", + "nameLocation": "1914:17:8", "nodeType": "VariableDeclaration", "scope": 23282, - "src": "1939:24:8", + "src": "1907:24:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -849,7 +915,7 @@ "id": 23279, "name": "uint32", "nodeType": "ElementaryTypeName", - "src": "1939:6:8", + "src": "1907:6:8", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" @@ -858,23 +924,23 @@ "visibility": "internal" } ], - "src": "1867:102:8" + "src": "1835:102:8" } }, { "id": 23291, "nodeType": "EventDefinition", - "src": "2057:59:8", + "src": "2025:59:8", "anonymous": false, "documentation": { "id": 23283, "nodeType": "StructuredDocumentation", - "src": "1976:76:8", + "src": "1944:76:8", "text": " @notice Emitted when we reorg out a portion of the chain." }, "eventSelector": "ea952b3dfe43a8e680ea58302c72429cd78ef0537abeaf75797ef9bb0496cefc", "name": "Reorg", - "nameLocation": "2063:5:8", + "nameLocation": "2031:5:8", "parameters": { "id": 23290, "nodeType": "ParameterList", @@ -885,10 +951,10 @@ "indexed": false, "mutability": "mutable", "name": "count", - "nameLocation": "2077:5:8", + "nameLocation": "2045:5:8", "nodeType": "VariableDeclaration", "scope": 23291, - "src": "2069:13:8", + "src": "2037:13:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -899,7 +965,7 @@ "id": 23284, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2069:7:8", + "src": "2037:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -913,10 +979,10 @@ "indexed": false, "mutability": "mutable", "name": "oldTip", - "nameLocation": "2092:6:8", + "nameLocation": "2060:6:8", "nodeType": "VariableDeclaration", "scope": 23291, - "src": "2084:14:8", + "src": "2052:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -927,7 +993,7 @@ "id": 23286, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2084:7:8", + "src": "2052:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -941,10 +1007,10 @@ "indexed": false, "mutability": "mutable", "name": "newTip", - "nameLocation": "2108:6:8", + "nameLocation": "2076:6:8", "nodeType": "VariableDeclaration", "scope": 23291, - "src": "2100:14:8", + "src": "2068:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -955,7 +1021,7 @@ "id": 23288, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2100:7:8", + "src": "2068:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -964,18 +1030,18 @@ "visibility": "internal" } ], - "src": "2068:47:8" + "src": "2036:47:8" } }, { "id": 23293, "nodeType": "VariableDeclaration", - "src": "2122:33:8", + "src": "2090:33:8", "constant": false, "mutability": "mutable", "name": "latestBlockHeight", - "nameLocation": "2138:17:8", - "scope": 23986, + "nameLocation": "2106:17:8", + "scope": 24037, "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -986,7 +1052,7 @@ "id": 23292, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2122:7:8", + "src": "2090:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -997,12 +1063,12 @@ { "id": 23295, "nodeType": "VariableDeclaration", - "src": "2162:31:8", + "src": "2130:31:8", "constant": false, "mutability": "mutable", "name": "latestBlockTime", - "nameLocation": "2178:15:8", - "scope": 23986, + "nameLocation": "2146:15:8", + "scope": 24037, "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1013,7 +1079,7 @@ "id": 23294, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2162:7:8", + "src": "2130:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1024,65 +1090,218 @@ { "id": 23299, "nodeType": "VariableDeclaration", - "src": "2200:53:8", - "constant": false, - "mutability": "mutable", - "name": "blockHeightToHash", - "nameLocation": "2236:17:8", - "scope": 23986, + "src": "2489:40:8", + "constant": true, + "documentation": { + "id": 23296, + "nodeType": "StructuredDocumentation", + "src": "2168:316:8", + "text": " @notice Store the last 2n blocks. Reorgs deeper than n are unsupported.\n (For comparison, the deepest Bitcoin reorg so far was 53 blocks in Aug\n 2010, and anything over 5 blocks would be considered catastrophic today.)\n Storing only the last n blocks saves ~17,000 gas per block." + }, + "mutability": "constant", + "name": "MAX_ALLOWED_REORG", + "nameLocation": "2506:17:8", + "scope": 24037, "stateVariable": true, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, "typeName": { + "id": 23297, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2489:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "hexValue": "353030", "id": 23298, - "keyType": { - "id": 23296, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "2208:7:8", + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2526:3:8", + "typeDescriptions": { + "typeIdentifier": "t_rational_500_by_1", + "typeString": "int_const 500" + }, + "value": "500" + }, + "visibility": "internal" + }, + { + "id": 23304, + "nodeType": "VariableDeclaration", + "src": "2535:51:8", + "constant": true, + "mutability": "constant", + "name": "NUM_BLOCKS", + "nameLocation": "2552:10:8", + "scope": 24037, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 23300, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2535:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "value": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23303, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "leftExpression": { + "id": 23301, + "name": "MAX_ALLOWED_REORG", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23299, + "src": "2565:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "nodeType": "Mapping", - "src": "2200:27:8", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" + "nodeType": "BinaryOperation", + "operator": "*", + "rightExpression": { + "hexValue": "32", + "id": 23302, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "2585:1:8", + "typeDescriptions": { + "typeIdentifier": "t_rational_2_by_1", + "typeString": "int_const 2" + }, + "value": "2" }, - "valueType": { - "id": 23297, + "src": "2565:21:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + }, + { + "id": 23308, + "nodeType": "VariableDeclaration", + "src": "2592:38:8", + "constant": false, + "functionSelector": "34cdf78d", + "mutability": "mutable", + "name": "blockHashes", + "nameLocation": "2619:11:8", + "scope": 24037, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$1000_storage", + "typeString": "bytes32[1000]" + }, + "typeName": { + "baseType": { + "id": 23305, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2219:7:8", + "src": "2592:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } + }, + "id": 23307, + "length": { + "id": 23306, + "name": "NUM_BLOCKS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23304, + "src": "2600:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "ArrayTypeName", + "src": "2592:19:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$1000_storage_ptr", + "typeString": "bytes32[1000]" } }, - "visibility": "private" + "visibility": "public" }, { - "id": 23304, + "id": 23310, + "nodeType": "VariableDeclaration", + "src": "2636:28:8", + "constant": false, + "functionSelector": "e870c914", + "mutability": "mutable", + "name": "latestBlockIx", + "nameLocation": "2651:13:8", + "scope": 24037, + "stateVariable": true, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 23309, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "2636:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "public" + }, + { + "id": 23315, "nodeType": "VariableDeclaration", - "src": "2326:49:8", + "src": "2737:49:8", "constant": false, "documentation": { - "id": 23300, + "id": 23311, "nodeType": "StructuredDocumentation", - "src": "2260:61:8", + "src": "2671:61:8", "text": "@notice Difficulty targets in each retargeting period. " }, "functionSelector": "0d2b2860", "mutability": "mutable", "name": "periodToTarget", - "nameLocation": "2361:14:8", - "scope": 23986, + "nameLocation": "2772:14:8", + "scope": 24037, "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1090,28 +1309,28 @@ "typeString": "mapping(uint256 => uint256)" }, "typeName": { - "id": 23303, + "id": 23314, "keyType": { - "id": 23301, + "id": 23312, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2334:7:8", + "src": "2745:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Mapping", - "src": "2326:27:8", + "src": "2737:27:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" }, "valueType": { - "id": 23302, + "id": 23313, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2345:7:8", + "src": "2756:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1121,21 +1340,21 @@ "visibility": "public" }, { - "id": 23307, + "id": 23318, "nodeType": "VariableDeclaration", - "src": "2462:27:8", + "src": "2873:27:8", "constant": false, "documentation": { - "id": 23305, + "id": 23316, "nodeType": "StructuredDocumentation", - "src": "2382:75:8", + "src": "2793:75:8", "text": "@notice The longest reorg that this BtcMirror instance has observed. " }, "functionSelector": "76e92c84", "mutability": "mutable", "name": "longestReorg", - "nameLocation": "2477:12:8", - "scope": 23986, + "nameLocation": "2888:12:8", + "scope": 24037, "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1143,10 +1362,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23306, + "id": 23317, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2462:7:8", + "src": "2873:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1155,21 +1374,21 @@ "visibility": "public" }, { - "id": 23310, + "id": 23321, "nodeType": "VariableDeclaration", - "src": "2566:31:8", + "src": "2977:31:8", "constant": false, "documentation": { - "id": 23308, + "id": 23319, "nodeType": "StructuredDocumentation", - "src": "2496:65:8", + "src": "2907:65:8", "text": "@notice Whether we're tracking testnet or mainnet Bitcoin. " }, "functionSelector": "92108c86", "mutability": "immutable", "name": "isTestnet", - "nameLocation": "2588:9:8", - "scope": 23986, + "nameLocation": "2999:9:8", + "scope": 24037, "stateVariable": true, "storageLocation": "default", "typeDescriptions": { @@ -1177,10 +1396,10 @@ "typeString": "bool" }, "typeName": { - "id": 23309, + "id": 23320, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "2566:4:8", + "src": "2977:4:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1189,53 +1408,57 @@ "visibility": "public" }, { - "id": 23351, + "id": 23362, "nodeType": "FunctionDefinition", - "src": "2883:398:8", + "src": "3294:381:8", "body": { - "id": 23350, + "id": 23361, "nodeType": "Block", - "src": "3045:236:8", + "src": "3456:219:8", "statements": [ { "expression": { - "id": 23328, + "id": 23339, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { - "id": 23324, - "name": "blockHeightToHash", + "id": 23335, + "name": "blockHashes", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23299, - "src": "3055:17:8", + "referencedDeclaration": 23308, + "src": "3466:11:8", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" + "typeIdentifier": "t_array$_t_bytes32_$1000_storage", + "typeString": "bytes32[1000] storage ref" } }, - "id": 23326, + "id": 23337, "indexExpression": { - "id": 23325, - "name": "_blockHeight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23313, - "src": "3073:12:8", + "hexValue": "30", + "id": 23336, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "3478:1:8", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "3055:31:8", + "src": "3466:14:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1244,41 +1467,41 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23327, + "id": 23338, "name": "_blockHash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23315, - "src": "3089:10:8", + "referencedDeclaration": 23326, + "src": "3483:10:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "3055:44:8", + "src": "3466:27:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 23329, + "id": 23340, "nodeType": "ExpressionStatement", - "src": "3055:44:8" + "src": "3466:27:8" }, { "expression": { - "id": 23332, + "id": 23343, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23330, + "id": 23341, "name": "latestBlockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23293, - "src": "3109:17:8", + "src": "3503:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1287,41 +1510,41 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23331, + "id": 23342, "name": "_blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23313, - "src": "3129:12:8", + "referencedDeclaration": 23324, + "src": "3523:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3109:32:8", + "src": "3503:32:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23333, + "id": 23344, "nodeType": "ExpressionStatement", - "src": "3109:32:8" + "src": "3503:32:8" }, { "expression": { - "id": 23336, + "id": 23347, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23334, + "id": 23345, "name": "latestBlockTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23295, - "src": "3151:15:8", + "src": "3545:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1330,65 +1553,65 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23335, + "id": 23346, "name": "_blockTime", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23317, - "src": "3169:10:8", + "referencedDeclaration": 23328, + "src": "3563:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3151:28:8", + "src": "3545:28:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23337, + "id": 23348, "nodeType": "ExpressionStatement", - "src": "3151:28:8" + "src": "3545:28:8" }, { "expression": { - "id": 23344, + "id": 23355, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { - "id": 23338, + "id": 23349, "name": "periodToTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23304, - "src": "3189:14:8", + "referencedDeclaration": 23315, + "src": "3583:14:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" } }, - "id": 23342, + "id": 23353, "indexExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23341, + "id": 23352, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23339, + "id": 23350, "name": "_blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23313, - "src": "3204:12:8", + "referencedDeclaration": 23324, + "src": "3598:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1398,21 +1621,21 @@ "operator": "/", "rightExpression": { "hexValue": "32303136", - "id": 23340, + "id": 23351, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "3219:4:8", + "src": "3613:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "3204:19:8", + "src": "3598:19:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1423,7 +1646,7 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "3189:35:8", + "src": "3583:35:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1432,41 +1655,41 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23343, + "id": 23354, "name": "_expectedTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23319, - "src": "3227:15:8", + "referencedDeclaration": 23330, + "src": "3621:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "3189:53:8", + "src": "3583:53:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23345, + "id": 23356, "nodeType": "ExpressionStatement", - "src": "3189:53:8" + "src": "3583:53:8" }, { "expression": { - "id": 23348, + "id": 23359, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23346, + "id": 23357, "name": "isTestnet", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23310, - "src": "3252:9:8", + "referencedDeclaration": 23321, + "src": "3646:9:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1475,33 +1698,33 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23347, + "id": 23358, "name": "_isTestnet", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23321, - "src": "3264:10:8", + "referencedDeclaration": 23332, + "src": "3658:10:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "src": "3252:22:8", + "src": "3646:22:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 23349, + "id": 23360, "nodeType": "ExpressionStatement", - "src": "3252:22:8" + "src": "3646:22:8" } ] }, "documentation": { - "id": 23311, + "id": 23322, "nodeType": "StructuredDocumentation", - "src": "2604:274:8", + "src": "3015:274:8", "text": "@notice Tracks Bitcoin starting from a given block. The isTestnet\n argument is necessary because the Bitcoin testnet does not\n respect the difficulty rules, so we disable block difficulty\n checks in order to track it." }, "implemented": true, @@ -1510,18 +1733,18 @@ "name": "", "nameLocation": "-1:-1:-1", "parameters": { - "id": 23322, + "id": 23333, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23313, + "id": 23324, "mutability": "mutable", "name": "_blockHeight", - "nameLocation": "2912:12:8", + "nameLocation": "3323:12:8", "nodeType": "VariableDeclaration", - "scope": 23351, - "src": "2904:20:8", + "scope": 23362, + "src": "3315:20:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1529,10 +1752,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23312, + "id": 23323, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2904:7:8", + "src": "3315:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1542,13 +1765,13 @@ }, { "constant": false, - "id": 23315, + "id": 23326, "mutability": "mutable", "name": "_blockHash", - "nameLocation": "2942:10:8", + "nameLocation": "3353:10:8", "nodeType": "VariableDeclaration", - "scope": 23351, - "src": "2934:18:8", + "scope": 23362, + "src": "3345:18:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1556,10 +1779,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23314, + "id": 23325, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "2934:7:8", + "src": "3345:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1569,13 +1792,13 @@ }, { "constant": false, - "id": 23317, + "id": 23328, "mutability": "mutable", "name": "_blockTime", - "nameLocation": "2970:10:8", + "nameLocation": "3381:10:8", "nodeType": "VariableDeclaration", - "scope": 23351, - "src": "2962:18:8", + "scope": 23362, + "src": "3373:18:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1583,10 +1806,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23316, + "id": 23327, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2962:7:8", + "src": "3373:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1596,13 +1819,13 @@ }, { "constant": false, - "id": 23319, + "id": 23330, "mutability": "mutable", "name": "_expectedTarget", - "nameLocation": "2998:15:8", + "nameLocation": "3409:15:8", "nodeType": "VariableDeclaration", - "scope": 23351, - "src": "2990:23:8", + "scope": 23362, + "src": "3401:23:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1610,10 +1833,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23318, + "id": 23329, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "2990:7:8", + "src": "3401:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1623,13 +1846,13 @@ }, { "constant": false, - "id": 23321, + "id": 23332, "mutability": "mutable", "name": "_isTestnet", - "nameLocation": "3028:10:8", + "nameLocation": "3439:10:8", "nodeType": "VariableDeclaration", - "scope": 23351, - "src": "3023:15:8", + "scope": 23362, + "src": "3434:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1637,10 +1860,10 @@ "typeString": "bool" }, "typeName": { - "id": 23320, + "id": 23331, "name": "bool", "nodeType": "ElementaryTypeName", - "src": "3023:4:8", + "src": "3434:4:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -1649,50 +1872,298 @@ "visibility": "internal" } ], - "src": "2894:150:8" + "src": "3305:150:8" }, "returnParameters": { - "id": 23323, + "id": 23334, "nodeType": "ParameterList", "parameters": [], - "src": "3045:0:8" + "src": "3456:0:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { - "id": 23364, + "id": 23393, "nodeType": "FunctionDefinition", - "src": "3371:117:8", + "src": "3912:298:8", "body": { - "id": 23363, + "id": 23392, "nodeType": "Block", - "src": "3439:49:8", + "src": "3982:228:8", "statements": [ { "expression": { - "baseExpression": { - "id": 23359, - "name": "blockHeightToHash", + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23373, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 23371, + "name": "blockNum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23365, + "src": "4000:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<=", + "rightExpression": { + "id": 23372, + "name": "latestBlockHeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23293, + "src": "4012:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4000:29:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "426c6f636b206e6f7420796574207375626d6974746564", + "id": 23374, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4031:25:8", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_1c0f32660d56c345b086a58c26d30741543b3c82099b3177e6e06fd740ef7d8f", + "typeString": "literal_string \"Block not yet submitted\"" + }, + "value": "Block not yet submitted" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_1c0f32660d56c345b086a58c26d30741543b3c82099b3177e6e06fd740ef7d8f", + "typeString": "literal_string \"Block not yet submitted\"" + } + ], + "id": 23370, + "name": "require", "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23299, - "src": "3456:17:8", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "3992:7:8", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } }, - "id": 23361, - "indexExpression": { - "id": 23360, - "name": "number", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23354, - "src": "3474:6:8", + "id": 23375, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "3992:65:8", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 23376, + "nodeType": "ExpressionStatement", + "src": "3992:65:8" + }, + { + "condition": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23381, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 23377, + "name": "blockNum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23365, + "src": "4071:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "<", + "rightExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23380, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 23378, + "name": "latestBlockHeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23293, + "src": "4082:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 23379, + "name": "MAX_ALLOWED_REORG", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23299, + "src": "4102:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4082:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4071:48:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + "id": 23385, + "nodeType": "IfStatement", + "src": "4067:87:8", + "trueBody": { + "id": 23384, + "nodeType": "Block", + "src": "4121:33:8", + "statements": [ + { + "expression": { + "hexValue": "30", + "id": 23382, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "4142:1:8", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "functionReturnParameters": 23369, + "id": 23383, + "nodeType": "Return", + "src": "4135:8:8" + } + ] + } + }, + { + "expression": { + "baseExpression": { + "id": 23386, + "name": "blockHashes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23308, + "src": "4170:11:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$1000_storage", + "typeString": "bytes32[1000] storage ref" + } + }, + "id": 23390, + "indexExpression": { + "arguments": [ + { + "id": 23388, + "name": "blockNum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23365, + "src": "4193:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 23387, + "name": "getBlockIx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23412, + "src": "4182:10:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 23389, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "4182:20:8", + "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1703,47 +2174,47 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "3456:25:8", + "src": "4170:33:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "functionReturnParameters": 23358, - "id": 23362, + "functionReturnParameters": 23369, + "id": 23391, "nodeType": "Return", - "src": "3449:32:8" + "src": "4163:40:8" } ] }, "baseFunctions": [ - 25269 + 25320 ], "documentation": { - "id": 23352, + "id": 23363, "nodeType": "StructuredDocumentation", - "src": "3287:79:8", - "text": " @notice Returns the Bitcoin block hash at a specific height." + "src": "3681:226:8", + "text": " @notice Returns the Bitcoin block hash at a specific height.\n The block number must not be higher than getLatestBlockHeight().\n Returns 0 if the block is too old, and we no longer store its hash." }, "functionSelector": "ee82ac5e", "implemented": true, "kind": "function", "modifiers": [], "name": "getBlockHash", - "nameLocation": "3380:12:8", + "nameLocation": "3921:12:8", "parameters": { - "id": 23355, + "id": 23366, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23354, + "id": 23365, "mutability": "mutable", - "name": "number", - "nameLocation": "3401:6:8", + "name": "blockNum", + "nameLocation": "3942:8:8", "nodeType": "VariableDeclaration", - "scope": 23364, - "src": "3393:14:8", + "scope": 23393, + "src": "3934:16:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1751,10 +2222,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23353, + "id": 23364, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "3393:7:8", + "src": "3934:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1763,21 +2234,21 @@ "visibility": "internal" } ], - "src": "3392:16:8" + "src": "3933:18:8" }, "returnParameters": { - "id": 23358, + "id": 23369, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23357, + "id": 23368, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", - "scope": 23364, - "src": "3430:7:8", + "scope": 23393, + "src": "3973:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1785,10 +2256,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23356, + "id": 23367, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "3430:7:8", + "src": "3973:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -1797,49 +2268,292 @@ "visibility": "internal" } ], - "src": "3429:9:8" + "src": "3972:9:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "view", "virtual": false, "visibility": "public" }, { - "id": 23373, + "id": 23412, "nodeType": "FunctionDefinition", - "src": "3570:103:8", + "src": "4216:189:8", "body": { - "id": 23372, + "id": 23411, "nodeType": "Block", - "src": "3632:41:8", + "src": "4285:120:8", "statements": [ { "expression": { - "id": 23370, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23409, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23406, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23404, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23402, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 23400, + "name": "NUM_BLOCKS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23304, + "src": "4315:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 23401, + "name": "latestBlockIx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23310, + "src": "4328:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4315:26:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 23403, + "name": "blockNum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23395, + "src": "4344:8:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4315:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 23405, + "name": "latestBlockHeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23293, + "src": "4355:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4315:57:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 23407, + "isConstant": false, + "isInlineArray": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "nodeType": "TupleExpression", + "src": "4314:59:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "id": 23408, + "name": "NUM_BLOCKS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23304, + "src": "4388:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "4314:84:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "functionReturnParameters": 23399, + "id": 23410, + "nodeType": "Return", + "src": "4295:103:8" + } + ] + }, + "implemented": true, + "kind": "function", + "modifiers": [], + "name": "getBlockIx", + "nameLocation": "4225:10:8", + "parameters": { + "id": 23396, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 23395, + "mutability": "mutable", + "name": "blockNum", + "nameLocation": "4244:8:8", + "nodeType": "VariableDeclaration", + "scope": 23412, + "src": "4236:16:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 23394, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4236:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4235:18:8" + }, + "returnParameters": { + "id": 23399, + "nodeType": "ParameterList", + "parameters": [ + { + "constant": false, + "id": 23398, + "mutability": "mutable", + "name": "", + "nameLocation": "-1:-1:-1", + "nodeType": "VariableDeclaration", + "scope": 23412, + "src": "4276:7:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "typeName": { + "id": 23397, + "name": "uint256", + "nodeType": "ElementaryTypeName", + "src": "4276:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "visibility": "internal" + } + ], + "src": "4275:9:8" + }, + "scope": 24037, + "stateMutability": "view", + "virtual": false, + "visibility": "private" + }, + { + "id": 23421, + "nodeType": "FunctionDefinition", + "src": "4487:103:8", + "body": { + "id": 23420, + "nodeType": "Block", + "src": "4549:41:8", + "statements": [ + { + "expression": { + "id": 23418, "name": "latestBlockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23293, - "src": "3649:17:8", + "src": "4566:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "functionReturnParameters": 23369, - "id": 23371, + "functionReturnParameters": 23417, + "id": 23419, "nodeType": "Return", - "src": "3642:24:8" + "src": "4559:24:8" } ] }, "baseFunctions": [ - 25275 + 25326 ], "documentation": { - "id": 23365, + "id": 23413, "nodeType": "StructuredDocumentation", - "src": "3494:71:8", + "src": "4411:71:8", "text": " @notice Returns the height of the current chain tip." }, "functionSelector": "e875aa5d", @@ -1847,26 +2561,26 @@ "kind": "function", "modifiers": [], "name": "getLatestBlockHeight", - "nameLocation": "3579:20:8", + "nameLocation": "4496:20:8", "parameters": { - "id": 23366, + "id": 23414, "nodeType": "ParameterList", "parameters": [], - "src": "3599:2:8" + "src": "4516:2:8" }, "returnParameters": { - "id": 23369, + "id": 23417, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23368, + "id": 23416, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", - "scope": 23373, - "src": "3623:7:8", + "scope": 23421, + "src": "4540:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1874,10 +2588,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23367, + "id": 23415, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "3623:7:8", + "src": "4540:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1886,49 +2600,49 @@ "visibility": "internal" } ], - "src": "3622:9:8" + "src": "4539:9:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "view", "virtual": false, "visibility": "public" }, { - "id": 23382, + "id": 23430, "nodeType": "FunctionDefinition", - "src": "3758:99:8", + "src": "4675:99:8", "body": { - "id": 23381, + "id": 23429, "nodeType": "Block", - "src": "3818:39:8", + "src": "4735:39:8", "statements": [ { "expression": { - "id": 23379, + "id": 23427, "name": "latestBlockTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23295, - "src": "3835:15:8", + "src": "4752:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "functionReturnParameters": 23378, - "id": 23380, + "functionReturnParameters": 23426, + "id": 23428, "nodeType": "Return", - "src": "3828:22:8" + "src": "4745:22:8" } ] }, "baseFunctions": [ - 25281 + 25332 ], "documentation": { - "id": 23374, + "id": 23422, "nodeType": "StructuredDocumentation", - "src": "3679:74:8", + "src": "4596:74:8", "text": " @notice Returns the timestamp of the current chain tip." }, "functionSelector": "32c25832", @@ -1936,26 +2650,26 @@ "kind": "function", "modifiers": [], "name": "getLatestBlockTime", - "nameLocation": "3767:18:8", + "nameLocation": "4684:18:8", "parameters": { - "id": 23375, + "id": 23423, "nodeType": "ParameterList", "parameters": [], - "src": "3785:2:8" + "src": "4702:2:8" }, "returnParameters": { - "id": 23378, + "id": 23426, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23377, + "id": 23425, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", - "scope": 23382, - "src": "3809:7:8", + "scope": 23430, + "src": "4726:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -1963,10 +2677,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23376, + "id": 23424, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "3809:7:8", + "src": "4726:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -1975,36 +2689,36 @@ "visibility": "internal" } ], - "src": "3808:9:8" + "src": "4725:9:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "view", "virtual": false, "visibility": "public" }, { - "id": 23680, + "id": 23723, "nodeType": "FunctionDefinition", - "src": "4034:3541:8", + "src": "4951:3340:8", "body": { - "id": 23679, + "id": 23722, "nodeType": "Block", - "src": "4107:3468:8", + "src": "5024:3267:8", "statements": [ { "assignments": [ - 23391 + 23439 ], "declarations": [ { "constant": false, - "id": 23391, + "id": 23439, "mutability": "mutable", "name": "numHeaders", - "nameLocation": "4125:10:8", + "nameLocation": "5042:10:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "4117:18:8", + "scope": 23722, + "src": "5034:18:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2012,10 +2726,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23390, + "id": 23438, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "4117:7:8", + "src": "5034:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2024,38 +2738,38 @@ "visibility": "internal" } ], - "id": 23396, + "id": 23444, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23395, + "id": 23443, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { - "id": 23392, + "id": 23440, "name": "blockHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23387, - "src": "4138:12:8", + "referencedDeclaration": 23435, + "src": "5055:12:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } }, - "id": 23393, + "id": 23441, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", - "src": "4138:19:8", + "src": "5055:19:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2065,28 +2779,28 @@ "operator": "/", "rightExpression": { "hexValue": "3830", - "id": 23394, + "id": 23442, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4160:2:8", + "src": "5077:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_80_by_1", "typeString": "int_const 80" }, "value": "80" }, - "src": "4138:24:8", + "src": "5055:24:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "4117:45:8" + "src": "5034:45:8" }, { "expression": { @@ -2096,7 +2810,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23403, + "id": 23451, "isConstant": false, "isLValue": false, "isPure": false, @@ -2106,18 +2820,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23400, + "id": 23448, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23398, + "id": 23446, "name": "numHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23391, - "src": "4180:10:8", + "referencedDeclaration": 23439, + "src": "5097:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2127,21 +2841,21 @@ "operator": "*", "rightExpression": { "hexValue": "3830", - "id": 23399, + "id": 23447, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4193:2:8", + "src": "5110:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_80_by_1", "typeString": "int_const 80" }, "value": "80" }, - "src": "4180:15:8", + "src": "5097:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2151,31 +2865,31 @@ "operator": "==", "rightExpression": { "expression": { - "id": 23401, + "id": 23449, "name": "blockHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23387, - "src": "4199:12:8", + "referencedDeclaration": 23435, + "src": "5116:12:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } }, - "id": 23402, + "id": 23450, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", - "src": "4199:19:8", + "src": "5116:19:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "4180:38:8", + "src": "5097:38:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2183,19 +2897,129 @@ }, { "hexValue": "77726f6e6720686561646572206c656e677468", - "id": 23404, + "id": 23452, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "4220:21:8", + "src": "5137:21:8", "typeDescriptions": { "typeIdentifier": "t_stringliteral_7c1ce6ee4bcddee703df91dd1e87a53318cd7d42160e806de6da03a2f497e05a", "typeString": "literal_string \"wrong header length\"" }, - "value": "wrong header length" + "value": "wrong header length" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_7c1ce6ee4bcddee703df91dd1e87a53318cd7d42160e806de6da03a2f497e05a", + "typeString": "literal_string \"wrong header length\"" + } + ], + "id": 23445, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "5089:7:8", + "typeDescriptions": { + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" + } + }, + "id": 23453, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "5089:70:8", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } + }, + "id": 23454, + "nodeType": "ExpressionStatement", + "src": "5089:70:8" + }, + { + "expression": { + "arguments": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23458, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 23456, + "name": "numHeaders", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23439, + "src": "5177:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": ">", + "rightExpression": { + "hexValue": "30", + "id": 23457, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5190:1:8", + "typeDescriptions": { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + }, + "value": "0" + }, + "src": "5177:14:8", + "typeDescriptions": { + "typeIdentifier": "t_bool", + "typeString": "bool" + } + }, + { + "hexValue": "6d757374207375626d6974206174206c65617374206f6e6520626c6f636b", + "id": 23459, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "string", + "lValueRequested": false, + "nodeType": "Literal", + "src": "5193:32:8", + "typeDescriptions": { + "typeIdentifier": "t_stringliteral_03dfda0eb9819020f6152b57ec58b5230b57a04b1632adb7acb39789b5b8c329", + "typeString": "literal_string \"must submit at least one block\"" + }, + "value": "must submit at least one block" } ], "expression": { @@ -2205,11 +3029,11 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_7c1ce6ee4bcddee703df91dd1e87a53318cd7d42160e806de6da03a2f497e05a", - "typeString": "literal_string \"wrong header length\"" + "typeIdentifier": "t_stringliteral_03dfda0eb9819020f6152b57ec58b5230b57a04b1632adb7acb39789b5b8c329", + "typeString": "literal_string \"must submit at least one block\"" } ], - "id": 23397, + "id": 23455, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -2217,13 +3041,13 @@ -18 ], "referencedDeclaration": -18, - "src": "4172:7:8", + "src": "5169:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23405, + "id": 23460, "isConstant": false, "isLValue": false, "isPure": false, @@ -2231,16 +3055,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4172:70:8", + "src": "5169:57:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23406, + "id": 23461, "nodeType": "ExpressionStatement", - "src": "4172:70:8" + "src": "5169:57:8" }, { "expression": { @@ -2250,18 +3074,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23410, + "id": 23467, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23408, - "name": "numHeaders", + "id": 23463, + "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23391, - "src": "4260:10:8", + "referencedDeclaration": 23433, + "src": "5244:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2270,42 +3094,68 @@ "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { - "hexValue": "30", - "id": 23409, + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23466, "isConstant": false, "isLValue": false, - "isPure": true, - "kind": "number", + "isPure": false, "lValueRequested": false, - "nodeType": "Literal", - "src": "4273:1:8", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" + "leftExpression": { + "id": 23464, + "name": "latestBlockHeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23293, + "src": "5258:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - "value": "0" + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "id": 23465, + "name": "MAX_ALLOWED_REORG", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23299, + "src": "5278:17:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "5258:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } }, - "src": "4260:14:8", + "src": "5244:51:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { - "hexValue": "6d757374207375626d6974206174206c65617374206f6e6520626c6f636b", - "id": 23411, + "hexValue": "72656f7267", + "id": 23468, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "4276:32:8", + "src": "5297:7:8", "typeDescriptions": { - "typeIdentifier": "t_stringliteral_03dfda0eb9819020f6152b57ec58b5230b57a04b1632adb7acb39789b5b8c329", - "typeString": "literal_string \"must submit at least one block\"" + "typeIdentifier": "t_stringliteral_fc433284f43bac7604db01e357bff1b94026ffc4791e80cd44b7b8d30b073b3f", + "typeString": "literal_string \"reorg\"" }, - "value": "must submit at least one block" + "value": "reorg" } ], "expression": { @@ -2315,11 +3165,11 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_03dfda0eb9819020f6152b57ec58b5230b57a04b1632adb7acb39789b5b8c329", - "typeString": "literal_string \"must submit at least one block\"" + "typeIdentifier": "t_stringliteral_fc433284f43bac7604db01e357bff1b94026ffc4791e80cd44b7b8d30b073b3f", + "typeString": "literal_string \"reorg\"" } ], - "id": 23407, + "id": 23462, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -2327,13 +3177,13 @@ -18 ], "referencedDeclaration": -18, - "src": "4252:7:8", + "src": "5236:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23412, + "id": 23469, "isConstant": false, "isLValue": false, "isPure": false, @@ -2341,31 +3191,31 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4252:57:8", + "src": "5236:69:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23413, + "id": 23470, "nodeType": "ExpressionStatement", - "src": "4252:57:8" + "src": "5236:69:8" }, { "assignments": [ - 23415 + 23472 ], "declarations": [ { "constant": false, - "id": 23415, + "id": 23472, "mutability": "mutable", "name": "oldPeriod", - "nameLocation": "4463:9:8", + "nameLocation": "5404:9:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "4455:17:8", + "scope": 23722, + "src": "5396:17:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2373,10 +3223,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23414, + "id": 23471, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "4455:7:8", + "src": "5396:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2385,24 +3235,24 @@ "visibility": "internal" } ], - "id": 23419, + "id": 23476, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23418, + "id": 23475, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23416, + "id": 23473, "name": "latestBlockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23293, - "src": "4475:17:8", + "src": "5416:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2412,43 +3262,43 @@ "operator": "/", "rightExpression": { "hexValue": "32303136", - "id": 23417, + "id": 23474, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4495:4:8", + "src": "5436:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "4475:24:8", + "src": "5416:24:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "4455:44:8" + "src": "5396:44:8" }, { "assignments": [ - 23421 + 23478 ], "declarations": [ { "constant": false, - "id": 23421, + "id": 23478, "mutability": "mutable", "name": "newHeight", - "nameLocation": "4517:9:8", + "nameLocation": "5458:9:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "4509:17:8", + "scope": 23722, + "src": "5450:17:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2456,10 +3306,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23420, + "id": 23477, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "4509:7:8", + "src": "5450:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2468,13 +3318,13 @@ "visibility": "internal" } ], - "id": 23427, + "id": 23484, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23426, + "id": 23483, "isConstant": false, "isLValue": false, "isPure": false, @@ -2484,18 +3334,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23424, + "id": 23481, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23422, + "id": 23479, "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23385, - "src": "4529:11:8", + "referencedDeclaration": 23433, + "src": "5470:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2504,18 +3354,18 @@ "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { - "id": 23423, + "id": 23480, "name": "numHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23391, - "src": "4543:10:8", + "referencedDeclaration": 23439, + "src": "5484:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "4529:24:8", + "src": "5470:24:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2525,43 +3375,43 @@ "operator": "-", "rightExpression": { "hexValue": "31", - "id": 23425, + "id": 23482, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4556:1:8", + "src": "5497:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "4529:28:8", + "src": "5470:28:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "4509:48:8" + "src": "5450:48:8" }, { "assignments": [ - 23429 + 23486 ], "declarations": [ { "constant": false, - "id": 23429, + "id": 23486, "mutability": "mutable", "name": "newPeriod", - "nameLocation": "4575:9:8", + "nameLocation": "5516:9:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "4567:17:8", + "scope": 23722, + "src": "5508:17:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2569,10 +3419,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23428, + "id": 23485, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "4567:7:8", + "src": "5508:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2581,24 +3431,24 @@ "visibility": "internal" } ], - "id": 23433, + "id": 23490, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23432, + "id": 23489, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23430, + "id": 23487, "name": "newHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "4587:9:8", + "referencedDeclaration": 23478, + "src": "5528:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2608,28 +3458,28 @@ "operator": "/", "rightExpression": { "hexValue": "32303136", - "id": 23431, + "id": 23488, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4599:4:8", + "src": "5540:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "4587:16:8", + "src": "5528:16:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "4567:36:8" + "src": "5508:36:8" }, { "expression": { @@ -2639,18 +3489,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23437, + "id": 23494, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23435, + "id": 23492, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "4621:9:8", + "referencedDeclaration": 23486, + "src": "5562:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2659,18 +3509,18 @@ "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { - "id": 23436, + "id": 23493, "name": "oldPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23415, - "src": "4634:9:8", + "referencedDeclaration": 23472, + "src": "5575:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "4621:22:8", + "src": "5562:22:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -2678,14 +3528,14 @@ }, { "hexValue": "6f6c6420646966666963756c747920706572696f64", - "id": 23438, + "id": 23495, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "4645:23:8", + "src": "5586:23:8", "typeDescriptions": { "typeIdentifier": "t_stringliteral_f9ec9e4124499b43db73b903817989bb84cd016996cdc1fc384fa6b476985f4b", "typeString": "literal_string \"old difficulty period\"" @@ -2704,7 +3554,7 @@ "typeString": "literal_string \"old difficulty period\"" } ], - "id": 23434, + "id": 23491, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -2712,13 +3562,13 @@ -18 ], "referencedDeclaration": -18, - "src": "4613:7:8", + "src": "5554:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23439, + "id": 23496, "isConstant": false, "isLValue": false, "isPure": false, @@ -2726,31 +3576,31 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4613:56:8", + "src": "5554:56:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23440, + "id": 23497, "nodeType": "ExpressionStatement", - "src": "4613:56:8" + "src": "5554:56:8" }, { "assignments": [ - 23442 + 23499 ], "declarations": [ { "constant": false, - "id": 23442, + "id": 23499, "mutability": "mutable", "name": "parentPeriod", - "nameLocation": "4763:12:8", + "nameLocation": "5704:12:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "4755:20:8", + "scope": 23722, + "src": "5696:20:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2758,10 +3608,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23441, + "id": 23498, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "4755:7:8", + "src": "5696:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2770,13 +3620,13 @@ "visibility": "internal" } ], - "id": 23449, + "id": 23506, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23448, + "id": 23505, "isConstant": false, "isLValue": false, "isPure": false, @@ -2788,18 +3638,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23445, + "id": 23502, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23443, + "id": 23500, "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23385, - "src": "4779:11:8", + "referencedDeclaration": 23433, + "src": "5720:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2809,35 +3659,35 @@ "operator": "-", "rightExpression": { "hexValue": "31", - "id": 23444, + "id": 23501, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4793:1:8", + "src": "5734:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "4779:15:8", + "src": "5720:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23446, + "id": 23503, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "4778:17:8", + "src": "5719:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2847,43 +3697,43 @@ "operator": "/", "rightExpression": { "hexValue": "32303136", - "id": 23447, + "id": 23504, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4798:4:8", + "src": "5739:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "4778:24:8", + "src": "5719:24:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "4755:47:8" + "src": "5696:47:8" }, { "assignments": [ - 23451 + 23508 ], "declarations": [ { "constant": false, - "id": 23451, + "id": 23508, "mutability": "mutable", "name": "oldWork", - "nameLocation": "4820:7:8", + "nameLocation": "5761:7:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "4812:15:8", + "scope": 23722, + "src": "5753:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -2891,10 +3741,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23450, + "id": 23507, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "4812:7:8", + "src": "5753:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2903,17 +3753,17 @@ "visibility": "internal" } ], - "id": 23453, + "id": 23510, "initialValue": { "hexValue": "30", - "id": 23452, + "id": 23509, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4830:1:8", + "src": "5771:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" @@ -2921,7 +3771,7 @@ "value": "0" }, "nodeType": "VariableDeclarationStatement", - "src": "4812:19:8" + "src": "5753:19:8" }, { "condition": { @@ -2929,18 +3779,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23456, + "id": 23513, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23454, + "id": 23511, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "4845:9:8", + "referencedDeclaration": 23486, + "src": "5786:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -2949,30 +3799,30 @@ "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { - "id": 23455, + "id": 23512, "name": "parentPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23442, - "src": "4857:12:8", + "referencedDeclaration": 23499, + "src": "5798:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "4845:24:8", + "src": "5786:24:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 23485, + "id": 23542, "nodeType": "IfStatement", - "src": "4841:570:8", + "src": "5782:570:8", "trueBody": { - "id": 23484, + "id": 23541, "nodeType": "Block", - "src": "4871:540:8", + "src": "5812:540:8", "statements": [ { "expression": { @@ -2982,18 +3832,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23462, + "id": 23519, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23458, + "id": 23515, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "4892:9:8", + "referencedDeclaration": 23486, + "src": "5833:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3006,18 +3856,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23461, + "id": 23518, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23459, + "id": 23516, "name": "parentPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23442, - "src": "4905:12:8", + "referencedDeclaration": 23499, + "src": "5846:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3027,27 +3877,27 @@ "operator": "+", "rightExpression": { "hexValue": "31", - "id": 23460, + "id": 23517, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "4920:1:8", + "src": "5861:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "4905:16:8", + "src": "5846:16:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "4892:29:8", + "src": "5833:29:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3061,18 +3911,18 @@ "typeString": "bool" } ], - "id": 23457, + "id": 23514, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -3, - "src": "4885:6:8", + "src": "5826:6:8", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, - "id": 23463, + "id": 23520, "isConstant": false, "isLValue": false, "isPure": false, @@ -3080,16 +3930,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "4885:37:8", + "src": "5826:37:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23464, + "id": 23521, "nodeType": "ExpressionStatement", - "src": "4885:37:8" + "src": "5826:37:8" }, { "condition": { @@ -3097,18 +3947,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23467, + "id": 23524, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23465, + "id": 23522, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "5015:9:8", + "referencedDeclaration": 23486, + "src": "5956:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3117,27 +3967,27 @@ "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { - "id": 23466, + "id": 23523, "name": "oldPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23415, - "src": "5028:9:8", + "referencedDeclaration": 23472, + "src": "5969:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5015:22:8", + "src": "5956:22:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { - "id": 23482, + "id": 23539, "nodeType": "Block", - "src": "5269:132:8", + "src": "6210:132:8", "statements": [ { "expression": { @@ -3147,18 +3997,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23479, + "id": 23536, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23477, + "id": 23534, "name": "oldPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23415, - "src": "5360:9:8", + "referencedDeclaration": 23472, + "src": "6301:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3167,18 +4017,18 @@ "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { - "id": 23478, + "id": 23535, "name": "parentPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23442, - "src": "5373:12:8", + "referencedDeclaration": 23499, + "src": "6314:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5360:25:8", + "src": "6301:25:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -3192,18 +4042,18 @@ "typeString": "bool" } ], - "id": 23476, + "id": 23533, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -3, - "src": "5353:6:8", + "src": "6294:6:8", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, - "id": 23480, + "id": 23537, "isConstant": false, "isLValue": false, "isPure": false, @@ -3211,41 +4061,41 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5353:33:8", + "src": "6294:33:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23481, + "id": 23538, "nodeType": "ExpressionStatement", - "src": "5353:33:8" + "src": "6294:33:8" } ] }, - "id": 23483, + "id": 23540, "nodeType": "IfStatement", - "src": "5011:390:8", + "src": "5952:390:8", "trueBody": { - "id": 23475, + "id": 23532, "nodeType": "Block", - "src": "5039:224:8", + "src": "5980:224:8", "statements": [ { "expression": { - "id": 23473, + "id": 23530, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23468, + "id": 23525, "name": "oldWork", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23451, - "src": "5193:7:8", + "referencedDeclaration": 23508, + "src": "6134:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3256,24 +4106,24 @@ "rightHandSide": { "arguments": [ { - "id": 23470, + "id": 23527, "name": "oldPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23415, - "src": "5219:9:8", + "referencedDeclaration": 23472, + "src": "6160:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 23471, + "id": 23528, "name": "latestBlockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23293, - "src": "5230:17:8", + "src": "6171:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3291,18 +4141,18 @@ "typeString": "uint256" } ], - "id": 23469, + "id": 23526, "name": "getWorkInPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23732, - "src": "5203:15:8", + "referencedDeclaration": 23775, + "src": "6144:15:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) view returns (uint256)" } }, - "id": 23472, + "id": 23529, "isConstant": false, "isLValue": false, "isPure": false, @@ -3310,22 +4160,22 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5203:45:8", + "src": "6144:45:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5193:55:8", + "src": "6134:55:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23474, + "id": 23531, "nodeType": "ExpressionStatement", - "src": "5193:55:8" + "src": "6134:55:8" } ] } @@ -3335,18 +4185,18 @@ }, { "assignments": [ - 23487 + 23544 ], "declarations": [ { "constant": false, - "id": 23487, + "id": 23544, "mutability": "mutable", "name": "oldTip", - "nameLocation": "5468:6:8", + "nameLocation": "6409:6:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "5460:14:8", + "scope": 23722, + "src": "6401:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3354,10 +4204,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23486, + "id": 23543, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "5460:7:8", + "src": "6401:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -3366,16 +4216,16 @@ "visibility": "internal" } ], - "id": 23491, + "id": 23548, "initialValue": { "arguments": [ { - "id": 23489, + "id": 23546, "name": "latestBlockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23293, - "src": "5490:17:8", + "src": "6431:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3389,18 +4239,18 @@ "typeString": "uint256" } ], - "id": 23488, + "id": 23545, "name": "getBlockHash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23364, - "src": "5477:12:8", + "referencedDeclaration": 23393, + "src": "6418:12:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bytes32_$", "typeString": "function (uint256) view returns (bytes32)" } }, - "id": 23490, + "id": 23547, "isConstant": false, "isLValue": false, "isPure": false, @@ -3408,7 +4258,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5477:31:8", + "src": "6418:31:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", @@ -3416,22 +4266,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "5460:48:8" + "src": "6401:48:8" }, { "assignments": [ - 23493 + 23550 ], "declarations": [ { "constant": false, - "id": 23493, + "id": 23550, "mutability": "mutable", "name": "nReorg", - "nameLocation": "5526:6:8", + "nameLocation": "6467:6:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "5518:14:8", + "scope": 23722, + "src": "6459:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3439,10 +4289,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23492, + "id": 23549, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "5518:7:8", + "src": "6459:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3451,17 +4301,17 @@ "visibility": "internal" } ], - "id": 23495, + "id": 23552, "initialValue": { "hexValue": "30", - "id": 23494, + "id": 23551, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "5535:1:8", + "src": "6476:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" @@ -3469,28 +4319,28 @@ "value": "0" }, "nodeType": "VariableDeclarationStatement", - "src": "5518:18:8" + "src": "6459:18:8" }, { "body": { - "id": 23529, + "id": 23586, "nodeType": "Block", - "src": "5587:139:8", + "src": "6528:139:8", "statements": [ { "assignments": [ - 23507 + 23564 ], "declarations": [ { "constant": false, - "id": 23507, + "id": 23564, "mutability": "mutable", "name": "blockNum", - "nameLocation": "5609:8:8", + "nameLocation": "6550:8:8", "nodeType": "VariableDeclaration", - "scope": 23529, - "src": "5601:16:8", + "scope": 23586, + "src": "6542:16:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3498,10 +4348,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23506, + "id": 23563, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "5601:7:8", + "src": "6542:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3510,24 +4360,24 @@ "visibility": "internal" } ], - "id": 23511, + "id": 23568, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23510, + "id": 23567, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23508, + "id": 23565, "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23385, - "src": "5620:11:8", + "referencedDeclaration": 23433, + "src": "6561:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3536,40 +4386,40 @@ "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { - "id": 23509, + "id": 23566, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23497, - "src": "5634:1:8", + "referencedDeclaration": 23554, + "src": "6575:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5620:15:8", + "src": "6561:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "5601:34:8" + "src": "6542:34:8" }, { "expression": { - "id": 23527, + "id": 23584, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23512, + "id": 23569, "name": "nReorg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23493, - "src": "5649:6:8", + "referencedDeclaration": 23550, + "src": "6590:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3580,12 +4430,12 @@ "rightHandSide": { "arguments": [ { - "id": 23514, + "id": 23571, "name": "blockNum", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23507, - "src": "5671:8:8", + "referencedDeclaration": 23564, + "src": "6612:8:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3593,12 +4443,12 @@ }, { "baseExpression": { - "id": 23515, + "id": 23572, "name": "blockHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23387, - "src": "5681:12:8", + "referencedDeclaration": 23435, + "src": "6622:12:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" @@ -3609,21 +4459,21 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23524, + "id": 23581, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3830", - "id": 23519, + "id": 23576, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "5701:2:8", + "src": "6642:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_80_by_1", "typeString": "int_const 80" @@ -3639,18 +4489,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23522, + "id": 23579, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23520, + "id": 23577, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23497, - "src": "5707:1:8", + "referencedDeclaration": 23554, + "src": "6648:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3660,73 +4510,73 @@ "operator": "+", "rightExpression": { "hexValue": "31", - "id": 23521, + "id": 23578, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "5711:1:8", + "src": "6652:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "5707:5:8", + "src": "6648:5:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23523, + "id": 23580, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "5706:7:8", + "src": "6647:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5701:12:8", + "src": "6642:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23525, + "id": 23582, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexRangeAccess", - "src": "5681:33:8", + "src": "6622:33:8", "startExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23518, + "id": 23575, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3830", - "id": 23516, + "id": 23573, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "5694:2:8", + "src": "6635:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_80_by_1", "typeString": "int_const 80" @@ -3736,18 +4586,18 @@ "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { - "id": 23517, + "id": 23574, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23497, - "src": "5699:1:8", + "referencedDeclaration": 23554, + "src": "6640:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5694:6:8", + "src": "6635:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3770,18 +4620,18 @@ "typeString": "bytes calldata slice" } ], - "id": 23513, + "id": 23570, "name": "submitBlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23917, - "src": "5659:11:8", + "referencedDeclaration": 23968, + "src": "6600:11:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$_t_bytes_calldata_ptr_$returns$_t_uint256_$", "typeString": "function (uint256,bytes calldata) returns (uint256)" } }, - "id": 23526, + "id": 23583, "isConstant": false, "isLValue": false, "isPure": false, @@ -3789,22 +4639,22 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "5659:56:8", + "src": "6600:56:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5649:66:8", + "src": "6590:66:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23528, + "id": 23585, "nodeType": "ExpressionStatement", - "src": "5649:66:8" + "src": "6590:66:8" } ] }, @@ -3813,18 +4663,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23502, + "id": 23559, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23500, + "id": 23557, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23497, - "src": "5566:1:8", + "referencedDeclaration": 23554, + "src": "6507:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3833,38 +4683,38 @@ "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { - "id": 23501, + "id": 23558, "name": "numHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23391, - "src": "5570:10:8", + "referencedDeclaration": 23439, + "src": "6511:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5566:14:8", + "src": "6507:14:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 23530, + "id": 23587, "initializationExpression": { "assignments": [ - 23497 + 23554 ], "declarations": [ { "constant": false, - "id": 23497, + "id": 23554, "mutability": "mutable", "name": "i", - "nameLocation": "5559:1:8", + "nameLocation": "6500:1:8", "nodeType": "VariableDeclaration", - "scope": 23530, - "src": "5551:9:8", + "scope": 23587, + "src": "6492:9:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -3872,10 +4722,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23496, + "id": 23553, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "5551:7:8", + "src": "6492:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3884,17 +4734,17 @@ "visibility": "internal" } ], - "id": 23499, + "id": 23556, "initialValue": { "hexValue": "30", - "id": 23498, + "id": 23555, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "5563:1:8", + "src": "6504:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" @@ -3902,11 +4752,11 @@ "value": "0" }, "nodeType": "VariableDeclarationStatement", - "src": "5551:13:8" + "src": "6492:13:8" }, "loopExpression": { "expression": { - "id": 23504, + "id": 23561, "isConstant": false, "isLValue": false, "isPure": false, @@ -3914,14 +4764,14 @@ "nodeType": "UnaryOperation", "operator": "++", "prefix": false, - "src": "5582:3:8", + "src": "6523:3:8", "subExpression": { - "id": 23503, + "id": 23560, "name": "i", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23497, - "src": "5582:1:8", + "referencedDeclaration": 23554, + "src": "6523:1:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3932,12 +4782,12 @@ "typeString": "uint256" } }, - "id": 23505, + "id": 23562, "nodeType": "ExpressionStatement", - "src": "5582:3:8" + "src": "6523:3:8" }, "nodeType": "ForStatement", - "src": "5546:180:8" + "src": "6487:180:8" }, { "condition": { @@ -3945,18 +4795,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23533, + "id": 23590, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23531, + "id": 23588, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "5791:9:8", + "referencedDeclaration": 23486, + "src": "6732:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -3965,27 +4815,27 @@ "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { - "id": 23532, + "id": 23589, "name": "parentPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23442, - "src": "5803:12:8", + "referencedDeclaration": 23499, + "src": "6744:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "5791:24:8", + "src": "6732:24:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { - "id": 23621, + "id": 23658, "nodeType": "Block", - "src": "6751:336:8", + "src": "7420:336:8", "statements": [ { "expression": { @@ -3995,18 +4845,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23605, + "id": 23642, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23603, + "id": 23640, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "6925:9:8", + "referencedDeclaration": 23486, + "src": "7594:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4015,18 +4865,18 @@ "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { - "id": 23604, + "id": 23641, "name": "oldPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23415, - "src": "6938:9:8", + "referencedDeclaration": 23472, + "src": "7607:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "6925:22:8", + "src": "7594:22:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4040,18 +4890,18 @@ "typeString": "bool" } ], - "id": 23602, + "id": 23639, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -3, - "src": "6918:6:8", + "src": "7587:6:8", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, - "id": 23606, + "id": 23643, "isConstant": false, "isLValue": false, "isPure": false, @@ -4059,16 +4909,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6918:30:8", + "src": "7587:30:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23607, + "id": 23644, "nodeType": "ExpressionStatement", - "src": "6918:30:8" + "src": "7587:30:8" }, { "expression": { @@ -4078,18 +4928,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23611, + "id": 23648, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23609, + "id": 23646, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "6969:9:8", + "referencedDeclaration": 23486, + "src": "7638:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4098,18 +4948,18 @@ "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { - "id": 23610, + "id": 23647, "name": "parentPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23442, - "src": "6982:12:8", + "referencedDeclaration": 23499, + "src": "7651:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "6969:25:8", + "src": "7638:25:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4123,18 +4973,18 @@ "typeString": "bool" } ], - "id": 23608, + "id": 23645, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -3, - "src": "6962:6:8", + "src": "7631:6:8", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, - "id": 23612, + "id": 23649, "isConstant": false, "isLValue": false, "isPure": false, @@ -4142,16 +4992,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6962:33:8", + "src": "7631:33:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23613, + "id": 23650, "nodeType": "ExpressionStatement", - "src": "6962:33:8" + "src": "7631:33:8" }, { "expression": { @@ -4161,18 +5011,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23617, + "id": 23654, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23615, + "id": 23652, "name": "newHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "7017:9:8", + "referencedDeclaration": 23478, + "src": "7686:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4181,18 +5031,18 @@ "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { - "id": 23616, + "id": 23653, "name": "latestBlockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23293, - "src": "7029:17:8", + "src": "7698:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "7017:29:8", + "src": "7686:29:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -4200,14 +5050,14 @@ }, { "hexValue": "696e73756666696369656e7420636861696e206c656e677468", - "id": 23618, + "id": 23655, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "7048:27:8", + "src": "7717:27:8", "typeDescriptions": { "typeIdentifier": "t_stringliteral_ade0f7d5039e0f77a06d7776870a46b2e82a4199a77c11ccfa93118f78f35f56", "typeString": "literal_string \"insufficient chain length\"" @@ -4226,7 +5076,7 @@ "typeString": "literal_string \"insufficient chain length\"" } ], - "id": 23614, + "id": 23651, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -4234,13 +5084,13 @@ -18 ], "referencedDeclaration": -18, - "src": "7009:7:8", + "src": "7678:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23619, + "id": 23656, "isConstant": false, "isLValue": false, "isPure": false, @@ -4248,41 +5098,41 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7009:67:8", + "src": "7678:67:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23620, + "id": 23657, "nodeType": "ExpressionStatement", - "src": "7009:67:8" + "src": "7678:67:8" } ] }, - "id": 23622, + "id": 23659, "nodeType": "IfStatement", - "src": "5787:1300:8", + "src": "6728:1028:8", "trueBody": { - "id": 23601, + "id": 23638, "nodeType": "Block", - "src": "5817:928:8", + "src": "6758:656:8", "statements": [ { "assignments": [ - 23535 + 23592 ], "declarations": [ { "constant": false, - "id": 23535, + "id": 23592, "mutability": "mutable", "name": "lastHeader", - "nameLocation": "5996:10:8", + "nameLocation": "6937:10:8", "nodeType": "VariableDeclaration", - "scope": 23601, - "src": "5981:25:8", + "scope": 23638, + "src": "6922:25:8", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { @@ -4290,10 +5140,10 @@ "typeString": "bytes" }, "typeName": { - "id": 23534, + "id": 23591, "name": "bytes", "nodeType": "ElementaryTypeName", - "src": "5981:5:8", + "src": "6922:5:8", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" @@ -4302,47 +5152,47 @@ "visibility": "internal" } ], - "id": 23544, + "id": 23601, "initialValue": { "baseExpression": { - "id": 23536, + "id": 23593, "name": "blockHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23387, - "src": "6009:12:8", + "referencedDeclaration": 23435, + "src": "6950:12:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } }, - "id": 23543, + "id": 23600, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexRangeAccess", - "src": "6009:36:8", + "src": "6950:36:8", "startExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23542, + "id": 23599, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "3830", - "id": 23537, + "id": 23594, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "6022:2:8", + "src": "6963:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_80_by_1", "typeString": "int_const 80" @@ -4358,18 +5208,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23540, + "id": 23597, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23538, + "id": 23595, "name": "numHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23391, - "src": "6028:10:8", + "referencedDeclaration": 23439, + "src": "6969:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4379,41 +5229,41 @@ "operator": "-", "rightExpression": { "hexValue": "31", - "id": 23539, + "id": 23596, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "6041:1:8", + "src": "6982:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "6028:14:8", + "src": "6969:14:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23541, + "id": 23598, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "6027:16:8", + "src": "6968:16:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "6022:21:8", + "src": "6963:21:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4425,22 +5275,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "5981:64:8" + "src": "6922:64:8" }, { "assignments": [ - 23546 + 23603 ], "declarations": [ { "constant": false, - "id": 23546, + "id": 23603, "mutability": "mutable", "name": "newDifficultyBits", - "nameLocation": "6066:17:8", + "nameLocation": "7007:17:8", "nodeType": "VariableDeclaration", - "scope": 23601, - "src": "6059:24:8", + "scope": 23638, + "src": "7000:24:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4448,10 +5298,10 @@ "typeString": "uint32" }, "typeName": { - "id": 23545, + "id": 23602, "name": "uint32", "nodeType": "ElementaryTypeName", - "src": "6059:6:8", + "src": "7000:6:8", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" @@ -4460,7 +5310,7 @@ "visibility": "internal" } ], - "id": 23560, + "id": 23617, "initialValue": { "arguments": [ { @@ -4469,12 +5319,12 @@ "arguments": [ { "baseExpression": { - "id": 23553, + "id": 23610, "name": "lastHeader", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23535, - "src": "6134:10:8", + "referencedDeclaration": 23592, + "src": "7075:10:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" @@ -4482,37 +5332,37 @@ }, "endExpression": { "hexValue": "3736", - "id": 23555, + "id": 23612, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "6148:2:8", + "src": "7089:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_76_by_1", "typeString": "int_const 76" }, "value": "76" }, - "id": 23556, + "id": 23613, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexRangeAccess", - "src": "6134:17:8", + "src": "7075:17:8", "startExpression": { "hexValue": "3732", - "id": 23554, + "id": 23611, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "6145:2:8", + "src": "7086:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_72_by_1", "typeString": "int_const 72" @@ -4532,26 +5382,26 @@ "typeString": "bytes calldata slice" } ], - "id": 23552, + "id": 23609, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "6127:6:8", + "src": "7068:6:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes4_$", "typeString": "type(bytes4)" }, "typeName": { - "id": 23551, + "id": 23608, "name": "bytes4", "nodeType": "ElementaryTypeName", - "src": "6127:6:8", + "src": "7068:6:8", "typeDescriptions": {} } }, - "id": 23557, + "id": 23614, "isConstant": false, "isLValue": false, "isPure": false, @@ -4559,7 +5409,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6127:25:8", + "src": "7068:25:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes4", @@ -4574,26 +5424,26 @@ "typeString": "bytes4" } ], - "id": 23550, + "id": 23607, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "6120:6:8", + "src": "7061:6:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint32_$", "typeString": "type(uint32)" }, "typeName": { - "id": 23549, + "id": 23606, "name": "uint32", "nodeType": "ElementaryTypeName", - "src": "6120:6:8", + "src": "7061:6:8", "typeDescriptions": {} } }, - "id": 23558, + "id": 23615, "isConstant": false, "isLValue": false, "isPure": false, @@ -4601,7 +5451,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6120:33:8", + "src": "7061:33:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint32", @@ -4617,32 +5467,32 @@ } ], "expression": { - "id": 23547, + "id": 23604, "name": "Endian", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 25240, - "src": "6086:6:8", + "referencedDeclaration": 25291, + "src": "7027:6:8", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Endian_$25240_$", + "typeIdentifier": "t_type$_t_contract$_Endian_$25291_$", "typeString": "type(library Endian)" } }, - "id": 23548, + "id": 23605, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "reverse32", "nodeType": "MemberAccess", - "referencedDeclaration": 25215, - "src": "6086:16:8", + "referencedDeclaration": 25266, + "src": "7027:16:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint32_$returns$_t_uint32_$", "typeString": "function (uint32) pure returns (uint32)" } }, - "id": 23559, + "id": 23616, "isConstant": false, "isLValue": false, "isPure": false, @@ -4650,7 +5500,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6086:81:8", + "src": "7027:81:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint32", @@ -4658,22 +5508,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "6059:108:8" + "src": "7000:108:8" }, { "assignments": [ - 23562 + 23619 ], "declarations": [ { "constant": false, - "id": 23562, + "id": 23619, "mutability": "mutable", "name": "newWork", - "nameLocation": "6190:7:8", + "nameLocation": "7131:7:8", "nodeType": "VariableDeclaration", - "scope": 23601, - "src": "6182:15:8", + "scope": 23638, + "src": "7123:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -4681,10 +5531,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23561, + "id": 23618, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "6182:7:8", + "src": "7123:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4693,28 +5543,28 @@ "visibility": "internal" } ], - "id": 23567, + "id": 23624, "initialValue": { "arguments": [ { - "id": 23564, + "id": 23621, "name": "newPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23429, - "src": "6216:9:8", + "referencedDeclaration": 23486, + "src": "7157:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 23565, + "id": 23622, "name": "newHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "6227:9:8", + "referencedDeclaration": 23478, + "src": "7168:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4732,18 +5582,18 @@ "typeString": "uint256" } ], - "id": 23563, + "id": 23620, "name": "getWorkInPeriod", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23732, - "src": "6200:15:8", + "referencedDeclaration": 23775, + "src": "7141:15:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_uint256_$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256,uint256) view returns (uint256)" } }, - "id": 23566, + "id": 23623, "isConstant": false, "isLValue": false, "isPure": false, @@ -4751,7 +5601,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6200:37:8", + "src": "7141:37:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -4759,7 +5609,7 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "6182:55:8" + "src": "7123:55:8" }, { "expression": { @@ -4769,18 +5619,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23571, + "id": 23628, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23569, + "id": 23626, "name": "newWork", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23562, - "src": "6259:7:8", + "referencedDeclaration": 23619, + "src": "7200:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -4789,359 +5639,118 @@ "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { - "id": 23570, + "id": 23627, "name": "oldWork", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23451, - "src": "6269:7:8", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6259:17:8", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "hexValue": "696e73756666696369656e7420746f74616c20646966666963756c7479", - "id": 23572, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6278:31:8", - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ea303308cbc0cfdfbceb9388dfb89405f9c58b5bcb80b9d5fae7045565d19e67", - "typeString": "literal_string \"insufficient total difficulty\"" - }, - "value": "insufficient total difficulty" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ea303308cbc0cfdfbceb9388dfb89405f9c58b5bcb80b9d5fae7045565d19e67", - "typeString": "literal_string \"insufficient total difficulty\"" - } - ], - "id": 23568, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "6251:7:8", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 23573, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6251:59:8", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 23574, - "nodeType": "ExpressionStatement", - "src": "6251:59:8" - }, - { - "body": { - "id": 23593, - "nodeType": "Block", - "src": "6526:57:8", - "statements": [ - { - "expression": { - "id": 23591, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "baseExpression": { - "id": 23587, - "name": "blockHeightToHash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23299, - "src": "6544:17:8", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" - } - }, - "id": 23589, - "indexExpression": { - "id": 23588, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23576, - "src": "6562:1:8", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "6544:20:8", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "hexValue": "30", - "id": 23590, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6567:1:8", - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "6544:24:8", - "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" - } - }, - "id": 23592, - "nodeType": "ExpressionStatement", - "src": "6544:24:8" - } - ] - }, - "condition": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 23583, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 23581, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23576, - "src": "6497:1:8", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "id": 23582, - "name": "latestBlockHeight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23293, - "src": "6502:17:8", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6497:22:8", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 23594, - "initializationExpression": { - "assignments": [ - 23576 - ], - "declarations": [ - { - "constant": false, - "id": 23576, - "mutability": "mutable", - "name": "i", - "nameLocation": "6478:1:8", - "nodeType": "VariableDeclaration", - "scope": 23594, - "src": "6470:9:8", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 23575, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "6470:7:8", + "referencedDeclaration": 23508, + "src": "7210:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "visibility": "internal" - } - ], - "id": 23580, - "initialValue": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 23579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 23577, - "name": "newHeight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "6482:9:8", + "typeString": "uint256" + } + }, + "src": "7200:17:8", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_bool", + "typeString": "bool" } }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "hexValue": "31", - "id": 23578, + { + "hexValue": "696e73756666696369656e7420746f74616c20646966666963756c7479", + "id": 23629, "isConstant": false, "isLValue": false, "isPure": true, - "kind": "number", + "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "6494:1:8", + "src": "7219:31:8", "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" + "typeIdentifier": "t_stringliteral_ea303308cbc0cfdfbceb9388dfb89405f9c58b5bcb80b9d5fae7045565d19e67", + "typeString": "literal_string \"insufficient total difficulty\"" }, - "value": "1" - }, - "src": "6482:13:8", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "value": "insufficient total difficulty" } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6470:25:8" - }, - "loopExpression": { + ], "expression": { - "id": 23585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "6521:3:8", - "subExpression": { - "id": 23584, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23576, - "src": "6521:1:8", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "argumentTypes": [ + { + "typeIdentifier": "t_bool", + "typeString": "bool" + }, + { + "typeIdentifier": "t_stringliteral_ea303308cbc0cfdfbceb9388dfb89405f9c58b5bcb80b9d5fae7045565d19e67", + "typeString": "literal_string \"insufficient total difficulty\"" } - }, + ], + "id": 23625, + "name": "require", + "nodeType": "Identifier", + "overloadedDeclarations": [ + -18, + -18 + ], + "referencedDeclaration": -18, + "src": "7192:7:8", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", + "typeString": "function (bool,string memory) pure" } }, - "id": 23586, - "nodeType": "ExpressionStatement", - "src": "6521:3:8" + "id": 23630, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7192:59:8", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_tuple$__$", + "typeString": "tuple()" + } }, - "nodeType": "ForStatement", - "src": "6465:118:8" + "id": 23631, + "nodeType": "ExpressionStatement", + "src": "7192:59:8" }, { "eventCall": { "arguments": [ { - "id": 23596, + "id": 23633, "name": "newHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "6651:9:8", + "referencedDeclaration": 23478, + "src": "7320:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 23597, + "id": 23634, "name": "newWork", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23562, - "src": "6678:7:8", + "referencedDeclaration": 23619, + "src": "7347:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 23598, + "id": 23635, "name": "newDifficultyBits", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23546, - "src": "6703:17:8", + "referencedDeclaration": 23603, + "src": "7372:17:8", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" @@ -5163,18 +5772,18 @@ "typeString": "uint32" } ], - "id": 23595, + "id": 23632, "name": "NewTotalDifficultySinceRetarget", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23282, - "src": "6602:31:8", + "src": "7271:31:8", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_uint32_$returns$__$", "typeString": "function (uint256,uint256,uint32)" } }, - "id": 23599, + "id": 23636, "isConstant": false, "isLValue": false, "isPure": false, @@ -5182,34 +5791,113 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "6602:132:8", + "src": "7271:132:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23600, + "id": 23637, "nodeType": "EmitStatement", - "src": "6597:137:8" + "src": "7266:137:8" } ] } }, { "expression": { - "id": 23625, + "id": 23664, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftHandSide": { + "id": 23660, + "name": "latestBlockIx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23310, + "src": "7817:13:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "Assignment", + "operator": "=", + "rightHandSide": { + "arguments": [ + { + "id": 23662, + "name": "newHeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23478, + "src": "7844:9:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 23661, + "name": "getBlockIx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23412, + "src": "7833:10:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" + } + }, + "id": 23663, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "7833:21:8", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "7817:37:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "id": 23665, + "nodeType": "ExpressionStatement", + "src": "7817:37:8" + }, + { + "expression": { + "id": 23668, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23623, + "id": 23666, "name": "latestBlockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23293, - "src": "7148:17:8", + "src": "7864:17:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5218,41 +5906,41 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23624, + "id": 23667, "name": "newHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "7168:9:8", + "referencedDeclaration": 23478, + "src": "7884:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "7148:29:8", + "src": "7864:29:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23626, + "id": 23669, "nodeType": "ExpressionStatement", - "src": "7148:29:8" + "src": "7864:29:8" }, { "assignments": [ - 23628 + 23671 ], "declarations": [ { "constant": false, - "id": 23628, + "id": 23671, "mutability": "mutable", "name": "ixT", - "nameLocation": "7195:3:8", + "nameLocation": "7911:3:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "7187:11:8", + "scope": 23722, + "src": "7903:11:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5260,10 +5948,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23627, + "id": 23670, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7187:7:8", + "src": "7903:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5272,38 +5960,38 @@ "visibility": "internal" } ], - "id": 23633, + "id": 23676, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23632, + "id": 23675, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { - "id": 23629, + "id": 23672, "name": "blockHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23387, - "src": "7201:12:8", + "referencedDeclaration": 23435, + "src": "7917:12:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } }, - "id": 23630, + "id": 23673, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", - "src": "7201:19:8", + "src": "7917:19:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5313,43 +6001,43 @@ "operator": "-", "rightExpression": { "hexValue": "3132", - "id": 23631, + "id": 23674, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7223:2:8", + "src": "7939:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_12_by_1", "typeString": "int_const 12" }, "value": "12" }, - "src": "7201:24:8", + "src": "7917:24:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "7187:38:8" + "src": "7903:38:8" }, { "assignments": [ - 23635 + 23678 ], "declarations": [ { "constant": false, - "id": 23635, + "id": 23678, "mutability": "mutable", "name": "time", - "nameLocation": "7242:4:8", + "nameLocation": "7958:4:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "7235:11:8", + "scope": 23722, + "src": "7951:11:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5357,10 +6045,10 @@ "typeString": "uint32" }, "typeName": { - "id": 23634, + "id": 23677, "name": "uint32", "nodeType": "ElementaryTypeName", - "src": "7235:6:8", + "src": "7951:6:8", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" @@ -5369,19 +6057,19 @@ "visibility": "internal" } ], - "id": 23648, + "id": 23691, "initialValue": { "arguments": [ { "arguments": [ { "baseExpression": { - "id": 23640, + "id": 23683, "name": "blockHeaders", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23387, - "src": "7263:12:8", + "referencedDeclaration": 23435, + "src": "7979:12:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" @@ -5392,18 +6080,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23644, + "id": 23687, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23642, + "id": 23685, "name": "ixT", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23628, - "src": "7280:3:8", + "referencedDeclaration": 23671, + "src": "7996:3:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5413,40 +6101,40 @@ "operator": "+", "rightExpression": { "hexValue": "34", - "id": 23643, + "id": 23686, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7286:1:8", + "src": "8002:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" }, "value": "4" }, - "src": "7280:7:8", + "src": "7996:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23645, + "id": 23688, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexRangeAccess", - "src": "7263:25:8", + "src": "7979:25:8", "startExpression": { - "id": 23641, + "id": 23684, "name": "ixT", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23628, - "src": "7276:3:8", + "referencedDeclaration": 23671, + "src": "7992:3:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5465,26 +6153,26 @@ "typeString": "bytes calldata slice" } ], - "id": 23639, + "id": 23682, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "7256:6:8", + "src": "7972:6:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes4_$", "typeString": "type(bytes4)" }, "typeName": { - "id": 23638, + "id": 23681, "name": "bytes4", "nodeType": "ElementaryTypeName", - "src": "7256:6:8", + "src": "7972:6:8", "typeDescriptions": {} } }, - "id": 23646, + "id": 23689, "isConstant": false, "isLValue": false, "isPure": false, @@ -5492,7 +6180,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7256:33:8", + "src": "7972:33:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes4", @@ -5507,26 +6195,26 @@ "typeString": "bytes4" } ], - "id": 23637, + "id": 23680, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "7249:6:8", + "src": "7965:6:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint32_$", "typeString": "type(uint32)" }, "typeName": { - "id": 23636, + "id": 23679, "name": "uint32", "nodeType": "ElementaryTypeName", - "src": "7249:6:8", + "src": "7965:6:8", "typeDescriptions": {} } }, - "id": 23647, + "id": 23690, "isConstant": false, "isLValue": false, "isPure": false, @@ -5534,7 +6222,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7249:41:8", + "src": "7965:41:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint32", @@ -5542,22 +6230,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "7235:55:8" + "src": "7951:55:8" }, { "expression": { - "id": 23654, + "id": 23697, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23649, + "id": 23692, "name": "latestBlockTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23295, - "src": "7300:15:8", + "src": "8016:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5568,12 +6256,12 @@ "rightHandSide": { "arguments": [ { - "id": 23652, + "id": 23695, "name": "time", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23635, - "src": "7335:4:8", + "referencedDeclaration": 23678, + "src": "8051:4:8", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" @@ -5588,32 +6276,32 @@ } ], "expression": { - "id": 23650, + "id": 23693, "name": "Endian", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 25240, - "src": "7318:6:8", + "referencedDeclaration": 25291, + "src": "8034:6:8", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Endian_$25240_$", + "typeIdentifier": "t_type$_t_contract$_Endian_$25291_$", "typeString": "type(library Endian)" } }, - "id": 23651, + "id": 23694, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "reverse32", "nodeType": "MemberAccess", - "referencedDeclaration": 25215, - "src": "7318:16:8", + "referencedDeclaration": 25266, + "src": "8034:16:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint32_$returns$_t_uint32_$", "typeString": "function (uint32) pure returns (uint32)" } }, - "id": 23653, + "id": 23696, "isConstant": false, "isLValue": false, "isPure": false, @@ -5621,37 +6309,37 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7318:22:8", + "src": "8034:22:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, - "src": "7300:40:8", + "src": "8016:40:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23655, + "id": 23698, "nodeType": "ExpressionStatement", - "src": "7300:40:8" + "src": "8016:40:8" }, { "assignments": [ - 23657 + 23700 ], "declarations": [ { "constant": false, - "id": 23657, + "id": 23700, "mutability": "mutable", "name": "newTip", - "nameLocation": "7395:6:8", + "nameLocation": "8111:6:8", "nodeType": "VariableDeclaration", - "scope": 23679, - "src": "7387:14:8", + "scope": 23722, + "src": "8103:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5659,10 +6347,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23656, + "id": 23699, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "7387:7:8", + "src": "8103:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5671,16 +6359,16 @@ "visibility": "internal" } ], - "id": 23661, + "id": 23704, "initialValue": { "arguments": [ { - "id": 23659, + "id": 23702, "name": "newHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "7417:9:8", + "referencedDeclaration": 23478, + "src": "8133:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5694,18 +6382,18 @@ "typeString": "uint256" } ], - "id": 23658, + "id": 23701, "name": "getBlockHash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23364, - "src": "7404:12:8", + "referencedDeclaration": 23393, + "src": "8120:12:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bytes32_$", "typeString": "function (uint256) view returns (bytes32)" } }, - "id": 23660, + "id": 23703, "isConstant": false, "isLValue": false, "isPure": false, @@ -5713,7 +6401,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7404:23:8", + "src": "8120:23:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", @@ -5721,42 +6409,42 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "7387:40:8" + "src": "8103:40:8" }, { "eventCall": { "arguments": [ { - "id": 23663, + "id": 23706, "name": "newHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23421, - "src": "7449:9:8", + "referencedDeclaration": 23478, + "src": "8165:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 23664, + "id": 23707, "name": "latestBlockTime", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23295, - "src": "7460:15:8", + "src": "8176:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 23665, + "id": 23708, "name": "newTip", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23657, - "src": "7477:6:8", + "referencedDeclaration": 23700, + "src": "8193:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5778,18 +6466,18 @@ "typeString": "bytes32" } ], - "id": 23662, + "id": 23705, "name": "NewTip", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23273, - "src": "7442:6:8", + "src": "8158:6:8", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_uint256_$_t_bytes32_$returns$__$", "typeString": "function (uint256,uint256,bytes32)" } }, - "id": 23666, + "id": 23709, "isConstant": false, "isLValue": false, "isPure": false, @@ -5797,16 +6485,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7442:42:8", + "src": "8158:42:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23667, + "id": 23710, "nodeType": "EmitStatement", - "src": "7437:47:8" + "src": "8153:47:8" }, { "condition": { @@ -5814,18 +6502,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23670, + "id": 23713, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23668, + "id": 23711, "name": "nReorg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23493, - "src": "7498:6:8", + "referencedDeclaration": 23550, + "src": "8214:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -5835,68 +6523,68 @@ "operator": ">", "rightExpression": { "hexValue": "30", - "id": 23669, + "id": 23712, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7507:1:8", + "src": "8223:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, - "src": "7498:10:8", + "src": "8214:10:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 23678, + "id": 23721, "nodeType": "IfStatement", - "src": "7494:75:8", + "src": "8210:75:8", "trueBody": { - "id": 23677, + "id": 23720, "nodeType": "Block", - "src": "7510:59:8", + "src": "8226:59:8", "statements": [ { "eventCall": { "arguments": [ { - "id": 23672, + "id": 23715, "name": "nReorg", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23493, - "src": "7535:6:8", + "referencedDeclaration": 23550, + "src": "8251:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { - "id": 23673, + "id": 23716, "name": "oldTip", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23487, - "src": "7543:6:8", + "referencedDeclaration": 23544, + "src": "8259:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, { - "id": 23674, + "id": 23717, "name": "newTip", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23657, - "src": "7551:6:8", + "referencedDeclaration": 23700, + "src": "8267:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -5918,18 +6606,18 @@ "typeString": "bytes32" } ], - "id": 23671, + "id": 23714, "name": "Reorg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 23291, - "src": "7529:5:8", + "src": "8245:5:8", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_uint256_$_t_bytes32_$_t_bytes32_$returns$__$", "typeString": "function (uint256,bytes32,bytes32)" } }, - "id": 23675, + "id": 23718, "isConstant": false, "isLValue": false, "isPure": false, @@ -5937,16 +6625,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7529:29:8", + "src": "8245:29:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23676, + "id": 23719, "nodeType": "EmitStatement", - "src": "7524:34:8" + "src": "8240:34:8" } ] } @@ -5954,12 +6642,12 @@ ] }, "baseFunctions": [ - 25289 + 25340 ], "documentation": { - "id": 23383, + "id": 23431, "nodeType": "StructuredDocumentation", - "src": "3863:166:8", + "src": "4780:166:8", "text": " Submits a new Bitcoin chain segment. Must be heavier (not necessarily\n longer) than the chain rooted at getBlockHash(getLatestBlockHeight())." }, "functionSelector": "d1a2eab2", @@ -5967,20 +6655,20 @@ "kind": "function", "modifiers": [], "name": "submit", - "nameLocation": "4043:6:8", + "nameLocation": "4960:6:8", "parameters": { - "id": 23388, + "id": 23436, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23385, + "id": 23433, "mutability": "mutable", "name": "blockHeight", - "nameLocation": "4058:11:8", + "nameLocation": "4975:11:8", "nodeType": "VariableDeclaration", - "scope": 23680, - "src": "4050:19:8", + "scope": 23723, + "src": "4967:19:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -5988,10 +6676,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23384, + "id": 23432, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "4050:7:8", + "src": "4967:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6001,13 +6689,13 @@ }, { "constant": false, - "id": 23387, + "id": 23435, "mutability": "mutable", "name": "blockHeaders", - "nameLocation": "4086:12:8", + "nameLocation": "5003:12:8", "nodeType": "VariableDeclaration", - "scope": 23680, - "src": "4071:27:8", + "scope": 23723, + "src": "4988:27:8", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { @@ -6015,10 +6703,10 @@ "typeString": "bytes" }, "typeName": { - "id": 23386, + "id": 23434, "name": "bytes", "nodeType": "ElementaryTypeName", - "src": "4071:5:8", + "src": "4988:5:8", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" @@ -6027,42 +6715,42 @@ "visibility": "internal" } ], - "src": "4049:50:8" + "src": "4966:50:8" }, "returnParameters": { - "id": 23389, + "id": 23437, "nodeType": "ParameterList", "parameters": [], - "src": "4107:0:8" + "src": "5024:0:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { - "id": 23732, + "id": 23775, "nodeType": "FunctionDefinition", - "src": "7581:380:8", + "src": "8297:380:8", "body": { - "id": 23731, + "id": 23774, "nodeType": "Block", - "src": "7697:264:8", + "src": "8413:264:8", "statements": [ { "assignments": [ - 23690 + 23733 ], "declarations": [ { "constant": false, - "id": 23690, + "id": 23733, "mutability": "mutable", "name": "target", - "nameLocation": "7715:6:8", + "nameLocation": "8431:6:8", "nodeType": "VariableDeclaration", - "scope": 23731, - "src": "7707:14:8", + "scope": 23774, + "src": "8423:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6070,10 +6758,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23689, + "id": 23732, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7707:7:8", + "src": "8423:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6082,28 +6770,28 @@ "visibility": "internal" } ], - "id": 23694, + "id": 23737, "initialValue": { "baseExpression": { - "id": 23691, + "id": 23734, "name": "periodToTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23304, - "src": "7724:14:8", + "referencedDeclaration": 23315, + "src": "8440:14:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" } }, - "id": 23693, + "id": 23736, "indexExpression": { - "id": 23692, + "id": 23735, "name": "period", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23682, - "src": "7739:6:8", + "referencedDeclaration": 23725, + "src": "8455:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6114,29 +6802,29 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "7724:22:8", + "src": "8440:22:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "7707:39:8" + "src": "8423:39:8" }, { "assignments": [ - 23696 + 23739 ], "declarations": [ { "constant": false, - "id": 23696, + "id": 23739, "mutability": "mutable", "name": "workPerBlock", - "nameLocation": "7764:12:8", + "nameLocation": "8480:12:8", "nodeType": "VariableDeclaration", - "scope": 23731, - "src": "7756:20:8", + "scope": 23774, + "src": "8472:20:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6144,10 +6832,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23695, + "id": 23738, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7756:7:8", + "src": "8472:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6156,13 +6844,13 @@ "visibility": "internal" } ], - "id": 23705, + "id": 23748, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23704, + "id": 23747, "isConstant": false, "isLValue": false, "isPure": false, @@ -6174,7 +6862,7 @@ "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", "typeString": "int_const 1157...(70 digits omitted)...9935" }, - "id": 23701, + "id": 23744, "isConstant": false, "isLValue": false, "isPure": true, @@ -6184,21 +6872,21 @@ "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639936_by_1", "typeString": "int_const 1157...(70 digits omitted)...9936" }, - "id": 23699, + "id": 23742, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "hexValue": "32", - "id": 23697, + "id": 23740, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7780:1:8", + "src": "8496:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" @@ -6209,21 +6897,21 @@ "operator": "**", "rightExpression": { "hexValue": "323536", - "id": 23698, + "id": 23741, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7783:3:8", + "src": "8499:3:8", "typeDescriptions": { "typeIdentifier": "t_rational_256_by_1", "typeString": "int_const 256" }, "value": "256" }, - "src": "7780:6:8", + "src": "8496:6:8", "typeDescriptions": { "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639936_by_1", "typeString": "int_const 1157...(70 digits omitted)...9936" @@ -6233,35 +6921,35 @@ "operator": "-", "rightExpression": { "hexValue": "31", - "id": 23700, + "id": 23743, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7789:1:8", + "src": "8505:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "7780:10:8", + "src": "8496:10:8", "typeDescriptions": { "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", "typeString": "int_const 1157...(70 digits omitted)...9935" } } ], - "id": 23702, + "id": 23745, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "7779:12:8", + "src": "8495:12:8", "typeDescriptions": { "typeIdentifier": "t_rational_115792089237316195423570985008687907853269984665640564039457584007913129639935_by_1", "typeString": "int_const 1157...(70 digits omitted)...9935" @@ -6270,40 +6958,40 @@ "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { - "id": 23703, + "id": 23746, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23690, - "src": "7794:6:8", + "referencedDeclaration": 23733, + "src": "8510:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "7779:21:8", + "src": "8495:21:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "7756:44:8" + "src": "8472:44:8" }, { "assignments": [ - 23707 + 23750 ], "declarations": [ { "constant": false, - "id": 23707, + "id": 23750, "mutability": "mutable", "name": "numBlocks", - "nameLocation": "7819:9:8", + "nameLocation": "8535:9:8", "nodeType": "VariableDeclaration", - "scope": 23731, - "src": "7811:17:8", + "scope": 23774, + "src": "8527:17:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6311,10 +6999,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23706, + "id": 23749, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7811:7:8", + "src": "8527:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6323,13 +7011,13 @@ "visibility": "internal" } ], - "id": 23716, + "id": 23759, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23715, + "id": 23758, "isConstant": false, "isLValue": false, "isPure": false, @@ -6339,18 +7027,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23713, + "id": 23756, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23708, + "id": 23751, "name": "height", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23684, - "src": "7831:6:8", + "referencedDeclaration": 23727, + "src": "8547:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6365,18 +7053,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23711, + "id": 23754, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23709, + "id": 23752, "name": "period", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23682, - "src": "7841:6:8", + "referencedDeclaration": 23725, + "src": "8557:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6386,41 +7074,41 @@ "operator": "*", "rightExpression": { "hexValue": "32303136", - "id": 23710, + "id": 23753, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7850:4:8", + "src": "8566:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "7841:13:8", + "src": "8557:13:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23712, + "id": 23755, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "7840:15:8", + "src": "8556:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "7831:24:8", + "src": "8547:24:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6430,28 +7118,28 @@ "operator": "+", "rightExpression": { "hexValue": "31", - "id": 23714, + "id": 23757, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7858:1:8", + "src": "8574:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "7831:28:8", + "src": "8547:28:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "7811:48:8" + "src": "8527:48:8" }, { "expression": { @@ -6461,7 +7149,7 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 23724, + "id": 23767, "isConstant": false, "isLValue": false, "isPure": false, @@ -6471,18 +7159,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23720, + "id": 23763, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23718, + "id": 23761, "name": "numBlocks", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23707, - "src": "7876:9:8", + "referencedDeclaration": 23750, + "src": "8592:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6492,21 +7180,21 @@ "operator": ">=", "rightExpression": { "hexValue": "31", - "id": 23719, + "id": 23762, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7889:1:8", + "src": "8605:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "7876:14:8", + "src": "8592:14:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6519,18 +7207,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23723, + "id": 23766, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23721, + "id": 23764, "name": "numBlocks", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23707, - "src": "7894:9:8", + "referencedDeclaration": 23750, + "src": "8610:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6540,27 +7228,27 @@ "operator": "<=", "rightExpression": { "hexValue": "32303136", - "id": 23722, + "id": 23765, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "7907:4:8", + "src": "8623:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "7894:17:8", + "src": "8610:17:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "src": "7876:35:8", + "src": "8592:35:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6574,18 +7262,18 @@ "typeString": "bool" } ], - "id": 23717, + "id": 23760, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -3, - "src": "7869:6:8", + "src": "8585:6:8", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, - "id": 23725, + "id": 23768, "isConstant": false, "isLValue": false, "isPure": false, @@ -6593,16 +7281,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "7869:43:8", + "src": "8585:43:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23726, + "id": 23769, "nodeType": "ExpressionStatement", - "src": "7869:43:8" + "src": "8585:43:8" }, { "expression": { @@ -6610,18 +7298,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23729, + "id": 23772, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23727, + "id": 23770, "name": "numBlocks", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23707, - "src": "7930:9:8", + "referencedDeclaration": 23750, + "src": "8646:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6630,27 +7318,27 @@ "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { - "id": 23728, + "id": 23771, "name": "workPerBlock", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23696, - "src": "7942:12:8", + "referencedDeclaration": 23739, + "src": "8658:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "7930:24:8", + "src": "8646:24:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "functionReturnParameters": 23688, - "id": 23730, + "functionReturnParameters": 23731, + "id": 23773, "nodeType": "Return", - "src": "7923:31:8" + "src": "8639:31:8" } ] }, @@ -6658,20 +7346,20 @@ "kind": "function", "modifiers": [], "name": "getWorkInPeriod", - "nameLocation": "7590:15:8", + "nameLocation": "8306:15:8", "parameters": { - "id": 23685, + "id": 23728, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23682, + "id": 23725, "mutability": "mutable", "name": "period", - "nameLocation": "7614:6:8", + "nameLocation": "8330:6:8", "nodeType": "VariableDeclaration", - "scope": 23732, - "src": "7606:14:8", + "scope": 23775, + "src": "8322:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6679,10 +7367,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23681, + "id": 23724, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7606:7:8", + "src": "8322:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6692,13 +7380,13 @@ }, { "constant": false, - "id": 23684, + "id": 23727, "mutability": "mutable", "name": "height", - "nameLocation": "7630:6:8", + "nameLocation": "8346:6:8", "nodeType": "VariableDeclaration", - "scope": 23732, - "src": "7622:14:8", + "scope": 23775, + "src": "8338:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6706,10 +7394,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23683, + "id": 23726, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7622:7:8", + "src": "8338:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6718,21 +7406,21 @@ "visibility": "internal" } ], - "src": "7605:32:8" + "src": "8321:32:8" }, "returnParameters": { - "id": 23688, + "id": 23731, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23687, + "id": 23730, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", - "scope": 23732, - "src": "7684:7:8", + "scope": 23775, + "src": "8400:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6740,10 +7428,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23686, + "id": 23729, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7684:7:8", + "src": "8400:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6752,21 +7440,21 @@ "visibility": "internal" } ], - "src": "7683:9:8" + "src": "8399:9:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "view", "virtual": false, "visibility": "private" }, { - "id": 23917, + "id": 23968, "nodeType": "FunctionDefinition", - "src": "7967:2321:8", + "src": "8683:2439:8", "body": { - "id": 23916, + "id": 23967, "nodeType": "Block", - "src": "8094:2194:8", + "src": "8810:2312:8", "statements": [ { "expression": { @@ -6776,32 +7464,32 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23745, + "id": 23788, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { - "id": 23742, + "id": 23785, "name": "blockHeader", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23736, - "src": "8145:11:8", + "referencedDeclaration": 23779, + "src": "8861:11:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" } }, - "id": 23743, + "id": 23786, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", - "src": "8145:18:8", + "src": "8861:18:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6811,21 +7499,21 @@ "operator": "==", "rightExpression": { "hexValue": "3830", - "id": 23744, + "id": 23787, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "8167:2:8", + "src": "8883:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_80_by_1", "typeString": "int_const 80" }, "value": "80" }, - "src": "8145:24:8", + "src": "8861:24:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -6839,18 +7527,18 @@ "typeString": "bool" } ], - "id": 23741, + "id": 23784, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -3, - "src": "8138:6:8", + "src": "8854:6:8", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, - "id": 23746, + "id": 23789, "isConstant": false, "isLValue": false, "isPure": false, @@ -6858,31 +7546,31 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8138:32:8", + "src": "8854:32:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23747, + "id": 23790, "nodeType": "ExpressionStatement", - "src": "8138:32:8" + "src": "8854:32:8" }, { "assignments": [ - 23749 + 23792 ], "declarations": [ { "constant": false, - "id": 23749, + "id": 23792, "mutability": "mutable", "name": "blockHashNum", - "nameLocation": "8188:12:8", + "nameLocation": "8904:12:8", "nodeType": "VariableDeclaration", - "scope": 23916, - "src": "8180:20:8", + "scope": 23967, + "src": "8896:20:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -6890,10 +7578,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23748, + "id": 23791, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "8180:7:8", + "src": "8896:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -6902,7 +7590,7 @@ "visibility": "internal" } ], - "id": 23764, + "id": 23807, "initialValue": { "arguments": [ { @@ -6914,12 +7602,12 @@ { "arguments": [ { - "id": 23758, + "id": 23801, "name": "blockHeader", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23736, - "src": "8267:11:8", + "referencedDeclaration": 23779, + "src": "8983:11:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" @@ -6933,18 +7621,18 @@ "typeString": "bytes calldata" } ], - "id": 23757, + "id": 23800, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -22, - "src": "8260:6:8", + "src": "8976:6:8", "typeDescriptions": { "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 23759, + "id": 23802, "isConstant": false, "isLValue": false, "isPure": false, @@ -6952,7 +7640,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8260:19:8", + "src": "8976:19:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", @@ -6968,31 +7656,31 @@ } ], "expression": { - "id": 23755, + "id": 23798, "name": "abi", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -1, - "src": "8249:3:8", + "src": "8965:3:8", "typeDescriptions": { "typeIdentifier": "t_magic_abi", "typeString": "abi" } }, - "id": 23756, + "id": 23799, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "encode", "nodeType": "MemberAccess", - "src": "8249:10:8", + "src": "8965:10:8", "typeDescriptions": { "typeIdentifier": "t_function_abiencode_pure$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () pure returns (bytes memory)" } }, - "id": 23760, + "id": 23803, "isConstant": false, "isLValue": false, "isPure": false, @@ -7000,7 +7688,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8249:31:8", + "src": "8965:31:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", @@ -7015,18 +7703,18 @@ "typeString": "bytes memory" } ], - "id": 23754, + "id": 23797, "name": "sha256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -22, - "src": "8242:6:8", + "src": "8958:6:8", "typeDescriptions": { "typeIdentifier": "t_function_sha256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, - "id": 23761, + "id": 23804, "isConstant": false, "isLValue": false, "isPure": false, @@ -7034,7 +7722,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8242:39:8", + "src": "8958:39:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", @@ -7049,26 +7737,26 @@ "typeString": "bytes32" } ], - "id": 23753, + "id": 23796, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "8234:7:8", + "src": "8950:7:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { - "id": 23752, + "id": 23795, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "8234:7:8", + "src": "8950:7:8", "typeDescriptions": {} } }, - "id": 23762, + "id": 23805, "isConstant": false, "isLValue": false, "isPure": false, @@ -7076,7 +7764,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8234:48:8", + "src": "8950:48:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -7092,32 +7780,32 @@ } ], "expression": { - "id": 23750, + "id": 23793, "name": "Endian", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 25240, - "src": "8203:6:8", + "referencedDeclaration": 25291, + "src": "8919:6:8", "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Endian_$25240_$", + "typeIdentifier": "t_type$_t_contract$_Endian_$25291_$", "typeString": "type(library Endian)" } }, - "id": 23751, + "id": 23794, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "reverse256", "nodeType": "MemberAccess", - "referencedDeclaration": 25113, - "src": "8203:17:8", + "referencedDeclaration": 25164, + "src": "8919:17:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, - "id": 23763, + "id": 23806, "isConstant": false, "isLValue": false, "isPure": false, @@ -7125,7 +7813,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8203:89:8", + "src": "8919:89:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -7133,22 +7821,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "8180:112:8" + "src": "8896:112:8" }, { "assignments": [ - 23766 + 23809 ], "declarations": [ { "constant": false, - "id": 23766, + "id": 23809, "mutability": "mutable", - "name": "oldHash", - "nameLocation": "8419:7:8", + "name": "newHash", + "nameLocation": "9135:7:8", "nodeType": "VariableDeclaration", - "scope": 23916, - "src": "8411:15:8", + "scope": 23967, + "src": "9127:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7156,10 +7844,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23765, + "id": 23808, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8411:7:8", + "src": "9127:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7168,90 +7856,109 @@ "visibility": "internal" } ], - "id": 23770, + "id": 23814, "initialValue": { - "baseExpression": { - "id": 23767, - "name": "blockHeightToHash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23299, - "src": "8429:17:8", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" + "arguments": [ + { + "id": 23812, + "name": "blockHashNum", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23792, + "src": "9153:12:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } } - }, - "id": 23769, - "indexExpression": { - "id": 23768, - "name": "blockHeight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23734, - "src": "8447:11:8", + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 23811, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9145:7:8", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 23810, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9145:7:8", + "typeDescriptions": {} } }, + "id": 23813, "isConstant": false, - "isLValue": true, + "isLValue": false, "isPure": false, + "kind": "typeConversion", "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8429:30:8", + "names": [], + "nodeType": "FunctionCall", + "src": "9145:21:8", + "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "VariableDeclarationStatement", - "src": "8411:48:8" + "src": "9127:39:8" }, { "assignments": [ - 23772 + 23816 ], "declarations": [ { "constant": false, - "id": 23772, + "id": 23816, "mutability": "mutable", - "name": "newHash", - "nameLocation": "8477:7:8", + "name": "blockIx", + "nameLocation": "9184:7:8", "nodeType": "VariableDeclaration", - "scope": 23916, - "src": "8469:15:8", + "scope": 23967, + "src": "9176:15:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, "typeName": { - "id": 23771, - "name": "bytes32", + "id": 23815, + "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "8469:7:8", + "src": "9176:7:8", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "visibility": "internal" } ], - "id": 23777, + "id": 23820, "initialValue": { "arguments": [ { - "id": 23775, - "name": "blockHashNum", + "id": 23818, + "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23749, - "src": "8495:12:8", + "referencedDeclaration": 23777, + "src": "9205:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7265,42 +7972,34 @@ "typeString": "uint256" } ], - "id": 23774, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "8487:7:8", + "id": 23817, + "name": "getBlockIx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23412, + "src": "9194:10:8", "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes32_$", - "typeString": "type(bytes32)" - }, - "typeName": { - "id": 23773, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8487:7:8", - "typeDescriptions": {} + "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) view returns (uint256)" } }, - "id": 23776, + "id": 23819, "isConstant": false, "isLValue": false, "isPure": false, - "kind": "typeConversion", + "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8487:21:8", + "src": "9194:23:8", "tryCall": false, "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "8469:39:8" + "src": "9176:41:8" }, { "condition": { @@ -7308,96 +8007,48 @@ "typeIdentifier": "t_bool", "typeString": "bool" }, - "id": 23787, + "id": 23829, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "commonType": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" }, - "id": 23783, + "id": 23823, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23778, - "name": "oldHash", + "id": 23821, + "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23766, - "src": "8522:7:8", + "referencedDeclaration": 23777, + "src": "9244:11:8", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, "nodeType": "BinaryOperation", - "operator": "!=", + "operator": "<=", "rightExpression": { - "arguments": [ - { - "hexValue": "30", - "id": 23781, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8541:1:8", - "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": 23780, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "8533:7:8", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes32_$", - "typeString": "type(bytes32)" - }, - "typeName": { - "id": 23779, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8533:7:8", - "typeDescriptions": {} - } - }, - "id": 23782, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8533:10:8", - "tryCall": false, + "id": 23822, + "name": "latestBlockHeight", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23293, + "src": "9259:17:8", "typeDescriptions": { - "typeIdentifier": "t_bytes32", - "typeString": "bytes32" + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "src": "8522:21:8", + "src": "9244:32:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -7410,18 +8061,43 @@ "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, - "id": 23786, + "id": 23828, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23784, - "name": "oldHash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23766, - "src": "8547:7:8", + "baseExpression": { + "id": 23824, + "name": "blockHashes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23308, + "src": "9280:11:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$1000_storage", + "typeString": "bytes32[1000] storage ref" + } + }, + "id": 23826, + "indexExpression": { + "id": 23825, + "name": "blockIx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23816, + "src": "9292:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "isConstant": false, + "isLValue": true, + "isPure": false, + "lValueRequested": false, + "nodeType": "IndexAccess", + "src": "9280:20:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7430,51 +8106,51 @@ "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { - "id": 23785, + "id": 23827, "name": "newHash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23772, - "src": "8558:7:8", + "referencedDeclaration": 23809, + "src": "9304:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "8547:18:8", + "src": "9280:31:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "src": "8522:43:8", + "src": "9244:67:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, - "id": 23793, + "id": 23835, "nodeType": "IfStatement", - "src": "8518:169:8", + "src": "9227:215:8", "trueBody": { - "id": 23792, + "id": 23834, "nodeType": "Block", - "src": "8567:120:8", + "src": "9322:120:8", "statements": [ { "expression": { - "id": 23790, + "id": 23832, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23788, + "id": 23830, "name": "numReorged", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23739, - "src": "8662:10:8", + "referencedDeclaration": 23782, + "src": "9417:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7484,61 +8160,61 @@ "operator": "=", "rightHandSide": { "hexValue": "31", - "id": 23789, + "id": 23831, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "8675:1:8", + "src": "9430:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "8662:14:8", + "src": "9417:14:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23791, + "id": 23833, "nodeType": "ExpressionStatement", - "src": "8662:14:8" + "src": "9417:14:8" } ] } }, { "expression": { - "id": 23798, + "id": 23840, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { - "id": 23794, - "name": "blockHeightToHash", + "id": 23836, + "name": "blockHashes", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23299, - "src": "8777:17:8", + "referencedDeclaration": 23308, + "src": "9572:11:8", "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" + "typeIdentifier": "t_array$_t_bytes32_$1000_storage", + "typeString": "bytes32[1000] storage ref" } }, - "id": 23796, + "id": 23838, "indexExpression": { - "id": 23795, - "name": "blockHeight", + "id": 23837, + "name": "blockIx", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23734, - "src": "8795:11:8", + "referencedDeclaration": 23816, + "src": "9584:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -7549,7 +8225,7 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "8777:30:8", + "src": "9572:20:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7558,41 +8234,41 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23797, + "id": 23839, "name": "newHash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23772, - "src": "8810:7:8", + "referencedDeclaration": 23809, + "src": "9595:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "8777:40:8", + "src": "9572:30:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 23799, + "id": 23841, "nodeType": "ExpressionStatement", - "src": "8777:40:8" + "src": "9572:30:8" }, { "assignments": [ - 23801 + 23843 ], "declarations": [ { "constant": false, - "id": 23801, + "id": 23843, "mutability": "mutable", "name": "prevHash", - "nameLocation": "8868:8:8", + "nameLocation": "9653:8:8", "nodeType": "VariableDeclaration", - "scope": 23916, - "src": "8860:16:8", + "scope": 23967, + "src": "9645:16:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -7600,10 +8276,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23800, + "id": 23842, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8860:7:8", + "src": "9645:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -7612,7 +8288,7 @@ "visibility": "internal" } ], - "id": 23818, + "id": 23860, "initialValue": { "arguments": [ { @@ -7623,12 +8299,12 @@ "arguments": [ { "baseExpression": { - "id": 23810, + "id": 23852, "name": "blockHeader", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23736, - "src": "8934:11:8", + "referencedDeclaration": 23779, + "src": "9719:11:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" @@ -7636,37 +8312,37 @@ }, "endExpression": { "hexValue": "3336", - "id": 23812, + "id": 23854, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "8948:2:8", + "src": "9733:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_36_by_1", "typeString": "int_const 36" }, "value": "36" }, - "id": 23813, + "id": 23855, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexRangeAccess", - "src": "8934:17:8", + "src": "9719:17:8", "startExpression": { "hexValue": "34", - "id": 23811, + "id": 23853, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "8946:1:8", + "src": "9731:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_4_by_1", "typeString": "int_const 4" @@ -7686,26 +8362,26 @@ "typeString": "bytes calldata slice" } ], - "id": 23809, + "id": 23851, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "8926:7:8", + "src": "9711:7:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes32_$", "typeString": "type(bytes32)" }, "typeName": { - "id": 23808, + "id": 23850, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "8926:7:8", + "src": "9711:7:8", "typeDescriptions": {} } }, - "id": 23814, + "id": 23856, "isConstant": false, "isLValue": false, "isPure": false, @@ -7713,7 +8389,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8926:26:8", + "src": "9711:26:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", @@ -7728,26 +8404,26 @@ "typeString": "bytes32" } ], - "id": 23807, + "id": 23849, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "8918:7:8", + "src": "9703:7:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { - "id": 23806, + "id": 23848, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "8918:7:8", + "src": "9703:7:8", "typeDescriptions": {} } }, - "id": 23815, + "id": 23857, "isConstant": false, "isLValue": false, "isPure": false, @@ -7755,7 +8431,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8918:35:8", + "src": "9703:35:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -7763,98 +8439,282 @@ } } ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "id": 23804, - "name": "Endian", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 25240, - "src": "8900:6:8", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_contract$_Endian_$25240_$", - "typeString": "type(library Endian)" - } - }, - "id": 23805, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "reverse256", - "nodeType": "MemberAccess", - "referencedDeclaration": 25113, - "src": "8900:17:8", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", - "typeString": "function (uint256) pure returns (uint256)" - } - }, - "id": 23816, + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "expression": { + "id": 23846, + "name": "Endian", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 25291, + "src": "9685:6:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_contract$_Endian_$25291_$", + "typeString": "type(library Endian)" + } + }, + "id": 23847, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "memberName": "reverse256", + "nodeType": "MemberAccess", + "referencedDeclaration": 25164, + "src": "9685:17:8", + "typeDescriptions": { + "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", + "typeString": "function (uint256) pure returns (uint256)" + } + }, + "id": 23858, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "functionCall", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9685:54:8", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + ], + "id": 23845, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9664:7:8", + "typeDescriptions": { + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 23844, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9664:7:8", + "typeDescriptions": {} + } + }, + "id": 23859, + "isConstant": false, + "isLValue": false, + "isPure": false, + "kind": "typeConversion", + "lValueRequested": false, + "names": [], + "nodeType": "FunctionCall", + "src": "9664:85:8", + "tryCall": false, + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "nodeType": "VariableDeclarationStatement", + "src": "9645:104:8" + }, + { + "assignments": [ + 23862 + ], + "declarations": [ + { + "constant": false, + "id": 23862, + "mutability": "mutable", + "name": "parent", + "nameLocation": "9767:6:8", + "nodeType": "VariableDeclaration", + "scope": 23967, + "src": "9759:14:8", + "stateVariable": false, + "storageLocation": "default", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + }, + "typeName": { + "id": 23861, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9759:7:8", + "typeDescriptions": { + "typeIdentifier": "t_bytes32", + "typeString": "bytes32" + } + }, + "visibility": "internal" + } + ], + "id": 23873, + "initialValue": { + "baseExpression": { + "id": 23863, + "name": "blockHashes", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23308, + "src": "9776:11:8", + "typeDescriptions": { + "typeIdentifier": "t_array$_t_bytes32_$1000_storage", + "typeString": "bytes32[1000] storage ref" + } + }, + "id": 23872, + "indexExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23871, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "components": [ + { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23868, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "commonType": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + }, + "id": 23866, + "isConstant": false, + "isLValue": false, + "isPure": false, + "lValueRequested": false, + "leftExpression": { + "id": 23864, + "name": "blockIx", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23816, + "src": "9789:7:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "+", + "rightExpression": { + "id": 23865, + "name": "NUM_BLOCKS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23304, + "src": "9799:10:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "src": "9789:20:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + }, + "nodeType": "BinaryOperation", + "operator": "-", + "rightExpression": { + "hexValue": "31", + "id": 23867, + "isConstant": false, + "isLValue": false, + "isPure": true, + "kind": "number", + "lValueRequested": false, + "nodeType": "Literal", + "src": "9812:1:8", + "typeDescriptions": { + "typeIdentifier": "t_rational_1_by_1", + "typeString": "int_const 1" + }, + "value": "1" + }, + "src": "9789:24:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" + } + } + ], + "id": 23869, "isConstant": false, + "isInlineArray": false, "isLValue": false, "isPure": false, - "kind": "functionCall", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8900:54:8", - "tryCall": false, + "nodeType": "TupleExpression", + "src": "9788:26:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } - } - ], - "expression": { - "argumentTypes": [ - { + }, + "nodeType": "BinaryOperation", + "operator": "%", + "rightExpression": { + "id": 23870, + "name": "NUM_BLOCKS", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23304, + "src": "9817:10:8", + "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } - ], - "id": 23803, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "8879:7:8", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes32_$", - "typeString": "type(bytes32)" }, - "typeName": { - "id": 23802, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "8879:7:8", - "typeDescriptions": {} + "src": "9788:39:8", + "typeDescriptions": { + "typeIdentifier": "t_uint256", + "typeString": "uint256" } }, - "id": 23817, "isConstant": false, - "isLValue": false, + "isLValue": true, "isPure": false, - "kind": "typeConversion", "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8879:85:8", - "tryCall": false, + "nodeType": "IndexAccess", + "src": "9776:52:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "VariableDeclarationStatement", - "src": "8860:104:8" + "src": "9759:69:8" }, { "expression": { @@ -7864,117 +8724,106 @@ "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, - "id": 23826, + "id": 23880, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23820, - "name": "prevHash", + "id": 23875, + "name": "parent", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23801, - "src": "8982:8:8", + "referencedDeclaration": 23862, + "src": "9846:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "BinaryOperation", - "operator": "==", + "operator": "!=", "rightExpression": { - "baseExpression": { - "id": 23821, - "name": "blockHeightToHash", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23299, - "src": "8994:17:8", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_bytes32_$", - "typeString": "mapping(uint256 => bytes32)" - } - }, - "id": 23825, - "indexExpression": { - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 23824, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "id": 23822, - "name": "blockHeight", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 23734, - "src": "9012:11:8", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "hexValue": "31", - "id": 23823, + "arguments": [ + { + "hexValue": "30", + "id": 23878, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9026:1:8", + "src": "9864:1:8", "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" }, - "value": "1" - }, - "src": "9012:15:8", + "value": "0" + } + ], + "expression": { + "argumentTypes": [ + { + "typeIdentifier": "t_rational_0_by_1", + "typeString": "int_const 0" + } + ], + "id": 23877, + "isConstant": false, + "isLValue": false, + "isPure": true, + "lValueRequested": false, + "nodeType": "ElementaryTypeNameExpression", + "src": "9856:7:8", "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" + "typeIdentifier": "t_type$_t_bytes32_$", + "typeString": "type(bytes32)" + }, + "typeName": { + "id": 23876, + "name": "bytes32", + "nodeType": "ElementaryTypeName", + "src": "9856:7:8", + "typeDescriptions": {} } }, + "id": 23879, "isConstant": false, - "isLValue": true, - "isPure": false, + "isLValue": false, + "isPure": true, + "kind": "typeConversion", "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8994:34:8", + "names": [], + "nodeType": "FunctionCall", + "src": "9856:10:8", + "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "8982:46:8", + "src": "9846:20:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { - "hexValue": "62616420706172656e74", - "id": 23827, + "hexValue": "706172656e7420626c6f636b206e6f7420796574207375626d6974746564", + "id": 23881, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "9030:12:8", + "src": "9868:32:8", "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c7f13d53460a2cdc4a80d0a5469f8f2bf841580f155f618930b2436cf0d56629", - "typeString": "literal_string \"bad parent\"" + "typeIdentifier": "t_stringliteral_8b35159129f633c9fd7931bf314dfa280d34b8b00342af1c746d151fd8e3bf60", + "typeString": "literal_string \"parent block not yet submitted\"" }, - "value": "bad parent" + "value": "parent block not yet submitted" } ], "expression": { @@ -7984,11 +8833,11 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_c7f13d53460a2cdc4a80d0a5469f8f2bf841580f155f618930b2436cf0d56629", - "typeString": "literal_string \"bad parent\"" + "typeIdentifier": "t_stringliteral_8b35159129f633c9fd7931bf314dfa280d34b8b00342af1c746d151fd8e3bf60", + "typeString": "literal_string \"parent block not yet submitted\"" } ], - "id": 23819, + "id": 23874, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -7996,13 +8845,13 @@ -18 ], "referencedDeclaration": -18, - "src": "8974:7:8", + "src": "9838:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23828, + "id": 23882, "isConstant": false, "isLValue": false, "isPure": false, @@ -8010,16 +8859,16 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "8974:69:8", + "src": "9838:63:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23829, + "id": 23883, "nodeType": "ExpressionStatement", - "src": "8974:69:8" + "src": "9838:63:8" }, { "expression": { @@ -8029,106 +8878,58 @@ "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, - "id": 23836, + "id": 23887, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23831, + "id": 23885, "name": "prevHash", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23801, - "src": "9061:8:8", + "referencedDeclaration": 23843, + "src": "9919:8:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "BinaryOperation", - "operator": "!=", + "operator": "==", "rightExpression": { - "arguments": [ - { - "hexValue": "30", - "id": 23834, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9081:1:8", - "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": 23833, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "9073:7:8", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_bytes32_$", - "typeString": "type(bytes32)" - }, - "typeName": { - "id": 23832, - "name": "bytes32", - "nodeType": "ElementaryTypeName", - "src": "9073:7:8", - "typeDescriptions": {} - } - }, - "id": 23835, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9073:10:8", - "tryCall": false, + "id": 23886, + "name": "parent", + "nodeType": "Identifier", + "overloadedDeclarations": [], + "referencedDeclaration": 23862, + "src": "9931:6:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "src": "9061:22:8", + "src": "9919:18:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { - "hexValue": "706172656e7420626c6f636b206e6f7420796574207375626d6974746564", - "id": 23837, + "hexValue": "62616420706172656e74", + "id": 23888, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "9085:32:8", + "src": "9939:12:8", "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8b35159129f633c9fd7931bf314dfa280d34b8b00342af1c746d151fd8e3bf60", - "typeString": "literal_string \"parent block not yet submitted\"" + "typeIdentifier": "t_stringliteral_c7f13d53460a2cdc4a80d0a5469f8f2bf841580f155f618930b2436cf0d56629", + "typeString": "literal_string \"bad parent\"" }, - "value": "parent block not yet submitted" + "value": "bad parent" } ], "expression": { @@ -8138,11 +8939,11 @@ "typeString": "bool" }, { - "typeIdentifier": "t_stringliteral_8b35159129f633c9fd7931bf314dfa280d34b8b00342af1c746d151fd8e3bf60", - "typeString": "literal_string \"parent block not yet submitted\"" + "typeIdentifier": "t_stringliteral_c7f13d53460a2cdc4a80d0a5469f8f2bf841580f155f618930b2436cf0d56629", + "typeString": "literal_string \"bad parent\"" } ], - "id": 23830, + "id": 23884, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -8150,13 +8951,13 @@ -18 ], "referencedDeclaration": -18, - "src": "9053:7:8", + "src": "9911:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23838, + "id": 23889, "isConstant": false, "isLValue": false, "isPure": false, @@ -8164,31 +8965,31 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9053:65:8", + "src": "9911:41:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23839, + "id": 23890, "nodeType": "ExpressionStatement", - "src": "9053:65:8" + "src": "9911:41:8" }, { "assignments": [ - 23841 + 23892 ], "declarations": [ { "constant": false, - "id": 23841, + "id": 23892, "mutability": "mutable", "name": "bits", - "nameLocation": "9169:4:8", + "nameLocation": "10003:4:8", "nodeType": "VariableDeclaration", - "scope": 23916, - "src": "9161:12:8", + "scope": 23967, + "src": "9995:12:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8196,10 +8997,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23840, + "id": 23891, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "9161:7:8", + "src": "9995:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8208,17 +9009,17 @@ "visibility": "internal" } ], - "id": 23849, + "id": 23900, "initialValue": { "arguments": [ { "baseExpression": { - "id": 23844, + "id": 23895, "name": "blockHeader", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23736, - "src": "9184:11:8", + "referencedDeclaration": 23779, + "src": "10018:11:8", "typeDescriptions": { "typeIdentifier": "t_bytes_calldata_ptr", "typeString": "bytes calldata" @@ -8226,37 +9027,37 @@ }, "endExpression": { "hexValue": "3736", - "id": 23846, + "id": 23897, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9199:2:8", + "src": "10033:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_76_by_1", "typeString": "int_const 76" }, "value": "76" }, - "id": 23847, + "id": 23898, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "IndexRangeAccess", - "src": "9184:18:8", + "src": "10018:18:8", "startExpression": { "hexValue": "3732", - "id": 23845, + "id": 23896, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9196:2:8", + "src": "10030:2:8", "typeDescriptions": { "typeIdentifier": "t_rational_72_by_1", "typeString": "int_const 72" @@ -8276,26 +9077,26 @@ "typeString": "bytes calldata slice" } ], - "id": 23843, + "id": 23894, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "9176:7:8", + "src": "10010:7:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes32_$", "typeString": "type(bytes32)" }, "typeName": { - "id": 23842, + "id": 23893, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "9176:7:8", + "src": "10010:7:8", "typeDescriptions": {} } }, - "id": 23848, + "id": 23899, "isConstant": false, "isLValue": false, "isPure": false, @@ -8303,7 +9104,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9176:27:8", + "src": "10010:27:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", @@ -8311,22 +9112,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "9161:42:8" + "src": "9995:42:8" }, { "assignments": [ - 23851 + 23902 ], "declarations": [ { "constant": false, - "id": 23851, + "id": 23902, "mutability": "mutable", "name": "target", - "nameLocation": "9221:6:8", + "nameLocation": "10055:6:8", "nodeType": "VariableDeclaration", - "scope": 23916, - "src": "9213:14:8", + "scope": 23967, + "src": "10047:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8334,10 +9135,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23850, + "id": 23901, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "9213:7:8", + "src": "10047:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8346,16 +9147,16 @@ "visibility": "internal" } ], - "id": 23855, + "id": 23906, "initialValue": { "arguments": [ { - "id": 23853, + "id": 23904, "name": "bits", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23841, - "src": "9240:4:8", + "referencedDeclaration": 23892, + "src": "10074:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -8369,18 +9170,18 @@ "typeString": "bytes32" } ], - "id": 23852, + "id": 23903, "name": "getTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23985, - "src": "9230:9:8", + "referencedDeclaration": 24036, + "src": "10064:9:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_bytes32_$returns$_t_uint256_$", "typeString": "function (bytes32) pure returns (uint256)" } }, - "id": 23854, + "id": 23905, "isConstant": false, "isLValue": false, "isPure": false, @@ -8388,7 +9189,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9230:15:8", + "src": "10064:15:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", @@ -8396,7 +9197,7 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "9213:32:8" + "src": "10047:32:8" }, { "expression": { @@ -8406,18 +9207,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23859, + "id": 23910, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23857, + "id": 23908, "name": "blockHashNum", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23749, - "src": "9263:12:8", + "referencedDeclaration": 23792, + "src": "10097:12:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8426,18 +9227,18 @@ "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { - "id": 23858, + "id": 23909, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23851, - "src": "9278:6:8", + "referencedDeclaration": 23902, + "src": "10112:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "9263:21:8", + "src": "10097:21:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8445,14 +9246,14 @@ }, { "hexValue": "626c6f636b20686173682061626f766520746172676574", - "id": 23860, + "id": 23911, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "9286:25:8", + "src": "10120:25:8", "typeDescriptions": { "typeIdentifier": "t_stringliteral_86973d254803c8f7db9d394fc4ca9051c038beaf9a40eb47e09bed0c5a897239", "typeString": "literal_string \"block hash above target\"" @@ -8471,7 +9272,7 @@ "typeString": "literal_string \"block hash above target\"" } ], - "id": 23856, + "id": 23907, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -8479,13 +9280,13 @@ -18 ], "referencedDeclaration": -18, - "src": "9255:7:8", + "src": "10089:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23861, + "id": 23912, "isConstant": false, "isLValue": false, "isPure": false, @@ -8493,31 +9294,31 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "9255:57:8", + "src": "10089:57:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23862, + "id": 23913, "nodeType": "ExpressionStatement", - "src": "9255:57:8" + "src": "10089:57:8" }, { "assignments": [ - 23864 + 23915 ], "declarations": [ { "constant": false, - "id": 23864, + "id": 23915, "mutability": "mutable", "name": "period", - "nameLocation": "9385:6:8", + "nameLocation": "10219:6:8", "nodeType": "VariableDeclaration", - "scope": 23916, - "src": "9377:14:8", + "scope": 23967, + "src": "10211:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8525,10 +9326,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23863, + "id": 23914, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "9377:7:8", + "src": "10211:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8537,24 +9338,24 @@ "visibility": "internal" } ], - "id": 23868, + "id": 23919, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23867, + "id": 23918, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23865, + "id": 23916, "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23734, - "src": "9394:11:8", + "referencedDeclaration": 23777, + "src": "10228:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8564,28 +9365,28 @@ "operator": "/", "rightExpression": { "hexValue": "32303136", - "id": 23866, + "id": 23917, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9408:4:8", + "src": "10242:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "9394:18:8", + "src": "10228:18:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "9377:35:8" + "src": "10211:35:8" }, { "condition": { @@ -8593,7 +9394,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23873, + "id": 23924, "isConstant": false, "isLValue": false, "isPure": false, @@ -8603,18 +9404,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23871, + "id": 23922, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23869, + "id": 23920, "name": "blockHeight", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23734, - "src": "9426:11:8", + "referencedDeclaration": 23777, + "src": "10260:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8624,21 +9425,21 @@ "operator": "%", "rightExpression": { "hexValue": "32303136", - "id": 23870, + "id": 23921, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9440:4:8", + "src": "10274:4:8", "typeDescriptions": { "typeIdentifier": "t_rational_2016_by_1", "typeString": "int_const 2016" }, "value": "2016" }, - "src": "9426:18:8", + "src": "10260:18:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8648,21 +9449,21 @@ "operator": "==", "rightExpression": { "hexValue": "30", - "id": 23872, + "id": 23923, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9448:1:8", + "src": "10282:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, - "src": "9426:23:8", + "src": "10260:23:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8670,7 +9471,7 @@ }, "falseBody": { "condition": { - "id": 23903, + "id": 23954, "isConstant": false, "isLValue": false, "isPure": false, @@ -8678,14 +9479,14 @@ "nodeType": "UnaryOperation", "operator": "!", "prefix": true, - "src": "10146:10:8", + "src": "10980:10:8", "subExpression": { - "id": 23902, + "id": 23953, "name": "isTestnet", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23310, - "src": "10147:9:8", + "referencedDeclaration": 23321, + "src": "10981:9:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8696,13 +9497,13 @@ "typeString": "bool" } }, - "id": 23914, + "id": 23965, "nodeType": "IfStatement", - "src": "10142:140:8", + "src": "10976:140:8", "trueBody": { - "id": 23913, + "id": 23964, "nodeType": "Block", - "src": "10158:124:8", + "src": "10992:124:8", "statements": [ { "expression": { @@ -8712,18 +9513,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23909, + "id": 23960, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23905, + "id": 23956, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23851, - "src": "10213:6:8", + "referencedDeclaration": 23902, + "src": "11047:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8733,25 +9534,25 @@ "operator": "==", "rightExpression": { "baseExpression": { - "id": 23906, + "id": 23957, "name": "periodToTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23304, - "src": "10223:14:8", + "referencedDeclaration": 23315, + "src": "11057:14:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" } }, - "id": 23908, + "id": 23959, "indexExpression": { - "id": 23907, + "id": 23958, "name": "period", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23864, - "src": "10238:6:8", + "referencedDeclaration": 23915, + "src": "11072:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8762,13 +9563,13 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "10223:22:8", + "src": "11057:22:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "10213:32:8", + "src": "11047:32:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8776,14 +9577,14 @@ }, { "hexValue": "77726f6e6720646966666963756c74792062697473", - "id": 23910, + "id": 23961, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "10247:23:8", + "src": "11081:23:8", "typeDescriptions": { "typeIdentifier": "t_stringliteral_8c3428725f0605702cf3cf5c96b661c609328443adb9874c76d9e6e6405e4fac", "typeString": "literal_string \"wrong difficulty bits\"" @@ -8802,7 +9603,7 @@ "typeString": "literal_string \"wrong difficulty bits\"" } ], - "id": 23904, + "id": 23955, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -8810,13 +9611,13 @@ -18 ], "referencedDeclaration": -18, - "src": "10205:7:8", + "src": "11039:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23911, + "id": 23962, "isConstant": false, "isLValue": false, "isPure": false, @@ -8824,42 +9625,42 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "10205:66:8", + "src": "11039:66:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23912, + "id": 23963, "nodeType": "ExpressionStatement", - "src": "10205:66:8" + "src": "11039:66:8" } ] } }, - "id": 23915, + "id": 23966, "nodeType": "IfStatement", - "src": "9422:860:8", + "src": "10256:860:8", "trueBody": { - "id": 23901, + "id": 23952, "nodeType": "Block", - "src": "9451:685:8", + "src": "10285:685:8", "statements": [ { "assignments": [ - 23875 + 23926 ], "declarations": [ { "constant": false, - "id": 23875, + "id": 23926, "mutability": "mutable", "name": "lastTarget", - "nameLocation": "9707:10:8", + "nameLocation": "10541:10:8", "nodeType": "VariableDeclaration", - "scope": 23901, - "src": "9699:18:8", + "scope": 23952, + "src": "10533:18:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -8867,10 +9668,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23874, + "id": 23925, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "9699:7:8", + "src": "10533:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8879,38 +9680,38 @@ "visibility": "internal" } ], - "id": 23881, + "id": 23932, "initialValue": { "baseExpression": { - "id": 23876, + "id": 23927, "name": "periodToTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23304, - "src": "9720:14:8", + "referencedDeclaration": 23315, + "src": "10554:14:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" } }, - "id": 23880, + "id": 23931, "indexExpression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23879, + "id": 23930, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23877, + "id": 23928, "name": "period", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23864, - "src": "9735:6:8", + "referencedDeclaration": 23915, + "src": "10569:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8920,21 +9721,21 @@ "operator": "-", "rightExpression": { "hexValue": "31", - "id": 23878, + "id": 23929, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "9744:1:8", + "src": "10578:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, - "src": "9735:10:8", + "src": "10569:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -8945,18 +9746,18 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "9720:26:8", + "src": "10554:26:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "9699:47:8" + "src": "10533:47:8" }, { "condition": { - "id": 23883, + "id": 23934, "isConstant": false, "isLValue": false, "isPure": false, @@ -8964,14 +9765,14 @@ "nodeType": "UnaryOperation", "operator": "!", "prefix": true, - "src": "9975:10:8", + "src": "10809:10:8", "subExpression": { - "id": 23882, + "id": 23933, "name": "isTestnet", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23310, - "src": "9976:9:8", + "referencedDeclaration": 23321, + "src": "10810:9:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -8982,13 +9783,13 @@ "typeString": "bool" } }, - "id": 23894, + "id": 23945, "nodeType": "IfStatement", - "src": "9971:110:8", + "src": "10805:110:8", "trueBody": { - "id": 23893, + "id": 23944, "nodeType": "Block", - "src": "9987:94:8", + "src": "10821:94:8", "statements": [ { "expression": { @@ -8998,7 +9799,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23889, + "id": 23940, "isConstant": false, "isLValue": false, "isPure": false, @@ -9008,18 +9809,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23887, + "id": 23938, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23885, + "id": 23936, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23851, - "src": "10013:6:8", + "referencedDeclaration": 23902, + "src": "10847:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9029,21 +9830,21 @@ "operator": ">>", "rightExpression": { "hexValue": "32", - "id": 23886, + "id": 23937, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10023:1:8", + "src": "10857:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" }, "value": "2" }, - "src": "10013:11:8", + "src": "10847:11:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9052,18 +9853,18 @@ "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { - "id": 23888, + "id": 23939, "name": "lastTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23875, - "src": "10027:10:8", + "referencedDeclaration": 23926, + "src": "10861:10:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "10013:24:8", + "src": "10847:24:8", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" @@ -9071,14 +9872,14 @@ }, { "hexValue": "3c32352520646966666963756c7479207265746172676574", - "id": 23890, + "id": 23941, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", - "src": "10039:26:8", + "src": "10873:26:8", "typeDescriptions": { "typeIdentifier": "t_stringliteral_ee063c5ceb820c882d80680cdf7a1ceedb48d9c65ff06d3aa37e9af79b61f6c3", "typeString": "literal_string \"<25% difficulty retarget\"" @@ -9097,7 +9898,7 @@ "typeString": "literal_string \"<25% difficulty retarget\"" } ], - "id": 23884, + "id": 23935, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ @@ -9105,13 +9906,13 @@ -18 ], "referencedDeclaration": -18, - "src": "10005:7:8", + "src": "10839:7:8", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, - "id": 23891, + "id": 23942, "isConstant": false, "isLValue": false, "isPure": false, @@ -9119,48 +9920,48 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "10005:61:8", + "src": "10839:61:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, - "id": 23892, + "id": 23943, "nodeType": "ExpressionStatement", - "src": "10005:61:8" + "src": "10839:61:8" } ] } }, { "expression": { - "id": 23899, + "id": 23950, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "baseExpression": { - "id": 23895, + "id": 23946, "name": "periodToTarget", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23304, - "src": "10094:14:8", + "referencedDeclaration": 23315, + "src": "10928:14:8", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_uint256_$_t_uint256_$", "typeString": "mapping(uint256 => uint256)" } }, - "id": 23897, + "id": 23948, "indexExpression": { - "id": 23896, + "id": 23947, "name": "period", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23864, - "src": "10109:6:8", + "referencedDeclaration": 23915, + "src": "10943:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9171,7 +9972,7 @@ "isPure": false, "lValueRequested": true, "nodeType": "IndexAccess", - "src": "10094:22:8", + "src": "10928:22:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9180,26 +9981,26 @@ "nodeType": "Assignment", "operator": "=", "rightHandSide": { - "id": 23898, + "id": 23949, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23851, - "src": "10119:6:8", + "referencedDeclaration": 23902, + "src": "10953:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "10094:31:8", + "src": "10928:31:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23900, + "id": 23951, "nodeType": "ExpressionStatement", - "src": "10094:31:8" + "src": "10928:31:8" } ] } @@ -9210,20 +10011,20 @@ "kind": "function", "modifiers": [], "name": "submitBlock", - "nameLocation": "7976:11:8", + "nameLocation": "8692:11:8", "parameters": { - "id": 23737, + "id": 23780, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23734, + "id": 23777, "mutability": "mutable", "name": "blockHeight", - "nameLocation": "7996:11:8", + "nameLocation": "8712:11:8", "nodeType": "VariableDeclaration", - "scope": 23917, - "src": "7988:19:8", + "scope": 23968, + "src": "8704:19:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9231,10 +10032,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23733, + "id": 23776, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "7988:7:8", + "src": "8704:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9244,13 +10045,13 @@ }, { "constant": false, - "id": 23736, + "id": 23779, "mutability": "mutable", "name": "blockHeader", - "nameLocation": "8024:11:8", + "nameLocation": "8740:11:8", "nodeType": "VariableDeclaration", - "scope": 23917, - "src": "8009:26:8", + "scope": 23968, + "src": "8725:26:8", "stateVariable": false, "storageLocation": "calldata", "typeDescriptions": { @@ -9258,10 +10059,10 @@ "typeString": "bytes" }, "typeName": { - "id": 23735, + "id": 23778, "name": "bytes", "nodeType": "ElementaryTypeName", - "src": "8009:5:8", + "src": "8725:5:8", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" @@ -9270,21 +10071,21 @@ "visibility": "internal" } ], - "src": "7987:49:8" + "src": "8703:49:8" }, "returnParameters": { - "id": 23740, + "id": 23783, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23739, + "id": 23782, "mutability": "mutable", "name": "numReorged", - "nameLocation": "8078:10:8", + "nameLocation": "8794:10:8", "nodeType": "VariableDeclaration", - "scope": 23917, - "src": "8070:18:8", + "scope": 23968, + "src": "8786:18:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9292,10 +10093,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23738, + "id": 23781, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "8070:7:8", + "src": "8786:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9304,36 +10105,36 @@ "visibility": "internal" } ], - "src": "8069:20:8" + "src": "8785:20:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "nonpayable", "virtual": false, "visibility": "private" }, { - "id": 23985, + "id": 24036, "nodeType": "FunctionDefinition", - "src": "10294:618:8", + "src": "11128:618:8", "body": { - "id": 23984, + "id": 24035, "nodeType": "Block", - "src": "10357:555:8", + "src": "11191:555:8", "statements": [ { "assignments": [ - 23925 + 23976 ], "declarations": [ { "constant": false, - "id": 23925, + "id": 23976, "mutability": "mutable", "name": "exp", - "nameLocation": "10659:3:8", + "nameLocation": "11493:3:8", "nodeType": "VariableDeclaration", - "scope": 23984, - "src": "10651:11:8", + "scope": 24035, + "src": "11485:11:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9341,10 +10142,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23924, + "id": 23975, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "10651:7:8", + "src": "11485:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9353,33 +10154,33 @@ "visibility": "internal" } ], - "id": 23932, + "id": 23983, "initialValue": { "arguments": [ { "baseExpression": { - "id": 23928, + "id": 23979, "name": "bits", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23919, - "src": "10671:4:8", + "referencedDeclaration": 23970, + "src": "11505:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 23930, + "id": 23981, "indexExpression": { "hexValue": "33", - "id": 23929, + "id": 23980, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10676:1:8", + "src": "11510:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_3_by_1", "typeString": "int_const 3" @@ -9391,7 +10192,7 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "10671:7:8", + "src": "11505:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" @@ -9405,26 +10206,26 @@ "typeString": "bytes1" } ], - "id": 23927, + "id": 23978, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "10665:5:8", + "src": "11499:5:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint8_$", "typeString": "type(uint8)" }, "typeName": { - "id": 23926, + "id": 23977, "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "10665:5:8", + "src": "11499:5:8", "typeDescriptions": {} } }, - "id": 23931, + "id": 23982, "isConstant": false, "isLValue": false, "isPure": false, @@ -9432,7 +10233,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "10665:14:8", + "src": "11499:14:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint8", @@ -9440,22 +10241,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "10651:28:8" + "src": "11485:28:8" }, { "assignments": [ - 23934 + 23985 ], "declarations": [ { "constant": false, - "id": 23934, + "id": 23985, "mutability": "mutable", "name": "mantissa", - "nameLocation": "10697:8:8", + "nameLocation": "11531:8:8", "nodeType": "VariableDeclaration", - "scope": 23984, - "src": "10689:16:8", + "scope": 24035, + "src": "11523:16:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9463,10 +10264,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23933, + "id": 23984, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "10689:7:8", + "src": "11523:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9475,33 +10276,33 @@ "visibility": "internal" } ], - "id": 23941, + "id": 23992, "initialValue": { "arguments": [ { "baseExpression": { - "id": 23937, + "id": 23988, "name": "bits", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23919, - "src": "10714:4:8", + "referencedDeclaration": 23970, + "src": "11548:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 23939, + "id": 23990, "indexExpression": { "hexValue": "32", - "id": 23938, + "id": 23989, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10719:1:8", + "src": "11553:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_2_by_1", "typeString": "int_const 2" @@ -9513,7 +10314,7 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "10714:7:8", + "src": "11548:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" @@ -9527,26 +10328,26 @@ "typeString": "bytes1" } ], - "id": 23936, + "id": 23987, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "10708:5:8", + "src": "11542:5:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint8_$", "typeString": "type(uint8)" }, "typeName": { - "id": 23935, + "id": 23986, "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "10708:5:8", + "src": "11542:5:8", "typeDescriptions": {} } }, - "id": 23940, + "id": 23991, "isConstant": false, "isLValue": false, "isPure": false, @@ -9554,7 +10355,7 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "10708:14:8", + "src": "11542:14:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint8", @@ -9562,22 +10363,22 @@ } }, "nodeType": "VariableDeclarationStatement", - "src": "10689:33:8" + "src": "11523:33:8" }, { "expression": { - "id": 23954, + "id": 24005, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23942, + "id": 23993, "name": "mantissa", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23934, - "src": "10732:8:8", + "referencedDeclaration": 23985, + "src": "11566:8:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9590,7 +10391,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23953, + "id": 24004, "isConstant": false, "isLValue": false, "isPure": false, @@ -9602,18 +10403,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23945, + "id": 23996, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23943, + "id": 23994, "name": "mantissa", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23934, - "src": "10744:8:8", + "referencedDeclaration": 23985, + "src": "11578:8:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9623,35 +10424,35 @@ "operator": "<<", "rightExpression": { "hexValue": "38", - "id": 23944, + "id": 23995, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10756:1:8", + "src": "11590:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, - "src": "10744:13:8", + "src": "11578:13:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23946, + "id": 23997, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "10743:15:8", + "src": "11577:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9663,28 +10464,28 @@ "arguments": [ { "baseExpression": { - "id": 23949, + "id": 24000, "name": "bits", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23919, - "src": "10767:4:8", + "referencedDeclaration": 23970, + "src": "11601:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 23951, + "id": 24002, "indexExpression": { "hexValue": "31", - "id": 23950, + "id": 24001, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10772:1:8", + "src": "11606:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" @@ -9696,7 +10497,7 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "10767:7:8", + "src": "11601:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" @@ -9710,26 +10511,26 @@ "typeString": "bytes1" } ], - "id": 23948, + "id": 23999, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "10761:5:8", + "src": "11595:5:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint8_$", "typeString": "type(uint8)" }, "typeName": { - "id": 23947, + "id": 23998, "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "10761:5:8", + "src": "11595:5:8", "typeDescriptions": {} } }, - "id": 23952, + "id": 24003, "isConstant": false, "isLValue": false, "isPure": false, @@ -9737,43 +10538,43 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "10761:14:8", + "src": "11595:14:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, - "src": "10743:32:8", + "src": "11577:32:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "10732:43:8", + "src": "11566:43:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23955, + "id": 24006, "nodeType": "ExpressionStatement", - "src": "10732:43:8" + "src": "11566:43:8" }, { "expression": { - "id": 23968, + "id": 24019, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { - "id": 23956, + "id": 24007, "name": "mantissa", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23934, - "src": "10785:8:8", + "referencedDeclaration": 23985, + "src": "11619:8:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9786,7 +10587,7 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23967, + "id": 24018, "isConstant": false, "isLValue": false, "isPure": false, @@ -9798,18 +10599,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23959, + "id": 24010, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23957, + "id": 24008, "name": "mantissa", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23934, - "src": "10797:8:8", + "referencedDeclaration": 23985, + "src": "11631:8:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9819,35 +10620,35 @@ "operator": "<<", "rightExpression": { "hexValue": "38", - "id": 23958, + "id": 24009, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10809:1:8", + "src": "11643:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" }, "value": "8" }, - "src": "10797:13:8", + "src": "11631:13:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23960, + "id": 24011, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "10796:15:8", + "src": "11630:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9859,28 +10660,28 @@ "arguments": [ { "baseExpression": { - "id": 23963, + "id": 24014, "name": "bits", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23919, - "src": "10820:4:8", + "referencedDeclaration": 23970, + "src": "11654:4:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, - "id": 23965, + "id": 24016, "indexExpression": { "hexValue": "30", - "id": 23964, + "id": 24015, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10825:1:8", + "src": "11659:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" @@ -9892,7 +10693,7 @@ "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", - "src": "10820:7:8", + "src": "11654:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes1", "typeString": "bytes1" @@ -9906,26 +10707,26 @@ "typeString": "bytes1" } ], - "id": 23962, + "id": 24013, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", - "src": "10814:5:8", + "src": "11648:5:8", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint8_$", "typeString": "type(uint8)" }, "typeName": { - "id": 23961, + "id": 24012, "name": "uint8", "nodeType": "ElementaryTypeName", - "src": "10814:5:8", + "src": "11648:5:8", "typeDescriptions": {} } }, - "id": 23966, + "id": 24017, "isConstant": false, "isLValue": false, "isPure": false, @@ -9933,43 +10734,43 @@ "lValueRequested": false, "names": [], "nodeType": "FunctionCall", - "src": "10814:14:8", + "src": "11648:14:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, - "src": "10796:32:8", + "src": "11630:32:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "10785:43:8", + "src": "11619:43:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "id": 23969, + "id": 24020, "nodeType": "ExpressionStatement", - "src": "10785:43:8" + "src": "11619:43:8" }, { "assignments": [ - 23971 + 24022 ], "declarations": [ { "constant": false, - "id": 23971, + "id": 24022, "mutability": "mutable", "name": "target", - "nameLocation": "10846:6:8", + "nameLocation": "11680:6:8", "nodeType": "VariableDeclaration", - "scope": 23984, - "src": "10838:14:8", + "scope": 24035, + "src": "11672:14:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -9977,10 +10778,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23970, + "id": 24021, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "10838:7:8", + "src": "11672:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -9989,24 +10790,24 @@ "visibility": "internal" } ], - "id": 23981, + "id": 24032, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23980, + "id": 24031, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23972, + "id": 24023, "name": "mantissa", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23934, - "src": "10855:8:8", + "referencedDeclaration": 23985, + "src": "11689:8:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10021,21 +10822,21 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23978, + "id": 24029, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "hexValue": "38", - "id": 23973, + "id": 24024, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10868:1:8", + "src": "11702:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_8_by_1", "typeString": "int_const 8" @@ -10051,18 +10852,18 @@ "typeIdentifier": "t_uint256", "typeString": "uint256" }, - "id": 23976, + "id": 24027, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { - "id": 23974, + "id": 24025, "name": "exp", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23925, - "src": "10873:3:8", + "referencedDeclaration": 23976, + "src": "11707:3:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10072,86 +10873,86 @@ "operator": "-", "rightExpression": { "hexValue": "33", - "id": 23975, + "id": 24026, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", - "src": "10879:1:8", + "src": "11713:1:8", "typeDescriptions": { "typeIdentifier": "t_rational_3_by_1", "typeString": "int_const 3" }, "value": "3" }, - "src": "10873:7:8", + "src": "11707:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23977, + "id": 24028, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "10872:9:8", + "src": "11706:9:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "10868:13:8", + "src": "11702:13:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], - "id": 23979, + "id": 24030, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", - "src": "10867:15:8", + "src": "11701:15:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "src": "10855:27:8", + "src": "11689:27:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", - "src": "10838:44:8" + "src": "11672:44:8" }, { "expression": { - "id": 23982, + "id": 24033, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], - "referencedDeclaration": 23971, - "src": "10899:6:8", + "referencedDeclaration": 24022, + "src": "11733:6:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, - "functionReturnParameters": 23923, - "id": 23983, + "functionReturnParameters": 23974, + "id": 24034, "nodeType": "Return", - "src": "10892:13:8" + "src": "11726:13:8" } ] }, @@ -10160,20 +10961,20 @@ "kind": "function", "modifiers": [], "name": "getTarget", - "nameLocation": "10303:9:8", + "nameLocation": "11137:9:8", "parameters": { - "id": 23920, + "id": 23971, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23919, + "id": 23970, "mutability": "mutable", "name": "bits", - "nameLocation": "10321:4:8", + "nameLocation": "11155:4:8", "nodeType": "VariableDeclaration", - "scope": 23985, - "src": "10313:12:8", + "scope": 24036, + "src": "11147:12:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10181,10 +10982,10 @@ "typeString": "bytes32" }, "typeName": { - "id": 23918, + "id": 23969, "name": "bytes32", "nodeType": "ElementaryTypeName", - "src": "10313:7:8", + "src": "11147:7:8", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" @@ -10193,21 +10994,21 @@ "visibility": "internal" } ], - "src": "10312:14:8" + "src": "11146:14:8" }, "returnParameters": { - "id": 23923, + "id": 23974, "nodeType": "ParameterList", "parameters": [ { "constant": false, - "id": 23922, + "id": 23973, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", - "scope": 23985, - "src": "10348:7:8", + "scope": 24036, + "src": "11182:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { @@ -10215,10 +11016,10 @@ "typeString": "uint256" }, "typeName": { - "id": 23921, + "id": 23972, "name": "uint256", "nodeType": "ElementaryTypeName", - "src": "10348:7:8", + "src": "11182:7:8", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" @@ -10227,9 +11028,9 @@ "visibility": "internal" } ], - "src": "10347:9:8" + "src": "11181:9:8" }, - "scope": 23986, + "scope": 24037, "stateMutability": "pure", "virtual": false, "visibility": "public" @@ -10242,12 +11043,12 @@ "id": 23263, "name": "IBtcMirror", "nodeType": "IdentifierPath", - "referencedDeclaration": 25290, - "src": "1484:10:8" + "referencedDeclaration": 25341, + "src": "1452:10:8" }, "id": 23264, "nodeType": "InheritanceSpecifier", - "src": "1484:10:8" + "src": "1452:10:8" } ], "canonicalName": "BtcMirror", @@ -10255,16 +11056,15 @@ "contractKind": "contract", "fullyImplemented": true, "linearizedBaseContracts": [ - 23986, - 25290 + 24037, + 25341 ], "name": "BtcMirror", - "nameLocation": "1471:9:8", - "scope": 23987, + "nameLocation": "1439:9:8", + "scope": 24038, "usedErrors": [] } - ], - "license": "MIT" + ] }, "id": 8 } \ No newline at end of file diff --git a/packages/contracts/src/BtcMirror.sol b/packages/contracts/src/BtcMirror.sol index 8d8079c..c42d281 100644 --- a/packages/contracts/src/BtcMirror.sol +++ b/packages/contracts/src/BtcMirror.sol @@ -1,4 +1,3 @@ -// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; import "./Endian.sol"; @@ -57,7 +56,16 @@ contract BtcMirror is IBtcMirror { uint256 private latestBlockTime; - mapping(uint256 => bytes32) private blockHeightToHash; + /** + * @notice Store the last 2n blocks. Reorgs deeper than n are unsupported. + * (For comparison, the deepest Bitcoin reorg so far was 53 blocks in Aug + * 2010, and anything over 5 blocks would be considered catastrophic today.) + * Storing only the last n blocks saves ~17,000 gas per block. + */ + uint256 constant MAX_ALLOWED_REORG = 500; + uint256 constant NUM_BLOCKS = MAX_ALLOWED_REORG * 2; + bytes32[NUM_BLOCKS] public blockHashes; + uint256 public latestBlockIx; /** @notice Difficulty targets in each retargeting period. */ mapping(uint256 => uint256) public periodToTarget; @@ -80,7 +88,7 @@ contract BtcMirror is IBtcMirror { uint256 _expectedTarget, bool _isTestnet ) { - blockHeightToHash[_blockHeight] = _blockHash; + blockHashes[0] = _blockHash; latestBlockHeight = _blockHeight; latestBlockTime = _blockTime; periodToTarget[_blockHeight / 2016] = _expectedTarget; @@ -89,9 +97,21 @@ contract BtcMirror is IBtcMirror { /** * @notice Returns the Bitcoin block hash at a specific height. + * The block number must not be higher than getLatestBlockHeight(). + * Returns 0 if the block is too old, and we no longer store its hash. */ - function getBlockHash(uint256 number) public view returns (bytes32) { - return blockHeightToHash[number]; + function getBlockHash(uint256 blockNum) public view returns (bytes32) { + require(blockNum <= latestBlockHeight, "Block not yet submitted"); + if (blockNum < latestBlockHeight - MAX_ALLOWED_REORG) { + return 0; + } + return blockHashes[getBlockIx(blockNum)]; + } + + function getBlockIx(uint256 blockNum) private view returns (uint256) { + return + (NUM_BLOCKS + latestBlockIx + blockNum - latestBlockHeight) % + NUM_BLOCKS; } /** @@ -116,9 +136,9 @@ contract BtcMirror is IBtcMirror { uint256 numHeaders = blockHeaders.length / 80; require(numHeaders * 80 == blockHeaders.length, "wrong header length"); require(numHeaders > 0, "must submit at least one block"); + require(blockHeight > latestBlockHeight - MAX_ALLOWED_REORG, "reorg"); // sanity check: the new chain must not end in a past difficulty period - // (BtcMirror does not support a 2-week reorg) uint256 oldPeriod = latestBlockHeight / 2016; uint256 newHeight = blockHeight + numHeaders - 1; uint256 newPeriod = newHeight / 2016; @@ -160,12 +180,6 @@ contract BtcMirror is IBtcMirror { uint256 newWork = getWorkInPeriod(newPeriod, newHeight); require(newWork > oldWork, "insufficient total difficulty"); - // erase any block hashes above newHeight, now invalidated. - // (in case we just accepted a shorter, heavier chain.) - for (uint256 i = newHeight + 1; i <= latestBlockHeight; i++) { - blockHeightToHash[i] = 0; - } - emit NewTotalDifficultySinceRetarget( newHeight, newWork, @@ -180,6 +194,7 @@ contract BtcMirror is IBtcMirror { } // record the new tip height and timestamp + latestBlockIx = getBlockIx(newHeight); latestBlockHeight = newHeight; uint256 ixT = blockHeaders.length - 12; uint32 time = uint32(bytes4(blockHeaders[ixT:ixT + 4])); @@ -219,21 +234,25 @@ contract BtcMirror is IBtcMirror { // optimistically save the block hash // we'll revert if the header turns out to be invalid - bytes32 oldHash = blockHeightToHash[blockHeight]; bytes32 newHash = bytes32(blockHashNum); - if (oldHash != bytes32(0) && oldHash != newHash) { + uint256 blockIx = getBlockIx(blockHeight); + if ( + blockHeight <= latestBlockHeight && blockHashes[blockIx] != newHash + ) { // if we're overwriting a non-zero block hash, that block is reorged numReorged = 1; } - // this is the most expensive line. 20,000 gas to use a new storage slot - blockHeightToHash[blockHeight] = newHash; + // this is the most expensive line + // 20k gas to use a new storage slot initially, 3k once array is full + blockHashes[blockIx] = newHash; // verify previous hash bytes32 prevHash = bytes32( Endian.reverse256(uint256(bytes32(blockHeader[4:36]))) ); - require(prevHash == blockHeightToHash[blockHeight - 1], "bad parent"); - require(prevHash != bytes32(0), "parent block not yet submitted"); + bytes32 parent = blockHashes[(blockIx + NUM_BLOCKS - 1) % NUM_BLOCKS]; + require(parent != bytes32(0), "parent block not yet submitted"); + require(prevHash == parent, "bad parent"); // verify proof-of-work bytes32 bits = bytes32(blockHeader[72:76]); diff --git a/packages/contracts/test/BtcTxVerifier.t.sol b/packages/contracts/test/BtcTxVerifier.t.sol index b3839ed..9d0df49 100644 --- a/packages/contracts/test/BtcTxVerifier.t.sol +++ b/packages/contracts/test/BtcTxVerifier.t.sol @@ -95,6 +95,6 @@ contract BtcTxVerifierTest is DSTest { assertTrue(!verif.verifyPayment(1, 736000, txP, 1, destSH, 25200000)); vm.expectRevert("Block hash mismatch"); - assertTrue(!verif.verifyPayment(1, 700000, txP, 0, destSH, 25200000)); + assertTrue(!verif.verifyPayment(1, 735990, txP, 0, destSH, 25200000)); } }