Contract 0xe78996a233895be74a66f451f1019ca9734205cc 3

Contract Overview

Balance:
346.191426100100000008 xDAI

xDAI Value:
$346.63 (@ $1.00/xDAI)
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xaf79384443aa627e1beff8d114c03b7716f513e384d2f8548e01b0416a0eb91cSubmit Answer251867652022-11-27 17:28:4021 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001544565
0xdb44f5ee9208878b4c46b6b414028b258b422c19b5694e4acf0b2b2d31233162Submit Answer251867642022-11-27 17:28:3021 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0xcee41c8e1930f707d20f0d6f5d2eefda9ee58de36b986de68c7f12fd6c92f94dSubmit Answer251867552022-11-27 17:27:4522 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001544565
0x249d13bf6fb8868687eb81d8bd66b7abd5d8b78850ec23a5a40b78bd07d8eaa5Submit Answer251867532022-11-27 17:27:3522 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0xe7025c0237bfedce4bb9524c9e9bc83b7075fd743751a9aba8abd72cb3592192Submit Answer251867452022-11-27 17:26:5023 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001544565
0xc72b69faf296504dfbeec031f87d46050ee18ddf826f88ddce026ff8f75bf8a9Submit Answer251867422022-11-27 17:26:3523 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001544565
0x59520846560344f28ae50b8fdde3260fe8ddabbc0344a9474fa414ac2cb8e5fcSubmit Answer251867392022-11-27 17:26:2023 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001544565
0x33601e1c5568507497903e5e02071b69054a90a1e9d5e26bde73584254a28ed6Submit Answer251867382022-11-27 17:26:1023 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0x718102ff5da6c3c35db568dfbd7d6c8f1b19eaffe9dd1bb9ab5187a7f9736b0cSubmit Answer251867312022-11-27 17:25:3524 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0xfb5679cb4e85001bae8e81928db1b08dabdaff080e63e08d9ce5a7c10ac73df8Submit Answer251867302022-11-27 17:25:3024 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.00019976374
0xaf5773bf87d26f165439c5dcab678fc17e9646ac222a942f6a5f40d921e57028Submit Answer251867272022-11-27 17:25:1524 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0x0bb802d18d30b3e0a691bb3ef22f28be939c1f94cb9f1f23a3c083d7cef88fb7Submit Answer251867242022-11-27 17:24:5525 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001544565
0x8ce299c2f67c7b28a0a4abeee1eac12eb0234a0c79c8db4d937cf0c9a36440feSubmit Answer251867132022-11-27 17:24:0026 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0xefdd82ab5e98ef31344c4ebcb4e36f36788ce965f789c0e61247714f7416762fSubmit Answer251867122022-11-27 17:23:5026 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0xef269a1013752f064a0aba05d7d3c6897db5b91af69a2b84cd81ff36912e7d41Submit Answer251867042022-11-27 17:23:1026 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001244985
0x3784da09a12b12ef1cdb2d499d31807cc0a2d094bc64e2821a55f69d78068331Submit Answer251867022022-11-27 17:23:0027 mins ago0x130f5e56220c218953824d2997c4870961cbdd24 IN  0xe78996a233895be74a66f451f1019ca9734205cc0.01 xDAI0.0001544565
0x6ff36dc6fbcd2df13a37a645a3d800c96c60348cf19663f6b5feb8541f6068eaSubmit Answer251860252022-11-27 16:22:151 hr 27 mins ago0x5e7b645d5bf86750cb1913122ba8a8545e2a9fd1 IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.000179682606
0x4ee50815e7e832578d86701715f43d14443f2fcc7c349550d5b889b2b58fd1c6Ask Question Wit...251860162022-11-27 16:21:251 hr 28 mins ago0x209469c921db9d5bd77084370e80b63d5cdd63c1 IN  0xe78996a233895be74a66f451f1019ca9734205cc0 xDAI0.0002881725
0x9654901594bac6045d3d623a1f1aa80c693ab15b5c14dda0e4d0a10f9ccc0295Submit Answer251756352022-11-27 0:49:1517 hrs ago0x1f5fae0615ee87196f229ea19d726d58846bdc0e IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.0002001692
0xc35f4a8c6954a95c3a547b635ab34374333cfe288e4c8a07d095a577cc6a3188Submit Answer251756252022-11-27 0:48:2017 hrs 1 min ago0x1f5fae0615ee87196f229ea19d726d58846bdc0e IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.00015477
0x7178692bfc592103f098ed4e4b7fe060ce81e0f51bd84f0e4bf7e54a1779580fSubmit Answer251756222022-11-27 0:48:0517 hrs 1 min ago0x1f5fae0615ee87196f229ea19d726d58846bdc0e IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.00015477
0x68c30d8e4faccc79cb0dc5851241e5e9b55d20ff7c1395065f5efec4c16b733aSubmit Answer251732062022-11-26 21:11:1020 hrs 38 mins ago0x9c2b07dd951edae10fbf58bb98a1448cde417f58 IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.00016153992
0xf4feffb9b81eb565fe9d514dfd0675ba75bb1d10aae4af0dc6873b1d576059aaSubmit Answer251731822022-11-26 21:09:0020 hrs 41 mins ago0x748930339a9505b20db819ff6df217944633122d IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.00015477
0xf683ddddaefd9789e4cdaae641ebd5be868da227b4a162540c62eb9bd42d1c4fSubmit Answer251731762022-11-26 21:08:3020 hrs 41 mins ago0x748930339a9505b20db819ff6df217944633122d IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.00015477
0xa606142de1ad0d76cc316d2d64c206ed37ad5a00557a88430e968cb6e8c04a14Submit Answer251731722022-11-26 21:08:0520 hrs 41 mins ago0x748930339a9505b20db819ff6df217944633122d IN  0xe78996a233895be74a66f451f1019ca9734205cc5 xDAI0.00015477
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x1bf90ff50e60be033617ebd407d41fdd71e2351ea15e3ac69e2e2c54e8fefae0251731682022-11-26 21:07:4520 hrs 42 mins ago 0xe78996a233895be74a66f451f1019ca9734205cc0x748930339a9505b20db819ff6df217944633122d10 xDAI
0x03eccb04e3139e712821a876f3889924814e6b935605f0aba4e83e3ca42515c6251683362022-11-26 13:53:551 day 3 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae615 xDAI
0xb72daa3f3d120a504754c28c2ba6ecb866d07ebcadf3b279ed84f4b4ba19097e251579242022-11-25 22:19:051 day 19 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae630 xDAI
0x54c09cf51a6926d3df6313045b2e0234086e13ff692deb9cefb3ef8d5dac2b25251530482022-11-25 15:02:052 days 2 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x4ca2a670bd5505b870b21331a53d9bb4ae6e20845 xDAI
0xbe52cb4e3914e1b608526a2ce9a8ffaa54a8568311487ae52667a7f5eb836386251530312022-11-25 15:00:302 days 2 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0xc9534a59ef121516e5e1aead8d45d151e768e21635 xDAI
0xf22eb91e9877ca240337f759941976bb101d4100edd6bc53b8f74dd5b5f78ca9251520442022-11-25 13:32:102 days 4 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x6687c671980e65ebd722b9146fc61e2471558dd65 xDAI
0x1e5a3bfd4aa70287fb6b98fa5894c60c48f4a9839db62f5825316e631d941195251422412022-11-24 22:51:252 days 18 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0xfd4ba0a1c08e0af938a2b1ac06e8937c8535ec9329.875 xDAI
0xea2f15a1f84359912701bf39e86db8861e6b8a08611e4315800304de613ff483251360512022-11-24 13:38:253 days 4 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae620 xDAI
0xb3503eb6573440b7b84aa022b996cd8dc7a0db1768dcf2bf63ea169d81c6fa88251272532022-11-24 0:31:553 days 17 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0xc9534a59ef121516e5e1aead8d45d151e768e21610 xDAI
0x34d830532de61378e1c8571ad1f567a6fdd9d644ca9f9f716565fb599c4990f0250949152022-11-22 0:21:305 days 17 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0xfd4ba0a1c08e0af938a2b1ac06e8937c8535ec9325 xDAI
0xc76b768dd9d757c721117212841539112c2331cba9eb4140747f8dddb770d5c7249139162022-11-09 12:26:1018 days 5 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x748930339a9505b20db819ff6df217944633122d5 xDAI
0x8798ca193ce53d0116ac4c326c76731133deaf2acdd8dc5963378d8ff730e43a249095022022-11-09 3:14:1018 days 14 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0xb011122194c0487fe9214c9fc9a73ec770e94eae210 xDAI
0x765c4201347597b30aa418de47128930749290249d574e50ad282029cbf3170e249094952022-11-09 3:13:2018 days 14 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x129d7b969e56339bb417b58a4f8caaec8f438ace25 xDAI
0x6c8203679b5496389faf086bb877fc0a85fa3e8043b10b1067d5c1ce7a648462249033082022-11-08 14:19:0019 days 3 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0xc9534a59ef121516e5e1aead8d45d151e768e21650 xDAI
0xaaffc73f5aa4645d3807a1c3e474a56948cd9eb2c94f53312705e93a6c6d3d21248579072022-11-04 15:42:2023 days 2 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae650 xDAI
0x9e52f952e3b6637700f762ab0ca82e519d9ca5af2193a9733f4c36b6c6a769b4248214872022-11-01 18:43:2025 days 23 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae610 xDAI
0xd98c2854d881c063ed0756a19c914ff0a4fdf44e7dac0ce23098a3d090485731248183972022-11-01 12:52:0526 days 4 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x6c6234983bcf60d4497cd8ee416ba04600a0a4c20.0001 xDAI
0x2bfa90a26f8210ee9e98c73f863f3717f88de9f1d5ba55ecf986e75211d03183248142922022-11-01 5:05:2526 days 12 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae640 xDAI
0xd6b7f64eb28f68c8257036387a48681492c8f8296130be4c602c95526f13708b248069892022-10-31 15:15:3027 days 2 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae610 xDAI
0x190fc8b3182dc1462192a1a5c8be156d4df8c6a98d644c5f31a8f25e0fa5e0e1248010982022-10-31 4:05:3527 days 13 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae6185 xDAI
0x6f4ec11553357164d8396d7d5aeb82ccfb51ac6362ea6773459cb13f7b60a406247942912022-10-30 15:11:5028 days 2 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x8b8cfa966a1f1c758e804a015410d77cf50b3b9220 xDAI
0xe190d55077a0b5d24bdcca84402b2aa541e167c4cdd4307c7f20acfcdc8292c6247942822022-10-30 15:10:5528 days 2 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae665 xDAI
0x942a82087dc60c780aaf6bac9b29b467203796141e14f82d794243a5cae72608247689552022-10-28 13:44:1530 days 4 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x78da2bce1d0d8f81cd72c7274a2c4683b42b3ae665 xDAI
0x5083486ea92800fb71cd3e4bc9924e4cdce1e7917f8d50e700a2f8f5f7c380d0247685502022-10-28 12:56:4030 days 4 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0x2a7392691a8478d2773e8c601cc7a8f7b6461b540.01 xDAI
0x3a23f36d8b700430e9f4a2d5101c61691bcb5ae0705e25c5e73819dc8406b629247504882022-10-27 1:19:0531 days 16 hrs ago 0xe78996a233895be74a66f451f1019ca9734205cc0xc9534a59ef121516e5e1aead8d45d151e768e21650 xDAI
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RealityETH_v3_0

Compiler Version
v0.8.6+commit.11564f7e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at gnosisscan.io on 2022-08-04
*/

// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.6;

contract BalanceHolder {

    mapping(address => uint256) public balanceOf;

    event LogWithdraw(
        address indexed user,
        uint256 amount
    );

    function withdraw() 
    public {
        uint256 bal = balanceOf[msg.sender];
        balanceOf[msg.sender] = 0;
        payable(msg.sender).transfer(bal);
        emit LogWithdraw(msg.sender, bal);
    }

}

