{
  "_format": "hh-sol-artifact-1",
  "contractName": "AllocationLibTest",
  "sourceName": "contracts/test/claim/lib/AllocationLibTest.sol",
  "abi": [
    {
      "inputs": [],
      "name": "InvalidDepositAmount",
      "type": "error"
    },
    {
      "inputs": [],
      "name": "NotFinishedPeriod",
      "type": "error"
    },
    {
      "inputs": [],
      "name": "PeriodIntervalZero",
      "type": "error"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "period",
          "type": "uint256"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "recipient",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "depositAmount",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "contribution",
          "type": "uint256"
        }
      ],
      "name": "ContributionRecorded",
      "type": "event"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        }
      ],
      "name": "calculateContribution",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "pure",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "periodNumber",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "user",
          "type": "address"
        }
      ],
      "name": "consumeUserAllocation",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getAllocationConstants",
      "outputs": [
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "startTimestamp",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "periodInterval",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "genesisTimestamp",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "phase0RewardPerDay",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "numPhases",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "phase0Period",
              "type": "uint256"
            }
          ],
          "internalType": "struct AllocationLib.AllocationConstants",
          "name": "",
          "type": "tuple"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "periodNumber",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "user",
          "type": "address"
        }
      ],
      "name": "getAllocationInfo",
      "outputs": [
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "totalContribution",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "allocationPerPeriod",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "userContribution",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "userAllocation",
              "type": "uint256"
            }
          ],
          "internalType": "struct AllocationLib.AllocationInfo",
          "name": "",
          "type": "tuple"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "periodNumber",
          "type": "uint256"
        }
      ],
      "name": "getAllocationPerPeriod",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getCurrentPeriod",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "getStateStartTimestamp",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "key",
          "type": "uint256"
        }
      ],
      "name": "getTotalContributions",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "periodNumber",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "user",
          "type": "address"
        }
      ],
      "name": "getUserAllocation",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "key",
          "type": "uint256"
        },
        {
          "internalType": "address",
          "name": "user",
          "type": "address"
        }
      ],
      "name": "getUserContributions",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "uint256",
          "name": "periodInterval",
          "type": "uint256"
        }
      ],
      "name": "initialize",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "recipient",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "depositAmount",
          "type": "uint256"
        }
      ],
      "name": "recordContribution",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "userAllocation",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "bytecode": "0x6080604052348015600f57600080fd5b506109088061001f6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c80639af71b791161008c578063d0ece98911610066578063d0ece989146101f5578063e5e43f241461022b578063f658b1d51461023e578063fe4b84df1461025157600080fd5b80639af71b79146101855780639ed9a3ce1461018e578063cc1966b2146101a157600080fd5b8063086146d2146100d45780631949e829146100ef57806348cff27f146100f75780635bd1baaf1461010c5780635c6bb0ab1461012c57806362a668531461013f575b600080fd5b6100dc610264565b6040519081526020015b60405180910390f35b6000546100dc565b61010a6101053660046107ee565b610275565b005b6100dc61011a366004610818565b60009081526002602052604090205490565b6100dc61013a366004610818565b610285565b61015261014d366004610831565b610297565b6040516100e691908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6100dc60045481565b61010a61019c366004610831565b6102d5565b6101a96102e8565b6040516100e69190600060c082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b6100dc610203366004610831565b60009182526003602090815260408084206001600160a01b0393909316845291905290205490565b6100dc610239366004610831565b61032b565b6100dc61024c366004610818565b610338565b61010a61025f366004610818565b610343565b60006102706000610351565b905090565b61028160008383610370565b5050565b6000610291818361043a565b92915050565b6102c26040518060800160405280600081526020016000815260200160008152602001600081525090565b6102ce60008484610478565b9392505050565b6102e16000838361051c565b6004555050565b6103216040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6102706000610581565b60006102ce8184846105ff565b60006102918261066f565b61034e6000826106ec565b50565b60018101548154600091906103669042610873565b6102919190610886565b600061037b84610351565b905060006103888361066f565b90508085600201600084815260200190815260200160002060008282546103af91906108a8565b9091555050600082815260038601602090815260408083206001600160a01b0388168452909152812080548392906103e89084906108a8565b909155505060408051848152602081018390526001600160a01b0386169184917f8d0cf479602fd3cf00c7e5f661984c44659a827edb5f23cd85094cdc942f4649910160405180910390a35050505050565b6000806104508460000154856001015485610754565b90506201518084600101548261046691906108bb565b6104709190610886565b949350505050565b6104a36040518060800160405280600081526020016000815260200160008152602001600081525090565b6000838152600285016020526040812054906104bf868661043a565b600086815260038801602090815260408083206001600160a01b03891684529091528120549192506104f28888886105ff565b60408051608081018252958652602086019490945292840191909152506060820152949350505050565b600061052784610351565b831061054657604051635c6f5fd960e01b815260040160405180910390fd5b60006105538585856105ff565b6000948552600395909501602090815260408086206001600160a01b03959095168652939052505081205590565b6105ba6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b506040805160c0810182528254815260019092015460208301526366b2e150908201526a076496d888478bcef00000606082015260076080820152601060a082015290565b60008281526002840160205260408120548082036106215760009150506102ce565b600084815260038601602090815260408083206001600160a01b03871684529091529020548190610652878761043a565b61065c91906108bb565b6106669190610886565b95945050505050565b60008167016345785d8a00000361068857506001919050565b81670de0b6b3a76400000361069f57506004919050565b81678ac7230489e80000036106b657506009919050565b8168056bc75e2d63100000036106ce57506010919050565b60405163fe9ba5cd60e01b815260040160405180910390fd5b919050565b8060000361070d57604051630938939360e41b815260040160405180910390fd5b600182018190556201518081111561073f5761072c6201518042610886565b61073990620151806108bb565b82555050565b8061074a8142610886565b61073991906108bb565b600080620151806366b2e15061076a86866108bb565b61077490886108a8565b61077e9190610873565b6107889190610886565b90506a076496d888478bcef0000060005b60078110156107ca576010811b808410156107ba57829450505050506102ce565b90920391600191821c9101610799565b5060009695505050505050565b80356001600160a01b03811681146106e757600080fd5b6000806040838503121561080157600080fd5b61080a836107d7565b946020939093013593505050565b60006020828403121561082a57600080fd5b5035919050565b6000806040838503121561084457600080fd5b82359150610854602084016107d7565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102915761029161085d565b6000826108a357634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156102915761029161085d565b80820281158282048414176102915761029161085d56fea26469706673582212209b7a2f9106601c26c5660a0511e55a0e5911eb613362fcfcc15758d5f9ab539564736f6c634300081b0033",
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80639af71b791161008c578063d0ece98911610066578063d0ece989146101f5578063e5e43f241461022b578063f658b1d51461023e578063fe4b84df1461025157600080fd5b80639af71b79146101855780639ed9a3ce1461018e578063cc1966b2146101a157600080fd5b8063086146d2146100d45780631949e829146100ef57806348cff27f146100f75780635bd1baaf1461010c5780635c6bb0ab1461012c57806362a668531461013f575b600080fd5b6100dc610264565b6040519081526020015b60405180910390f35b6000546100dc565b61010a6101053660046107ee565b610275565b005b6100dc61011a366004610818565b60009081526002602052604090205490565b6100dc61013a366004610818565b610285565b61015261014d366004610831565b610297565b6040516100e691908151815260208083015190820152604080830151908201526060918201519181019190915260800190565b6100dc60045481565b61010a61019c366004610831565b6102d5565b6101a96102e8565b6040516100e69190600060c082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b6100dc610203366004610831565b60009182526003602090815260408084206001600160a01b0393909316845291905290205490565b6100dc610239366004610831565b61032b565b6100dc61024c366004610818565b610338565b61010a61025f366004610818565b610343565b60006102706000610351565b905090565b61028160008383610370565b5050565b6000610291818361043a565b92915050565b6102c26040518060800160405280600081526020016000815260200160008152602001600081525090565b6102ce60008484610478565b9392505050565b6102e16000838361051c565b6004555050565b6103216040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6102706000610581565b60006102ce8184846105ff565b60006102918261066f565b61034e6000826106ec565b50565b60018101548154600091906103669042610873565b6102919190610886565b600061037b84610351565b905060006103888361066f565b90508085600201600084815260200190815260200160002060008282546103af91906108a8565b9091555050600082815260038601602090815260408083206001600160a01b0388168452909152812080548392906103e89084906108a8565b909155505060408051848152602081018390526001600160a01b0386169184917f8d0cf479602fd3cf00c7e5f661984c44659a827edb5f23cd85094cdc942f4649910160405180910390a35050505050565b6000806104508460000154856001015485610754565b90506201518084600101548261046691906108bb565b6104709190610886565b949350505050565b6104a36040518060800160405280600081526020016000815260200160008152602001600081525090565b6000838152600285016020526040812054906104bf868661043a565b600086815260038801602090815260408083206001600160a01b03891684529091528120549192506104f28888886105ff565b60408051608081018252958652602086019490945292840191909152506060820152949350505050565b600061052784610351565b831061054657604051635c6f5fd960e01b815260040160405180910390fd5b60006105538585856105ff565b6000948552600395909501602090815260408086206001600160a01b03959095168652939052505081205590565b6105ba6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b506040805160c0810182528254815260019092015460208301526366b2e150908201526a076496d888478bcef00000606082015260076080820152601060a082015290565b60008281526002840160205260408120548082036106215760009150506102ce565b600084815260038601602090815260408083206001600160a01b03871684529091529020548190610652878761043a565b61065c91906108bb565b6106669190610886565b95945050505050565b60008167016345785d8a00000361068857506001919050565b81670de0b6b3a76400000361069f57506004919050565b81678ac7230489e80000036106b657506009919050565b8168056bc75e2d63100000036106ce57506010919050565b60405163fe9ba5cd60e01b815260040160405180910390fd5b919050565b8060000361070d57604051630938939360e41b815260040160405180910390fd5b600182018190556201518081111561073f5761072c6201518042610886565b61073990620151806108bb565b82555050565b8061074a8142610886565b61073991906108bb565b600080620151806366b2e15061076a86866108bb565b61077490886108a8565b61077e9190610873565b6107889190610886565b90506a076496d888478bcef0000060005b60078110156107ca576010811b808410156107ba57829450505050506102ce565b90920391600191821c9101610799565b5060009695505050505050565b80356001600160a01b03811681146106e757600080fd5b6000806040838503121561080157600080fd5b61080a836107d7565b946020939093013593505050565b60006020828403121561082a57600080fd5b5035919050565b6000806040838503121561084457600080fd5b82359150610854602084016107d7565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b818103818111156102915761029161085d565b6000826108a357634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156102915761029161085d565b80820281158282048414176102915761029161085d56fea26469706673582212209b7a2f9106601c26c5660a0511e55a0e5911eb613362fcfcc15758d5f9ab539564736f6c634300081b0033",
  "linkReferences": {},
  "deployedLinkReferences": {}
}
