{
  "address": "0x7Beb84c52ce96DFd90431FAA97378994a8baa6df",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_controller",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "DepositFunded",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "string",
          "name": "param",
          "type": "string"
        }
      ],
      "name": "ParameterUpdate",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "reserveHolder",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "claimant",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "ReserveClaimed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "reserveHolder",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "ReserveFunded",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "controller",
          "type": "address"
        }
      ],
      "name": "SetController",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "startRound",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "endRound",
          "type": "uint256"
        }
      ],
      "name": "Unlock",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        }
      ],
      "name": "UnlockCancelled",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "recipient",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "faceValue",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "winProb",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "senderNonce",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "recipientRand",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "bytes",
          "name": "auxData",
          "type": "bytes"
        }
      ],
      "name": "WinningTicketRedeemed",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "recipient",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "WinningTicketTransfer",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "deposit",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "reserve",
          "type": "uint256"
        }
      ],
      "name": "Withdrawal",
      "type": "event"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "address",
              "name": "recipient",
              "type": "address"
            },
            {
              "internalType": "address",
              "name": "sender",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "faceValue",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "winProb",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "senderNonce",
              "type": "uint256"
            },
            {
              "internalType": "bytes32",
              "name": "recipientRandHash",
              "type": "bytes32"
            },
            {
              "internalType": "bytes",
              "name": "auxData",
              "type": "bytes"
            }
          ],
          "internalType": "struct MTicketBrokerCore.Ticket[]",
          "name": "_tickets",
          "type": "tuple[]"
        },
        {
          "internalType": "bytes[]",
          "name": "_sigs",
          "type": "bytes[]"
        },
        {
          "internalType": "uint256[]",
          "name": "_recipientRands",
          "type": "uint256[]"
        }
      ],
      "name": "batchRedeemWinningTickets",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "cancelUnlock",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_reserveHolder",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "_claimant",
          "type": "address"
        }
      ],
      "name": "claimableReserve",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_reserveHolder",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "_claimant",
          "type": "address"
        }
      ],
      "name": "claimedReserve",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "controller",
      "outputs": [
        {
          "internalType": "contract IController",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "fundDeposit",
      "outputs": [],
      "stateMutability": "payable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "_depositAmount",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "_reserveAmount",
          "type": "uint256"
        }
      ],
      "name": "fundDepositAndReserve",
      "outputs": [],
      "stateMutability": "payable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_addr",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "_depositAmount",
          "type": "uint256"
        },
        {
          "internalType": "uint256",
          "name": "_reserveAmount",
          "type": "uint256"
        }
      ],
      "name": "fundDepositAndReserveFor",
      "outputs": [],
      "stateMutability": "payable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "fundReserve",
      "outputs": [],
      "stateMutability": "payable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_reserveHolder",
          "type": "address"
        }
      ],
      "name": "getReserveInfo",
      "outputs": [
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "fundsRemaining",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "claimedInCurrentRound",
              "type": "uint256"
            }
          ],
          "internalType": "struct MReserve.ReserveInfo",
          "name": "info",
          "type": "tuple"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_sender",
          "type": "address"
        }
      ],
      "name": "getSenderInfo",
      "outputs": [
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "deposit",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "withdrawRound",
              "type": "uint256"
            }
          ],
          "internalType": "struct MixinTicketBrokerCore.Sender",
          "name": "sender",
          "type": "tuple"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "fundsRemaining",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "claimedInCurrentRound",
              "type": "uint256"
            }
          ],
          "internalType": "struct MReserve.ReserveInfo",
          "name": "reserve",
          "type": "tuple"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "address",
              "name": "recipient",
              "type": "address"
            },
            {
              "internalType": "address",
              "name": "sender",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "faceValue",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "winProb",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "senderNonce",
              "type": "uint256"
            },
            {
              "internalType": "bytes32",
              "name": "recipientRandHash",
              "type": "bytes32"
            },
            {
              "internalType": "bytes",
              "name": "auxData",
              "type": "bytes"
            }
          ],
          "internalType": "struct MTicketBrokerCore.Ticket",
          "name": "_ticket",
          "type": "tuple"
        }
      ],
      "name": "getTicketHash",
      "outputs": [
        {
          "internalType": "bytes32",
          "name": "",
          "type": "bytes32"
        }
      ],
      "stateMutability": "pure",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_sender",
          "type": "address"
        }
      ],
      "name": "isUnlockInProgress",
      "outputs": [
        {
          "internalType": "bool",
          "name": "",
          "type": "bool"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "components": [
            {
              "internalType": "address",
              "name": "recipient",
              "type": "address"
            },
            {
              "internalType": "address",
              "name": "sender",
              "type": "address"
            },
            {
              "internalType": "uint256",
              "name": "faceValue",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "winProb",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "senderNonce",
              "type": "uint256"
            },
            {
              "internalType": "bytes32",
              "name": "recipientRandHash",
              "type": "bytes32"
            },
            {
              "internalType": "bytes",
              "name": "auxData",
              "type": "bytes"
            }
          ],
          "internalType": "struct MTicketBrokerCore.Ticket",
          "name": "_ticket",
          "type": "tuple"
        },
        {
          "internalType": "bytes",
          "name": "_sig",
          "type": "bytes"
        },
        {
          "internalType": "uint256",
          "name": "_recipientRand",
          "type": "uint256"
        }
      ],
      "name": "redeemWinningTicket",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_controller",
          "type": "address"
        }
      ],
      "name": "setController",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "_ticketValidityPeriod",
          "type": "uint256"
        }
      ],
      "name": "setTicketValidityPeriod",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "_unlockPeriod",
          "type": "uint256"
        }
      ],
      "name": "setUnlockPeriod",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "targetContractId",
      "outputs": [
        {
          "internalType": "bytes32",
          "name": "",
          "type": "bytes32"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "ticketValidityPeriod",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "unlock",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "unlockPeriod",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "bytes32",
          "name": "",
          "type": "bytes32"
        }
      ],
      "name": "usedTickets",
      "outputs": [
        {
          "internalType": "bool",
          "name": "",
          "type": "bool"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "withdraw",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "transactionHash": "0x4a8616020e1883bcb5fb88ad16ca619255d59b718ad20d58358b7c6acbe06cff",
  "receipt": {
    "to": null,
    "from": "0xB5Af4138f0f33be0D6414Eb25271B9C2Dc245fb5",
    "contractAddress": "0x7Beb84c52ce96DFd90431FAA97378994a8baa6df",
    "transactionIndex": 0,
    "gasUsed": "41421177",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "blockHash": "0x442b27e8a7182deeec6190ce130a1c61aa87db7f5fea16c961251b82e37e6efb",
    "transactionHash": "0x4a8616020e1883bcb5fb88ad16ca619255d59b718ad20d58358b7c6acbe06cff",
    "logs": [],
    "blockNumber": 5856351,
    "cumulativeGasUsed": "19139697",
    "status": 1,
    "byzantium": true
  },
  "args": [
    "0xD8E8328501E9645d16Cf49539efC04f734606ee4"
  ],
  "numDeployments": 1,
  "solcInputHash": "fbb7c6c031c5ea66d51283bdfeec92b9",
  "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"DepositFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"param\",\"type\":\"string\"}],\"name\":\"ParameterUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"reserveHolder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"claimant\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReserveClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"reserveHolder\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"ReserveFunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"controller\",\"type\":\"address\"}],\"name\":\"SetController\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startRound\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endRound\",\"type\":\"uint256\"}],\"name\":\"Unlock\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"UnlockCancelled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"faceValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"winProb\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"recipientRand\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"auxData\",\"type\":\"bytes\"}],\"name\":\"WinningTicketRedeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WinningTicketTransfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reserve\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"faceValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"winProb\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientRandHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"auxData\",\"type\":\"bytes\"}],\"internalType\":\"struct MTicketBrokerCore.Ticket[]\",\"name\":\"_tickets\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"_sigs\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_recipientRands\",\"type\":\"uint256[]\"}],\"name\":\"batchRedeemWinningTickets\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cancelUnlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserveHolder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_claimant\",\"type\":\"address\"}],\"name\":\"claimableReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserveHolder\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_claimant\",\"type\":\"address\"}],\"name\":\"claimedReserve\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"controller\",\"outputs\":[{\"internalType\":\"contract IController\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fundDeposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_depositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_reserveAmount\",\"type\":\"uint256\"}],\"name\":\"fundDepositAndReserve\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_depositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_reserveAmount\",\"type\":\"uint256\"}],\"name\":\"fundDepositAndReserveFor\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fundReserve\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserveHolder\",\"type\":\"address\"}],\"name\":\"getReserveInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fundsRemaining\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedInCurrentRound\",\"type\":\"uint256\"}],\"internalType\":\"struct MReserve.ReserveInfo\",\"name\":\"info\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"getSenderInfo\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"withdrawRound\",\"type\":\"uint256\"}],\"internalType\":\"struct MixinTicketBrokerCore.Sender\",\"name\":\"sender\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"fundsRemaining\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedInCurrentRound\",\"type\":\"uint256\"}],\"internalType\":\"struct MReserve.ReserveInfo\",\"name\":\"reserve\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"faceValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"winProb\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientRandHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"auxData\",\"type\":\"bytes\"}],\"internalType\":\"struct MTicketBrokerCore.Ticket\",\"name\":\"_ticket\",\"type\":\"tuple\"}],\"name\":\"getTicketHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_sender\",\"type\":\"address\"}],\"name\":\"isUnlockInProgress\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"faceValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"winProb\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"senderNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"recipientRandHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"auxData\",\"type\":\"bytes\"}],\"internalType\":\"struct MTicketBrokerCore.Ticket\",\"name\":\"_ticket\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"_sig\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_recipientRand\",\"type\":\"uint256\"}],\"name\":\"redeemWinningTicket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_controller\",\"type\":\"address\"}],\"name\":\"setController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_ticketValidityPeriod\",\"type\":\"uint256\"}],\"name\":\"setTicketValidityPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_unlockPeriod\",\"type\":\"uint256\"}],\"name\":\"setUnlockPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"targetContractId\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"ticketValidityPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unlockPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedTickets\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"batchRedeemWinningTickets((address,address,uint256,uint256,uint256,bytes32,bytes)[],bytes[],uint256[])\":{\"params\":{\"_recipientRands\":\"Array of preimages for the recipientRandHash included in each ticket (`_recipientRands[i]` corresponds to `_tickets[i]`)\",\"_sigs\":\"Array of sender signatures over the hash of tickets (`_sigs[i]` corresponds to `_tickets[i]`)\",\"_tickets\":\"Array of winning tickets to be redeemed in order to claim payment\"}},\"claimableReserve(address,address)\":{\"details\":\"Returns the amount of funds claimable by a claimant from a reserve in the current round\",\"params\":{\"_claimant\":\"Address of claimant\",\"_reserveHolder\":\"Address of reserve holder\"},\"returns\":{\"_0\":\"Amount of funds claimable by `_claimant` from the reserve for `_reserveHolder` in the current round\"}},\"claimedReserve(address,address)\":{\"details\":\"Returns the amount of funds claimed by a claimant from a reserve in the current round\",\"params\":{\"_claimant\":\"Address of claimant\",\"_reserveHolder\":\"Address of reserve holder\"},\"returns\":{\"_0\":\"Amount of funds claimed by `_claimant` from the reserve for `_reserveHolder` in the current round\"}},\"constructor\":{\"details\":\"This constructor will not initialize any state variables besides `controller`. The following setter functions should be used to initialize state variables post-deployment: - setUnlockPeriod() - setTicketValidityPeriod()\",\"params\":{\"_controller\":\"Address of Controller that this contract will be registered with\"}},\"fundDepositAndReserve(uint256,uint256)\":{\"params\":{\"_depositAmount\":\"Amount of ETH to add to the caller's deposit\",\"_reserveAmount\":\"Amount of ETH to add to the caller's reserve\"}},\"fundDepositAndReserveFor(address,uint256,uint256)\":{\"params\":{\"_depositAmount\":\"Amount of ETH to add to the address' deposit\",\"_reserveAmount\":\"Amount of ETH to add to the address' reserve\"}},\"getReserveInfo(address)\":{\"details\":\"Returns info about a reserve\",\"params\":{\"_reserveHolder\":\"Address of reserve holder\"},\"returns\":{\"info\":\"Info about the reserve for `_reserveHolder`\"}},\"getSenderInfo(address)\":{\"params\":{\"_sender\":\"Address of sender\"},\"returns\":{\"reserve\":\"Info about the reserve for `_sender`\",\"sender\":\"Info about the sender for `_sender`\"}},\"getTicketHash((address,address,uint256,uint256,uint256,bytes32,bytes))\":{\"details\":\"Returns the hash of a ticket\",\"params\":{\"_ticket\":\"Ticket to be hashed\"},\"returns\":{\"_0\":\"keccak256 hash of `_ticket`\"}},\"isUnlockInProgress(address)\":{\"params\":{\"_sender\":\"Address of sender\"},\"returns\":{\"_0\":\"Boolean indicating whether `_sender` has an unlock in progress\"}},\"redeemWinningTicket((address,address,uint256,uint256,uint256,bytes32,bytes),bytes,uint256)\":{\"params\":{\"_recipientRand\":\"The preimage for the recipientRandHash included in `_ticket`\",\"_sig\":\"Sender's signature over the hash of `_ticket`\",\"_ticket\":\"Winning ticket to be redeemed in order to claim payment\"}},\"setController(address)\":{\"params\":{\"_controller\":\"Controller contract address\"}},\"setTicketValidityPeriod(uint256)\":{\"params\":{\"_ticketValidityPeriod\":\"Value for ticketValidityPeriod\"}},\"setUnlockPeriod(uint256)\":{\"params\":{\"_unlockPeriod\":\"Value for unlockPeriod\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"batchRedeemWinningTickets((address,address,uint256,uint256,uint256,bytes32,bytes)[],bytes[],uint256[])\":{\"notice\":\"Redeems multiple winning tickets. The function will redeem all of the provided tickets and handle any failures gracefully without reverting the entire function\"},\"cancelUnlock()\":{\"notice\":\"Cancels the unlock period for the caller\"},\"constructor\":{\"notice\":\"TicketBroker constructor. Only invokes constructor of base Manager contract with provided Controller address\"},\"fundDeposit()\":{\"notice\":\"Adds ETH to the caller's deposit\"},\"fundDepositAndReserve(uint256,uint256)\":{\"notice\":\"Adds ETH to the caller's deposit and reserve\"},\"fundDepositAndReserveFor(address,uint256,uint256)\":{\"notice\":\"Adds ETH to the address' deposit and reserve\"},\"fundReserve()\":{\"notice\":\"Adds ETH to the caller's reserve\"},\"getSenderInfo(address)\":{\"notice\":\"Returns info about a sender\"},\"isUnlockInProgress(address)\":{\"notice\":\"Returns whether a sender is currently in the unlock period\"},\"redeemWinningTicket((address,address,uint256,uint256,uint256,bytes32,bytes),bytes,uint256)\":{\"notice\":\"Redeems a winning ticket that has been signed by a sender and reveals the recipient recipientRand that corresponds to the recipientRandHash included in the ticket\"},\"setController(address)\":{\"notice\":\"Set controller. Only callable by current controller\"},\"setTicketValidityPeriod(uint256)\":{\"notice\":\"Sets ticketValidityPeriod value. Only callable by the Controller owner\"},\"setUnlockPeriod(uint256)\":{\"notice\":\"Sets unlockPeriod value. Only callable by the Controller owner\"},\"unlock()\":{\"notice\":\"Initiates the unlock period for the caller\"},\"withdraw()\":{\"notice\":\"Withdraws all ETH from the caller's deposit and reserve\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/pm/TicketBroker.sol\":\"TicketBroker\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n    bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n     */\\n    function toString(uint256 value) internal pure returns (string memory) {\\n        // Inspired by OraclizeAPI's implementation - MIT licence\\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n        if (value == 0) {\\n            return \\\"0\\\";\\n        }\\n        uint256 temp = value;\\n        uint256 digits;\\n        while (temp != 0) {\\n            digits++;\\n            temp /= 10;\\n        }\\n        bytes memory buffer = new bytes(digits);\\n        while (value != 0) {\\n            digits -= 1;\\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n            value /= 10;\\n        }\\n        return string(buffer);\\n    }\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n     */\\n    function toHexString(uint256 value) internal pure returns (string memory) {\\n        if (value == 0) {\\n            return \\\"0x00\\\";\\n        }\\n        uint256 temp = value;\\n        uint256 length = 0;\\n        while (temp != 0) {\\n            length++;\\n            temp >>= 8;\\n        }\\n        return toHexString(value, length);\\n    }\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n     */\\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n        bytes memory buffer = new bytes(2 * length + 2);\\n        buffer[0] = \\\"0\\\";\\n        buffer[1] = \\\"x\\\";\\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\\n            buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n            value >>= 4;\\n        }\\n        require(value == 0, \\\"Strings: hex length insufficient\\\");\\n        return string(buffer);\\n    }\\n}\\n\",\"keccak256\":\"0x32c202bd28995dd20c4347b7c6467a6d3241c74c8ad3edcbb610cd9205916c45\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSA {\\n    enum RecoverError {\\n        NoError,\\n        InvalidSignature,\\n        InvalidSignatureLength,\\n        InvalidSignatureS,\\n        InvalidSignatureV\\n    }\\n\\n    function _throwError(RecoverError error) private pure {\\n        if (error == RecoverError.NoError) {\\n            return; // no error: do nothing\\n        } else if (error == RecoverError.InvalidSignature) {\\n            revert(\\\"ECDSA: invalid signature\\\");\\n        } else if (error == RecoverError.InvalidSignatureLength) {\\n            revert(\\\"ECDSA: invalid signature length\\\");\\n        } else if (error == RecoverError.InvalidSignatureS) {\\n            revert(\\\"ECDSA: invalid signature 's' value\\\");\\n        } else if (error == RecoverError.InvalidSignatureV) {\\n            revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the address that signed a hashed message (`hash`) with\\n     * `signature` or error string. This address can then be used for verification purposes.\\n     *\\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n     * this function rejects them by requiring the `s` value to be in the lower\\n     * half order, and the `v` value to be either 27 or 28.\\n     *\\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n     * verification to be secure: it is possible to craft signatures that\\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n     * this is by receiving a hash of the original message (which may otherwise\\n     * be too long), and then calling {toEthSignedMessageHash} on it.\\n     *\\n     * Documentation for signature generation:\\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n     *\\n     * _Available since v4.3._\\n     */\\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n        // Check the signature length\\n        // - case 65: r,s,v signature (standard)\\n        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._\\n        if (signature.length == 65) {\\n            bytes32 r;\\n            bytes32 s;\\n            uint8 v;\\n            // ecrecover takes the signature parameters, and the only way to get them\\n            // currently is to use assembly.\\n            assembly {\\n                r := mload(add(signature, 0x20))\\n                s := mload(add(signature, 0x40))\\n                v := byte(0, mload(add(signature, 0x60)))\\n            }\\n            return tryRecover(hash, v, r, s);\\n        } else if (signature.length == 64) {\\n            bytes32 r;\\n            bytes32 vs;\\n            // ecrecover takes the signature parameters, and the only way to get them\\n            // currently is to use assembly.\\n            assembly {\\n                r := mload(add(signature, 0x20))\\n                vs := mload(add(signature, 0x40))\\n            }\\n            return tryRecover(hash, r, vs);\\n        } else {\\n            return (address(0), RecoverError.InvalidSignatureLength);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the address that signed a hashed message (`hash`) with\\n     * `signature`. This address can then be used for verification purposes.\\n     *\\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n     * this function rejects them by requiring the `s` value to be in the lower\\n     * half order, and the `v` value to be either 27 or 28.\\n     *\\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n     * verification to be secure: it is possible to craft signatures that\\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n     * this is by receiving a hash of the original message (which may otherwise\\n     * be too long), and then calling {toEthSignedMessageHash} on it.\\n     */\\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n        (address recovered, RecoverError error) = tryRecover(hash, signature);\\n        _throwError(error);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n     *\\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n     *\\n     * _Available since v4.3._\\n     */\\n    function tryRecover(\\n        bytes32 hash,\\n        bytes32 r,\\n        bytes32 vs\\n    ) internal pure returns (address, RecoverError) {\\n        bytes32 s;\\n        uint8 v;\\n        assembly {\\n            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)\\n            v := add(shr(255, vs), 27)\\n        }\\n        return tryRecover(hash, v, r, s);\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n     *\\n     * _Available since v4.2._\\n     */\\n    function recover(\\n        bytes32 hash,\\n        bytes32 r,\\n        bytes32 vs\\n    ) internal pure returns (address) {\\n        (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n        _throwError(error);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n     * `r` and `s` signature fields separately.\\n     *\\n     * _Available since v4.3._\\n     */\\n    function tryRecover(\\n        bytes32 hash,\\n        uint8 v,\\n        bytes32 r,\\n        bytes32 s\\n    ) internal pure returns (address, RecoverError) {\\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n        // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n        //\\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n        // these malleable signatures as well.\\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n            return (address(0), RecoverError.InvalidSignatureS);\\n        }\\n        if (v != 27 && v != 28) {\\n            return (address(0), RecoverError.InvalidSignatureV);\\n        }\\n\\n        // If the signature is valid (and not malleable), return the signer address\\n        address signer = ecrecover(hash, v, r, s);\\n        if (signer == address(0)) {\\n            return (address(0), RecoverError.InvalidSignature);\\n        }\\n\\n        return (signer, RecoverError.NoError);\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\\n     * `r` and `s` signature fields separately.\\n     */\\n    function recover(\\n        bytes32 hash,\\n        uint8 v,\\n        bytes32 r,\\n        bytes32 s\\n    ) internal pure returns (address) {\\n        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n        _throwError(error);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n     * produces hash corresponding to the one signed with the\\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n     * JSON-RPC method as part of EIP-191.\\n     *\\n     * See {recover}.\\n     */\\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n        // 32 is the length in bytes of hash,\\n        // enforced by the type signature above\\n        return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n    }\\n\\n    /**\\n     * @dev Returns an Ethereum Signed Message, created from `s`. This\\n     * produces hash corresponding to the one signed with the\\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n     * JSON-RPC method as part of EIP-191.\\n     *\\n     * See {recover}.\\n     */\\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n        return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", Strings.toString(s.length), s));\\n    }\\n\\n    /**\\n     * @dev Returns an Ethereum Signed Typed Data, created from a\\n     * `domainSeparator` and a `structHash`. This produces hash corresponding\\n     * to the one signed with the\\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n     * JSON-RPC method as part of EIP-712.\\n     *\\n     * See {recover}.\\n     */\\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n        return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n    }\\n}\\n\",\"keccak256\":\"0xe9e291de7ffe06e66503c6700b1bb84ff6e0989cbb974653628d8994e7c97f03\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMath {\\n    /**\\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            uint256 c = a + b;\\n            if (c < a) return (false, 0);\\n            return (true, c);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the substraction of two unsigned integers, with an overflow flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            if (b > a) return (false, 0);\\n            return (true, a - b);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n            // benefit is lost if 'b' is also tested.\\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n            if (a == 0) return (true, 0);\\n            uint256 c = a * b;\\n            if (c / a != b) return (false, 0);\\n            return (true, c);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            if (b == 0) return (false, 0);\\n            return (true, a / b);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            if (b == 0) return (false, 0);\\n            return (true, a % b);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the addition of two unsigned integers, reverting on\\n     * overflow.\\n     *\\n     * Counterpart to Solidity's `+` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Addition cannot overflow.\\n     */\\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a + b;\\n    }\\n\\n    /**\\n     * @dev Returns the subtraction of two unsigned integers, reverting on\\n     * overflow (when the result is negative).\\n     *\\n     * Counterpart to Solidity's `-` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Subtraction cannot overflow.\\n     */\\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a - b;\\n    }\\n\\n    /**\\n     * @dev Returns the multiplication of two unsigned integers, reverting on\\n     * overflow.\\n     *\\n     * Counterpart to Solidity's `*` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Multiplication cannot overflow.\\n     */\\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a * b;\\n    }\\n\\n    /**\\n     * @dev Returns the integer division of two unsigned integers, reverting on\\n     * division by zero. The result is rounded towards zero.\\n     *\\n     * Counterpart to Solidity's `/` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a / b;\\n    }\\n\\n    /**\\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n     * reverting when dividing by zero.\\n     *\\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\\n     * invalid opcode to revert (consuming all remaining gas).\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a % b;\\n    }\\n\\n    /**\\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n     * overflow (when the result is negative).\\n     *\\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\\n     * message unnecessarily. For custom revert reasons use {trySub}.\\n     *\\n     * Counterpart to Solidity's `-` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Subtraction cannot overflow.\\n     */\\n    function sub(\\n        uint256 a,\\n        uint256 b,\\n        string memory errorMessage\\n    ) internal pure returns (uint256) {\\n        unchecked {\\n            require(b <= a, errorMessage);\\n            return a - b;\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n     * division by zero. The result is rounded towards zero.\\n     *\\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n     * uses an invalid opcode to revert (consuming all remaining gas).\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function div(\\n        uint256 a,\\n        uint256 b,\\n        string memory errorMessage\\n    ) internal pure returns (uint256) {\\n        unchecked {\\n            require(b > 0, errorMessage);\\n            return a / b;\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n     * reverting with custom message when dividing by zero.\\n     *\\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\\n     * message unnecessarily. For custom revert reasons use {tryMod}.\\n     *\\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\\n     * invalid opcode to revert (consuming all remaining gas).\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function mod(\\n        uint256 a,\\n        uint256 b,\\n        string memory errorMessage\\n    ) internal pure returns (uint256) {\\n        unchecked {\\n            require(b > 0, errorMessage);\\n            return a % b;\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xa2f576be637946f767aa56601c26d717f48a0aff44f82e46f13807eea1009a21\",\"license\":\"MIT\"},\"contracts/IController.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./zeppelin/Pausable.sol\\\";\\n\\nabstract contract IController is Pausable {\\n    event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash);\\n\\n    function setContractInfo(\\n        bytes32 _id,\\n        address _contractAddress,\\n        bytes20 _gitCommitHash\\n    ) external virtual;\\n\\n    function updateController(bytes32 _id, address _controller) external virtual;\\n\\n    function getContract(bytes32 _id) public view virtual returns (address);\\n}\\n\",\"keccak256\":\"0x34ea30a2b44d0cbec58fc1d703476ff0085b0fdadab0cd65c35c00b8867f7546\",\"license\":\"MIT\"},\"contracts/IManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\ninterface IManager {\\n    event SetController(address controller);\\n    event ParameterUpdate(string param);\\n\\n    function setController(address _controller) external;\\n}\\n\",\"keccak256\":\"0xc179e4cecc593741514237d5194b4aaac6b829789629fa19ed04f572a8530481\",\"license\":\"MIT\"},\"contracts/Manager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./IManager.sol\\\";\\nimport \\\"./IController.sol\\\";\\n\\ncontract Manager is IManager {\\n    // Controller that contract is registered with\\n    IController public controller;\\n\\n    // Check if sender is controller\\n    modifier onlyController() {\\n        _onlyController();\\n        _;\\n    }\\n\\n    // Check if sender is controller owner\\n    modifier onlyControllerOwner() {\\n        _onlyControllerOwner();\\n        _;\\n    }\\n\\n    // Check if controller is not paused\\n    modifier whenSystemNotPaused() {\\n        _whenSystemNotPaused();\\n        _;\\n    }\\n\\n    // Check if controller is paused\\n    modifier whenSystemPaused() {\\n        _whenSystemPaused();\\n        _;\\n    }\\n\\n    constructor(address _controller) {\\n        controller = IController(_controller);\\n    }\\n\\n    /**\\n     * @notice Set controller. Only callable by current controller\\n     * @param _controller Controller contract address\\n     */\\n    function setController(address _controller) external onlyController {\\n        controller = IController(_controller);\\n\\n        emit SetController(_controller);\\n    }\\n\\n    function _onlyController() private view {\\n        require(msg.sender == address(controller), \\\"caller must be Controller\\\");\\n    }\\n\\n    function _onlyControllerOwner() private view {\\n        require(msg.sender == controller.owner(), \\\"caller must be Controller owner\\\");\\n    }\\n\\n    function _whenSystemNotPaused() private view {\\n        require(!controller.paused(), \\\"system is paused\\\");\\n    }\\n\\n    function _whenSystemPaused() private view {\\n        require(controller.paused(), \\\"system is not paused\\\");\\n    }\\n}\\n\",\"keccak256\":\"0xc415e3f42da9f82ddd5953031f3f26aed824368fcc34d3b8a17015bfe80dc109\",\"license\":\"MIT\"},\"contracts/ManagerProxyTarget.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./Manager.sol\\\";\\n\\n/**\\n * @title ManagerProxyTarget\\n * @notice The base contract that target contracts used by a proxy contract should inherit from\\n * @dev Both the target contract and the proxy contract (implemented as ManagerProxy) MUST inherit from ManagerProxyTarget in order to guarantee\\n that both contracts have the same storage layout. Differing storage layouts in a proxy contract and target contract can\\n potentially break the delegate proxy upgradeability mechanism\\n */\\nabstract contract ManagerProxyTarget is Manager {\\n    // Used to look up target contract address in controller's registry\\n    bytes32 public targetContractId;\\n}\\n\",\"keccak256\":\"0x920bcc2def240e06272dc06cbcb9f12976f1698cd4f1020c165af25ee837e553\",\"license\":\"MIT\"},\"contracts/bonding/IBondingManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\n/**\\n * @title Interface for BondingManager\\n * TODO: switch to interface type\\n */\\ninterface IBondingManager {\\n    event TranscoderUpdate(address indexed transcoder, uint256 rewardCut, uint256 feeShare);\\n    event TranscoderActivated(address indexed transcoder, uint256 activationRound);\\n    event TranscoderDeactivated(address indexed transcoder, uint256 deactivationRound);\\n    event TranscoderSlashed(address indexed transcoder, address finder, uint256 penalty, uint256 finderReward);\\n    event Reward(address indexed transcoder, uint256 amount);\\n    event Bond(\\n        address indexed newDelegate,\\n        address indexed oldDelegate,\\n        address indexed delegator,\\n        uint256 additionalAmount,\\n        uint256 bondedAmount\\n    );\\n    event Unbond(\\n        address indexed delegate,\\n        address indexed delegator,\\n        uint256 unbondingLockId,\\n        uint256 amount,\\n        uint256 withdrawRound\\n    );\\n    event Rebond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount);\\n    event TransferBond(\\n        address indexed oldDelegator,\\n        address indexed newDelegator,\\n        uint256 oldUnbondingLockId,\\n        uint256 newUnbondingLockId,\\n        uint256 amount\\n    );\\n    event WithdrawStake(address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound);\\n    event WithdrawFees(address indexed delegator, address recipient, uint256 amount);\\n    event EarningsClaimed(\\n        address indexed delegate,\\n        address indexed delegator,\\n        uint256 rewards,\\n        uint256 fees,\\n        uint256 startRound,\\n        uint256 endRound\\n    );\\n\\n    // Deprecated events\\n    // These event signatures can be used to construct the appropriate topic hashes to filter for past logs corresponding\\n    // to these deprecated events.\\n    // event Bond(address indexed delegate, address indexed delegator);\\n    // event Unbond(address indexed delegate, address indexed delegator);\\n    // event WithdrawStake(address indexed delegator);\\n    // event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered);\\n    // event TranscoderEvicted(address indexed transcoder);\\n    // event TranscoderResigned(address indexed transcoder);\\n\\n    // External functions\\n    function updateTranscoderWithFees(\\n        address _transcoder,\\n        uint256 _fees,\\n        uint256 _round\\n    ) external;\\n\\n    function slashTranscoder(\\n        address _transcoder,\\n        address _finder,\\n        uint256 _slashAmount,\\n        uint256 _finderFee\\n    ) external;\\n\\n    function setCurrentRoundTotalActiveStake() external;\\n\\n    // Public functions\\n    function getTranscoderPoolSize() external view returns (uint256);\\n\\n    function transcoderTotalStake(address _transcoder) external view returns (uint256);\\n\\n    function isActiveTranscoder(address _transcoder) external view returns (bool);\\n\\n    function getTotalBonded() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x6406378868b556ca91b1ab6cccd036695c8984d30a225f75a5979cb9aa7c1df2\",\"license\":\"MIT\"},\"contracts/pm/TicketBroker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./mixins/MixinContractRegistry.sol\\\";\\nimport \\\"./mixins/MixinReserve.sol\\\";\\nimport \\\"./mixins/MixinTicketBrokerCore.sol\\\";\\nimport \\\"./mixins/MixinTicketProcessor.sol\\\";\\nimport \\\"./mixins/MixinWrappers.sol\\\";\\n\\ncontract TicketBroker is\\n    MixinContractRegistry,\\n    MixinReserve,\\n    MixinTicketBrokerCore,\\n    MixinTicketProcessor,\\n    MixinWrappers\\n{\\n    /**\\n     * @notice TicketBroker constructor. Only invokes constructor of base Manager contract with provided Controller address\\n     * @dev This constructor will not initialize any state variables besides `controller`. The following setter functions\\n     * should be used to initialize state variables post-deployment:\\n     * - setUnlockPeriod()\\n     * - setTicketValidityPeriod()\\n     * @param _controller Address of Controller that this contract will be registered with\\n     */\\n    constructor(address _controller)\\n        MixinContractRegistry(_controller)\\n        MixinReserve()\\n        MixinTicketBrokerCore()\\n        MixinTicketProcessor()\\n    {}\\n\\n    /**\\n     * @notice Sets unlockPeriod value. Only callable by the Controller owner\\n     * @param _unlockPeriod Value for unlockPeriod\\n     */\\n    function setUnlockPeriod(uint256 _unlockPeriod) external onlyControllerOwner {\\n        unlockPeriod = _unlockPeriod;\\n\\n        emit ParameterUpdate(\\\"unlockPeriod\\\");\\n    }\\n\\n    /**\\n     * @notice Sets ticketValidityPeriod value. Only callable by the Controller owner\\n     * @param _ticketValidityPeriod Value for ticketValidityPeriod\\n     */\\n    function setTicketValidityPeriod(uint256 _ticketValidityPeriod) external onlyControllerOwner {\\n        require(_ticketValidityPeriod > 0, \\\"ticketValidityPeriod must be greater than 0\\\");\\n\\n        ticketValidityPeriod = _ticketValidityPeriod;\\n\\n        emit ParameterUpdate(\\\"ticketValidityPeriod\\\");\\n    }\\n}\\n\",\"keccak256\":\"0x3e1b4458d61a3c20e23707bde667f936af006668f1ec4a69b2322ff7e79336e7\",\"license\":\"MIT\"},\"contracts/pm/mixins/MixinContractRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"../../ManagerProxyTarget.sol\\\";\\nimport \\\"./interfaces/MContractRegistry.sol\\\";\\n\\nabstract contract MixinContractRegistry is MContractRegistry, ManagerProxyTarget {\\n    /**\\n     * @dev Checks if the current round has been initialized\\n     */\\n    modifier currentRoundInitialized() override {\\n        require(roundsManager().currentRoundInitialized(), \\\"current round is not initialized\\\");\\n        _;\\n    }\\n\\n    constructor(address _controller) Manager(_controller) {}\\n\\n    /**\\n     * @dev Returns an instance of the IBondingManager interface\\n     */\\n    function bondingManager() internal view override returns (IBondingManager) {\\n        return IBondingManager(controller.getContract(keccak256(\\\"BondingManager\\\")));\\n    }\\n\\n    /**\\n     * @dev Returns an instance of the IMinter interface\\n     */\\n    function minter() internal view override returns (IMinter) {\\n        return IMinter(controller.getContract(keccak256(\\\"Minter\\\")));\\n    }\\n\\n    /**\\n     * @dev Returns an instance of the IRoundsManager interface\\n     */\\n    function roundsManager() internal view override returns (IRoundsManager) {\\n        return IRoundsManager(controller.getContract(keccak256(\\\"RoundsManager\\\")));\\n    }\\n}\\n\",\"keccak256\":\"0xaf3b21d532c7fdcd02606045c66646b035a257a27dea374b8c8487339778ee2a\",\"license\":\"MIT\"},\"contracts/pm/mixins/MixinReserve.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./interfaces/MReserve.sol\\\";\\nimport \\\"./MixinContractRegistry.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\n\\nabstract contract MixinReserve is MixinContractRegistry, MReserve {\\n    using SafeMath for uint256;\\n\\n    struct Reserve {\\n        uint256 funds; // Amount of funds in the reserve\\n        mapping(uint256 => uint256) claimedForRound; // Mapping of round => total amount claimed\\n        mapping(uint256 => mapping(address => uint256)) claimedByAddress; // Mapping of round => claimant address => amount claimed\\n    }\\n\\n    // Mapping of address => reserve\\n    mapping(address => Reserve) internal reserves;\\n\\n    /**\\n     * @dev Returns info about a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @return info Info about the reserve for `_reserveHolder`\\n     */\\n    function getReserveInfo(address _reserveHolder) public view override returns (ReserveInfo memory info) {\\n        info.fundsRemaining = remainingReserve(_reserveHolder);\\n        info.claimedInCurrentRound = reserves[_reserveHolder].claimedForRound[roundsManager().currentRound()];\\n    }\\n\\n    /**\\n     * @dev Returns the amount of funds claimable by a claimant from a reserve in the current round\\n     * @param _reserveHolder Address of reserve holder\\n     * @param _claimant Address of claimant\\n     * @return Amount of funds claimable by `_claimant` from the reserve for `_reserveHolder` in the current round\\n     */\\n    function claimableReserve(address _reserveHolder, address _claimant) public view returns (uint256) {\\n        Reserve storage reserve = reserves[_reserveHolder];\\n\\n        uint256 currentRound = roundsManager().currentRound();\\n\\n        if (!bondingManager().isActiveTranscoder(_claimant)) {\\n            return 0;\\n        }\\n\\n        uint256 poolSize = bondingManager().getTranscoderPoolSize();\\n        if (poolSize == 0) {\\n            return 0;\\n        }\\n\\n        // Total claimable funds = remaining funds + amount claimed for the round\\n        uint256 totalClaimable = reserve.funds.add(reserve.claimedForRound[currentRound]);\\n        return totalClaimable.div(poolSize).sub(reserve.claimedByAddress[currentRound][_claimant]);\\n    }\\n\\n    /**\\n     * @dev Returns the amount of funds claimed by a claimant from a reserve in the current round\\n     * @param _reserveHolder Address of reserve holder\\n     * @param _claimant Address of claimant\\n     * @return Amount of funds claimed by `_claimant` from the reserve for `_reserveHolder` in the current round\\n     */\\n    function claimedReserve(address _reserveHolder, address _claimant) public view override returns (uint256) {\\n        Reserve storage reserve = reserves[_reserveHolder];\\n        uint256 currentRound = roundsManager().currentRound();\\n        return reserve.claimedByAddress[currentRound][_claimant];\\n    }\\n\\n    /**\\n     * @dev Adds funds to a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @param _amount Amount of funds to add to reserve\\n     */\\n    function addReserve(address _reserveHolder, uint256 _amount) internal override {\\n        reserves[_reserveHolder].funds = reserves[_reserveHolder].funds.add(_amount);\\n\\n        emit ReserveFunded(_reserveHolder, _amount);\\n    }\\n\\n    /**\\n     * @dev Clears contract storage used for a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     */\\n    function clearReserve(address _reserveHolder) internal override {\\n        // This delete operation will only clear reserve.funds and will not clear the storage for reserve.claimedForRound\\n        // reserve.claimedByAddress because these fields are mappings and the Solidity `delete` keyword will not modify mappings.\\n        // This *could* be a problem in the following scenario:\\n        //\\n        // 1) In round N, for address A, reserve.claimedForRound[N] > 0 and reserve.claimedByAddress[N][r_i] > 0 where r_i is\\n        // a member of the active set in round N\\n        // 2) This function is called by MixinTicketBrokerCore.withdraw() in round N\\n        // 3) Address A funds its reserve again\\n        //\\n        // After step 3, A has reserve.funds > 0, reserve.claimedForRound[N] > 0 and reserve.claimedByAddress[N][r_i] > 0\\n        // despite having funded a fresh reserve after previously withdrawing all of its funds in the same round.\\n        // We prevent this scenario by disallowing reserve claims starting at an address' withdraw round in\\n        // MixinTicketBrokerCore.redeemWinningTicket()\\n        delete reserves[_reserveHolder];\\n    }\\n\\n    /**\\n     * @dev Claims funds from a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @param _claimant Address of claimant\\n     * @param _amount Amount of funds to claim from the reserve\\n     * @return Amount of funds (<= `_amount`) claimed by `_claimant` from the reserve for `_reserveHolder`\\n     */\\n    function claimFromReserve(\\n        address _reserveHolder,\\n        address _claimant,\\n        uint256 _amount\\n    ) internal override returns (uint256) {\\n        uint256 claimableFunds = claimableReserve(_reserveHolder, _claimant);\\n        // If the given amount > claimableFunds then claim claimableFunds\\n        // If the given amount <= claimableFunds then claim the given amount\\n        uint256 claimAmount = _amount > claimableFunds ? claimableFunds : _amount;\\n\\n        if (claimAmount > 0) {\\n            uint256 currentRound = roundsManager().currentRound();\\n            Reserve storage reserve = reserves[_reserveHolder];\\n            // Increase total amount claimed for the round\\n            reserve.claimedForRound[currentRound] = reserve.claimedForRound[currentRound].add(claimAmount);\\n            // Increase amount claimed by claimant for the round\\n            reserve.claimedByAddress[currentRound][_claimant] = reserve.claimedByAddress[currentRound][_claimant].add(\\n                claimAmount\\n            );\\n            // Decrease remaining reserve\\n            reserve.funds = reserve.funds.sub(claimAmount);\\n\\n            emit ReserveClaimed(_reserveHolder, _claimant, claimAmount);\\n        }\\n\\n        return claimAmount;\\n    }\\n\\n    /**\\n     * @dev Returns the amount of funds remaining in a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @return Amount of funds remaining in the reserve for `_reserveHolder`\\n     */\\n    function remainingReserve(address _reserveHolder) internal view override returns (uint256) {\\n        return reserves[_reserveHolder].funds;\\n    }\\n}\\n\",\"keccak256\":\"0x1b1d7694fe606eb1c0ba2e203889b416804bd1547ee63ed572c1c628f219c775\",\"license\":\"MIT\"},\"contracts/pm/mixins/MixinTicketBrokerCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./interfaces/MReserve.sol\\\";\\nimport \\\"./interfaces/MTicketProcessor.sol\\\";\\nimport \\\"./interfaces/MTicketBrokerCore.sol\\\";\\nimport \\\"./MixinContractRegistry.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\n\\nabstract contract MixinTicketBrokerCore is MixinContractRegistry, MReserve, MTicketProcessor, MTicketBrokerCore {\\n    using SafeMath for uint256;\\n\\n    struct Sender {\\n        uint256 deposit; // Amount of funds deposited\\n        uint256 withdrawRound; // Round that sender can withdraw deposit & reserve\\n    }\\n\\n    // Mapping of address => Sender\\n    mapping(address => Sender) internal senders;\\n\\n    // Number of rounds before a sender can withdraw after requesting an unlock\\n    uint256 public unlockPeriod;\\n\\n    // Mapping of ticket hashes => boolean indicating if ticket was redeemed\\n    mapping(bytes32 => bool) public usedTickets;\\n\\n    // Checks if msg.value is equal to the given deposit and reserve amounts\\n    modifier checkDepositReserveETHValueSplit(uint256 _depositAmount, uint256 _reserveAmount) {\\n        require(\\n            msg.value == _depositAmount.add(_reserveAmount),\\n            \\\"msg.value does not equal sum of deposit amount and reserve amount\\\"\\n        );\\n\\n        _;\\n    }\\n\\n    // Process deposit funding\\n    modifier processDeposit(address _sender, uint256 _amount) {\\n        Sender storage sender = senders[_sender];\\n        sender.deposit = sender.deposit.add(_amount);\\n        if (_isUnlockInProgress(sender)) {\\n            _cancelUnlock(sender, _sender);\\n        }\\n\\n        _;\\n\\n        emit DepositFunded(_sender, _amount);\\n    }\\n\\n    // Process reserve funding\\n    modifier processReserve(address _sender, uint256 _amount) {\\n        Sender storage sender = senders[_sender];\\n        addReserve(_sender, _amount);\\n        if (_isUnlockInProgress(sender)) {\\n            _cancelUnlock(sender, _sender);\\n        }\\n\\n        _;\\n    }\\n\\n    /**\\n     * @notice Adds ETH to the caller's deposit\\n     */\\n    function fundDeposit() external payable whenSystemNotPaused processDeposit(msg.sender, msg.value) {\\n        processFunding(msg.value);\\n    }\\n\\n    /**\\n     * @notice Adds ETH to the caller's reserve\\n     */\\n    function fundReserve() external payable whenSystemNotPaused processReserve(msg.sender, msg.value) {\\n        processFunding(msg.value);\\n    }\\n\\n    /**\\n     * @notice Adds ETH to the caller's deposit and reserve\\n     * @param _depositAmount Amount of ETH to add to the caller's deposit\\n     * @param _reserveAmount Amount of ETH to add to the caller's reserve\\n     */\\n    function fundDepositAndReserve(uint256 _depositAmount, uint256 _reserveAmount) external payable {\\n        fundDepositAndReserveFor(msg.sender, _depositAmount, _reserveAmount);\\n    }\\n\\n    /**\\n     * @notice Adds ETH to the address' deposit and reserve\\n     * @param _depositAmount Amount of ETH to add to the address' deposit\\n     * @param _reserveAmount Amount of ETH to add to the address' reserve\\n     */\\n    function fundDepositAndReserveFor(\\n        address _addr,\\n        uint256 _depositAmount,\\n        uint256 _reserveAmount\\n    )\\n        public\\n        payable\\n        whenSystemNotPaused\\n        checkDepositReserveETHValueSplit(_depositAmount, _reserveAmount)\\n        processDeposit(_addr, _depositAmount)\\n        processReserve(_addr, _reserveAmount)\\n    {\\n        processFunding(msg.value);\\n    }\\n\\n    /**\\n     * @notice Redeems a winning ticket that has been signed by a sender and reveals the\\n     recipient recipientRand that corresponds to the recipientRandHash included in the ticket\\n     * @param _ticket Winning ticket to be redeemed in order to claim payment\\n     * @param _sig Sender's signature over the hash of `_ticket`\\n     * @param _recipientRand The preimage for the recipientRandHash included in `_ticket`\\n     */\\n    function redeemWinningTicket(\\n        Ticket memory _ticket,\\n        bytes memory _sig,\\n        uint256 _recipientRand\\n    ) public whenSystemNotPaused currentRoundInitialized {\\n        bytes32 ticketHash = getTicketHash(_ticket);\\n\\n        // Require a valid winning ticket for redemption\\n        requireValidWinningTicket(_ticket, ticketHash, _sig, _recipientRand);\\n\\n        Sender storage sender = senders[_ticket.sender];\\n\\n        // Require sender to be locked\\n        require(isLocked(sender), \\\"sender is unlocked\\\");\\n        // Require either a non-zero deposit or non-zero reserve for the sender\\n        require(sender.deposit > 0 || remainingReserve(_ticket.sender) > 0, \\\"sender deposit and reserve are zero\\\");\\n\\n        // Mark ticket as used to prevent replay attacks involving redeeming\\n        // the same winning ticket multiple times\\n        usedTickets[ticketHash] = true;\\n\\n        uint256 amountToTransfer;\\n\\n        if (_ticket.faceValue > sender.deposit) {\\n            // If ticket face value > sender's deposit then claim from\\n            // the sender's reserve\\n\\n            amountToTransfer = sender.deposit.add(\\n                claimFromReserve(_ticket.sender, _ticket.recipient, _ticket.faceValue.sub(sender.deposit))\\n            );\\n\\n            sender.deposit = 0;\\n        } else {\\n            // If ticket face value <= sender's deposit then only deduct\\n            // from sender's deposit\\n\\n            amountToTransfer = _ticket.faceValue;\\n            sender.deposit = sender.deposit.sub(_ticket.faceValue);\\n        }\\n\\n        if (amountToTransfer > 0) {\\n            winningTicketTransfer(_ticket.recipient, amountToTransfer, _ticket.auxData);\\n\\n            emit WinningTicketTransfer(_ticket.sender, _ticket.recipient, amountToTransfer);\\n        }\\n\\n        emit WinningTicketRedeemed(\\n            _ticket.sender,\\n            _ticket.recipient,\\n            _ticket.faceValue,\\n            _ticket.winProb,\\n            _ticket.senderNonce,\\n            _recipientRand,\\n            _ticket.auxData\\n        );\\n    }\\n\\n    /**\\n     * @notice Initiates the unlock period for the caller\\n     */\\n    function unlock() public whenSystemNotPaused {\\n        Sender storage sender = senders[msg.sender];\\n\\n        require(sender.deposit > 0 || remainingReserve(msg.sender) > 0, \\\"sender deposit and reserve are zero\\\");\\n        require(!_isUnlockInProgress(sender), \\\"unlock already initiated\\\");\\n\\n        uint256 currentRound = roundsManager().currentRound();\\n        sender.withdrawRound = currentRound.add(unlockPeriod);\\n\\n        emit Unlock(msg.sender, currentRound, sender.withdrawRound);\\n    }\\n\\n    /**\\n     * @notice Cancels the unlock period for the caller\\n     */\\n    function cancelUnlock() public whenSystemNotPaused {\\n        Sender storage sender = senders[msg.sender];\\n\\n        _cancelUnlock(sender, msg.sender);\\n    }\\n\\n    /**\\n     * @notice Withdraws all ETH from the caller's deposit and reserve\\n     */\\n    function withdraw() public whenSystemNotPaused {\\n        Sender storage sender = senders[msg.sender];\\n\\n        uint256 deposit = sender.deposit;\\n        uint256 reserve = remainingReserve(msg.sender);\\n\\n        require(deposit > 0 || reserve > 0, \\\"sender deposit and reserve are zero\\\");\\n        require(_isUnlockInProgress(sender), \\\"no unlock request in progress\\\");\\n        require(!isLocked(sender), \\\"account is locked\\\");\\n\\n        sender.deposit = 0;\\n        clearReserve(msg.sender);\\n\\n        withdrawTransfer(payable(msg.sender), deposit.add(reserve));\\n\\n        emit Withdrawal(msg.sender, deposit, reserve);\\n    }\\n\\n    /**\\n     * @notice Returns whether a sender is currently in the unlock period\\n     * @param _sender Address of sender\\n     * @return Boolean indicating whether `_sender` has an unlock in progress\\n     */\\n    function isUnlockInProgress(address _sender) public view returns (bool) {\\n        Sender memory sender = senders[_sender];\\n        return _isUnlockInProgress(sender);\\n    }\\n\\n    /**\\n     * @notice Returns info about a sender\\n     * @param _sender Address of sender\\n     * @return sender Info about the sender for `_sender`\\n     * @return reserve Info about the reserve for `_sender`\\n     */\\n    function getSenderInfo(address _sender) public view returns (Sender memory sender, ReserveInfo memory reserve) {\\n        sender = senders[_sender];\\n        reserve = getReserveInfo(_sender);\\n    }\\n\\n    /**\\n     * @dev Returns the hash of a ticket\\n     * @param _ticket Ticket to be hashed\\n     * @return keccak256 hash of `_ticket`\\n     */\\n    function getTicketHash(Ticket memory _ticket) public pure returns (bytes32) {\\n        return\\n            keccak256(\\n                abi.encodePacked(\\n                    _ticket.recipient,\\n                    _ticket.sender,\\n                    _ticket.faceValue,\\n                    _ticket.winProb,\\n                    _ticket.senderNonce,\\n                    _ticket.recipientRandHash,\\n                    _ticket.auxData\\n                )\\n            );\\n    }\\n\\n    /**\\n     * @dev Helper to cancel an unlock\\n     * @param _sender Sender that is cancelling an unlock\\n     * @param _senderAddress Address of sender\\n     */\\n    function _cancelUnlock(Sender storage _sender, address _senderAddress) internal {\\n        require(_isUnlockInProgress(_sender), \\\"no unlock request in progress\\\");\\n\\n        _sender.withdrawRound = 0;\\n\\n        emit UnlockCancelled(_senderAddress);\\n    }\\n\\n    /**\\n     * @dev Validates a winning ticket, succeeds or reverts\\n     * @param _ticket Winning ticket to be validated\\n     * @param _ticketHash Hash of `_ticket`\\n     * @param _sig Sender's signature over `_ticketHash`\\n     * @param _recipientRand The preimage for the recipientRandHash included in `_ticket`\\n     */\\n    function requireValidWinningTicket(\\n        Ticket memory _ticket,\\n        bytes32 _ticketHash,\\n        bytes memory _sig,\\n        uint256 _recipientRand\\n    ) internal view {\\n        require(_ticket.recipient != address(0), \\\"ticket recipient is null address\\\");\\n        require(_ticket.sender != address(0), \\\"ticket sender is null address\\\");\\n\\n        requireValidTicketAuxData(_ticket.auxData);\\n\\n        require(\\n            keccak256(abi.encodePacked(_recipientRand)) == _ticket.recipientRandHash,\\n            \\\"recipientRand does not match recipientRandHash\\\"\\n        );\\n\\n        require(!usedTickets[_ticketHash], \\\"ticket is used\\\");\\n\\n        require(isValidTicketSig(_ticket.sender, _sig, _ticketHash), \\\"invalid signature over ticket hash\\\");\\n\\n        require(isWinningTicket(_sig, _recipientRand, _ticket.winProb), \\\"ticket did not win\\\");\\n    }\\n\\n    /**\\n     * @dev Returns whether a sender is locked\\n     * @param _sender Sender to check for locked status\\n     * @return Boolean indicating whether sender is currently locked\\n     */\\n    function isLocked(Sender memory _sender) internal view returns (bool) {\\n        return _sender.withdrawRound == 0 || roundsManager().currentRound() < _sender.withdrawRound;\\n    }\\n\\n    /**\\n     * @dev Returns whether a signature over a ticket hash is valid for a sender\\n     * @param _sender Address of sender\\n     * @param _sig Signature over `_ticketHash`\\n     * @param _ticketHash Hash of the ticket\\n     * @return Boolean indicating whether `_sig` is valid signature over `_ticketHash` for `_sender`\\n     */\\n    function isValidTicketSig(\\n        address _sender,\\n        bytes memory _sig,\\n        bytes32 _ticketHash\\n    ) internal pure returns (bool) {\\n        address signer = ECDSA.recover(ECDSA.toEthSignedMessageHash(_ticketHash), _sig);\\n        return signer != address(0) && _sender == signer;\\n    }\\n\\n    /**\\n     * @dev Returns whether a ticket won\\n     * @param _sig Sender's signature over the ticket\\n     * @param _recipientRand The preimage for the recipientRandHash included in the ticket\\n     * @param _winProb The winning probability of the ticket\\n     * @return Boolean indicating whether the ticket won\\n     */\\n    function isWinningTicket(\\n        bytes memory _sig,\\n        uint256 _recipientRand,\\n        uint256 _winProb\\n    ) internal pure returns (bool) {\\n        return uint256(keccak256(abi.encodePacked(_sig, _recipientRand))) < _winProb;\\n    }\\n\\n    /**\\n     * @dev Helper to check if a sender is currently in the unlock period\\n     * @param _sender Sender to check for an unlock\\n     * @return Boolean indicating whether the sender is currently in the unlock period\\n     */\\n    function _isUnlockInProgress(Sender memory _sender) internal pure returns (bool) {\\n        return _sender.withdrawRound > 0;\\n    }\\n}\\n\",\"keccak256\":\"0x44f9b93f0f831a21119e77285a6fae45ca7a5087711b9a46effd62c46eb79386\",\"license\":\"MIT\"},\"contracts/pm/mixins/MixinTicketProcessor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./interfaces/MTicketProcessor.sol\\\";\\nimport \\\"./MixinContractRegistry.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/math/SafeMath.sol\\\";\\n\\nabstract contract MixinTicketProcessor is MixinContractRegistry, MTicketProcessor {\\n    using SafeMath for uint256;\\n\\n    // Number of rounds that a ticket is valid for starting from\\n    // its creationRound\\n    uint256 public ticketValidityPeriod;\\n\\n    /**\\n     * @dev Process sent funds.\\n     * @param _amount Amount of funds sent\\n     */\\n    function processFunding(uint256 _amount) internal override {\\n        // Send funds to Minter\\n        minter().depositETH{ value: _amount }();\\n    }\\n\\n    /**\\n     * @dev Transfer withdrawal funds for a ticket sender\\n     * @param _amount Amount of withdrawal funds\\n     */\\n    function withdrawTransfer(address payable _sender, uint256 _amount) internal override {\\n        // Ask Minter to send withdrawal funds to the ticket sender\\n        minter().trustedWithdrawETH(_sender, _amount);\\n    }\\n\\n    /**\\n     * @dev Transfer funds for a recipient's winning ticket\\n     * @param _recipient Address of recipient\\n     * @param _amount Amount of funds for the winning ticket\\n     * @param _auxData Auxilary data for the winning ticket\\n     */\\n    function winningTicketTransfer(\\n        address _recipient,\\n        uint256 _amount,\\n        bytes memory _auxData\\n    ) internal override {\\n        (uint256 creationRound, ) = getCreationRoundAndBlockHash(_auxData);\\n\\n        // Ask BondingManager to update fee pool for recipient with\\n        // winning ticket funds\\n        bondingManager().updateTranscoderWithFees(_recipient, _amount, creationRound);\\n    }\\n\\n    /**\\n     * @dev Validates a ticket's auxilary data (succeeds or reverts)\\n     * @param _auxData Auxilary data inclueded in a ticket\\n     */\\n    function requireValidTicketAuxData(bytes memory _auxData) internal view override {\\n        (uint256 creationRound, bytes32 creationRoundBlockHash) = getCreationRoundAndBlockHash(_auxData);\\n        bytes32 blockHash = roundsManager().blockHashForRound(creationRound);\\n\\n        require(blockHash != bytes32(0), \\\"ticket creationRound does not have a block hash\\\");\\n        require(creationRoundBlockHash == blockHash, \\\"ticket creationRoundBlockHash invalid for creationRound\\\");\\n\\n        uint256 currRound = roundsManager().currentRound();\\n\\n        require(creationRound.add(ticketValidityPeriod) > currRound, \\\"ticket is expired\\\");\\n    }\\n\\n    /**\\n     * @dev Returns a ticket's creationRound and creationRoundBlockHash parsed from ticket auxilary data\\n     * @param _auxData Auxilary data for a ticket\\n     * @return creationRound and creationRoundBlockHash parsed from `_auxData`\\n     */\\n    function getCreationRoundAndBlockHash(bytes memory _auxData)\\n        internal\\n        pure\\n        returns (uint256 creationRound, bytes32 creationRoundBlockHash)\\n    {\\n        require(_auxData.length == 64, \\\"invalid length for ticket auxData: must be 64 bytes\\\");\\n\\n        // _auxData format:\\n        // Bytes [0:31] = creationRound\\n        // Bytes [32:63] = creationRoundBlockHash\\n        assembly {\\n            creationRound := mload(add(_auxData, 32))\\n            creationRoundBlockHash := mload(add(_auxData, 64))\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0x38a3a855f30ebce7af979a0876f11943b6064bc652908c47572f93a202989c41\",\"license\":\"MIT\"},\"contracts/pm/mixins/MixinWrappers.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./interfaces/MTicketBrokerCore.sol\\\";\\nimport \\\"./MixinContractRegistry.sol\\\";\\n\\nabstract contract MixinWrappers is MixinContractRegistry, MTicketBrokerCore {\\n    /**\\n     * @notice Redeems multiple winning tickets. The function will redeem all of the provided tickets and handle any failures gracefully without reverting the entire function\\n     * @param _tickets Array of winning tickets to be redeemed in order to claim payment\\n     * @param _sigs Array of sender signatures over the hash of tickets (`_sigs[i]` corresponds to `_tickets[i]`)\\n     * @param _recipientRands Array of preimages for the recipientRandHash included in each ticket (`_recipientRands[i]` corresponds to `_tickets[i]`)\\n     */\\n    function batchRedeemWinningTickets(\\n        Ticket[] memory _tickets,\\n        bytes[] memory _sigs,\\n        uint256[] memory _recipientRands\\n    ) public whenSystemNotPaused currentRoundInitialized {\\n        for (uint256 i = 0; i < _tickets.length; i++) {\\n            redeemWinningTicketNoRevert(_tickets[i], _sigs[i], _recipientRands[i]);\\n        }\\n    }\\n\\n    /**\\n     * @dev Redeems a winning ticket that has been signed by a sender and reveals the\\n     recipient recipientRand that corresponds to the recipientRandHash included in the ticket\\n     This function wraps `redeemWinningTicket()` and returns false if the underlying call reverts\\n     * @param _ticket Winning ticket to be redeemed in order to claim payment\\n     * @param _sig Sender's signature over the hash of `_ticket`\\n     * @param _recipientRand The preimage for the recipientRandHash included in `_ticket`\\n     * @return success Boolean indicating whether the underlying `redeemWinningTicket()` call succeeded\\n     */\\n    function redeemWinningTicketNoRevert(\\n        Ticket memory _ticket,\\n        bytes memory _sig,\\n        uint256 _recipientRand\\n    ) internal returns (bool success) {\\n        // ABI encode calldata for `redeemWinningTicket()`\\n        // A tuple type is used to represent the Ticket struct in the function signature\\n        bytes memory redeemWinningTicketCalldata = abi.encodeWithSignature(\\n            \\\"redeemWinningTicket((address,address,uint256,uint256,uint256,bytes32,bytes),bytes,uint256)\\\",\\n            _ticket,\\n            _sig,\\n            _recipientRand\\n        );\\n\\n        // Call `redeemWinningTicket()`\\n        // solium-disable-next-line\\n        (success, ) = address(this).call(redeemWinningTicketCalldata);\\n    }\\n}\\n\",\"keccak256\":\"0xf0831bba68089167c5cc9ed9a04564d0a68e1454bd65cf91083103197d047b1d\",\"license\":\"MIT\"},\"contracts/pm/mixins/interfaces/MContractRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"../../../bonding/IBondingManager.sol\\\";\\nimport \\\"../../../token/IMinter.sol\\\";\\nimport \\\"../../../rounds/IRoundsManager.sol\\\";\\n\\nabstract contract MContractRegistry {\\n    /**\\n     * @notice Checks if the current round has been initialized\\n     * @dev Executes the 'currentRoundInitialized' modifier in 'MixinContractRegistry'\\n     */\\n    modifier currentRoundInitialized() virtual {\\n        _;\\n    }\\n\\n    /**\\n     * @dev Returns an instance of the IBondingManager interface\\n     */\\n    function bondingManager() internal view virtual returns (IBondingManager);\\n\\n    /**\\n     * @dev Returns an instance of the IMinter interface\\n     */\\n    function minter() internal view virtual returns (IMinter);\\n\\n    /**\\n     * @dev Returns an instance of the IRoundsManager interface\\n     */\\n    function roundsManager() internal view virtual returns (IRoundsManager);\\n}\\n\",\"keccak256\":\"0xc58fb56b6ccfe36e5e09322ca1793a805668c84877cf6856403da51e2e35a359\",\"license\":\"MIT\"},\"contracts/pm/mixins/interfaces/MReserve.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nabstract contract MReserve {\\n    struct ReserveInfo {\\n        uint256 fundsRemaining; // Funds remaining in reserve\\n        uint256 claimedInCurrentRound; // Funds claimed from reserve in current round\\n    }\\n\\n    // Emitted when funds are added to a reserve\\n    event ReserveFunded(address indexed reserveHolder, uint256 amount);\\n    // Emitted when funds are claimed from a reserve\\n    event ReserveClaimed(address indexed reserveHolder, address claimant, uint256 amount);\\n\\n    /**\\n     * @notice Returns info about a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @return info Info about the reserve for `_reserveHolder`\\n     */\\n    function getReserveInfo(address _reserveHolder) public view virtual returns (ReserveInfo memory info);\\n\\n    /**\\n     * @notice Returns the amount of funds claimed by a claimant from a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @param _claimant Address of claimant\\n     * @return Amount of funds claimed by `_claimant` from the reserve for `_reserveHolder`\\n     */\\n    function claimedReserve(address _reserveHolder, address _claimant) public view virtual returns (uint256);\\n\\n    /**\\n     * @dev Adds funds to a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @param _amount Amount of funds to add to reserve\\n     */\\n    function addReserve(address _reserveHolder, uint256 _amount) internal virtual;\\n\\n    /**\\n     * @dev Clears contract storage used for a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     */\\n    function clearReserve(address _reserveHolder) internal virtual;\\n\\n    /**\\n     * @dev Claims funds from a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @param _claimant Address of claimant\\n     * @param _amount Amount of funds to claim from the reserve\\n     * @return Amount of funds (<= `_amount`) claimed by `_claimant` from the reserve for `_reserveHolder`\\n     */\\n    function claimFromReserve(\\n        address _reserveHolder,\\n        address _claimant,\\n        uint256 _amount\\n    ) internal virtual returns (uint256);\\n\\n    /**\\n     * @dev Returns the amount of funds remaining in a reserve\\n     * @param _reserveHolder Address of reserve holder\\n     * @return Amount of funds remaining in the reserve for `_reserveHolder`\\n     */\\n    function remainingReserve(address _reserveHolder) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x01229dd7088e23db674d032c239d90a14e8922532a82c7d46a3e7fe5fa234827\",\"license\":\"MIT\"},\"contracts/pm/mixins/interfaces/MTicketBrokerCore.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nabstract contract MTicketBrokerCore {\\n    struct Ticket {\\n        address recipient; // Address of ticket recipient\\n        address sender; // Address of ticket sender\\n        uint256 faceValue; // Face value of ticket paid to recipient if ticket wins\\n        uint256 winProb; // Probability ticket will win represented as winProb / (2^256 - 1)\\n        uint256 senderNonce; // Sender's monotonically increasing counter for each ticket\\n        bytes32 recipientRandHash; // keccak256 hash commitment to recipient's random value\\n        bytes auxData; // Auxilary data included in ticket used for additional validation\\n    }\\n\\n    // Emitted when funds are added to a sender's deposit\\n    event DepositFunded(address indexed sender, uint256 amount);\\n    // Emitted when a winning ticket is redeemed\\n    event WinningTicketRedeemed(\\n        address indexed sender,\\n        address indexed recipient,\\n        uint256 faceValue,\\n        uint256 winProb,\\n        uint256 senderNonce,\\n        uint256 recipientRand,\\n        bytes auxData\\n    );\\n    // Emitted when a funds transfer for a winning ticket redemption is executed\\n    event WinningTicketTransfer(address indexed sender, address indexed recipient, uint256 amount);\\n    // Emitted when a sender requests an unlock\\n    event Unlock(address indexed sender, uint256 startRound, uint256 endRound);\\n    // Emitted when a sender cancels an unlock\\n    event UnlockCancelled(address indexed sender);\\n    // Emitted when a sender withdraws its deposit & reserve\\n    event Withdrawal(address indexed sender, uint256 deposit, uint256 reserve);\\n}\\n\",\"keccak256\":\"0x80c3b528a357a1895fc5e3d6a7b935db89ab1ba10a0af677d677b7a66434bc0f\",\"license\":\"MIT\"},\"contracts/pm/mixins/interfaces/MTicketProcessor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nabstract contract MTicketProcessor {\\n    /**\\n     * @dev Process sent funds.\\n     * @param _amount Amount of funds sent\\n     */\\n    function processFunding(uint256 _amount) internal virtual;\\n\\n    /**\\n     * @dev Transfer withdrawal funds for a ticket sender\\n     * @param _amount Amount of withdrawal funds\\n     */\\n    function withdrawTransfer(address payable _sender, uint256 _amount) internal virtual;\\n\\n    /**\\n     * @dev Transfer funds for a recipient's winning ticket\\n     * @param _recipient Address of recipient\\n     * @param _amount Amount of funds for the winning ticket\\n     * @param _auxData Auxilary data for the winning ticket\\n     */\\n    function winningTicketTransfer(\\n        address _recipient,\\n        uint256 _amount,\\n        bytes memory _auxData\\n    ) internal virtual;\\n\\n    /**\\n     * @dev Validates a ticket's auxilary data (succeeds or reverts)\\n     * @param _auxData Auxilary data inclueded in a ticket\\n     */\\n    function requireValidTicketAuxData(bytes memory _auxData) internal view virtual;\\n}\\n\",\"keccak256\":\"0xe026045f70ec840465b6d146cd4ddc5ea8b9a8e8ee0c6288f44649dd3c4a12e9\",\"license\":\"MIT\"},\"contracts/rounds/IRoundsManager.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\n/**\\n * @title RoundsManager interface\\n */\\ninterface IRoundsManager {\\n    // Events\\n    event NewRound(uint256 indexed round, bytes32 blockHash);\\n\\n    // Deprecated events\\n    // These event signatures can be used to construct the appropriate topic hashes to filter for past logs corresponding\\n    // to these deprecated events.\\n    // event NewRound(uint256 round)\\n\\n    // External functions\\n    function initializeRound() external;\\n\\n    function lipUpgradeRound(uint256 _lip) external view returns (uint256);\\n\\n    // Public functions\\n    function blockNum() external view returns (uint256);\\n\\n    function blockHash(uint256 _block) external view returns (bytes32);\\n\\n    function blockHashForRound(uint256 _round) external view returns (bytes32);\\n\\n    function currentRound() external view returns (uint256);\\n\\n    function currentRoundStartBlock() external view returns (uint256);\\n\\n    function currentRoundInitialized() external view returns (bool);\\n\\n    function currentRoundLocked() external view returns (bool);\\n}\\n\",\"keccak256\":\"0xfc453a476bb68b874c21678a128b46ffcad0af69008e0e3e857d46499214f75f\",\"license\":\"MIT\"},\"contracts/token/IMinter.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"../IController.sol\\\";\\n\\n/**\\n * @title Minter interface\\n */\\ninterface IMinter {\\n    // Events\\n    event SetCurrentRewardTokens(uint256 currentMintableTokens, uint256 currentInflation);\\n\\n    // External functions\\n    function createReward(uint256 _fracNum, uint256 _fracDenom) external returns (uint256);\\n\\n    function trustedTransferTokens(address _to, uint256 _amount) external;\\n\\n    function trustedBurnTokens(uint256 _amount) external;\\n\\n    function trustedWithdrawETH(address payable _to, uint256 _amount) external;\\n\\n    function depositETH() external payable returns (bool);\\n\\n    function setCurrentRewardTokens() external;\\n\\n    function currentMintableTokens() external view returns (uint256);\\n\\n    function currentMintedTokens() external view returns (uint256);\\n\\n    // Public functions\\n    function getController() external view returns (IController);\\n}\\n\",\"keccak256\":\"0x3fbb7a4239a8b5979fb4c45a41495e9694a9f454de82dca3cf6a14dfe71255c7\",\"license\":\"MIT\"},\"contracts/zeppelin/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\n/**\\n * @title Ownable\\n * @dev The Ownable contract has an owner address, and provides basic authorization control\\n * functions, this simplifies the implementation of \\\"user permissions\\\".\\n */\\ncontract Ownable {\\n    address public owner;\\n\\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n    /**\\n     * @dev The Ownable constructor sets the original `owner` of the contract to the sender\\n     * account.\\n     */\\n    constructor() {\\n        owner = msg.sender;\\n    }\\n\\n    /**\\n     * @dev Throws if called by any account other than the owner.\\n     */\\n    modifier onlyOwner() {\\n        require(msg.sender == owner);\\n        _;\\n    }\\n\\n    /**\\n     * @dev Allows the current owner to transfer control of the contract to a newOwner.\\n     * @param newOwner The address to transfer ownership to.\\n     */\\n    function transferOwnership(address newOwner) public onlyOwner {\\n        require(newOwner != address(0));\\n        emit OwnershipTransferred(owner, newOwner);\\n        owner = newOwner;\\n    }\\n}\\n\",\"keccak256\":\"0x64f114689f2f161c4a4b8fc8442ab914436a33e6021bf17401eaeac73319a419\",\"license\":\"MIT\"},\"contracts/zeppelin/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.9;\\n\\nimport \\\"./Ownable.sol\\\";\\n\\n/**\\n * @title Pausable\\n * @dev Base contract which allows children to implement an emergency stop mechanism.\\n */\\ncontract Pausable is Ownable {\\n    event Pause();\\n    event Unpause();\\n\\n    bool public paused;\\n\\n    /**\\n     * @dev Modifier to make a function callable only when the contract is not paused.\\n     */\\n    modifier whenNotPaused() {\\n        require(!paused);\\n        _;\\n    }\\n\\n    /**\\n     * @dev Modifier to make a function callable only when the contract is paused.\\n     */\\n    modifier whenPaused() {\\n        require(paused);\\n        _;\\n    }\\n\\n    /**\\n     * @dev called by the owner to pause, triggers stopped state\\n     */\\n    function pause() public onlyOwner whenNotPaused {\\n        paused = true;\\n        emit Pause();\\n    }\\n\\n    /**\\n     * @dev called by the owner to unpause, returns to normal state\\n     */\\n    function unpause() public onlyOwner whenPaused {\\n        paused = false;\\n        emit Unpause();\\n    }\\n}\\n\",\"keccak256\":\"0xe9635fcac46c22547a08f6977a8c75e7341411f1201f60bdd4c79c26e6c286ef\",\"license\":\"MIT\"}},\"version\":1}",
  "bytecode": "[encoded data, 24254 characters]",
  "deployedBytecode": "[encoded data, 23942 characters]",
  "devdoc": {
    "kind": "dev",
    "methods": {
      "batchRedeemWinningTickets((address,address,uint256,uint256,uint256,bytes32,bytes)[],bytes[],uint256[])": {
        "params": {
          "_recipientRands": "Array of preimages for the recipientRandHash included in each ticket (`_recipientRands[i]` corresponds to `_tickets[i]`)",
          "_sigs": "Array of sender signatures over the hash of tickets (`_sigs[i]` corresponds to `_tickets[i]`)",
          "_tickets": "Array of winning tickets to be redeemed in order to claim payment"
        }
      },
      "claimableReserve(address,address)": {
        "details": "Returns the amount of funds claimable by a claimant from a reserve in the current round",
        "params": {
          "_claimant": "Address of claimant",
          "_reserveHolder": "Address of reserve holder"
        },
        "returns": {
          "_0": "Amount of funds claimable by `_claimant` from the reserve for `_reserveHolder` in the current round"
        }
      },
      "claimedReserve(address,address)": {
        "details": "Returns the amount of funds claimed by a claimant from a reserve in the current round",
        "params": {
          "_claimant": "Address of claimant",
          "_reserveHolder": "Address of reserve holder"
        },
        "returns": {
          "_0": "Amount of funds claimed by `_claimant` from the reserve for `_reserveHolder` in the current round"
        }
      },
      "constructor": {
        "details": "This constructor will not initialize any state variables besides `controller`. The following setter functions should be used to initialize state variables post-deployment: - setUnlockPeriod() - setTicketValidityPeriod()",
        "params": {
          "_controller": "Address of Controller that this contract will be registered with"
        }
      },
      "fundDepositAndReserve(uint256,uint256)": {
        "params": {
          "_depositAmount": "Amount of ETH to add to the caller's deposit",
          "_reserveAmount": "Amount of ETH to add to the caller's reserve"
        }
      },
      "fundDepositAndReserveFor(address,uint256,uint256)": {
        "params": {
          "_depositAmount": "Amount of ETH to add to the address' deposit",
          "_reserveAmount": "Amount of ETH to add to the address' reserve"
        }
      },
      "getReserveInfo(address)": {
        "details": "Returns info about a reserve",
        "params": {
          "_reserveHolder": "Address of reserve holder"
        },
        "returns": {
          "info": "Info about the reserve for `_reserveHolder`"
        }
      },
      "getSenderInfo(address)": {
        "params": {
          "_sender": "Address of sender"
        },
        "returns": {
          "reserve": "Info about the reserve for `_sender`",
          "sender": "Info about the sender for `_sender`"
        }
      },
      "getTicketHash((address,address,uint256,uint256,uint256,bytes32,bytes))": {
        "details": "Returns the hash of a ticket",
        "params": {
          "_ticket": "Ticket to be hashed"
        },
        "returns": {
          "_0": "keccak256 hash of `_ticket`"
        }
      },
      "isUnlockInProgress(address)": {
        "params": {
          "_sender": "Address of sender"
        },
        "returns": {
          "_0": "Boolean indicating whether `_sender` has an unlock in progress"
        }
      },
      "redeemWinningTicket((address,address,uint256,uint256,uint256,bytes32,bytes),bytes,uint256)": {
        "params": {
          "_recipientRand": "The preimage for the recipientRandHash included in `_ticket`",
          "_sig": "Sender's signature over the hash of `_ticket`",
          "_ticket": "Winning ticket to be redeemed in order to claim payment"
        }
      },
      "setController(address)": {
        "params": {
          "_controller": "Controller contract address"
        }
      },
      "setTicketValidityPeriod(uint256)": {
        "params": {
          "_ticketValidityPeriod": "Value for ticketValidityPeriod"
        }
      },
      "setUnlockPeriod(uint256)": {
        "params": {
          "_unlockPeriod": "Value for unlockPeriod"
        }
      }
    },
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {
      "batchRedeemWinningTickets((address,address,uint256,uint256,uint256,bytes32,bytes)[],bytes[],uint256[])": {
        "notice": "Redeems multiple winning tickets. The function will redeem all of the provided tickets and handle any failures gracefully without reverting the entire function"
      },
      "cancelUnlock()": {
        "notice": "Cancels the unlock period for the caller"
      },
      "constructor": {
        "notice": "TicketBroker constructor. Only invokes constructor of base Manager contract with provided Controller address"
      },
      "fundDeposit()": {
        "notice": "Adds ETH to the caller's deposit"
      },
      "fundDepositAndReserve(uint256,uint256)": {
        "notice": "Adds ETH to the caller's deposit and reserve"
      },
      "fundDepositAndReserveFor(address,uint256,uint256)": {
        "notice": "Adds ETH to the address' deposit and reserve"
      },
      "fundReserve()": {
        "notice": "Adds ETH to the caller's reserve"
      },
      "getSenderInfo(address)": {
        "notice": "Returns info about a sender"
      },
      "isUnlockInProgress(address)": {
        "notice": "Returns whether a sender is currently in the unlock period"
      },
      "redeemWinningTicket((address,address,uint256,uint256,uint256,bytes32,bytes),bytes,uint256)": {
        "notice": "Redeems a winning ticket that has been signed by a sender and reveals the recipient recipientRand that corresponds to the recipientRandHash included in the ticket"
      },
      "setController(address)": {
        "notice": "Set controller. Only callable by current controller"
      },
      "setTicketValidityPeriod(uint256)": {
        "notice": "Sets ticketValidityPeriod value. Only callable by the Controller owner"
      },
      "setUnlockPeriod(uint256)": {
        "notice": "Sets unlockPeriod value. Only callable by the Controller owner"
      },
      "unlock()": {
        "notice": "Initiates the unlock period for the caller"
      },
      "withdraw()": {
        "notice": "Withdraws all ETH from the caller's deposit and reserve"
      }
    },
    "version": 1
  },
  "storageLayout": {
    "storage": [
      {
        "astId": 2670,
        "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
        "label": "controller",
        "offset": 0,
        "slot": "0",
        "type": "t_contract(IController)2645"
      },
      {
        "astId": 2852,
        "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
        "label": "targetContractId",
        "offset": 0,
        "slot": "1",
        "type": "t_bytes32"
      },
      {
        "astId": 8525,
        "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
        "label": "reserves",
        "offset": 0,
        "slot": "2",
        "type": "t_mapping(t_address,t_struct(Reserve)8520_storage)"
      },
      {
        "astId": 8849,
        "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
        "label": "senders",
        "offset": 0,
        "slot": "3",
        "type": "t_mapping(t_address,t_struct(Sender)8844_storage)"
      },
      {
        "astId": 8851,
        "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
        "label": "unlockPeriod",
        "offset": 0,
        "slot": "4",
        "type": "t_uint256"
      },
      {
        "astId": 8855,
        "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
        "label": "usedTickets",
        "offset": 0,
        "slot": "5",
        "type": "t_mapping(t_bytes32,t_bool)"
      },
      {
        "astId": 9644,
        "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
        "label": "ticketValidityPeriod",
        "offset": 0,
        "slot": "6",
        "type": "t_uint256"
      }
    ],
    "types": {
      "t_address": {
        "encoding": "inplace",
        "label": "address",
        "numberOfBytes": "20"
      },
      "t_bool": {
        "encoding": "inplace",
        "label": "bool",
        "numberOfBytes": "1"
      },
      "t_bytes32": {
        "encoding": "inplace",
        "label": "bytes32",
        "numberOfBytes": "32"
      },
      "t_contract(IController)2645": {
        "encoding": "inplace",
        "label": "contract IController",
        "numberOfBytes": "20"
      },
      "t_mapping(t_address,t_struct(Reserve)8520_storage)": {
        "encoding": "mapping",
        "key": "t_address",
        "label": "mapping(address => struct MixinReserve.Reserve)",
        "numberOfBytes": "32",
        "value": "t_struct(Reserve)8520_storage"
      },
      "t_mapping(t_address,t_struct(Sender)8844_storage)": {
        "encoding": "mapping",
        "key": "t_address",
        "label": "mapping(address => struct MixinTicketBrokerCore.Sender)",
        "numberOfBytes": "32",
        "value": "t_struct(Sender)8844_storage"
      },
      "t_mapping(t_address,t_uint256)": {
        "encoding": "mapping",
        "key": "t_address",
        "label": "mapping(address => uint256)",
        "numberOfBytes": "32",
        "value": "t_uint256"
      },
      "t_mapping(t_bytes32,t_bool)": {
        "encoding": "mapping",
        "key": "t_bytes32",
        "label": "mapping(bytes32 => bool)",
        "numberOfBytes": "32",
        "value": "t_bool"
      },
      "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": {
        "encoding": "mapping",
        "key": "t_uint256",
        "label": "mapping(uint256 => mapping(address => uint256))",
        "numberOfBytes": "32",
        "value": "t_mapping(t_address,t_uint256)"
      },
      "t_mapping(t_uint256,t_uint256)": {
        "encoding": "mapping",
        "key": "t_uint256",
        "label": "mapping(uint256 => uint256)",
        "numberOfBytes": "32",
        "value": "t_uint256"
      },
      "t_struct(Reserve)8520_storage": {
        "encoding": "inplace",
        "label": "struct MixinReserve.Reserve",
        "members": [
          {
            "astId": 8509,
            "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
            "label": "funds",
            "offset": 0,
            "slot": "0",
            "type": "t_uint256"
          },
          {
            "astId": 8513,
            "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
            "label": "claimedForRound",
            "offset": 0,
            "slot": "1",
            "type": "t_mapping(t_uint256,t_uint256)"
          },
          {
            "astId": 8519,
            "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
            "label": "claimedByAddress",
            "offset": 0,
            "slot": "2",
            "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))"
          }
        ],
        "numberOfBytes": "96"
      },
      "t_struct(Sender)8844_storage": {
        "encoding": "inplace",
        "label": "struct MixinTicketBrokerCore.Sender",
        "members": [
          {
            "astId": 8841,
            "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
            "label": "deposit",
            "offset": 0,
            "slot": "0",
            "type": "t_uint256"
          },
          {
            "astId": 8843,
            "contract": "contracts/pm/TicketBroker.sol:TicketBroker",
            "label": "withdrawRound",
            "offset": 0,
            "slot": "1",
            "type": "t_uint256"
          }
        ],
        "numberOfBytes": "64"
      },
      "t_uint256": {
        "encoding": "inplace",
        "label": "uint256",
        "numberOfBytes": "32"
      }
    }
  }
}