contract RealityETH_v3_0 is BalanceHolder {

    address constant NULL_ADDRESS = address(0);

    // History hash when no history is created, or history has been cleared
    bytes32 constant NULL_HASH = bytes32(0);

    // An unitinalized finalize_ts for a question will indicate an unanswered question.
    uint32 constant UNANSWERED = 0;

    // An unanswered reveal_ts for a commitment will indicate that it does not exist.
    uint256 constant COMMITMENT_NON_EXISTENT = 0;

    // Commit->reveal timeout is 1/8 of the question timeout (rounded down).
    uint32 constant COMMITMENT_TIMEOUT_RATIO = 8;

    // Proportion withheld when you claim an earlier bond.
    uint256 constant BOND_CLAIM_FEE_PROPORTION = 40; // One 40th ie 2.5%

    // Special value representing a question that was answered too soon.
    // bytes32(-2). By convention we use bytes32(-1) for "invalid", although the contract does not handle this.
    bytes32 constant UNRESOLVED_ANSWER = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe;

    event LogSetQuestionFee(
        address arbitrator,
        uint256 amount
    );

    event LogNewTemplate(
        uint256 indexed template_id,
        address indexed user, 
        string question_text
    );

    event LogNewQuestion(
        bytes32 indexed question_id,
        address indexed user, 
        uint256 template_id,
        string question,
        bytes32 indexed content_hash,
        address arbitrator, 
        uint32 timeout,
        uint32 opening_ts,
        uint256 nonce,
        uint256 created
    );

    event LogMinimumBond(
        bytes32 indexed question_id,
        uint256 min_bond
    );

    event LogFundAnswerBounty(
        bytes32 indexed question_id,
        uint256 bounty_added,
        uint256 bounty,
        address indexed user 
    );

    event LogNewAnswer(
        bytes32 answer,
        bytes32 indexed question_id,
        bytes32 history_hash,
        address indexed user,
        uint256 bond,
        uint256 ts,
        bool is_commitment
    );

    event LogAnswerReveal(
        bytes32 indexed question_id, 
        address indexed user, 
        bytes32 indexed answer_hash, 
        bytes32 answer, 
        uint256 nonce, 
        uint256 bond
    );

    event LogNotifyOfArbitrationRequest(
        bytes32 indexed question_id,
        address indexed user 
    );

    event LogCancelArbitration(
        bytes32 indexed question_id
    );

    event LogFinalize(
        bytes32 indexed question_id,
        bytes32 indexed answer
    );

    event LogClaim(
        bytes32 indexed question_id,
        address indexed user,
        uint256 amount
    );

    event LogReopenQuestion(
        bytes32 indexed question_id,
        bytes32 indexed reopened_question_id
    );

    struct Question {
        bytes32 content_hash;
        address arbitrator;
        uint32 opening_ts;
        uint32 timeout;
        uint32 finalize_ts;
        bool is_pending_arbitration;
        uint256 bounty;
        bytes32 best_answer;
        bytes32 history_hash;
        uint256 bond;
        uint256 min_bond;
    }

    // Stored in a mapping indexed by commitment_id, a hash of commitment hash, question, bond. 
    struct Commitment {
        uint32 reveal_ts;
        bool is_revealed;
        bytes32 revealed_answer;
    }

    // Only used when claiming more bonds than fits into a transaction
    // Stored in a mapping indexed by question_id.
    struct Claim {
        address payee;
        uint256 last_bond;
        uint256 queued_funds;
    }

    uint256 nextTemplateID = 0;
    mapping(uint256 => uint256) public templates;
    mapping(uint256 => bytes32) public template_hashes;
    mapping(bytes32 => Question) public questions;
    mapping(bytes32 => Claim) public question_claims;
    mapping(bytes32 => Commitment) public commitments;
    mapping(address => uint256) public arbitrator_question_fees; 
    mapping(bytes32 => bytes32) public reopened_questions;
    mapping(bytes32 => bool) public reopener_questions;


    modifier onlyArbitrator(bytes32 question_id) {
        require(msg.sender == questions[question_id].arbitrator, "msg.sender must be arbitrator");
        _;
    }

    modifier stateAny() {
        _;
    }

    modifier stateNotCreated(bytes32 question_id) {
        require(questions[question_id].timeout == 0, "question must not exist");
        _;
    }

    modifier stateOpen(bytes32 question_id) {
        require(questions[question_id].timeout > 0, "question must exist");
        require(!questions[question_id].is_pending_arbitration, "question must not be pending arbitration");
        uint32 finalize_ts = questions[question_id].finalize_ts;
        require(finalize_ts == UNANSWERED || finalize_ts > uint32(block.timestamp), "finalization deadline must not have passed");
        uint32 opening_ts = questions[question_id].opening_ts;
        require(opening_ts == 0 || opening_ts <= uint32(block.timestamp), "opening date must have passed"); 
        _;
    }

    modifier statePendingArbitration(bytes32 question_id) {
        require(questions[question_id].is_pending_arbitration, "question must be pending arbitration");
        _;
    }

    modifier stateOpenOrPendingArbitration(bytes32 question_id) {
        require(questions[question_id].timeout > 0, "question must exist");
        uint32 finalize_ts = questions[question_id].finalize_ts;
        require(finalize_ts == UNANSWERED || finalize_ts > uint32(block.timestamp), "finalization dealine must not have passed");
        uint32 opening_ts = questions[question_id].opening_ts;
        require(opening_ts == 0 || opening_ts <= uint32(block.timestamp), "opening date must have passed"); 
        _;
    }

    modifier stateFinalized(bytes32 question_id) {
        require(isFinalized(question_id), "question must be finalized");
        _;
    }

    modifier bondMustDoubleAndMatchMinimum(bytes32 question_id) {
        require(msg.value > 0, "bond must be positive"); 
        uint256 current_bond = questions[question_id].bond;
        if (current_bond == 0) {
            require(msg.value >= (questions[question_id].min_bond), "bond must exceed the minimum");
        } else {
            require(msg.value >= (current_bond * 2), "bond must be double at least previous bond");
        }
        _;
    }

    modifier previousBondMustNotBeatMaxPrevious(bytes32 question_id, uint256 max_previous) {
        if (max_previous > 0) {
            require(questions[question_id].bond <= max_previous, "bond must exceed max_previous");
        }
        _;
    }

    /// @notice Constructor, sets up some initial templates
    /// @dev Creates some generalized templates for different question types used in the DApp.
    constructor() {
        createTemplate('{"title": "%s", "type": "bool", "category": "%s", "lang": "%s"}');
        createTemplate('{"title": "%s", "type": "uint", "decimals": 18, "category": "%s", "lang": "%s"}');
        createTemplate('{"title": "%s", "type": "single-select", "outcomes": [%s], "category": "%s", "lang": "%s"}');
        createTemplate('{"title": "%s", "type": "multiple-select", "outcomes": [%s], "category": "%s", "lang": "%s"}');
        createTemplate('{"title": "%s", "type": "datetime", "category": "%s", "lang": "%s"}');
    }

    /// @notice Function for arbitrator to set an optional per-question fee. 
    /// @dev The per-question fee, charged when a question is asked, is intended as an anti-spam measure.
    /// @param fee The fee to be charged by the arbitrator when a question is asked
    function setQuestionFee(uint256 fee) 
        stateAny() 
    external {
        arbitrator_question_fees[msg.sender] = fee;
        emit LogSetQuestionFee(msg.sender, fee);
    }

    /// @notice Create a reusable template, which should be a JSON document.
    /// Placeholders should use gettext() syntax, eg %s.
    /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
    /// @param content The template content
    /// @return The ID of the newly-created template, which is created sequentially.
    function createTemplate(string memory content) 
        stateAny()
    public returns (uint256) {
        uint256 id = nextTemplateID;
        templates[id] = block.number;
        template_hashes[id] = keccak256(abi.encodePacked(content));
        emit LogNewTemplate(id, msg.sender, content);
        nextTemplateID = id + 1;
        return id;
    }

    /// @notice Create a new reusable template and use it to ask a question
    /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
    /// @param content The template content
    /// @param question A string containing the parameters that will be passed into the template to make the question
    /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
    /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
    /// @param opening_ts If set, the earliest time it should be possible to answer the question.
    /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
    /// @return The ID of the newly-created template, which is created sequentially.
    function createTemplateAndAskQuestion(
        string memory content, 
        string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce 
    ) 
        // stateNotCreated is enforced by the internal _askQuestion
    public payable returns (bytes32) {
        uint256 template_id = createTemplate(content);
        return askQuestion(template_id, question, arbitrator, timeout, opening_ts, nonce);
    }

    /// @notice Ask a new question and return the ID
    /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
    /// @param template_id The ID number of the template the question will use
    /// @param question A string containing the parameters that will be passed into the template to make the question
    /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
    /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
    /// @param opening_ts If set, the earliest time it should be possible to answer the question.
    /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
    /// @return The ID of the newly-created question, created deterministically.
    function askQuestion(uint256 template_id, string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce) 
        // stateNotCreated is enforced by the internal _askQuestion
    public payable returns (bytes32) {

        require(templates[template_id] > 0, "template must exist");

        bytes32 content_hash = keccak256(abi.encodePacked(template_id, opening_ts, question));
        bytes32 question_id = keccak256(abi.encodePacked(content_hash, arbitrator, timeout, uint256(0), address(this), msg.sender, nonce));

        // We emit this event here because _askQuestion doesn't need to know the unhashed question. Other events are emitted by _askQuestion.
        emit LogNewQuestion(question_id, msg.sender, template_id, question, content_hash, arbitrator, timeout, opening_ts, nonce, block.timestamp);
        _askQuestion(question_id, content_hash, arbitrator, timeout, opening_ts, 0);

        return question_id;
    }

    /// @notice Ask a new question and return the ID
    /// @dev Template data is only stored in the event logs, but its block number is kept in contract storage.
    /// @param template_id The ID number of the template the question will use
    /// @param question A string containing the parameters that will be passed into the template to make the question
    /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
    /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
    /// @param opening_ts If set, the earliest time it should be possible to answer the question.
    /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
    /// @param min_bond The minimum bond that may be used for an answer.
    /// @return The ID of the newly-created question, created deterministically.
    function askQuestionWithMinBond(uint256 template_id, string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond) 
        // stateNotCreated is enforced by the internal _askQuestion
    public payable returns (bytes32) {

        require(templates[template_id] > 0, "template must exist");

        bytes32 content_hash = keccak256(abi.encodePacked(template_id, opening_ts, question));
        bytes32 question_id = keccak256(abi.encodePacked(content_hash, arbitrator, timeout, min_bond, address(this), msg.sender, nonce));

        // We emit this event here because _askQuestion doesn't need to know the unhashed question.
        // Other events are emitted by _askQuestion.
        emit LogNewQuestion(question_id, msg.sender, template_id, question, content_hash, arbitrator, timeout, opening_ts, nonce, block.timestamp);
        _askQuestion(question_id, content_hash, arbitrator, timeout, opening_ts, min_bond);

        return question_id;
    }

    function _askQuestion(bytes32 question_id, bytes32 content_hash, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 min_bond) 
        stateNotCreated(question_id)
    internal {

        // A timeout of 0 makes no sense, and we will use this to check existence
        require(timeout > 0, "timeout must be positive"); 
        require(timeout < 365 days, "timeout must be less than 365 days"); 

        uint256 bounty = msg.value;

        // The arbitrator can set a fee for asking a question. 
        // This is intended as an anti-spam defence.
        // The fee is waived if the arbitrator is asking the question.
        // This allows them to set an impossibly high fee and make users proxy the question through them.
        // This would allow more sophisticated pricing, question whitelisting etc.
        if (arbitrator != NULL_ADDRESS && msg.sender != arbitrator) {
            uint256 question_fee = arbitrator_question_fees[arbitrator];
            require(bounty >= question_fee, "ETH provided must cover question fee"); 
            bounty = bounty - question_fee;
            balanceOf[arbitrator] = balanceOf[arbitrator] + question_fee;
        }

        questions[question_id].content_hash = content_hash;
        questions[question_id].arbitrator = arbitrator;
        questions[question_id].opening_ts = opening_ts;
        questions[question_id].timeout = timeout;

        if (bounty > 0) {
            questions[question_id].bounty = bounty;
            emit LogFundAnswerBounty(question_id, bounty, bounty, msg.sender);
        }

        if (min_bond > 0) {
            questions[question_id].min_bond = min_bond;
            emit LogMinimumBond(question_id, min_bond);
        }

    }

    /// @notice Add funds to the bounty for a question
    /// @dev Add bounty funds after the initial question creation. Can be done any time until the question is finalized.
    /// @param question_id The ID of the question you wish to fund
    function fundAnswerBounty(bytes32 question_id) 
        stateOpen(question_id)
    external payable {
        questions[question_id].bounty = questions[question_id].bounty + msg.value;
        emit LogFundAnswerBounty(question_id, msg.value, questions[question_id].bounty, msg.sender);
    }

    /// @notice Submit an answer for a question.
    /// @dev Adds the answer to the history and updates the current "best" answer.
    /// May be subject to front-running attacks; Substitute submitAnswerCommitment()->submitAnswerReveal() to prevent them.
    /// @param question_id The ID of the question
    /// @param answer The answer, encoded into bytes32
    /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
    function submitAnswer(bytes32 question_id, bytes32 answer, uint256 max_previous) 
        stateOpen(question_id)
        bondMustDoubleAndMatchMinimum(question_id)
        previousBondMustNotBeatMaxPrevious(question_id, max_previous)
    external payable {
        _addAnswerToHistory(question_id, answer, msg.sender, msg.value, false);
        _updateCurrentAnswer(question_id, answer);
    }

    /// @notice Submit an answer for a question, crediting it to the specified account.
    /// @dev Adds the answer to the history and updates the current "best" answer.
    /// May be subject to front-running attacks; Substitute submitAnswerCommitment()->submitAnswerReveal() to prevent them.
    /// @param question_id The ID of the question
    /// @param answer The answer, encoded into bytes32
    /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
    /// @param answerer The account to which the answer should be credited
    function submitAnswerFor(bytes32 question_id, bytes32 answer, uint256 max_previous, address answerer)
        stateOpen(question_id)
        bondMustDoubleAndMatchMinimum(question_id)
        previousBondMustNotBeatMaxPrevious(question_id, max_previous)
    external payable {
        require(answerer != NULL_ADDRESS, "answerer must be non-zero");
        _addAnswerToHistory(question_id, answer, answerer, msg.value, false);
        _updateCurrentAnswer(question_id, answer);
    }

    // @notice Verify and store a commitment, including an appropriate timeout
    // @param question_id The ID of the question to store
    // @param commitment The ID of the commitment
    function _storeCommitment(bytes32 question_id, bytes32 commitment_id) 
    internal
    {
        require(commitments[commitment_id].reveal_ts == COMMITMENT_NON_EXISTENT, "commitment must not already exist");

        uint32 commitment_timeout = questions[question_id].timeout / COMMITMENT_TIMEOUT_RATIO;
        commitments[commitment_id].reveal_ts = uint32(block.timestamp) + commitment_timeout;
    }

    /// @notice Submit the hash of an answer, laying your claim to that answer if you reveal it in a subsequent transaction.
    /// @dev Creates a hash, commitment_id, uniquely identifying this answer, to this question, with this bond.
    /// The commitment_id is stored in the answer history where the answer would normally go.
    /// Does not update the current best answer - this is left to the later submitAnswerReveal() transaction.
    /// @param question_id The ID of the question
    /// @param answer_hash The hash of your answer, plus a nonce that you will later reveal
    /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
    /// @param _answerer If specified, the address to be given as the question answerer. Defaults to the sender.
    /// @dev Specifying the answerer is useful if you want to delegate the commit-and-reveal to a third-party.
    function submitAnswerCommitment(bytes32 question_id, bytes32 answer_hash, uint256 max_previous, address _answerer) 
        stateOpen(question_id)
        bondMustDoubleAndMatchMinimum(question_id)
        previousBondMustNotBeatMaxPrevious(question_id, max_previous)
    external payable {

        bytes32 commitment_id = keccak256(abi.encodePacked(question_id, answer_hash, msg.value));
        address answerer = (_answerer == NULL_ADDRESS) ? msg.sender : _answerer;
        _storeCommitment(question_id, commitment_id);
        _addAnswerToHistory(question_id, commitment_id, answerer, msg.value, true);

    }

    /// @notice Submit the answer whose hash you sent in a previous submitAnswerCommitment() transaction
    /// @dev Checks the parameters supplied recreate an existing commitment, and stores the revealed answer
    /// Updates the current answer unless someone has since supplied a new answer with a higher bond
    /// msg.sender is intentionally not restricted to the user who originally sent the commitment; 
    /// For example, the user may want to provide the answer+nonce to a third-party service and let them send the tx
    /// NB If we are pending arbitration, it will be up to the arbitrator to wait and see any outstanding reveal is sent
    /// @param question_id The ID of the question
    /// @param answer The answer, encoded as bytes32
    /// @param nonce The nonce that, combined with the answer, recreates the answer_hash you gave in submitAnswerCommitment()
    /// @param bond The bond that you paid in your submitAnswerCommitment() transaction
    function submitAnswerReveal(bytes32 question_id, bytes32 answer, uint256 nonce, uint256 bond) 
        stateOpenOrPendingArbitration(question_id)
    external {

        bytes32 answer_hash = keccak256(abi.encodePacked(answer, nonce));
        bytes32 commitment_id = keccak256(abi.encodePacked(question_id, answer_hash, bond));

        require(!commitments[commitment_id].is_revealed, "commitment must not have been revealed yet");
        require(commitments[commitment_id].reveal_ts > uint32(block.timestamp), "reveal deadline must not have passed");

        commitments[commitment_id].revealed_answer = answer;
        commitments[commitment_id].is_revealed = true;

        if (bond == questions[question_id].bond) {
            _updateCurrentAnswer(question_id, answer);
        }

        emit LogAnswerReveal(question_id, msg.sender, answer_hash, answer, nonce, bond);

    }

    function _addAnswerToHistory(bytes32 question_id, bytes32 answer_or_commitment_id, address answerer, uint256 bond, bool is_commitment) 
    internal 
    {
        bytes32 new_history_hash = keccak256(abi.encodePacked(questions[question_id].history_hash, answer_or_commitment_id, bond, answerer, is_commitment));

        // Update the current bond level, if there's a bond (ie anything except arbitration)
        if (bond > 0) {
            questions[question_id].bond = bond;
        }
        questions[question_id].history_hash = new_history_hash;

        emit LogNewAnswer(answer_or_commitment_id, question_id, new_history_hash, answerer, bond, block.timestamp, is_commitment);
    }

    function _updateCurrentAnswer(bytes32 question_id, bytes32 answer)
    internal {
        questions[question_id].best_answer = answer;
        questions[question_id].finalize_ts = uint32(block.timestamp) + questions[question_id].timeout;
    }

    // Like _updateCurrentAnswer but without advancing the timeout
    function _updateCurrentAnswerByArbitrator(bytes32 question_id, bytes32 answer)
    internal {
        questions[question_id].best_answer = answer;
        questions[question_id].finalize_ts = uint32(block.timestamp);
    }

    /// @notice Notify the contract that the arbitrator has been paid for a question, freezing it pending their decision.
    /// @dev The arbitrator contract is trusted to only call this if they've been paid, and tell us who paid them.
    /// @param question_id The ID of the question
    /// @param requester The account that requested arbitration
    /// @param max_previous If specified, reverts if a bond higher than this was submitted after you sent your transaction.
    function notifyOfArbitrationRequest(bytes32 question_id, address requester, uint256 max_previous) 
        onlyArbitrator(question_id)
        stateOpen(question_id)
        previousBondMustNotBeatMaxPrevious(question_id, max_previous)
    external {
        require(questions[question_id].finalize_ts > UNANSWERED, "Question must already have an answer when arbitration is requested");
        questions[question_id].is_pending_arbitration = true;
        emit LogNotifyOfArbitrationRequest(question_id, requester);
    }

    /// @notice Cancel a previously-requested arbitration and extend the timeout
    /// @dev Useful when doing arbitration across chains that can't be requested atomically
    /// @param question_id The ID of the question
    function cancelArbitration(bytes32 question_id) 
        onlyArbitrator(question_id)
        statePendingArbitration(question_id)
    external {
        questions[question_id].is_pending_arbitration = false;
        questions[question_id].finalize_ts = uint32(block.timestamp) + questions[question_id].timeout;
        emit LogCancelArbitration(question_id);
    }

    /// @notice Submit the answer for a question, for use by the arbitrator.
    /// @dev Doesn't require (or allow) a bond.
    /// If the current final answer is correct, the account should be whoever submitted it.
    /// If the current final answer is wrong, the account should be whoever paid for arbitration.
    /// However, the answerer stipulations are not enforced by the contract.
    /// @param question_id The ID of the question
    /// @param answer The answer, encoded into bytes32
    /// @param answerer The account credited with this answer for the purpose of bond claims
    function submitAnswerByArbitrator(bytes32 question_id, bytes32 answer, address answerer) 
        onlyArbitrator(question_id)
        statePendingArbitration(question_id)
    public {

        require(answerer != NULL_ADDRESS, "answerer must be provided");
        emit LogFinalize(question_id, answer);

        questions[question_id].is_pending_arbitration = false;
        _addAnswerToHistory(question_id, answer, answerer, 0, false);
        _updateCurrentAnswerByArbitrator(question_id, answer);

    }

    /// @notice Submit the answer for a question, for use by the arbitrator, working out the appropriate winner based on the last answer details.
    /// @dev Doesn't require (or allow) a bond.
    /// @param question_id The ID of the question
    /// @param answer The answer, encoded into bytes32
    /// @param payee_if_wrong The account to by credited as winner if the last answer given is wrong, usually the account that paid the arbitrator
    /// @param last_history_hash The history hash before the final one
    /// @param last_answer_or_commitment_id The last answer given, or the commitment ID if it was a commitment.
    /// @param last_answerer The address that supplied the last answer
    function assignWinnerAndSubmitAnswerByArbitrator(bytes32 question_id, bytes32 answer, address payee_if_wrong, bytes32 last_history_hash, bytes32 last_answer_or_commitment_id, address last_answerer) 
    external {
        bool is_commitment = _verifyHistoryInputOrRevert(questions[question_id].history_hash, last_history_hash, last_answer_or_commitment_id, questions[question_id].bond, last_answerer);

        address payee;
        // If the last answer is an unrevealed commit, it's always wrong.
        // For anything else, the last answer was set as the "best answer" in submitAnswer or submitAnswerReveal.
        if (is_commitment && !commitments[last_answer_or_commitment_id].is_revealed) {
            require(commitments[last_answer_or_commitment_id].reveal_ts < uint32(block.timestamp), "You must wait for the reveal deadline before finalizing");
            payee = payee_if_wrong;
        } else {
            payee = (questions[question_id].best_answer == answer) ? last_answerer : payee_if_wrong;
        }
        submitAnswerByArbitrator(question_id, answer, payee);
    }


    /// @notice Report whether the answer to the specified question is finalized
    /// @param question_id The ID of the question
    /// @return Return true if finalized
    function isFinalized(bytes32 question_id) 
    view public returns (bool) {
        uint32 finalize_ts = questions[question_id].finalize_ts;
        return ( !questions[question_id].is_pending_arbitration && (finalize_ts > UNANSWERED) && (finalize_ts <= uint32(block.timestamp)) );
    }

    /// @notice (Deprecated) Return the final answer to the specified question, or revert if there isn't one
    /// @param question_id The ID of the question
    /// @return The answer formatted as a bytes32
    function getFinalAnswer(bytes32 question_id) 
        stateFinalized(question_id)
    external view returns (bytes32) {
        return questions[question_id].best_answer;
    }

    /// @notice Return the final answer to the specified question, or revert if there isn't one
    /// @param question_id The ID of the question
    /// @return The answer formatted as a bytes32
    function resultFor(bytes32 question_id) 
        stateFinalized(question_id)
    public view returns (bytes32) {
        return questions[question_id].best_answer;
    }

    /// @notice Returns whether the question was answered before it had an answer, ie resolved to UNRESOLVED_ANSWER
    /// @param question_id The ID of the question 
    function isSettledTooSoon(bytes32 question_id)
    public view returns(bool) {
        return (resultFor(question_id) == UNRESOLVED_ANSWER);
    }

    /// @notice Like resultFor(), but errors out if settled too soon, or returns the result of a replacement if it was reopened at the right time and settled
    /// @param question_id The ID of the question 
    function resultForOnceSettled(bytes32 question_id)
    external view returns(bytes32) {
        bytes32 result = resultFor(question_id);
        if (result == UNRESOLVED_ANSWER) {
            // Try the replacement
            bytes32 replacement_id = reopened_questions[question_id];
            require(replacement_id != bytes32(0x0), "Question was settled too soon and has not been reopened");
            // We only try one layer down rather than recursing to keep the gas costs predictable
            result = resultFor(replacement_id);
            require(result != UNRESOLVED_ANSWER, "Question replacement was settled too soon and has not been reopened");
        }
        return result;
    }

    /// @notice Asks a new question reopening a previously-asked question that was settled too soon
    /// @dev A special version of askQuestion() that replaces a previous question that was settled too soon
    /// @param template_id The ID number of the template the question will use
    /// @param question A string containing the parameters that will be passed into the template to make the question
    /// @param arbitrator The arbitration contract that will have the final word on the answer if there is a dispute
    /// @param timeout How long the contract should wait after the answer is changed before finalizing on that answer
    /// @param opening_ts If set, the earliest time it should be possible to answer the question.
    /// @param nonce A user-specified nonce used in the question ID. Change it to repeat a question.
    /// @param min_bond The minimum bond that can be used to provide the first answer.
    /// @param reopens_question_id The ID of the question this reopens
    /// @return The ID of the newly-created question, created deterministically.
    function reopenQuestion(uint256 template_id, string memory question, address arbitrator, uint32 timeout, uint32 opening_ts, uint256 nonce, uint256 min_bond, bytes32 reopens_question_id)
        // stateNotCreated is enforced by the internal _askQuestion
    public payable returns (bytes32) {

        require(isSettledTooSoon(reopens_question_id), "You can only reopen questions that resolved as settled too soon");

        bytes32 content_hash = keccak256(abi.encodePacked(template_id, opening_ts, question));

        // A reopening must exactly match the original question, except for the nonce and the creator
        require(content_hash == questions[reopens_question_id].content_hash, "content hash mismatch");
        require(arbitrator == questions[reopens_question_id].arbitrator, "arbitrator mismatch");
        require(timeout == questions[reopens_question_id].timeout, "timeout mismatch");
        require(opening_ts == questions[reopens_question_id].opening_ts , "opening_ts mismatch");
        require(min_bond == questions[reopens_question_id].min_bond, "min_bond mismatch");

        // If the the question was itself reopening some previous question, you'll have to re-reopen the previous question first.
        // This ensures the bounty can be passed on to the next attempt of the original question.
        require(!reopener_questions[reopens_question_id], "Question is already reopening a previous question");

        // A question can only be reopened once, unless the reopening was also settled too soon in which case it can be replaced
        bytes32 existing_reopen_question_id = reopened_questions[reopens_question_id];

        // Normally when we reopen a question we will take its bounty and pass it on to the reopened version.
        bytes32 take_bounty_from_question_id = reopens_question_id;
        // If the question has already been reopened but was again settled too soon, we can transfer its bounty to the next attempt.
        if (existing_reopen_question_id != bytes32(0)) {
            require(isSettledTooSoon(existing_reopen_question_id), "Question has already been reopened");
            // We'll overwrite the reopening with our new question and move the bounty.
            // Once that's done we'll detach the failed reopener and you'll be able to reopen that too if you really want, but without the bounty.
            reopener_questions[existing_reopen_question_id] = false;
            take_bounty_from_question_id = existing_reopen_question_id;
        }

        bytes32 question_id = askQuestionWithMinBond(template_id, question, arbitrator, timeout, opening_ts, nonce, min_bond);

        reopened_questions[reopens_question_id] = question_id;
        reopener_questions[question_id] = true;

        questions[question_id].bounty = questions[take_bounty_from_question_id].bounty + questions[question_id].bounty;
        questions[take_bounty_from_question_id].bounty = 0;

        emit LogReopenQuestion(question_id, reopens_question_id);

        return question_id;
    }

    /// @notice Return the final answer to the specified question, provided it matches the specified criteria.
    /// @dev Reverts if the question is not finalized, or if it does not match the specified criteria.
    /// @param question_id The ID of the question
    /// @param content_hash The hash of the question content (template ID + opening time + question parameter string)
    /// @param arbitrator The arbitrator chosen for the question (regardless of whether they are asked to arbitrate)
    /// @param min_timeout The timeout set in the initial question settings must be this high or higher
    /// @param min_bond The bond sent with the final answer must be this high or higher
    /// @return The answer formatted as a bytes32
    function getFinalAnswerIfMatches(
        bytes32 question_id, 
        bytes32 content_hash, address arbitrator, uint32 min_timeout, uint256 min_bond
    ) 
        stateFinalized(question_id)
    external view returns (bytes32) {
        require(content_hash == questions[question_id].content_hash, "content hash must match");
        require(arbitrator == questions[question_id].arbitrator, "arbitrator must match");
        require(min_timeout <= questions[question_id].timeout, "timeout must be long enough");
        require(min_bond <= questions[question_id].bond, "bond must be high enough");
        return questions[question_id].best_answer;
    }

    /// @notice Assigns the winnings (bounty and bonds) to everyone who gave the accepted answer
    /// Caller must provide the answer history, in reverse order
    /// @dev Works up the chain and assign bonds to the person who gave the right answer
    /// If someone gave the winning answer earlier, they must get paid from the higher bond
    /// That means we can't pay out the bond added at n until we have looked at n-1
    /// The first answer is authenticated by checking against the stored history_hash.
    /// One of the inputs to history_hash is the history_hash before it, so we use that to authenticate the next entry, etc
    /// Once we get to a null hash we'll know we're done and there are no more answers.
    /// Usually you would call the whole thing in a single transaction, but if not then the data is persisted to pick up later.
    /// @param question_id The ID of the question
    /// @param history_hashes Second-last-to-first, the hash of each history entry. (Final one should be empty).
    /// @param addrs Last-to-first, the address of each answerer or commitment sender
    /// @param bonds Last-to-first, the bond supplied with each answer or commitment
    /// @param answers Last-to-first, each answer supplied, or commitment ID if the answer was supplied with commit->reveal
    function claimWinnings(
        bytes32 question_id, 
        bytes32[] memory history_hashes, address[] memory addrs, uint256[] memory bonds, bytes32[] memory answers
    ) 
        stateFinalized(question_id)
    public {

        require(history_hashes.length > 0, "at least one history hash entry must be provided");

        // These are only set if we split our claim over multiple transactions.
        address payee = question_claims[question_id].payee; 
        uint256 last_bond = question_claims[question_id].last_bond; 
        uint256 queued_funds = question_claims[question_id].queued_funds; 

        // Starts as the hash of the final answer submitted. It'll be cleared when we're done.
        // If we're splitting the claim over multiple transactions, it'll be the hash where we left off last time
        bytes32 last_history_hash = questions[question_id].history_hash;

        bytes32 best_answer = questions[question_id].best_answer;

        uint256 i;
        for (i = 0; i < history_hashes.length; i++) {
        
            // Check input against the history hash, and see which of 2 possible values of is_commitment fits.
            bool is_commitment = _verifyHistoryInputOrRevert(last_history_hash, history_hashes[i], answers[i], bonds[i], addrs[i]);
            
            queued_funds = queued_funds + last_bond; 
            (queued_funds, payee) = _processHistoryItem(
                question_id, best_answer, queued_funds, payee, 
                addrs[i], bonds[i], answers[i], is_commitment);
 
            // Line the bond up for next time, when it will be added to somebody's queued_funds
            last_bond = bonds[i];

            // Burn (just leave in contract balance) a fraction of all bonds except the final one.
            // This creates a cost to increasing your own bond, which could be used to delay resolution maliciously
            if (last_bond != questions[question_id].bond) {
                last_bond = last_bond - last_bond / BOND_CLAIM_FEE_PROPORTION;
            }

            last_history_hash = history_hashes[i];

        }
 
        if (last_history_hash != NULL_HASH) {
            // We haven't yet got to the null hash (1st answer), ie the caller didn't supply the full answer chain.
            // Persist the details so we can pick up later where we left off later.

            // If we know who to pay we can go ahead and pay them out, only keeping back last_bond
            // (We always know who to pay unless all we saw were unrevealed commits)
            if (payee != NULL_ADDRESS) {
                _payPayee(question_id, payee, queued_funds);
                queued_funds = 0;
            }

            question_claims[question_id].payee = payee;
            question_claims[question_id].last_bond = last_bond;
            question_claims[question_id].queued_funds = queued_funds;
        } else {
            // There is nothing left below us so the payee can keep what remains
            _payPayee(question_id, payee, queued_funds + last_bond);
            delete question_claims[question_id];
        }

        questions[question_id].history_hash = last_history_hash;

    }

    function _payPayee(bytes32 question_id, address payee, uint256 value) 
    internal {
        balanceOf[payee] = balanceOf[payee] + value;
        emit LogClaim(question_id, payee, value);
    }

    function _verifyHistoryInputOrRevert(
        bytes32 last_history_hash,
        bytes32 history_hash, bytes32 answer, uint256 bond, address addr
    )
    internal pure returns (bool) {
        if (last_history_hash == keccak256(abi.encodePacked(history_hash, answer, bond, addr, true)) ) {
            return true;
        }
        if (last_history_hash == keccak256(abi.encodePacked(history_hash, answer, bond, addr, false)) ) {
            return false;
        } 
        revert("History input provided did not match the expected hash");
    }

    function _processHistoryItem(
        bytes32 question_id, bytes32 best_answer, 
        uint256 queued_funds, address payee, 
        address addr, uint256 bond, bytes32 answer, bool is_commitment
    )
    internal returns (uint256, address) {

        // For commit-and-reveal, the answer history holds the commitment ID instead of the answer.
        // We look at the referenced commitment ID and switch in the actual answer.
        if (is_commitment) {
            bytes32 commitment_id = answer;
            // If it's a commit but it hasn't been revealed, it will always be considered wrong.
            if (!commitments[commitment_id].is_revealed) {
                delete commitments[commitment_id];
                return (queued_funds, payee);
            } else {
                answer = commitments[commitment_id].revealed_answer;
                delete commitments[commitment_id];
            }
        }

        if (answer == best_answer) {

            if (payee == NULL_ADDRESS) {

                // The entry is for the first payee we come to, ie the winner.
                // They get the question bounty.
                payee = addr;

                if (best_answer != UNRESOLVED_ANSWER && questions[question_id].bounty > 0) {
                    _payPayee(question_id, payee, questions[question_id].bounty);
                    questions[question_id].bounty = 0;
                }

            } else if (addr != payee) {

                // Answerer has changed, ie we found someone lower down who needs to be paid

                // The lower answerer will take over receiving bonds from higher answerer.
                // They should also be paid the takeover fee, which is set at a rate equivalent to their bond. 
                // (This is our arbitrary rule, to give consistent right-answerers a defence against high-rollers.)

                // There should be enough for the fee, but if not, take what we have.
                // There's an edge case involving weird arbitrator behaviour where we may be short.
                uint256 answer_takeover_fee = (queued_funds >= bond) ? bond : queued_funds;
                // Settle up with the old (higher-bonded) payee
                _payPayee(question_id, payee, queued_funds - answer_takeover_fee);

                // Now start queued_funds again for the new (lower-bonded) payee
                payee = addr;
                queued_funds = answer_takeover_fee;

            }

        }

        return (queued_funds, payee);

    }

    /// @notice Convenience function to assign bounties/bonds for multiple questions in one go, then withdraw all your funds.
    /// Caller must provide the answer history for each question, in reverse order
    /// @dev Can be called by anyone to assign bonds/bounties, but funds are only withdrawn for the user making the call.
    /// @param question_ids The IDs of the questions you want to claim for
    /// @param lengths The number of history entries you will supply for each question ID
    /// @param hist_hashes In a single list for all supplied questions, the hash of each history entry.
    /// @param addrs In a single list for all supplied questions, the address of each answerer or commitment sender
    /// @param bonds In a single list for all supplied questions, the bond supplied with each answer or commitment
    /// @param answers In a single list for all supplied questions, each answer supplied, or commitment ID 
    function claimMultipleAndWithdrawBalance(
        bytes32[] memory question_ids, uint256[] memory lengths, 
        bytes32[] memory hist_hashes, address[] memory addrs, uint256[] memory bonds, bytes32[] memory answers
    ) 
        stateAny() // The finalization checks are done in the claimWinnings function
    public {
        
        uint256 qi;
        uint256 i;
        for (qi = 0; qi < question_ids.length; qi++) {
            bytes32 qid = question_ids[qi];
            uint256 ln = lengths[qi];
            bytes32[] memory hh = new bytes32[](ln);
            address[] memory ad = new address[](ln);
            uint256[] memory bo = new uint256[](ln);
            bytes32[] memory an = new bytes32[](ln);
            uint256 j;
            for (j = 0; j < ln; j++) {
                hh[j] = hist_hashes[i];
                ad[j] = addrs[i];
                bo[j] = bonds[i];
                an[j] = answers[i];
                i++;
            }
            claimWinnings(qid, hh, ad, bo, an);
        }
        withdraw();
    }

    /// @notice Returns the questions's content hash, identifying the question content
    /// @param question_id The ID of the question 
    function getContentHash(bytes32 question_id) 
    public view returns(bytes32) {
        return questions[question_id].content_hash;
    }

    /// @notice Returns the arbitrator address for the question
    /// @param question_id The ID of the question 
    function getArbitrator(bytes32 question_id) 
    public view returns(address) {
        return questions[question_id].arbitrator;
    }

    /// @notice Returns the timestamp when the question can first be answered
    /// @param question_id The ID of the question 
    function getOpeningTS(bytes32 question_id) 
    public view returns(uint32) {
        return questions[question_id].opening_ts;
    }

    /// @notice Returns the timeout in seconds used after each answer
    /// @param question_id The ID of the question 
    function getTimeout(bytes32 question_id) 
    public view returns(uint32) {
        return questions[question_id].timeout;
    }

    /// @notice Returns the timestamp at which the question will be/was finalized
    /// @param question_id The ID of the question 
    function getFinalizeTS(bytes32 question_id) 
    public view returns(uint32) {
        return questions[question_id].finalize_ts;
    }

    /// @notice Returns whether the question is pending arbitration
    /// @param question_id The ID of the question 
    function isPendingArbitration(bytes32 question_id) 
    public view returns(bool) {
        return questions[question_id].is_pending_arbitration;
    }

    /// @notice Returns the current total unclaimed bounty
    /// @dev Set back to zero once the bounty has been claimed
    /// @param question_id The ID of the question 
    function getBounty(bytes32 question_id) 
    public view returns(uint256) {
        return questions[question_id].bounty;
    }

    /// @notice Returns the current best answer
    /// @param question_id The ID of the question 
    function getBestAnswer(bytes32 question_id) 
    public view returns(bytes32) {
        return questions[question_id].best_answer;
    }

    /// @notice Returns the history hash of the question 
    /// @param question_id The ID of the question 
    /// @dev Updated on each answer, then rewound as each is claimed
    function getHistoryHash(bytes32 question_id) 
    public view returns(bytes32) {
        return questions[question_id].history_hash;
    }

    /// @notice Returns the highest bond posted so far for a question
    /// @param question_id The ID of the question 
    function getBond(bytes32 question_id) 
    public view returns(uint256) {
        return questions[question_id].bond;
    }

    /// @notice Returns the minimum bond that can answer the question
    /// @param question_id The ID of the question
    function getMinBond(bytes32 question_id)
    public view returns(uint256) {
        return questions[question_id].min_bond;
    }

}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"bytes32","name":"answer_hash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"answer","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bond","type":"uint256"}],"name":"LogAnswerReveal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"LogCancelArbitration","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"answer","type":"bytes32"}],"name":"LogFinalize","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"bounty_added","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bounty","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"LogFundAnswerBounty","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"min_bond","type":"uint256"}],"name":"LogMinimumBond","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"answer","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"history_hash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"bond","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ts","type":"uint256"},{"indexed":false,"internalType":"bool","name":"is_commitment","type":"bool"}],"name":"LogNewAnswer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"template_id","type":"uint256"},{"indexed":false,"internalType":"string","name":"question","type":"string"},{"indexed":true,"internalType":"bytes32","name":"content_hash","type":"bytes32"},{"indexed":false,"internalType":"address","name":"arbitrator","type":"address"},{"indexed":false,"internalType":"uint32","name":"timeout","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"opening_ts","type":"uint32"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"created","type":"uint256"}],"name":"LogNewQuestion","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"template_id","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"string","name":"question_text","type":"string"}],"name":"LogNewTemplate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"LogNotifyOfArbitrationRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"question_id","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"reopened_question_id","type":"bytes32"}],"name":"LogReopenQuestion","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"arbitrator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogSetQuestionFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogWithdraw","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"arbitrator_question_fees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"template_id","type":"uint256"},{"internalType":"string","name":"question","type":"string"},{"internalType":"address","name":"arbitrator","type":"address"},{"internalType":"uint32","name":"timeout","type":"uint32"},{"internalType":"uint32","name":"opening_ts","type":"uint32"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"askQuestion","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"template_id","type":"uint256"},{"internalType":"string","name":"question","type":"string"},{"internalType":"address","name":"arbitrator","type":"address"},{"internalType":"uint32","name":"timeout","type":"uint32"},{"internalType":"uint32","name":"opening_ts","type":"uint32"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"min_bond","type":"uint256"}],"name":"askQuestionWithMinBond","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32","name":"answer","type":"bytes32"},{"internalType":"address","name":"payee_if_wrong","type":"address"},{"internalType":"bytes32","name":"last_history_hash","type":"bytes32"},{"internalType":"bytes32","name":"last_answer_or_commitment_id","type":"bytes32"},{"internalType":"address","name":"last_answerer","type":"address"}],"name":"assignWinnerAndSubmitAnswerByArbitrator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"cancelArbitration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"question_ids","type":"bytes32[]"},{"internalType":"uint256[]","name":"lengths","type":"uint256[]"},{"internalType":"bytes32[]","name":"hist_hashes","type":"bytes32[]"},{"internalType":"address[]","name":"addrs","type":"address[]"},{"internalType":"uint256[]","name":"bonds","type":"uint256[]"},{"internalType":"bytes32[]","name":"answers","type":"bytes32[]"}],"name":"claimMultipleAndWithdrawBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32[]","name":"history_hashes","type":"bytes32[]"},{"internalType":"address[]","name":"addrs","type":"address[]"},{"internalType":"uint256[]","name":"bonds","type":"uint256[]"},{"internalType":"bytes32[]","name":"answers","type":"bytes32[]"}],"name":"claimWinnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"commitments","outputs":[{"internalType":"uint32","name":"reveal_ts","type":"uint32"},{"internalType":"bool","name":"is_revealed","type":"bool"},{"internalType":"bytes32","name":"revealed_answer","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"content","type":"string"}],"name":"createTemplate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"content","type":"string"},{"internalType":"string","name":"question","type":"string"},{"internalType":"address","name":"arbitrator","type":"address"},{"internalType":"uint32","name":"timeout","type":"uint32"},{"internalType":"uint32","name":"opening_ts","type":"uint32"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"createTemplateAndAskQuestion","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"fundAnswerBounty","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getArbitrator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getBestAnswer","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getBond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getBounty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getContentHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getFinalAnswer","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32","name":"content_hash","type":"bytes32"},{"internalType":"address","name":"arbitrator","type":"address"},{"internalType":"uint32","name":"min_timeout","type":"uint32"},{"internalType":"uint256","name":"min_bond","type":"uint256"}],"name":"getFinalAnswerIfMatches","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getFinalizeTS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getHistoryHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getMinBond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getOpeningTS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"getTimeout","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"isFinalized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"isPendingArbitration","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"isSettledTooSoon","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"address","name":"requester","type":"address"},{"internalType":"uint256","name":"max_previous","type":"uint256"}],"name":"notifyOfArbitrationRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"question_claims","outputs":[{"internalType":"address","name":"payee","type":"address"},{"internalType":"uint256","name":"last_bond","type":"uint256"},{"internalType":"uint256","name":"queued_funds","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"questions","outputs":[{"internalType":"bytes32","name":"content_hash","type":"bytes32"},{"internalType":"address","name":"arbitrator","type":"address"},{"internalType":"uint32","name":"opening_ts","type":"uint32"},{"internalType":"uint32","name":"timeout","type":"uint32"},{"internalType":"uint32","name":"finalize_ts","type":"uint32"},{"internalType":"bool","name":"is_pending_arbitration","type":"bool"},{"internalType":"uint256","name":"bounty","type":"uint256"},{"internalType":"bytes32","name":"best_answer","type":"bytes32"},{"internalType":"bytes32","name":"history_hash","type":"bytes32"},{"internalType":"uint256","name":"bond","type":"uint256"},{"internalType":"uint256","name":"min_bond","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"template_id","type":"uint256"},{"internalType":"string","name":"question","type":"string"},{"internalType":"address","name":"arbitrator","type":"address"},{"internalType":"uint32","name":"timeout","type":"uint32"},{"internalType":"uint32","name":"opening_ts","type":"uint32"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"min_bond","type":"uint256"},{"internalType":"bytes32","name":"reopens_question_id","type":"bytes32"}],"name":"reopenQuestion","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"reopened_questions","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"reopener_questions","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"resultFor","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"}],"name":"resultForOnceSettled","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setQuestionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32","name":"answer","type":"bytes32"},{"internalType":"uint256","name":"max_previous","type":"uint256"}],"name":"submitAnswer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32","name":"answer","type":"bytes32"},{"internalType":"address","name":"answerer","type":"address"}],"name":"submitAnswerByArbitrator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32","name":"answer_hash","type":"bytes32"},{"internalType":"uint256","name":"max_previous","type":"uint256"},{"internalType":"address","name":"_answerer","type":"address"}],"name":"submitAnswerCommitment","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32","name":"answer","type":"bytes32"},{"internalType":"uint256","name":"max_previous","type":"uint256"},{"internalType":"address","name":"answerer","type":"address"}],"name":"submitAnswerFor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"question_id","type":"bytes32"},{"internalType":"bytes32","name":"answer","type":"bytes32"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"bond","type":"uint256"}],"name":"submitAnswerReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"template_hashes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"templates","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405260006001553480156200001657600080fd5b506200003b6040518060600160405280603f8152602001620044a4603f9139620000d6565b50620000606040518060800160405280604f815260200162004580604f9139620000d6565b50620000856040518060800160405280605a815260200162004526605a9139620000d6565b50620000aa6040518060800160405280605c815260200162004448605c9139620000d6565b50620000cf604051806080016040528060438152602001620044e360439139620000d6565b5062000223565b600154600081815260026020908152604080832043905551919291620000ff9185910162000176565b60408051601f1981840301815282825280516020918201206000858152600390925291902055339082907fb87fb721c0a557bb8dff89a86796466931d82ba530a66a239263eb8735ade2e4906200015890879062000194565b60405180910390a36200016d816001620001c9565b60015592915050565b600082516200018a818460208701620001f0565b9190910192915050565b6020815260008251806020840152620001b5816040850160208701620001f0565b601f01601f19169190910160400192915050565b60008219821115620001eb57634e487b7160e01b600052601160045260246000fd5b500190565b60005b838110156200020d578181015183820152602001620001f3565b838111156200021d576000848401525b50505050565b61421580620002336000396000f3fe6080604052600436106102675760003560e01c80637f8d429e11610144578063ab5a4e35116100b6578063d44e293c1161007a578063d44e293c14610983578063d7cff986146109a3578063e83bfb58146109b6578063ebbdd2b0146109e6578063f6a94ecb14610a06578063fe92049d14610a2657600080fd5b8063ab5a4e35146108cc578063acae8f4e146108ec578063bc52565214610929578063c081d8a314610956578063d09cc57e146108ac57600080fd5b8063924532fb11610108578063924532fb146106e357806395addb90146107165780639e63fa6a1461080a5780639f1025c61461085c578063a1130d0414610899578063a462fb7b146108ac57600080fd5b80637f8d429e146105d857806382ffa9f7146105f8578063839df9451461062857806383bf4609146106925780638d552d46146106b257600080fd5b8063484c0714116101dd578063590158a7116101a1578063590158a7146104da57806359245ff3146105455780636fa427421461055857806370a0823114610585578063762c38fd146105b257806377f325df146105c557600080fd5b8063484c0714146104105780634dc266b4146104405780634df6ca2a146104605780634e60f8831461048057806351577ea9146104ad57600080fd5b80632417395c1161022f5780632417395c146103175780632518904c1461034757806326d6c97b1461039857806328828b1e146103c85780633ccfd60b146103e8578063484b93c4146103fd57600080fd5b806306c3b67a1461026c5780631101a0fd146102a1578063111ec138146102c35780631126a9dc146102d657806312a203c3146102f7575b600080fd5b34801561027857600080fd5b5061028c610287366004613780565b610a46565b60405190151581526020015b60405180910390f35b3480156102ad57600080fd5b506102c16102bc3660046137ce565b610a5b565b005b6102c16102d136600461398b565b610d60565b6102e96102e4366004613ba2565b610fc2565b604051908152602001610298565b34801561030357600080fd5b506102e9610312366004613911565b611408565b34801561032357600080fd5b506102e9610332366004613780565b60009081526004602052604090206003015490565b34801561035357600080fd5b50610380610362366004613780565b6000908152600460205260409020600101546001600160a01b031690565b6040516001600160a01b039091168152602001610298565b3480156103a457600080fd5b506102e96103b3366004613780565b60009081526004602052604090206006015490565b3480156103d457600080fd5b506102c16103e336600461368c565b6115e3565b3480156103f457600080fd5b506102c161189b565b6102e961040b366004613b17565b611915565b34801561041c57600080fd5b506102e961042b366004613780565b60009081526004602052604090206007015490565b34801561044c57600080fd5b506102c161045b3660046139ca565b611a36565b34801561046c57600080fd5b506102c161047b366004613780565b611d3c565b34801561048c57600080fd5b506102e961049b366004613780565b60036020526000908152604090205481565b3480156104b957600080fd5b506102e96104c8366004613780565b60009081526004602052604090205490565b3480156104e657600080fd5b506105206104f5366004613780565b6005602052600090815260409020805460018201546002909201546001600160a01b03909116919083565b604080516001600160a01b039094168452602084019290925290820152606001610298565b6102c1610553366004613780565b611d8a565b34801561056457600080fd5b506102e9610573366004613671565b60076020526000908152604090205481565b34801561059157600080fd5b506102e96105a0366004613671565b60006020819052908152604090205481565b6102e96105c0366004613ad5565b611f1d565b6102c16105d336600461395f565b61203f565b3480156105e457600080fd5b5061028c6105f3366004613780565b61224a565b34801561060457600080fd5b506102e9610613366004613780565b60009081526004602052604090206005015490565b34801561063457600080fd5b50610670610643366004613780565b6006602052600090815260409020805460019091015463ffffffff821691640100000000900460ff169083565b6040805163ffffffff9094168452911515602084015290820152606001610298565b34801561069e57600080fd5b506102e96106ad3660046139fc565b6122a6565b3480156106be57600080fd5b506102e96106cd366004613780565b6000908152600460208190526040909120015490565b3480156106ef57600080fd5b5061028c6106fe366004613780565b60009081526004602052604090206002015460ff1690565b34801561072257600080fd5b506107a3610731366004613780565b60046020819052600091825260409091208054600182015460028301546003840154948401546005850154600686015460079096015494966001600160a01b0385169663ffffffff600160a01b8704811697600160c01b8804821697600160e01b90049091169560ff1694929391908b565b604080519b8c526001600160a01b03909a1660208c015263ffffffff988916998b019990995295871660608a015295909316608088015290151560a087015260c086015260e085015261010084019190915261012083015261014082015261016001610298565b34801561081657600080fd5b50610847610825366004613780565b600090815260046020526040902060010154600160a01b900463ffffffff1690565b60405163ffffffff9091168152602001610298565b34801561086857600080fd5b50610847610877366004613780565b600090815260046020526040902060010154600160c01b900463ffffffff1690565b6102e96108a7366004613a38565b612342565b3480156108b857600080fd5b506102e96108c7366004613780565b61235e565b3480156108d857600080fd5b506102e96108e7366004613780565b61239e565b3480156108f857600080fd5b50610847610907366004613780565b600090815260046020526040902060010154600160e01b900463ffffffff1690565b34801561093557600080fd5b506102e9610944366004613780565b60026020526000908152604090205481565b34801561096257600080fd5b506102e9610971366004613780565b60086020526000908152604090205481565b34801561098f57600080fd5b506102c161099e3660046138b9565b6124cf565b6102c16109b136600461398b565b6125e6565b3480156109c257600080fd5b5061028c6109d1366004613780565b60096020526000908152604090205460ff1681565b3480156109f257600080fd5b506102c1610a01366004613780565b612846565b348015610a1257600080fd5b506102c1610a21366004613799565b61294a565b348015610a3257600080fd5b506102c1610a41366004613884565b612bca565b6000600119610a548361235e565b1492915050565b84610a658161224a565b610a8a5760405162461bcd60e51b8152600401610a8190613f07565b60405180910390fd5b6000855111610af45760405162461bcd60e51b815260206004820152603060248201527f6174206c65617374206f6e6520686973746f7279206861736820656e7472792060448201526f1b5d5cdd081899481c1c9bdd9a59195960821b6064820152608401610a81565b6000868152600560208181526040808420805460018201546002909201546004948590529286209485015494909301546001600160a01b039093169490939192905b8a51811015610ca4576000610bb2848d8481518110610b5757610b576141b3565b60200260200101518b8581518110610b7157610b716141b3565b60200260200101518d8681518110610b8b57610b8b6141b3565b60200260200101518f8781518110610ba557610ba56141b3565b6020026020010151612d1c565b9050610bbe868661408f565b9450610c1b8d84878a8f8781518110610bd957610bd96141b3565b60200260200101518f8881518110610bf357610bf36141b3565b60200260200101518f8981518110610c0d57610c0d6141b3565b602002602001015188612e0c565b8098508196505050898281518110610c3557610c356141b3565b60200260200101519550600460008e8152602001908152602001600020600601548614610c7457610c676028876140cf565b610c719087614125565b95505b8b8281518110610c8657610c866141b3565b60200260200101519350508080610c9c9061416c565b915050610b36565b8215610d02576001600160a01b03861615610cc957610cc48c8786612f56565b600093505b60008c815260056020526040902080546001600160a01b0319166001600160a01b03881617815560018101869055600201849055610d3e565b610d168c87610d11888861408f565b612f56565b60008c815260056020526040812080546001600160a01b031916815560018101829055600201555b50506000998a5260046020526040909920600501989098555050505050505050565b6000848152600460205260409020600101548490600160c01b900463ffffffff16610d9d5760405162461bcd60e51b8152600401610a8190613dde565b60008181526004602052604090206002015460ff1615610dcf5760405162461bcd60e51b8152600401610a8190613fa4565b600081815260046020526040902060010154600160e01b900463ffffffff16801580610e0657504263ffffffff168163ffffffff16115b610e225760405162461bcd60e51b8152600401610a8190613d94565b600082815260046020526040902060010154600160a01b900463ffffffff16801580610e5a57504263ffffffff168163ffffffff1611155b610e765760405162461bcd60e51b8152600401610a8190613e4f565b8660003411610e975760405162461bcd60e51b8152600401610a8190613f75565b60008181526004602052604090206006015480610ee457600082815260046020526040902060070154341015610edf5760405162461bcd60e51b8152600401610a8190613d5d565b610f0e565b610eef816002614106565b341015610f0e5760405162461bcd60e51b8152600401610a8190613ebd565b88878015610f4757600082815260046020526040902060060154811015610f475760405162461bcd60e51b8152600401610a8190613f3e565b6001600160a01b038816610f9d5760405162461bcd60e51b815260206004820152601960248201527f616e737765726572206d757374206265206e6f6e2d7a65726f000000000000006044820152606401610a81565b610fab8b8b8a346000612fd0565b610fb58b8b6130a8565b5050505050505050505050565b6000610fcd82610a46565b61103f5760405162461bcd60e51b815260206004820152603f60248201527f596f752063616e206f6e6c792072656f70656e207175657374696f6e7320746860448201527f6174207265736f6c76656420617320736574746c656420746f6f20736f6f6e006064820152608401610a81565b600089868a60405160200161105693929190613d11565b60408051601f1981840301815291815281516020928301206000868152600490935291205490915081146110c45760405162461bcd60e51b81526020600482015260156024820152740c6dedce8cadce840d0c2e6d040dad2e6dac2e8c6d605b1b6044820152606401610a81565b6000838152600460205260409020600101546001600160a01b038981169116146111265760405162461bcd60e51b81526020600482015260136024820152720c2e4c4d2e8e4c2e8dee440dad2e6dac2e8c6d606b1b6044820152606401610a81565b60008381526004602052604090206001015463ffffffff888116600160c01b90920416146111895760405162461bcd60e51b815260206004820152601060248201526f0e8d2dacadeeae840dad2e6dac2e8c6d60831b6044820152606401610a81565b60008381526004602052604090206001015463ffffffff878116600160a01b90920416146111ef5760405162461bcd60e51b81526020600482015260136024820152720dee0cadcd2dccebee8e640dad2e6dac2e8c6d606b1b6044820152606401610a81565b60008381526004602052604090206007015484146112435760405162461bcd60e51b81526020600482015260116024820152700dad2dcbec4dedcc840dad2e6dac2e8c6d607b1b6044820152606401610a81565b60008381526009602052604090205460ff16156112bc5760405162461bcd60e51b815260206004820152603160248201527f5175657374696f6e20697320616c72656164792072656f70656e696e67206120604482015270383932bb34b7bab99038bab2b9ba34b7b760791b6064820152608401610a81565b60008381526008602052604090205483811561134b576112db82610a46565b6113325760405162461bcd60e51b815260206004820152602260248201527f5175657374696f6e2068617320616c7265616479206265656e2072656f70656e604482015261195960f21b6064820152608401610a81565b506000818152600960205260409020805460ff19169055805b600061135c8d8d8d8d8d8d8d611915565b600087815260086020908152604080832084905583835260098252808320805460ff19166001179055600490915280822060039081015486845291909220909101549192506113aa9161408f565b6000828152600460205260408082206003908101939093558482528082209092018190559051879183917f32e7d5617fb1be6bd0e7c3974d438d4514c4cf349e9330691d8abf6f6fd431219190a39c9b505050505050505050505050565b6000856114148161224a565b6114305760405162461bcd60e51b8152600401610a8190613f07565b600087815260046020526040902054861461148d5760405162461bcd60e51b815260206004820152601760248201527f636f6e74656e742068617368206d757374206d617463680000000000000000006044820152606401610a81565b6000878152600460205260409020600101546001600160a01b038681169116146114f15760405162461bcd60e51b81526020600482015260156024820152740c2e4c4d2e8e4c2e8dee440daeae6e840dac2e8c6d605b1b6044820152606401610a81565b60008781526004602052604090206001015463ffffffff600160c01b909104811690851611156115635760405162461bcd60e51b815260206004820152601b60248201527f74696d656f7574206d757374206265206c6f6e6720656e6f75676800000000006044820152606401610a81565b6000878152600460205260409020600601548311156115c45760405162461bcd60e51b815260206004820152601860248201527f626f6e64206d757374206265206869676820656e6f75676800000000000000006044820152606401610a81565b6000878152600460208190526040909120015491505095945050505050565b6000805b8751821015611889576000888381518110611604576116046141b3565b602002602001015190506000888481518110611622576116226141b3565b602002602001015190506000816001600160401b03811115611646576116466141c9565b60405190808252806020026020018201604052801561166f578160200160208202803683370190505b5090506000826001600160401b0381111561168c5761168c6141c9565b6040519080825280602002602001820160405280156116b5578160200160208202803683370190505b5090506000836001600160401b038111156116d2576116d26141c9565b6040519080825280602002602001820160405280156116fb578160200160208202803683370190505b5090506000846001600160401b03811115611718576117186141c9565b604051908082528060200260200182016040528015611741578160200160208202803683370190505b50905060005b85811015611862578c8881518110611761576117616141b3565b602002602001015185828151811061177b5761177b6141b3565b6020026020010181815250508b8881518110611799576117996141b3565b60200260200101518482815181106117b3576117b36141b3565b60200260200101906001600160a01b031690816001600160a01b0316815250508a88815181106117e5576117e56141b3565b60200260200101518382815181106117ff576117ff6141b3565b60200260200101818152505089888151811061181d5761181d6141b3565b6020026020010151828281518110611837576118376141b3565b60209081029190910101528761184c8161416c565b985050808061185a9061416c565b915050611747565b61186f8786868686610a5b565b5050505050505081806118819061416c565b9250506115e7565b61189161189b565b5050505050505050565b33600081815260208190526040808220805490839055905190929183156108fc02918491818181858888f193505050501580156118dc573d6000803e3d6000fd5b5060405181815233907f4ce7033d118120e254016dccf195288400b28fc8936425acd5f17ce2df3ab7089060200160405180910390a250565b6000878152600260205260408120546119665760405162461bcd60e51b81526020600482015260136024820152721d195b5c1b185d19481b5d5cdd08195e1a5cdd606a1b6044820152606401610a81565b600088858960405160200161197d93929190613d11565b60405160208183030381529060405280519060200120905060008188888630338a6040516020016119b49796959493929190613c61565b60405160208183030381529060405280519060200120905081336001600160a01b0316827ffe2dac156a3890636ce13f65f4fdf41dcaee11526e4a5374531572d92194796c8d8d8d8d8d8d42604051611a139796959493929190613fec565b60405180910390a4611a2981838a8a8a89613112565b9998505050505050505050565b6000848152600460205260409020600101548490600160c01b900463ffffffff16611a735760405162461bcd60e51b8152600401610a8190613dde565b600081815260046020526040902060010154600160e01b900463ffffffff16801580611aaa57504263ffffffff168163ffffffff16115b611b085760405162461bcd60e51b815260206004820152602960248201527f66696e616c697a6174696f6e206465616c696e65206d757374206e6f742068616044820152681d99481c185cdcd95960ba1b6064820152608401610a81565b600082815260046020526040902060010154600160a01b900463ffffffff16801580611b4057504263ffffffff168163ffffffff1611155b611b5c5760405162461bcd60e51b8152600401610a8190613e4f565b604080516020808201899052818301889052825180830384018152606083018452805190820120608083018b905260a0830181905260c08084018990528451808503909101815260e090930184528251928201929092206000818152600690925292902054909190640100000000900460ff1615611c2f5760405162461bcd60e51b815260206004820152602a60248201527f636f6d6d69746d656e74206d757374206e6f742068617665206265656e2072656044820152691d99585b1959081e595d60b21b6064820152608401610a81565b60008181526006602052604090205463ffffffff428116911611611ca15760405162461bcd60e51b8152602060048201526024808201527f72657665616c20646561646c696e65206d757374206e6f7420686176652070616044820152631cdcd95960e21b6064820152608401610a81565b6000818152600660208181526040808420600181018d9055805464ff0000000019166401000000001790558c845260049091529091200154861415611cea57611cea89896130a8565b6040805189815260208101899052908101879052829033908b907fa7b2d313bc7a062e30b2c3b811aa4c9faf09755a6b4ea3bf42deff920944332f9060600160405180910390a4505050505050505050565b33600081815260076020908152604091829020849055815192835282018390527fdca703d022171824d3d639b33c1525fd2338120b4cfb89507c0b59596893acda910160405180910390a150565b6000818152600460205260409020600101548190600160c01b900463ffffffff16611dc75760405162461bcd60e51b8152600401610a8190613dde565b60008181526004602052604090206002015460ff1615611df95760405162461bcd60e51b8152600401610a8190613fa4565b600081815260046020526040902060010154600160e01b900463ffffffff16801580611e3057504263ffffffff168163ffffffff16115b611e4c5760405162461bcd60e51b8152600401610a8190613d94565b600082815260046020526040902060010154600160a01b900463ffffffff16801580611e8457504263ffffffff168163ffffffff1611155b611ea05760405162461bcd60e51b8152600401610a8190613e4f565b600084815260046020526040902060030154611ebd90349061408f565b6000858152600460205260409081902060030182905551339186917f54d68405b79f2aa4fd4e8db7b67844ad254cf8f208aac476c2894134a9deab6691611f0f91349190918252602082015260400190565b60405180910390a350505050565b600086815260026020526040812054611f6e5760405162461bcd60e51b81526020600482015260136024820152721d195b5c1b185d19481b5d5cdd08195e1a5cdd606a1b6044820152606401610a81565b6000878488604051602001611f8593929190613d11565b60405160208183030381529060405280519060200120905060008187876000303389604051602001611fbd9796959493929190613c61565b60405160208183030381529060405280519060200120905081336001600160a01b0316827ffe2dac156a3890636ce13f65f4fdf41dcaee11526e4a5374531572d92194796c8c8c8c8c8c8c4260405161201c9796959493929190613fec565b60405180910390a461203381838989896000613112565b98975050505050505050565b6000838152600460205260409020600101548390600160c01b900463ffffffff1661207c5760405162461bcd60e51b8152600401610a8190613dde565b60008181526004602052604090206002015460ff16156120ae5760405162461bcd60e51b8152600401610a8190613fa4565b600081815260046020526040902060010154600160e01b900463ffffffff168015806120e557504263ffffffff168163ffffffff16115b6121015760405162461bcd60e51b8152600401610a8190613d94565b600082815260046020526040902060010154600160a01b900463ffffffff1680158061213957504263ffffffff168163ffffffff1611155b6121555760405162461bcd60e51b8152600401610a8190613e4f565b85600034116121765760405162461bcd60e51b8152600401610a8190613f75565b600081815260046020526040902060060154806121c3576000828152600460205260409020600701543410156121be5760405162461bcd60e51b8152600401610a8190613d5d565b6121ed565b6121ce816002614106565b3410156121ed5760405162461bcd60e51b8152600401610a8190613ebd565b87868015612226576000828152600460205260409020600601548110156122265760405162461bcd60e51b8152600401610a8190613f3e565b6122348a8a33346000612fd0565b61223e8a8a6130a8565b50505050505050505050565b60008181526004602052604081206001810154600290910154600160e01b90910463ffffffff169060ff16158015612287575063ffffffff811615155b801561229f57504263ffffffff168163ffffffff1611155b9392505050565b6001546000818152600260209081526040808320439055519192916122cd91859101613cf5565b60408051601f1981840301815282825280516020918201206000858152600390925291902055339082907fb87fb721c0a557bb8dff89a86796466931d82ba530a66a239263eb8735ade2e490612324908790613d4a565b60405180910390a361233781600161408f565b60015590505b919050565b60008061234e886122a6565b9050612033818888888888611f1d565b60008161236a8161224a565b6123865760405162461bcd60e51b8152600401610a8190613f07565b50506000908152600460208190526040909120015490565b6000806123aa8361235e565b90506001198114156124c957600083815260086020526040902054806124385760405162461bcd60e51b815260206004820152603760248201527f5175657374696f6e2077617320736574746c656420746f6f20736f6f6e20616e60448201527f6420686173206e6f74206265656e2072656f70656e65640000000000000000006064820152608401610a81565b6124418161235e565b91506001198214156124c75760405162461bcd60e51b815260206004820152604360248201527f5175657374696f6e207265706c6163656d656e742077617320736574746c656460448201527f20746f6f20736f6f6e20616e6420686173206e6f74206265656e2072656f70656064820152621b995960ea1b608482015260a401610a81565b505b92915050565b600086815260046020526040812060058101546006909101546124f791908690869086612d1c565b9050600081801561251f5750600084815260066020526040902054640100000000900460ff16155b156125b75760008481526006602052604090205463ffffffff4281169116106125b05760405162461bcd60e51b815260206004820152603760248201527f596f75206d757374207761697420666f72207468652072657665616c2064656160448201527f646c696e65206265666f72652066696e616c697a696e670000000000000000006064820152608401610a81565b50846125db565b6000888152600460208190526040909120015487146125d657856125d8565b825b90505b611891888883612bca565b6000848152600460205260409020600101548490600160c01b900463ffffffff166126235760405162461bcd60e51b8152600401610a8190613dde565b60008181526004602052604090206002015460ff16156126555760405162461bcd60e51b8152600401610a8190613fa4565b600081815260046020526040902060010154600160e01b900463ffffffff1680158061268c57504263ffffffff168163ffffffff16115b6126a85760405162461bcd60e51b8152600401610a8190613d94565b600082815260046020526040902060010154600160a01b900463ffffffff168015806126e057504263ffffffff168163ffffffff1611155b6126fc5760405162461bcd60e51b8152600401610a8190613e4f565b866000341161271d5760405162461bcd60e51b8152600401610a8190613f75565b6000818152600460205260409020600601548061276a576000828152600460205260409020600701543410156127655760405162461bcd60e51b8152600401610a8190613d5d565b612794565b612775816002614106565b3410156127945760405162461bcd60e51b8152600401610a8190613ebd565b888780156127cd576000828152600460205260409020600601548110156127cd5760405162461bcd60e51b8152600401610a8190613f3e565b60408051602081018d90529081018b905234606082015260009060800160408051601f198184030181529190528051602090910120905060006001600160a01b038a161561281b578961281d565b335b90506128298d83613430565b6128378d8383346001612fd0565b50505050505050505050505050565b60008181526004602052604090206001015481906001600160a01b031633146128815760405162461bcd60e51b8152600401610a8190613e86565b600082815260046020526040902060020154829060ff166128b45760405162461bcd60e51b8152600401610a8190613e0b565b600083815260046020526040902060028101805460ff19169055600101546128e990600160c01b900463ffffffff16426140a7565b600084815260046020526040808220600101805463ffffffff94909416600160e01b026001600160e01b0390941693909317909255905184917f71bf7c2b9df0b8818e7eb6746a5bf69699ebbab041f3795f9ed58e469afa9a3a91a2505050565b60008381526004602052604090206001015483906001600160a01b031633146129855760405162461bcd60e51b8152600401610a8190613e86565b6000848152600460205260409020600101548490600160c01b900463ffffffff166129c25760405162461bcd60e51b8152600401610a8190613dde565b60008181526004602052604090206002015460ff16156129f45760405162461bcd60e51b8152600401610a8190613fa4565b600081815260046020526040902060010154600160e01b900463ffffffff16801580612a2b57504263ffffffff168163ffffffff16115b612a475760405162461bcd60e51b8152600401610a8190613d94565b600082815260046020526040902060010154600160a01b900463ffffffff16801580612a7f57504263ffffffff168163ffffffff1611155b612a9b5760405162461bcd60e51b8152600401610a8190613e4f565b86858015612ad457600082815260046020526040902060060154811015612ad45760405162461bcd60e51b8152600401610a8190613f3e565b600089815260046020526040902060010154600160e01b900463ffffffff16612b705760405162461bcd60e51b815260206004820152604260248201527f5175657374696f6e206d75737420616c7265616479206861766520616e20616e60448201527f73776572207768656e206172626974726174696f6e2069732072657175657374606482015261195960f21b608482015260a401610a81565b600089815260046020526040808220600201805460ff19166001179055516001600160a01b038a16918b917f75d7939999bc902187c4aed400872883e445145f1983539166f783fa040b47629190a3505050505050505050565b60008381526004602052604090206001015483906001600160a01b03163314612c055760405162461bcd60e51b8152600401610a8190613e86565b600084815260046020526040902060020154849060ff16612c385760405162461bcd60e51b8152600401610a8190613e0b565b6001600160a01b038316612c8e5760405162461bcd60e51b815260206004820152601960248201527f616e737765726572206d7573742062652070726f7669646564000000000000006044820152606401610a81565b604051849086907f18d760beffe3717270cd90d9d920ec1a48c194e9ad7bba23eb1c92d3eb974f9790600090a36000858152600460205260408120600201805460ff19169055612ce49086908690869080612fd0565b50505060009182526004602081905260409092209182015560010180546001600160e01b0316600160e01b4263ffffffff1602179055565b6000848484846001604051602001612d38959493929190613cba565b60405160208183030381529060405280519060200120861415612d5d57506001612e03565b848484846000604051602001612d77959493929190613cba565b60405160208183030381529060405280519060200120861415612d9c57506000612e03565b60405162461bcd60e51b815260206004820152603660248201527f486973746f727920696e7075742070726f766964656420646964206e6f74206d6044820152750c2e8c6d040e8d0ca40caf0e0cac6e8cac840d0c2e6d60531b6064820152608401610a81565b95945050505050565b6000808215612e85576000848152600660205260409020548490640100000000900460ff16612e5d576000908152600660205260408120805464ffffffffff19168155600101555086905085612f49565b6000908152600660205260408120600181018054825464ffffffffff19169092559190915593505b88841415612f43576001600160a01b038716612eff5785965060011960001b8914158015612ec3575060008a81526004602052604090206003015415155b15612efa5760008a815260046020526040902060030154612ee7908b908990612f56565b60008a8152600460205260408120600301555b612f43565b866001600160a01b0316866001600160a01b031614612f4357600085891015612f285788612f2a565b855b9050612f3b8b89610d11848d614125565b869750809850505b50869050855b9850989650505050505050565b6001600160a01b038216600090815260208190526040902054612f7a90829061408f565b6001600160a01b038316600081815260208181526040918290209390935551838152909185917f9c121aff33b50c1a53fef034ebec5f83da2d5a5187048f9c76c397ba27c1a1a6910160405180910390a3505050565b6000858152600460209081526040808320600501549051612ff992889187918991889101613cba565b604051602081830303815290604052805190602001209050600083111561302f5760008681526004602052604090206006018390555b600086815260046020908152604091829020600501839055815187815290810183905290810184905242606082015282151560808201526001600160a01b0385169087907fe47ca4ebbbc2990134d1168821f38c5e177f3d5ee564bffeadeaa351905e62219060a00160405180910390a3505050505050565b6000828152600460208190526040909120908101829055600101546130da90600160c01b900463ffffffff16426140a7565b600092835260046020526040909220600101805463ffffffff93909316600160e01b026001600160e01b039093169290921790915550565b6000868152600460205260409020600101548690600160c01b900463ffffffff16156131805760405162461bcd60e51b815260206004820152601760248201527f7175657374696f6e206d757374206e6f742065786973740000000000000000006044820152606401610a81565b60008463ffffffff16116131d65760405162461bcd60e51b815260206004820152601860248201527f74696d656f7574206d75737420626520706f73697469766500000000000000006044820152606401610a81565b6301e133808463ffffffff161061323a5760405162461bcd60e51b815260206004820152602260248201527f74696d656f7574206d757374206265206c657373207468616e20333635206461604482015261797360f01b6064820152608401610a81565b346001600160a01b0386161580159061325c5750336001600160a01b03871614155b15613322576001600160a01b038616600090815260076020526040902054808210156132d65760405162461bcd60e51b8152602060048201526024808201527f4554482070726f7669646564206d75737420636f766572207175657374696f6e6044820152632066656560e01b6064820152608401610a81565b6132e08183614125565b6001600160a01b03881660009081526020819052604090205490925061330790829061408f565b6001600160a01b038816600090815260208190526040902055505b6000888152600460205260409020878155600101805463ffffffff878116600160c01b0263ffffffff60c01b19918816600160a01b026001600160c01b03199093166001600160a01b038b1617929092171617905580156133d057600088815260046020908152604091829020600301839055815183815290810183905233918a917f54d68405b79f2aa4fd4e8db7b67844ad254cf8f208aac476c2894134a9deab66910160405180910390a35b821561189157600088815260046020526040908190206007018490555188907f9641ca9d53af3bead658ffcc6c7d8c35e7dae9938367bd8eb45bee35d5c625049061341e9086815260200190565b60405180910390a25050505050505050565b60008181526006602052604090205463ffffffff161561349c5760405162461bcd60e51b815260206004820152602160248201527f636f6d6d69746d656e74206d757374206e6f7420616c726561647920657869736044820152601d60fa1b6064820152608401610a81565b6000828152600460205260408120600101546134c790600890600160c01b900463ffffffff166140e3565b90506134d381426140a7565b600092835260066020526040909220805463ffffffff191663ffffffff909316929092179091555050565b80356001600160a01b038116811461233d57600080fd5b600082601f83011261352657600080fd5b8135602061353b6135368361406c565b61403c565b80838252828201915082860187848660051b890101111561355b57600080fd5b60005b858110156135815761356f826134fe565b8452928401929084019060010161355e565b5090979650505050505050565b600082601f83011261359f57600080fd5b813560206135af6135368361406c565b80838252828201915082860187848660051b89010111156135cf57600080fd5b60005b85811015613581578135845292840192908401906001016135d2565b600082601f8301126135ff57600080fd5b81356001600160401b03811115613618576136186141c9565b61362b601f8201601f191660200161403c565b81815284602083860101111561364057600080fd5b816020850160208301376000918101602001919091529392505050565b803563ffffffff8116811461233d57600080fd5b60006020828403121561368357600080fd5b61229f826134fe565b60008060008060008060c087890312156136a557600080fd5b86356001600160401b03808211156136bc57600080fd5b6136c88a838b0161358e565b975060208901359150808211156136de57600080fd5b6136ea8a838b0161358e565b9650604089013591508082111561370057600080fd5b61370c8a838b0161358e565b9550606089013591508082111561372257600080fd5b61372e8a838b01613515565b9450608089013591508082111561374457600080fd5b6137508a838b0161358e565b935060a089013591508082111561376657600080fd5b5061377389828a0161358e565b9150509295509295509295565b60006020828403121561379257600080fd5b5035919050565b6000806000606084860312156137ae57600080fd5b833592506137be602085016134fe565b9150604084013590509250925092565b600080600080600060a086880312156137e657600080fd5b8535945060208601356001600160401b038082111561380457600080fd5b61381089838a0161358e565b9550604088013591508082111561382657600080fd5b61383289838a01613515565b9450606088013591508082111561384857600080fd5b61385489838a0161358e565b9350608088013591508082111561386a57600080fd5b506138778882890161358e565b9150509295509295909350565b60008060006060848603121561389957600080fd5b83359250602084013591506138b0604085016134fe565b90509250925092565b60008060008060008060c087890312156138d257600080fd5b86359550602087013594506138e9604088016134fe565b9350606087013592506080870135915061390560a088016134fe565b90509295509295509295565b600080600080600060a0868803121561392957600080fd5b8535945060208601359350613940604087016134fe565b925061394e6060870161365d565b949793965091946080013592915050565b60008060006060848603121561397457600080fd5b505081359360208301359350604090920135919050565b600080600080608085870312156139a157600080fd5b8435935060208501359250604085013591506139bf606086016134fe565b905092959194509250565b600080600080608085870312156139e057600080fd5b5050823594602084013594506040840135936060013592509050565b600060208284031215613a0e57600080fd5b81356001600160401b03811115613a2457600080fd5b613a30848285016135ee565b949350505050565b60008060008060008060c08789031215613a5157600080fd5b86356001600160401b0380821115613a6857600080fd5b613a748a838b016135ee565b97506020890135915080821115613a8a57600080fd5b50613a9789828a016135ee565b955050613aa6604088016134fe565b9350613ab46060880161365d565b9250613ac26080880161365d565b915060a087013590509295509295509295565b60008060008060008060c08789031215613aee57600080fd5b8635955060208701356001600160401b03811115613b0b57600080fd5b613a9789828a016135ee565b600080600080600080600060e0888a031215613b3257600080fd5b8735965060208801356001600160401b03811115613b4f57600080fd5b613b5b8a828b016135ee565b965050613b6a604089016134fe565b9450613b786060890161365d565b9350613b866080890161365d565b925060a0880135915060c0880135905092959891949750929550565b600080600080600080600080610100898b031215613bbf57600080fd5b8835975060208901356001600160401b03811115613bdc57600080fd5b613be88b828c016135ee565b975050613bf760408a016134fe565b9550613c0560608a0161365d565b9450613c1360808a0161365d565b979a969950949793969560a0850135955060c08501359460e001359350915050565b60008151808452613c4d81602086016020860161413c565b601f01601f19169290920160200192915050565b968752606095861b6bffffffffffffffffffffffff19908116602089015260e09590951b6001600160e01b0319166034880152603887019390935290841b8316605886015290921b16606c830152608082015260a00190565b94855260208501939093526040840191909152606090811b6bffffffffffffffffffffffff191690830152151560f81b607482015260750190565b60008251613d0781846020870161413c565b9190910192915050565b83815263ffffffff60e01b8360e01b16602082015260008251613d3b81602485016020870161413c565b91909101602401949350505050565b60208152600061229f6020830184613c35565b6020808252601c908201527f626f6e64206d7573742065786365656420746865206d696e696d756d00000000604082015260600190565b6020808252602a908201527f66696e616c697a6174696f6e20646561646c696e65206d757374206e6f742068604082015269185d99481c185cdcd95960b21b606082015260800190565b6020808252601390820152721c5d595cdd1a5bdb881b5d5cdd08195e1a5cdd606a1b604082015260600190565b60208082526024908201527f7175657374696f6e206d7573742062652070656e64696e6720617262697472616040820152633a34b7b760e11b606082015260800190565b6020808252601d908201527f6f70656e696e672064617465206d757374206861766520706173736564000000604082015260600190565b6020808252601d908201527f6d73672e73656e646572206d7573742062652061726269747261746f72000000604082015260600190565b6020808252602a908201527f626f6e64206d75737420626520646f75626c65206174206c65617374207072656040820152691d9a5bdd5cc8189bdb9960b21b606082015260800190565b6020808252601a908201527f7175657374696f6e206d7573742062652066696e616c697a6564000000000000604082015260600190565b6020808252601d908201527f626f6e64206d75737420657863656564206d61785f70726576696f7573000000604082015260600190565b602080825260159082015274626f6e64206d75737420626520706f73697469766560581b604082015260600190565b60208082526028908201527f7175657374696f6e206d757374206e6f742062652070656e64696e672061726260408201526734ba3930ba34b7b760c11b606082015260800190565b87815260e06020820152600061400560e0830189613c35565b6001600160a01b039790971660408301525063ffffffff948516606082015292909316608083015260a082015260c0015292915050565b604051601f8201601f191681016001600160401b0381118282101715614064576140646141c9565b604052919050565b60006001600160401b03821115614085576140856141c9565b5060051b60200190565b600082198211156140a2576140a2614187565b500190565b600063ffffffff8083168185168083038211156140c6576140c6614187565b01949350505050565b6000826140de576140de61419d565b500490565b600063ffffffff808416806140fa576140fa61419d565b92169190910492915050565b600081600019048311821515161561412057614120614187565b500290565b60008282101561413757614137614187565b500390565b60005b8381101561415757818101518382015260200161413f565b83811115614166576000848401525b50505050565b600060001982141561418057614180614187565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea264697066735822122005531d2892fcdeb48472a864e59887b41c9670a9e5c69b4cabf85caa744b255764736f6c634300080600337b227469746c65223a20222573222c202274797065223a20226d756c7469706c652d73656c656374222c20226f7574636f6d6573223a205b25735d2c202263617465676f7279223a20222573222c20226c616e67223a20222573227d7b227469746c65223a20222573222c202274797065223a2022626f6f6c222c202263617465676f7279223a20222573222c20226c616e67223a20222573227d7b227469746c65223a20222573222c202274797065223a20226461746574696d65222c202263617465676f7279223a20222573222c20226c616e67223a20222573227d7b227469746c65223a20222573222c202274797065223a202273696e676c652d73656c656374222c20226f7574636f6d6573223a205b25735d2c202263617465676f7279223a20222573222c20226c616e67223a20222573227d7b227469746c65223a20222573222c202274797065223a202275696e74222c2022646563696d616c73223a2031382c202263617465676f7279223a20222573222c20226c616e67223a20222573227d

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.